cancel
Showing results for 
Search instead for 
Did you mean: 

Routine Query

Former Member
0 Kudos
71

Hello, I have a question about some DSOs joining.  I have three DSOs
DSO1
DSO2
DSO3

DSO1 and DSO2 have 1 to many relationship

DSO3 is blank yet

I want to bringing records from both DSOs in to DSO3. I can not do multicube and or infoset.

Some one told me i can write a end routine to gather records from both sides. is that possible then how? i know how to write a regular routine but not this kind where i can get multiple records from one dso based of of record coming from another dso.


please let me know,
Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

anshu_lilhori
Active Contributor
0 Kudos

Please share some sample data of both so that we can decide how to move ahead.

I am assuming you are suppose to load data to dso3 from dso1 and dso2 .

Dso 3 is not getting feed from other sources.

Now you need to decide the keyfields first and have to have find common key combination as well.

From one dso we cal load directly to dso3 and on second we can do a lookup based on the key combinations so that we get all the records.

If both dso1 and dso2 has same key fields then it can be loaded directly to dso3 as well.

Regards,

AL

Answers (3)

Answers (3)

Former Member
0 Kudos

Why would you need to write a routine if you want all the records from 1 and 2 DSO.

Create transformations from 1 and 2 to 3 and load it simply.

If you have any constraints on data fetching from 1 and 2, please explain.

Br, H

KodandaPani_KV
Active Contributor
0 Kudos

Hi Venkat,

its better to write the end routine and you are getting data form 2 DSO'S to 3 DSO.

you should maintain the common key fields for 3 DSO,S if don't have any common key fields other wise

make a secondary index for DSO's .

i will share sample code getting the data form 2 DSO's.

this code for higher education related seeing like this you can change only objects.

TYPES : begin of ty_ds200,

         HE_STUDNT TYPE /BI0/OIHE_STUDNT,
         HE_PRGRM type /BI0/OIHE_PRGRM,
         END OF ty_ds200 .


data : lt_ds200 type TABLE OF ty_ds200,
        ls_ds200 type ty_ds200 .

TYPES : BEGIN OF ty_dso400 ,

         HE_STUDNT TYPE /BI0/OIHE_STUDNT,
         HE_STORGP TYPE /BI0/OIHE_STORGP,
      
   END OF ty_dso400 .

data : lt_dso400 TYPE TABLE OF ty_dso400 ,
        ls_dso400 TYPE TY_dso400 .


--------------------------------------------------------

if RESULT_PACKAGE is NOT INITIAL .
   SELECT HE_STUDNT HE_PRGRM HE_STAGE from /BI0/AHE_DS0200 into TABLE
   lt_ds200
     FOR ALL ENTRIES IN RESULT_PACKAGE
     WHERE HE_STUDNT = RESULT_PACKAGE-HE_STUDNT


   SELECT HE_STUDNT HE_STORGP HE_STORGA HE_STCAMP /BIC/ZLC_GEO  from
   /BI0/AHE_DS0400
     INTO TABLE lt_dso400 for ALL ENTRIES IN RESULT_PACKAGE
     WHERE HE_STUDNT = RESULT_PACKAGE-HE_STUDNT
     and DATETO = '99991231'.

   loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS> .
     READ TABLE lt_ds200 into ls_ds200 WITH KEY HE_STUDNT =
     <RESULT_FIELDS>-HE_STUDNT .


     if sy-subrc = 0 .
       <RESULT_FIELDS>-HE_STAGE = ls_ds200-HE_STAGE .
       <RESULT_FIELDS>-HE_PRGRM = ls_ds200-HE_PRGRM .
     endif.

     READ TABLE LT_DSO400 INTO LS_DSO400 WITH KEY HE_STUDNT =
     <RESULT_FIELDS>-HE_STUDNT.

     if sy-subrc = 0 .
       <RESULT_FIELDS>-HE_STCAMP = ls_dsO400-HE_STCAMP .
       <RESULT_FIELDS>-HE_STORGA = LS_DSO400-HE_STORGA .

     endif.

     ENDLOOP .

   ENDIF.



hope it will help.


Thanks,

Phani.

Former Member
0 Kudos

you must have common field in  dso’s, create transformation between dso1->3, dso2-->3 and run the dtp to load data to dso3