on 03-24-2006 7:13 AM
The requirement is to load the data from ODS1 to IC1. When loading the data the restriction
needs to be based on selection criteria of Account, Company Code, Ref Key of ODS1
with the data in the table of ODS2(/bic/aODS200), for which a key figure value in ODS2
table is <> 0.
In other words, push the records from ODS1 to IC1 only when
Account, Company Code and Ref key of ODS1 matches with ODS2 table values and Key figure in
ODS2 is <> 0. Please note that ODS2 is just a look up table.
I understand that, a start routine needs to be developed for this. Please advise the ABAP code for this...
Thanks,
RR
Thank You for all of your inputs.
AHP:
Here is the code that i had done based on AHP pseudocode... But ran into an error "E:Field "[/BIC/AZOLAMTOT00-COMPANY]" unknown."
*
$$ begin of routine - insert your code only below this line -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
TABLES: /bic/ods200.
DATA : lt_ods2 like /bic/ods200 occurs 0 with header line.
SELECT * from /bic/ods200 into table lt_ods2
for all entries in data_package
where [/bic/ods200-company] = data_package-[company]
and [/bic/ods200-chrt_accts] = data_package-[chrt_accts]
and [/bic/ods200-gl_account] = data_package-[gl_account]
and [/bic/ods200-ref_key3] = data_package-[ref_key3]
AND [/bic/ods200-ztotal] <> 0
ENDSELECT.
sort lt_zolamtot by [company] [chrt_accts][gl_account] [ref_key3] .
*DELETE ADJACENT DUPLICATES FROM lt_zolamtot comparing [company] [chrt_accts] *[gl_account] [ref_key3].
loop at data_package.
read table lt_zolamtot with key [company]=data_package-[company] [chrt_accts]=data_package-[chrt_accts] [gl_account]=data_package-[gl_account] [ref_key3]=data_package-[ref_key3].
data_package-ztotal = ztotal
data_package-loc_currcy = loc_currcy
if sy-subrc ne 0.
delete data_package.
endif.
endloop.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
The requirement is to populate the ZTOTAL field and LOC_CURRCY into the Infocube, hence i have included the same.
Manfred: Please advise me on Binary search and how to code it.
$$ end of routine - insert your code only before this line -
Thank Again.
Regards,
RR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dear RR,
what's your infoobject name for company, ods name etc actually ?
you should not use [] , it means you should replace it with the real field name.
i see you didn't change the ods table name.
assume your ods name is zolamtot ?
binary search mentioned by Manfred used with read table.
it would helpful if you have abap guy there to help.
i think it's more than pseudo code, it's very near to your real code already, you just need to replace [] with real objects' name.
*
$$ begin of routine - insert your code only below this line -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
TABLES: /bic/AZOLAMTOT00.
DATA : lt_ZOLAMTOT like /bic/aZOLAMTOT00 occurs 0 with header line.
SELECT * from /bic/aZOLAMTOT00 into table lt_ZOLAMTOT
for all entries in data_package
where /bic/aZOLAMTOT00-/bi0/company = data_package-/bi0/company
and /bic/aZOLAMTOT00-/bi0/chrt_accts = data_package-/bi0/chrt_accts
and /bic/aZOLAMTOT00-/bi0/gl_account = data_package-/bi0/gl_account
and /bic/aZOLAMTOT00-/bi0/ref_key3 = data_package-/bi0/ref_key3
AND /bic/aZOLAMTOT00-ztotal <> 0.
ENDSELECT.
<b>* no endselect here</b>
sort lt_zolamtot by /bi0/company /bi0/chrt_accts /bi0/gl_account /bi0/ref_key3.
DELETE ADJACENT DUPLICATES FROM lt_zolamtot comparing /bi0/company /bi0/chrt_accts /bi0/gl_account /bi0/ref_key3.
loop at data_package.
read table lt_zolamtot with key /bi0/company =data_package-/bi0/company /bi0/chrt_accts=data_package-/bi0/chrt_accts /bi0/gl_account=data_package-/bi0/gl_account /bi0/ref_key3=data_package-/bi0/ref_key3
BINARY SEARCH.
if sy-subrc ne 0.
delete data_package.
else.
data_package-/bic/ztotal = lt_zolamtot-/bic/ztotal.
data_package-/bi0/loc_currcy = lt_zolamtot-/bi0/loc_currcy.
endif.
endloop.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
Dear AHP:
I appreciate your effort in helping me out on this. I have coded exactly, the way you have suggested. But, I still get the same error.
E:Field "/BIC/AZOLAMTOT00-/BI0/COMPANY" unknown.
Am I missing something here?
I do not have ABAP programmer in my team to take help.
It would be great help,if you can assist me in fixing this.
To me it looks fine, but I know, I am missing something over here.
Following are the data elements on table /BIC/AZOLAMTOT00.
/BI0/OICOMPANY
/BI0/OICHRT_ACCTS
/BI0/OIGL_ACCOUNT
/BI0/OIREF_KEY3
RODMUPDMOD
/BIC/OIZTOTAL
/BI0/OILOC_CURRCY
If you need more information, please let me know.
Thanks,
RR
hi RR,
try ...
tables : bic/aODS200.
data : lt_ods2 like /bic/aODS200 occurs 0 with header line.
select * from bic/aODS200 into table lt_ods2
for all entries in data_package
where [account] = data_package-[account]
and [company] = data_package-[company]
and [ref] = data_package-[ref]
and [keyfigure] <> 0.
cross check again if the record not exist in other ods
here we have list for records with kf <> 0.
sort lt_ods2 by [account] [company] [ref] .
DELETE ADJACENT DUPLICATES FROM lt_ods2 comparing [account] [company] [ref].
loop at data_package.
read table lt_ods2 with key [account]=data_package-[account] [company]=data_package-[company] [ref]=data_package-[ref].
if sy-subrc ne 0.
delete data_package.
endif.
endloop.
performance need to be tested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May be better if we declare internal table without using 'occurs 0 with header line'.You can declare a work area by saying '<wa name> like line of <internal table name>.Then while reading,read into the work area.
Also..i think u only need to select the 3-4 required fields from the ODS2 table.
Remove 'select *' and select only required fields.
regards,
Vishu
Hi RR,
Yes you need to write a start routine for this thing... hope the following code will give some idea ...
Start routine on ODS1
select account, com.code, refkey from ods2
where ods1/account = ods2/account
ods1/com.code = ods2/com.code
ods1/refkey = ods2/refkey.
If ods2/keyfig <> 0 .
delete package.
endif.
Regards,
PRK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.