on 10-05-2015 1:58 PM
Hallo!
I would be grateful for any advice.
I need to check 80 columns and I want to turn it into 80 lines.
Can this be done dynamically?
Thank you in advance
LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.
IF <source_fields>-zzabrsn001 <> ''.
RESULT_FIELDS-/bic/zrvk_mita = <source_fields>-objid.
RESULT_FIELDS-/bic/zrvk_abre = <source_fields>-zzabrsn001.
APPEND RESULT_FIELDS TO RESULT_PACKAGE.
CLEAR RESULT_FIELDS.
ENDIF.
IF <source_fields>-zzabrsn002 <> ''.
RESULT_FIELDS-/bic/zrvk_mita = <source_fields>-objid.
RESULT_FIELDS-/bic/zrvk_abre = <source_fields>-zzabrsn002.
APPEND RESULT_FIELDS TO RESULT_PACKAGE.
CLEAR RESULT_FIELDS.
ENDIF.
IF <source_fields>-zzabrsn003 <> ''.
RESULT_FIELDS-/bic/zrvk_mita = <source_fields>-objid.
RESULT_FIELDS-/bic/zrvk_abre = <source_fields>-zzabrsn003.
APPEND RESULT_FIELDS TO RESULT_PACKAGE.
CLEAR RESULT_FIELDS.
ENDIF.
IF <source_fields>-zzabrsn004 <> ''.
RESULT_FIELDS-/bic/zrvk_mita = <source_fields>-objid.
RESULT_FIELDS-/bic/zrvk_abre = <source_fields>-zzabrsn004.
APPEND RESULT_FIELDS TO RESULT_PACKAGE.
CLEAR RESULT_FIELDS.
ENDIF.
...
...
IF <source_fields>-zzabrsn080 <> ''.
RESULT_FIELDS-/bic/zrvk_mita = <source_fields>-objid.
RESULT_FIELDS-/bic/zrvk_abre = <source_fields>-zzabrsn080.
APPEND RESULT_FIELDS TO RESULT_PACKAGE.
CLEAR RESULT_FIELDS.
ENDIF.
ENDLOOP.
Hi Alexey,
Use the statement ASSING COMPONENT of STRUCTURE To ....
Show an example:
LOOP AT table into wa_table.
DO 80 TIMES.
ASSIGN COMPONENT sy-index of STRUCTURE wa_table to <fs>.
if sy-subrc eq 0.
"do the stuff <fs> contains the n-index field
endif.
Enddo.
endloop.
Hope it helps,
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use some ASSIGN COMPONENT to field symbols in a DO 80 TIMES.
(There was also the DO VARYING statement but this syntax is now "obsolete")
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.