cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine to Populate Account Group Field from Master data of 0Customer

Former Member
0 Kudos

Hello Friends. Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the

Start Routine to Populate Account Group Field from Master data of 0Customer. I do not want to use read from master data functionality since that field 0customer is not there in dso but similar field 0debitor is there. so i want to put this code

during the load from source DSO to Target DSO.

Error Explicit length specifications are necessary with types C, P, X, N und

DATA: L_S_DP_LINE TYPE DATA_PACKAGE_sTRUCTURE.

types: begin of comp,

CUSTOMER type /BI0/OICUSTOMER,

ACCNT_GRP type /BI0/OIACCNT_GRP,

end of comp.

DATA: l_S_comp type comp.

DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer INITIAL SIZE 0.

IF L_th_COMP[] IS INITIAL.

SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING FIELDS OF TABLE L_th_COMP.

ENDIF.

LOOP AT SOURCE_PACKAGE INTO L_S_DP_LINE.

READ TABLE L_TH_COMP INTO L_S_COMP WITH TABLE KEY CUSTOMER = L_s_DP_LINE-CUSTOMER

IF SY-SUBRC = 0.

L_S_DP_LINE-/BIC/ACCNT_GRP = L_S_COMP-/BIC/ACCNT_GRP.

MODIFY SOURCE_PACKAGE FROM L_S_DP_LINE.

ENDIF.

ENDLOOP.

soniya kapoor

Message was edited by:

soniya kapoor

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Soniya!!!

Let me understand what you are trying to do, you want to get - Account group from 0customer when you are loading data from one DSO to another. If that is the objective, then you have 0debtor in your base ods, based on that 0debtor you want to get the account group. Two ways to achieve this without writing any ABAP code.

1. You can turn the account group to Nav. Attribute in your 0DEBTOR because 0DEBTOR is reference object of 0CUSTOMER.

2. You can also put account group as a field in your target ods and when you are updating, you can use attribute of Master data.

That should address your problem, if I understood you right.

thanks.

Wond

Former Member
0 Kudos

Hello Wond Thanks for Good Answer and good option, But Client does not like this option and does not like Nav Attribute so he does not want to turn on any Nav Attribute, In general also We hav requirement to read a third table while uploading 1 dso table to 2 dso table,

so Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the

Start Routine to Populate Account Group Field from Master data of 0Customer.

No syntax Error But during the load it is updating the source table and not the target table. how to define now target table.

***SOURCE DSO Table

types: begin of typ_tgl1.

include type /BIC/AZDAFIAR000.

types: end of typ_tgl1.

types: begin of comp,

CUSTOMER type /BI0/OICUSTOMER,

ACCNT_GRP type /BI0/OIACCNT_GRP,

end of comp.

DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer

INITIAL SIZE 0.

data: wa_itab type COMP.

data: wa_zdtg type typ_tgl1.

IF L_th_COMP[] IS INITIAL.

***Master Data Table

SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING

FIELDS OF TABLE L_th_COMP.

sort L_th_COMP by CUSTOMER.

ENDIF.

LOOP AT L_th_COMP into wa_itab.

select * from /BIC/AZDAFIAR000 into wa_zdtg

where DEBITOR eq wa_itab-CUSTOMER. *** SOURCE DSO Table

IF SY-SUBRC = 0.

wa_zdtg-ACCNT_GRP = wa_itab-ACCNT_GRP.

MODIFY /BIC/AZDAFIAR000 from wa_zdtg. *** modify SOURCE DSO Table

ENDIF.

endselect.

endloop.

soniya kapoor