cancel
Showing results for 
Search instead for 
Did you mean: 

Modify RESULT_PACKAGE

Former Member
0 Kudos

Hi Experts,

Could you please suggest me how to modify the RESULT_PACKAGE in the End Routine using work area?

I have populated hashed internal table in the start routine and within the RESULT_PACKAGE loop, the internal table has been read with table key.

_Below is the *Start Routine*

if not SOURCE_PACKAGE[] is INITIAL.

  • Populate internal table using delivery header table

select /bic/ZMAILORID DELIV_NUMB CUST_GROUP SOLD_TO

from /bic/azkdlhead00

into table it_KLUGDELHEDR

FOR ALL ENTRIES IN SOURCE_PACKAGE

where /BIC/ZMAILORID = SOURCE_PACKAGE-MAILORDERID.

endif.

Below is the END ROUTINE.

loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

read table it_KLUGDELHEDR INTO wa_KLUGDELHEDR

WITH TABLE KEY ZMAILORID = <RESULT_FIELDS>-/bic/zMAILORID.

if sy-subrc eq 0.

<RESULT_FIELDS>-DELIV_NUMB = wa_KLUGDELHEDR-DELIV_NUMB.

<RESULT_FIELDS>-CUST_GROUP = wa_KLUGDELHEDR-CUST_GROUP.

<RESULT_FIELDS>-SOLD_TO = wa_KLUGDELHEDR-SOLD_TO.

endif.

ENDLOOP.

Please suggest on this matter.

Thanks in anticipation.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please use the below code:


    data:  itab_target type standard table of _ty_s_TG_1.
 DATA:  wa_target like line of itab_target.
if not SOURCE_PACKAGE[] is INITIAL.

* Populate internal table using delivery header table
select /bic/ZMAILORID DELIV_NUMB CUST_GROUP SOLD_TO
from /bic/azkdlhead00
into table it_KLUGDELHEDR
FOR ALL ENTRIES IN SOURCE_PACKAGE
where /BIC/ZMAILORID = SOURCE_PACKAGE-MAILORDERID.

endif.


Below is the END ROUTINE.

loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

read table it_KLUGDELHEDR INTO wa_KLUGDELHEDR
WITH TABLE KEY ZMAILORID = <RESULT_FIELDS>-/bic/zMAILORID.

if sy-subrc eq 0.

<RESULT_FIELDS>-DELIV_NUMB = wa_KLUGDELHEDR-DELIV_NUMB.
<RESULT_FIELDS>-CUST_GROUP = wa_KLUGDELHEDR-CUST_GROUP.
<RESULT_FIELDS>-SOLD_TO = wa_KLUGDELHEDR-SOLD_TO.

endif.

 APPEND <RESULT_FIELDS> TO ITAB_TARGET.

ENDLOOP.

   REFRESH RESULT_PACKAGE.

   RESULT_PACKAGE[] = ITAB_TARGET[].

-Vikram

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vikram,

Thanks for your reply. It workd fine.

Former Member
0 Kudos

Hi,

Thanks, but way of saying thanks in SDN is rewarding.

-Vikram