Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

Re: Transformation: Issue in End-Routine

$
0
0

Hi Ricardio,

 

The source has Deliv and Shipment in the key, while the target has Deliv and Material in the key. Due to that, by the time you are in the end routine, you have one record per Delivery in the Result Package. It looks like you want to expand that Result Package into one record per Delivery/Material combination. But there is nothing in the code that does the expanding.

 

So you'll need to change the code in the end routine. Your first option for the End Routine (nested LOOPs) was closer to being right than the second one, so I'll take that as a reference.

 

First, declare a work area called LS_RP and an itab called LT_RP. The structure of both is the same as that of Result_package. Then change that nested loop end routine to the following:

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

  CLEAR wa_odgi.

  LOOP AT it_odgi INTO wa_odgi WHERE DELIV_NUMB = <RESULT_FIELDS>-DELIV_NUMB.

     ls_rp = <result_fields>.

    ls_rp-material= wa_ODGI-material.

  CALL METHOD me->new_record__end_routine

    EXPORTING

      source_segid   = 1

      source_record = <result_fields>-RECORD

    IMPORTING

       record_new    = ls_rp-record.

    APPEND ls_rp to lt_rp.

  ENDLOOP.

ENDLOOP.

 

RESULT_PACKAGE = lt_rp.


Viewing all articles
Browse latest Browse all 3548

Trending Articles



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