cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP assistance

Former Member
0 Kudos

I want to write some logic in an update rule which will look up a master data (0CUSTOMER) object and will only load the data for the particular info object 0CUSTOMER in the cube if the value in the transaction data exists in the master data table. My thoughts are:

1. In the start routine carry out a lookup to the master data which I need to refer to - this I can do

2. In the info object routine delete or set to "" (not sure which is best) any record which does not match to a lookup value - need help with this

Could someone assist?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I would also recommend the start routine. Read the master data into a internal table first using the 'for all entries' statement in the select clause and while looping at the datapackage make a read of the internal table with the customer no. If the customer no doesn't exist in the table, delete the current row from the datapackage.

regards

Siggi

Former Member
0 Kudos

Siggi,

Thanks for this. Just to confirm I use the DELETE statement?

If I look at the Help file it would be similar to the example below but rather than equal I would put not equal or is there a better way to write in order to minimise load disruption:

PARAMETERS p_carrid TYPE scarr-carrid.

DATA: scarr_tab TYPE SORTED TABLE OF scarr

WITH UNIQUE KEY carrid,

scarr_wa LIKE LINE OF scarr_tab.

SELECT *

FROM scarr

INTO TABLE scarr_tab.

IF sy-subrc = 0.

scarr_wa-carrid = p_carrid.

DELETE TABLE scarr_tab FROM scarr_wa.

ENDIF.

Former Member
0 Kudos

Hi,

well it is something like this:

data: it_cust type standard table of /bi0/pcustomer,

wa_cust type /bi0/pcustomer,

l_index type sy-tabix.

select * into table it_cust from /bi0/pcustomer for all entries in data_package where customer = data_package-customer.

loop at data_package.

read table it_cust into wa_cust

with key customer = data_package-customer.

if sy-subrc <> 0.

    • now its up to you. you either delete the record

  • delete data_package index l_index.

    • or you post a dummy value like space or '9999999999' to the field customer.

  • data_package-customer = '9999999999'.

  • modify data_package index l_index.

endif.

endloop.

No warrenty that it is syntactically correct.

regards

Siggi

Answers (0)