Former Member

tell me the logic

Folks.....

iam selecting the data from bkpf to I_BKPF based on selection criteria.

then getting the data from REGUP to I_REGUP by doing for all entries in I_BKPF.

suppose in I_BKPF i have 20 records. and i got 3 records in I_REGUP.

now i need data from I_BSIK by doing for all entries on remaining ( 20-3 = 17).

please tell me how can i write the logic for it

regards

niru

10|10000 characters needed characters exceeded

Related questions

• Posted on Jan 18, 2008 at 09:22 PM

Hi neeru.. check this code..

sort I_BSIK by k1.

loop at I_REGUP.

read table I_BSIK with key k1 = I_REGUP-k1 Binary search. <<< k1 is the common key field in both tables.

if sy-subrc eq 0.

delete I_bsik index sy-index.

endif.

I_bsik will have 17 field after that.

-

I_REGUP has 3 entries and I_BSIK has 20 entires so looping I_REGUP and reading I_BSIK is better.

Edited by: Jackandjay on Jan 18, 2008 4:29 PM

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 18, 2008 at 09:23 PM

First Get the data from BKPF Table to i_bkpf

then use for all entries for REGUP.

now

Now get the data from BSIK Table using for all entries in I_BKPF

loop at i_bsik.

read table i_regup with condition bsik table

if sy-subrc eq 0.

delete i_bsik

endif.

endloop.

Thanks

Seshu

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 18, 2008 at 09:26 PM

Niru,

Unfortunately there is no quick trick to accomplish what you are looking for. You just have to write code; but there are a few ways.

1) Select for all 20 records and delete the records you don't want

2) Delete the 3 records from I_BKPF (or from a copy of the table) and then select.

3) Loop at I_BKPF, check if there is a corresponding I_REGUP, if not SELECT from BSIK. Very inefficient method and not recommended.