Skip to Content
0
Former Member
Oct 15, 2006 at 06:04 PM

Need to load data from ODS or master data table

25 Views

Hi folks,

I have a a situation where I have to populate Profit Center into my ODS when I load my data. The criteria is that if GL Accounts begin with '4' or '5' or '7' load Profit Center from /BI0/QCOSTCENTER <b>(master data)</b> and if GL Accounts begin with '1' or '2' or '3' load profit center from /BIC/AZPCA_F0800 (<b>ODS</b>) Here the code which doesn't seem to work. Please help.

<b>Tables: /BI0/PGL_ACCOUNT,

/BI0/QCOSTCENTER,

/BIC/AZPCA_F0800.</b>

data : itab like DATA_PACKAGE occurs 1 with header line.

loop at DATA_PACKAGE into itab.

if DATA_PACKAGE-GL_ACCOUNT eq '4' or DATA_PACKAGE-GL_ACCOUNT eq '5' or DATA_PACKAGE-GL_ACCOUNT eq '7*'.

select single Profit_CTR into ITAB-PROFIT_CTR

from /BI0/QCOSTCENTER where

Costcenter = DATA_PACKAGE-costcenter.

if sy-subrc = 0.

endif.

DATA_PACKAGE-Profit_CTR = ITAB-PROFIT_CTR.

modify DATA_PACKAGE.

elseif DATA_PACKAGE-GL_ACCOUNT eq '1' or DATA_PACKAGE-GL_ACCOUNT eq '2' or DATA_PACKAGE-GL_ACCOUNT eq '3*'.

select single Profit_CTR into ITAB-PROFIT_CTR from /BIC/AZPCA_F0800

where GL_ACCOUNT = DATA_PACKAGE-GL_ACCOUNT.

endif.

DATA_PACKAGE-Profit_CTR = ITAB-PROFIT_CTR.

endloop.

It is not working. Waiting for your response.