Skip to Content
author's profile photo Former Member
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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • 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.

    Award points if helpful

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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.

    Hope this logic will help you

    Thanks

    Seshu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.