7 Replies Latest reply: May 22, 2006 10:01 AM by Andrea Previati RSS

Insert records in DATA_PACKAGE?

Markus Fahlén
Currently Being Moderated

Hi,

 

I'm doing delta loads first to an ODS and then to an InfoCube. I was wondering if it's possible to insert new records in in the update routine (in the DATA_PACKAGE) in the update rules, between the ODS and the InfoCube, when the number of records are 0.

 

Or does the update routine never get executed when the number of records is equal to 0.

 

Thanks in advance,

Markus

  • Re: Insert records in DATA_PACKAGE?
    M. Kaar
    Currently Being Moderated

    Hello MaRkus,

    How r u ?

     

    Its a tough concept.... still i will place my idea....

     

    I believe it is not possible to insert a new record into the data package,

     

    -We could see any data package will come with this much number of records are in that particular data package.

     

    -using a program it could be made possible to update the ODS tables and then try loading the deltas.

     

    Data modification is possible, but Data addition ??? have to work on it man

     

    Best Regards....

    Sankar Kumar

    +91 98403 47141

  • Re: Insert records in DATA_PACKAGE?
    Sebastián Sosa
    Currently Being Moderated

    I think you can alter data packets on start routine.

    I heard about deleting and modifying data, but never add, but maybe you can try and its possible...

     

    regards,

     

    Sebastián.-

     

  • Re: Insert records in DATA_PACKAGE?
    Weidong Yang
    Currently Being Moderated

    Hi there,

     

    Yes, uou can do it in the start routine of transfer rule or update rule. Just like any ABAP codes. Do Append/Modify etc. in the start routine.

     

    Hope this helps.

     

     

    Weidong

  • Re: Insert records in DATA_PACKAGE?
    Eugene Khusainov
    Currently Being Moderated

    Hi Markus,

     

    Here is an example of how to do it:

     

    Re: Update Rule - to duplicate records in a data package

     

    Though, the program will not go into the loop. You may just give values to the structure fields and append them to data_package.

     

    Best regards,

    Eugene

  • Re: Insert records in DATA_PACKAGE?
    Udayabhanu Pattabhi Ram Chamarthy
    Currently Being Moderated

    Hi Markus:

    As stated by Weidong, you can add records.

     

    In this case, as soon as your Update Rule starts executing, use this type of COde:

     

    data_package-infoobject = "Your Value:

    append data_package.

     

    You can add the above statement in a loop. Make sure the append data_package is within hte loop too.

     

    If you have a particular code you need, ask us and we will provide it to you.

     

    Good day

    Ram Chamarthy

  • Re: Insert records in DATA_PACKAGE?
    Andrea Previati
    Currently Being Moderated

    Hi Markus

     

    the rightsolution is creating a start routine with internal table to load and elaborate your data.

    Check this example code

     

    Tables: /BI0/.....

    data: begin of data_package1 occurs 0.

          include structure /BIC/.....

    data: recno like sy-tabix,

          end of data_package1.

     

    $$ end of global - insert your declaration only before this line   -

     

    • The follow definition is new in the BW3.x

    TYPES:

      BEGIN OF DATA_PACKAGE_STRUCTURE.

         INCLUDE STRUCTURE /BIC/......

    TYPES:

         RECNO   LIKE sy-tabix,

      END OF DATA_PACKAGE_STRUCTURE.

    DATA:

      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE

           WITH HEADER LINE

           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

     

    FORM startup

      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring

               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n

               DATA_PACKAGE STRUCTURE DATA_PACKAGE

      USING    RECORD_ALL LIKE SY-TABIX

               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update

    *

    $$ begin of routine - insert your code only below this line        -

    • fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

    • to make monitor entries

     

    data_package1[] = DATA_PACKAGE[].

    LOOP at data_package1.

     

    select * from /BI0/.....

             where ..... = DATA_PACKAGE1-(field of interest)

             and OBJVERS = 'A'.

     

     

             Data_package1 = /BI0/(fieldof interest)

     

     

             DATA_PACKAGE = data_package1.

             append DATA_PACKAGE.

             clear DATA_PACKAGE.

     

             endselect.

             endloop.

    • if abort is not equal zero, the update process will be canceled

      ABORT = 0.

     

    $$ end of routine - insert your code only before this line         -

    *

     

    Hope it helps

     

    Andrea

Actions