cancel
Showing results for 
Search instead for 
Did you mean: 

LookUp Routine from One DSO to other DSO.

Former Member
0 Kudos

Hello,

I have to write field level routine (BI7) or fill the infoObject of DSO in Transformation by using lookup from otherDSO. Moreover large amount of data is getting loaded.

i guess We can write routine in two ways One is from via Start Routine and other method is InfoObject level/Char Routine.

Could anybody help.Also require some sample code for handling the same.

Purchasing document number and item are common in both dso's.

cheerz,

raps.

Edited by: Rajeev Pasupula on Aug 24, 2011 9:54 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Raps,

maybe it is better to use a start routine for populating an internal table with the information required (this internal table has to be declared in global declaration for use it after) and read this table in field routine (you cannot use only a start routine for your purpose because you don't have in it the fields of your target DSO).

Calling InfoObject = IO and table of your other DSO = /BIC/AZ*, you can fill in your start routine the following code:

  • begin of global declaration *

DATA: lt_AZ TYPE STANDARD TABLE OF /BIC/AZ* ,

wa_AZ TYPE /BIC/AZ* .

  • end of global declaration *

  • start of routine *

SELECT EBELN AC_DOC_LN IO

FROM /BIC/AZ*

into corresponding fields of table lt_AZ

for all entries in SOURCE_PACKAGE

where EBELN = SOURCE_PACKAGE-EBELN

and AC_DOC_LN = SOURCE_PACKAGE-AC_DOC_LN.

  • end of routine *

In field routine you can read lt_AZ and you have to fill in this code:

READ TABLE lt_AZ INTO wa_AZ.

WITH KEY wa_AZ-EBELN = SOURCE_FIELDS-EBELN

AND wa_AZ-AC_DOC_LN = SOURCE_FIELDS-AC_DOC_LN.

IF SY-SUBRC = 0.

RESULT = wa_AZ-IO.

CLEAR wa_AZ.

ENDIF.

Please check:

-- if the code in start routine identifies uniquely the correct record in other DSO (if you cannot, please fill other conditions in WHERE statement according to restrict correctly the selection from this DSO);

-- if the technical names of document and item are correct and if you have not standard InfoObject you have to use /bic/IO in place of IO.

Hope it helps.

Best regards.

Simone.