Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Пример в хэлпе, кусок
- TYPES strings TYPE STANDARD TABLE OF string WITH EMPTY KEY.
- DATA(words) = VALUE strings(
- ( `All` )
- ( `ABAP` )
- ( `constructs` )
- ( `are` )
- ( `imperative` ) ).
- "Table comprehension into helper table
- DATA(switched_words) = VALUE strings(
- FOR word IN words
- ( SWITCH #( word WHEN `All` THEN `Some`
- WHEN `imperative` THEN `functional`
- ELSE word ) ) ).
- "Table reduction of helper table
- DATA(sentence) =
- REDUCE string( INIT text = `` sep = ``
- FOR word IN switched_words
- NEXT text = |{ text }{ sep }{ word }| sep = ` ` ) && '.'.
- "Вот этот sentence заполнился значениями из строк switched_words.
- *-------------------------------------------------------------------
- "Мне надо в строку собрать имена БЕ:
- types
- : begin of lty_names
- , name1 type t001w-name1
- , end of lty_names
- .
- data
- : lt_bukrs_name type standard table of t001w-name1 "standard table of lty_names "закомментил, чтобы приблизить к примеру
- .
- select name1
- from t001w
- into table @lt_bukrs_name
- where werks in @s_bukrs "в werks нормальные имена филиалов хранятся
- .
- "Далее пишу в атрибут
- me->ms_data-butxt = reduce #( init text = space coma = space
- for name in lt_bukrs_name
- next text = |{ text } { coma } { name }| coma = ',' ).
- "пусто, ска
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement