Skip to Content
avatar image
Former Member

Capture last value in Transformation


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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 06, 2015 at 07:52 AM

    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...

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 05:04 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 05:44 PM

    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

    Add comment
    10|10000 characters needed characters exceeded