Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

which code would fit well in End Routine?

Hi All,

I found two way of writing end routine in BW. Out of these which one from below would be the right way to code it and what would be reason behind that.

Please help me out to understand more working of 4th generation language.

1) with append statement

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS> .

LOOP AT ITAB2 INTO WA WHERE /BIC/ZORDNUM = <RESULT_FIELDS>-/BIC/ZORDNUM.

<RESULT_FIELDS>-/BIC/ZITEMNUM = WA-/BIC/ZITEMNUM.

<RESULT_FIELDS>-MATERIAL = WA-MATERIAL.

<RESULT_FIELDS>-/BIC/ZITMTYP = WA-/BIC/ZITMTYP.

<RESULT_FIELDS>-QUANT_B = WA-QUANT_B.

<RESULT_FIELDS>-BASE_UOM = WA-BASE_UOM.

APPENDĀ  <RESULT_FIELDS> TO ITAB_TARGET.

ENDLOOP.

ENDLOOP

2) with modify statement


LOOP AT RESULT_PACKAGE ASSIGNING WA_RESULT_PACKAGE.

LOOP AT ITAB2 INTO WA WHERE /BIC/ZORDNUM = RESULT_PACKAGE-/BIC/ZORDNUM.

WA_RESULT_PACKAGE-/BIC/ZITEMNUM = WA-/BIC/ZITEMNUM.

WA_RESULT_PACKAGE-MATERIAL = WA-MATERIAL.

WA_RESULT_PACKAGE-/BIC/ZITMTYP = WA-/BIC/ZITMTYP.

WA_RESULT_PACKAGE-QUANT_B = WA-QUANT_B.

WA_RESULT_PACKAGE-BASE_UOM = WA-BASE_UOM.

modify RESULT_PACKAGE from WA_RESULT_PACKAGE.

ENDLOOP.

ENDLOOP

Thanks

Former Member
Not what you were looking for? View more on this topic or Ask a question