cancel
Showing results for 
Search instead for 
Did you mean: 

Capture last value in Transformation

Former Member
0 Kudos


I am passing data from an external system into BW DSO. I am passing Production Order, Operation, Qty into BW but we are viewing this data at the Production Order Level (not down to the Operation). The problem I am having is each Prod Order can have several Operations and the value coming in for the Quantity is the same at each Operation. I only want to capture that quantity value for the last operation.

I thought I might be able to handle this in RSD1 for the Qty InfoObject in the Aggregation tab but that doesn't work. What is the best way to select only the last operation and collect the value for Qty at that last operation? Do I need to do this in the start routine putting the results in an internal table and finding last operation? I'm not sure how to delete duplicates since only the production order is the same and the operations are different. Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

RafkeMagic
Active Contributor
0 Kudos

maybe I'm looking at this a bit too simplistic, but what about just making prodorder the only key field and using overwrite for your key figure? the dso will then only contain the last value for each prodorder...

ccc_ccc
Active Contributor
0 Kudos

Hi Keith,

data: SP TYPE STANDARD TABLE OF _ty_s_SC_1,

        wa_sp type _ty_s_SC_1.

DATA: w_po TYPE  (data element of po),

              w_pqty type (data element of Pqty)




if source_package is not initial.

loop source_package assigning <source_fields>.

   IF sy-tabix EQ 1.

        w_po =    <source_fields>-po.

        w_pqty = <source_fields>-pqty.

      ENDIF.

  IF w_po NE <source_fields>-po.

    

 

wa_sp-po = w_pol.

wa_sp-pqty = w_pqty.

append wa_sp to sp.

CLEAR: w_po, w_pqty.

      ENDIF.

  w_po =    <source_fields>-po.

   w_pqty = <source_fields>-pqty.

endloop.

clear: source_package.

source_package[] = sp[].

clear: sp.

endif

Try this piece of code in start routine.

Thank you,

Nanda

ccc_ccc
Active Contributor
0 Kudos

Hi Keith,

Please follow the below link, have similar issue and I suggested code.

May as per you need, just change/add piece of code.

Thank you,

Nanda