Skip to Content
avatar image
Former Member

Need help with lookup BW routine ABAP code

Hi Gurus,

I have a data flow where I have DSO1, DSO2 and DSO3.

DSO3 is a Translation table

ZCountry ZCOM_CODE 0Comp_code DE 2000 1000 GB 2010 1010 US 2030 1030

In DSO1, I have field ZCountry XX which has ZCom-Code 2-series, and in DSO2, I have 0COMP_CODE (1-series).

DSO3 is a translation DSO where we do mapping between, ZComp codes 2-series and 0Company codes 1-series based on ZCountry.

Scenario: I need a Transf. Rountine ABAP code Between DSO1 and DSO2 where we take e.g. Country DE from DSO1 with Company code "2000", and give result Company code "1000" for Country DE in DSO2.

Could you please help me with this? Thanks in advance! 😊

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 12, 2015 at 12:37 PM

    Hi Zalmay,

    Can you please share how you have solved issue so that it can helpful others.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 12:26 PM

    HI Zalamay,

    Can you Please elaborate your requirement a bit more with an example,so that to have a better idea, are you trying to do any lookup on DSO1 to get fill data into DSO2.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Zalmay,

      Try this below code in order to populate comp_code data in DSO3.

      types: begin of ty_temp,

          zcountry type /bic/zcountry,

          comp_code type 0comp_code,

      end of ty_temp.

      data : itab type table of ty_temp,

            wa type ty_temp.

      select /bic/zcountry 0comp_code from /bic/zdso300 into table itab for all enteris

      where zcountry = result_package-/bic/zcountry.

      loop at result_package assigning <result_fields>.

      read table itab into wa with key zcountry = <result_fields>-/bic/zcountry.

      <result_fields>-0comp_code = wa-comp_code.

      endloop.

      I jsut given rough code code,this may give an idea to you.

  • Jan 09, 2015 at 05:12 PM

    Hi Zalmay,

    Scenario: I need a Transf. Rountine ABAP code Between DSO1 and DSO2 where we take e.g. Country DE from DSO1 with Company code "2000", and give result Company code "1000" for Country DE in DSO2.



    Declaration part in Start Routine.


    Steps


    1) Create internal table for DSO3 to hold below infomation.


    ZCountryZCOM_CODE0Comp_codeDE20001000GB20101010US2030

    1030



    2) Write select statement to pull zcountry zcom_code 0comp_code all records where DSO3-country = source_package country and

    dso3 zcom_code = source_package-zcom_code.

    3) and update in internal table of DSO3 which is created in step 1

    4) goto individual routine and read internal table dso3 based on source_package-country and source-package-zcom_code with READ TABLE statement.,

    if sy-subrc eq 0

    result = dso3- 0comp_code.

    endif.

    Please try this,.

    Regards,

    Nanda

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2015 at 09:54 AM

    Thank you guys for the tips and help!

    I solved the issue.

    Thanks again!

    Add comment
    10|10000 characters needed characters exceeded