cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with lookup BW routine ABAP code

Former Member
0 Kudos

Hi Gurus,

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

DSO3 is a Translation table

ZCountryZCOM_CODE0Comp_code
DE20001000
GB20101010
US20301030

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!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Zalmay,

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

Former Member
0 Kudos

Hi Sunil,

I used this document, it was very well defined and staright forward.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0ff7df4-95da-2d10-3589-cc778005e...

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you guys for the tips and help!

I solved the issue.

Thanks again!

ccc_ccc
Active Contributor
0 Kudos

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_code
DE20001000
GB20101010
US2030

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Sunil,

ZCountryZCOM_CODE0Comp_code
DE20001000
GB20101010
US20301030

DSO1: KeyField: ZCountry, and 0CalDay

DSO1: DataFields: Status, 0calyear

We dont have ZComp_code in DSO1.

DSO2: Keyfield: Zcountry and 0Calday

DSO2, Datafield: Company Code, Status, 0calyear

Based on ZCountry XX, e.g. DE where ZComp_Code is 2000 in (DSO3) we want to populate 1000 into DSO2 0Comp_Code.

I hope i have explained it well.

Former Member
0 Kudos

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.