‎2011 Aug 03 9:15 AM
I want to do action in BRF which make field value substitution in some structure. I have table with 3 columns: Structure, Field, Value. two first columns are string.Now if i want make substitution i have to use multi and mulilevel CASE's. How can I make sunbstitution instruction using these strings like 'Structure'-'Field' = Value.
Thanks for any help.
‎2011 Aug 03 11:51 AM
Hi,
try something like this:
DATA:
ls_mara TYPE mara,
lv_str1 TYPE string VALUE 'LS_MARA',
lv_str2 TYPE string VALUE 'MATNR',
lv_field TYPE string.
FIELD-SYMBOLS:
<fs> TYPE ANY.
CONCATENATE lv_str1 '-' lv_str2 INTO lv_field.
ASSIGN (lv_field) TO <fs>.
Best regards,
Oliver
‎2011 Aug 03 11:51 AM
Hi,
try something like this:
DATA:
ls_mara TYPE mara,
lv_str1 TYPE string VALUE 'LS_MARA',
lv_str2 TYPE string VALUE 'MATNR',
lv_field TYPE string.
FIELD-SYMBOLS:
<fs> TYPE ANY.
CONCATENATE lv_str1 '-' lv_str2 INTO lv_field.
ASSIGN (lv_field) TO <fs>.
Best regards,
Oliver
‎2011 Aug 03 2:24 PM
Hi afromeen,
if I understand you correct, you want to substitute specific values in a table.
I would create a second table with same structure 3 columns: Structure, Field, Value. This table could be maintained using maintenance screen. Then put in here the Structure and Field names relevant for substitution and the substitution value.
Then loop at the original table. For each line, check if you have a substitution value. The substitution table can be loaded into a sorted or hashed key table and accessed quickly using READ TABLE WITH TABLE KEY. Use field-symbols to save time.
Regards,
Clemens