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

URGENT Please - Create new records while uploading data

Hi Gurus

We are using BW 7.0 and data is loaded to a custom InfoCube using Transformations. PSA is used to store data intermediately.

We have a requirement that data records from source system will come for different value types. If source data records contain '20' as value type then we need to split-up this record into 2 new records. The new data records should have value types '25' and '30'. And we need to distribute the amount in original data record equally among the 2 newly created data records.

Can somebody please explain how can we do that?

I think, we might have to write some code in Start Routine of Update Rules to do this but I know very little ABAP. So your expert help would be appreciated.

Points guaranteed!

Regards

Adi

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 09:34 PM

    Hi Adi,

    In transformation End Routine you do this.

    Sample Code:

    Data : Ls_result_package like result_package.
    Data : lt_result_package type standard table of ls_result_package.
    
    Loop at result_package into ls_result_package.
           If ls_result_package-<Value Type> = '20' .
           ls_result_package-<value type> = 25.
           ls_result_package-<Key Figure_1> = ls_result_package-<Key Figure_1> / 2.
           ls_result_package-<Key Figure_2> = ls_result_package-<Key Figure_2> / 2.
           ls_result_package-<Key Figure_3> = ls_result_package-<Key Figure_3> / 2.
           .
           .
           .
    <i>--> For First Record</i>
           append ls_result_package to lt_result_package.
    <i>---> for secound record</i>
           ls_result_package-<value type> = 30.
           append ls_result_package to lt_result_package.
           clear ls_result_package.
    Endloop.
    
    <i>--> Clear Result_package table</i>
    Refresh result_package.
    
    --> Push data from Lt_result_table to Result_Table.
    Insert lines of table lt_result_table from 1 into result_table.

    P.S: This is sample code only, check for systax errors....

    Hope it Helps

    Srini

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 27, 2007 at 02:38 PM

    Hi Adi,

    Data : Ls_source_package like source_package.

    Data : Ls_source_package1 like source_package.

    Loop at source_package into ls_source_package.

    If ls_source_package-<Value Type> = '20' .

    ls_source_package1-<value type> = 25.

    ls_result_package1-<Amount> = ls_source_package-<amount> / 2.

    append ls_result_package1 to source_package.

    ls_source_package1-<value type> = 30.

    ls_result_package1-<Amount> = ls_source_package-<amount> / 2.

    append ls_result_package1 to source_package.

    endloop.

    Please apply the above code in the start routine and check..

    Thanks,

    Add a comment
    10|10000 characters needed characters exceeded

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.