Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3180

which code would fit well in End Routine?

$
0
0

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


Viewing all articles
Browse latest Browse all 3180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>