on 03-03-2010 2:04 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
Thanks for your reply. It workd fine.
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.