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

Routine code in the BI transformation

Hi SDNers,

Can you help me to write a field routine code in the BI datasource transformation source(Datasource) to target(ODS).

Fields in Datasource:

MATPRICE & PRICE_TYPE

Field in the target:

0PRICE_AVG

I need to map the source to target based on the logic below.

If PRICE_TYPE is 'P02' , populate/assign the MATPRICE into 0PRICE_AVG.

Please give your suggessions.

Thanks,

Satya

Please do not ask ABAP help questions here. Its not a training forum

Edited by: Pravender on Aug 22, 2011 2:43 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 07:34 AM

    Hi Satya,

    You your self has written half of the logic,

    1) You will have to form a rule from MATPRICE to 0PRICE_AVG and select the rule type as Routine.

    2) In the rule make sure that you select both the infoobjects for input using '+' button on toolbar so that they will be avaiable for processing.

    3) In your routine you can simply write

    IF PRICE_TYPE = '02'.

    RESULT = MATPRICE.

    else.

    result = 0. * This step is optional and you can put whatever code you want or you can simply neglect the else part.

    endif.

    Regards,

    Durgesh.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Durgesh,

      I implemented the code in the system and even no syntax error. but when i check the data it is showing 0 .

      IF SOURCE_FIELDS-PRICE_TYPE = 'P02'.

      RESULT = SOURCE_FIELDS-MATPRICE.

      else.

      RESULT = 0.

      ENDIF.

      Please suggest.

      Thanks,

      satya

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 07:38 AM

    Hi,

    What should be assigned if PRICE_TYPE IS NOT 'P02' ?

    You should assign PRICE_TYPE & MATPRICE to your 0PRICE_AVG. then go to Rule type and select Routine

    if SOURCE_FIELDS-PRICE_TYPE = 'P10'.

    RESULT = SOURCE_FIELDS-MATPRICE.

    endif.

    -


    Thanks

    BVR

    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.