Skip to Content
avatar image
Former Member

Modify RESULT_PACKAGE

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 03, 2010 at 02:09 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 03, 2010 at 03:19 PM

    Hi Vikram,

    Thanks for your reply. It workd fine.

    Add comment
    10|10000 characters needed characters exceeded