cancel
Showing results for 
Search instead for 
Did you mean: 

Read TVARV entry in process chain

Former Member
0 Kudos

Hi BW Gurus,

I have an infopackage in which the accounting period is one of the selection conditions. What the accounting period is at any particular point in time is dependant on an entry in TVARV table. So in my process chain, I have to read TVARV and use that in the infopackage selection criteria and pull only for the accounting period that is in TVARV table. Can someone tell me how I can do this in my process chain???

Thanks

SRD.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You cannot do this within the InfoPackage or process chain. You will have to do this within your START routine.

At the beginning of the START routine you have to read TVARV and then LOOP at the data package. Within the LOOP you decide whether you want to process the record or just delete it.

Former Member
0 Kudos

Hi Arno,

So are you saying that I read TVARV, assign it to a variable and whenever the accounting period of a particular record is NOT EQUAL TO TVARV Entry then RETURNCODE <> 0 so that the record is not updated. But in start routine you do not have RETURNCODE , you can only do ABORT. So what would happen is whenever a data package has a record with acct period not equal to current TVARV entry, then the whole data package will ABORT. even though there are other records whose acct period = TVARV entry. Because the START routine executes for a data package and not for individual records.

Do you think my thinking here is wrong?? plz correct me if I am wrong.

Thanks for response

SRD

Former Member
0 Kudos

example:

*

data: l_tabix type sy-tabix.

*

select * from TVARV into table i_TVARV.

LOOP at data_package.

l_tabix = sy-tabix.

read table i_tvarv with key

<fieldname> = data_package-<fieldname>.

If sy-subrc <> 0.

delete data_package index l_tabix.

endif.

*

ENDLOOP.

So whenever you do not find the value in TVARV you can go ahead and delete the record, as you do not want to process it. Please keep in mind, that you must still define the internal table i_tvarv, which is not done in the example above.

Former Member
0 Kudos

Arno,

Your solution is perfect.It works like magic. I wish I can buy you a beer my friend.

Thank You

SRD

Former Member
0 Kudos

ya thats a good solution