Skip to Content
author's profile photo Former Member
Former Member

Start routine

HI All,

I am new to writing routines in transformation hence need a help with the below case.

I want to write a start routine ,The Start routine is used in a transformation that will load data from a real time DSO to a Staging DSO.

The need for start routine is, i want to look up into the Real time DSO Active table for a set of key fields for each record to be loaded in Staging DSO from Real time DSO ,sort those records in sequence and finally load only those records that are loaded latest,that is the most recent records for a given set of key fields.

Also, if the latest record is having a delete flag , this record set should not be loaded.

Regards,

Tapish

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 09:07 AM

    Hi,

    As, I can understand u want to load Staging layer DSO with filtering on delete flag.... with recent data....

    For recent data you can use Delta mechanism....

    For filtering with Delete flag.... In select statement in Start routine use Where Delete flag NEQ (Not Equal To) x.

    Please apply this and let me know if you stuck in between....

    Regards,

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 09:48 AM

    hi,

    as suggested by mahesh you can use delta mechanism for latest records. for filtering out the records with Delete flag D, you can set a filter in the DTP.You can find it in the Extraction tab of the DTP.

    Hope this will help.

    Regards,

    Rk.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2009 at 10:25 AM

    Hi,

    TYPES : BEGIN OF IT_1,
                 YOUR DECLARATION.
                 Eg: ZBILL_ITEM TYPE /BI0/OIBILL_ITEM,
                END OF ITY_1.
    
    DATA :  ZGT_1 TYPE TABLE OF _TY_S_SC_1,
                 ZGT_2 TYPE TABLE OF /BIC/AZDSO_DS0400, (Your DSO ACtive table name).
                ZWA_1 TYPE /BIC/AZDSO_DS0400.
    
     ZGT_1[] = SOURCE_PACKAGE[].
    
    SELECT * FROM /BIC/AZDSO_DS0400 INTO TABLE ZGT_2
                                            FOR ALL ENTRIES IN ZGT_1
                                            WHERE ZBATCH = GT_VDITM-BATCH. (Your Where class)

    Like this you need to write code.

    Here I missed look up part.

    Thanks

    reddy

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      See the following logic...

      I'm ,loading data to one DSO from 2LIS_13_VDITM datasource. Whole loading I need to find the ZTXT and ZS from other DSO based on Material , batch and Plant from 2LIS_13_VDITM data at Transfprmations level.The ZTXT and ZS details will store in

      /BIC/AZODS_DS0400 DSO.

      See the complete logic.

      DATA : ZGT_ITM TYPE TABLE OF _TY_S_SC_1,
                 ZWA_ITM TYPE /BIC/CS2LIS_13_VDITM,
                 ZGT_MID TYPE TABLE OF /BIC/AZODS_DS0400,
                 ZWA_MID TYPE /BIC/AZODS_DS0400,
                 L_TABIX TYPE SY-TABIX.
      
      
         ZGT_ITM[] = SOURCE_PACKAGE[].
      
          SELECT * FROM /BIC/AZODS_DS0400 INTO TABLE ZGT_MID
           FOR ALL ENTRIES IN ZGT_ITM  WHERE
           BATCH = ZGT_ITM-BATCH AND 
           MATERIAL = ZGT_ITM-MATERIAL AND 
           PLANT = ZGT_ITM-PLANT.
      
       sort ZGT_MID by batch material plant calday descending.
       delete adjacent duplicates from ZGT_MID comparing batch material plant.
      
      
      SORT ZGT_MID BY BATCH MATERIAL PLANT CALDAY.
      
      LOOP AT SOURCE_PACKAGE INTO ZWA_ITM.
            L_TABIX = SY-TABIX.
      
            READ TABLE ZGT_MID INTO ZWA_MID WITH KEY
                                       BATCH = ZWA_ITM-BATCH
                                       MATERIAL = ZWA_ITM-MATERIAL
                                       PLANT = ZWA_ITM-PLANT
                                    BINARY SEARCH.
            IF SY-SUBRC = 0.
              ZWA_ITM-/BIC/ZTXT = ZWA_MID-/BIC/ZTXT.
              ZWA_ITM-/BIC/ZS = ZWA_MID-/BIC/ZS.
            ENDIF.
      
      
      MODIFY SOURCE_PACKAGE FROM ZWA_ITM INDEX L_TABIX.
            CLEAR : ZWA_ITM,
                    ZWA_MID.
      ENDLOOP.

      Thanks

      Reddy

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.