cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine in Update Rules to populate additional fields from ODS

Former Member
0 Kudos

I have a flat file load which only contains values for a few characteristics on an order line item. I need to populate about 75 other fields for that order line item.

These 75 other fields are already assigned to that order line item - they exist in the ODS that this flat file load is going into. If the order item is >=2, I need to perform the population of the fields.

How do I write a start routine to assign all of these fields to the order line item?

The purpose of this is basically to create a new complete record.

Thanks,

Darryl

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Darryl,

1) Start Routine is called only once before the load starts.

2) You could perform some calculations (your 75 fields) and store these in a global data structure or in a table. You can access this structure or table from update routines.

2) The above global data is available in update routine which is executed once for each data record.

You can get some more info from:

http://help.sap.com/saphelp_nw04/helpdata/en/4f/a9ea964a86b04dbe4df20af6e598cf/frameset.htm

3) In the Communication structure there is a button to create Start ROutine.

If you need some sample code, I can dig it for you.

Good luck, BB

Former Member
0 Kudos

Hi BB,

If you can provide sample code, that'd be great. ABAP is not my specialty.

Thanks!

Darryl

edwin_harpino
Active Contributor
0 Kudos

hi Darryl,

check one sample

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] BINARY SEARCH.

if sy-subrc ne 0.

delete data_package.

endif.

endloop.

hope this helps.

Former Member
0 Kudos

Thanks A.H.P.

With your logic below...will the data packages where [key figure] = 0 still be loaded as is (via the standard update rule mappings?

Thanks again,

Darryl

edwin_harpino
Active Contributor
0 Kudos

hi Darryl,

no, 'delete data_package.' will eliminate the records.

to add new record, you can try

data_package-field1 = lt_ods-fieldname.

data_package-field2 = lt_ods-fieldname.

..

data_package-field75 = lt_ods-fieldname.

add data_package.

hope this helps.