Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP 7.5 Optimisation

250

Dear all,

Is there another way to write the following code using 7.5?



    LOOP AT lt_dfies ASSIGNING FIELD-SYMBOL(<lfs_dfies>).
IF <lfs_dfies>-keyflag NE 'X'.
EXIT.
ENDIF.
CASE <lfs_dfies>-fieldname.
WHEN 'MANDT'.
CONTINUE.
WHEN OTHERS.
lt_fcat = VALUE #( BASE lt_fcat ( fieldname = <lfs_dfies>-fieldname
tabname = ls_t681-kotab )
).
ENDCASE.
ENDLOOP. SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; }.L0S31 { font-style: italic; color: #808080; }.L0S33 { color: #4DA619; }.L0S52 { color: #0000FF; }.L0S55 { color: #800080; }.L0S70 { color: #808080; }

Thanks in advance for your help.

David

2 REPLIES 2

Sandra_Rossi
Active Contributor
171

something like that?

lt_fcat = VALUE #( FOR <lfs_dfies> IN lt_dfies
                   WHERE ( keyflag = 'X' AND fieldname <> 'MANDT' )
                   ( fieldname = <lfs_dfies>-fieldname 
                     tabname   = ls_t681-kotab ) ).

NB: I don't call that optimization, I call that "legibility".

0 Kudos
171

Hi Sandra,

Thanks it helps me a lot to understand the new coding.

David