Skip to Content
author's profile photo Former Member
Former Member

selection criteria

hi,

i have a requirement for credit memo,

if i have the duplicates of clearing doc and if the posting key of any one is 21 then i need to do some calculations.

my question is how to get or how to select the duplicates for documents in bsak.

previously im selectin based on selection criteria.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 03:52 PM

    Hi,

    In BSAK,

    fetch all records, that have the same co.code (BUKRS), Vendor or Creditor (LIFNR), and clearing doc.no. (AUGBL), if you can pass the year that is good b'coz this will reduce the number of records.

    Now sort this table and delete entries that does not have Posting Key (BSCHL) = '21'.

    Now the internal table has entries with only posting key 21.

    You can now do further processing for the remaining records.

    Regard,

    Subramanian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 03:23 PM

    Try this,

    Reference document number BSAK-XBLNR should have the same accounting document number BELNR for a particular clearing document number.

    Thanks,

    SKJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05:31 AM

    You need to get a query from bsak tables where documnet type (BSAK-BLART) is vendor Credit Memo (KG) and put it on an internal table. Once you fetch it, you can now get what you need by checking the rows of your internal table that have the same Document Number (BSAK-BLART) AND Line Item(BSAK-BUZEIT) AND Clearing Document (BSAK-AUGBL).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 06:33 AM

    Hi Poonam,

    Iam not sure about the exact field names but I think this will help in coding part:

    lets say clearing doucument = field1 and

    posting key = field2.

    if itab1 is the internal table which contains all your records,

    itab2 [ ] = itab1 [ ].

    loop at itab1 into wa_itab1.

    delete table itab2 from wa_itab1.

    read table itab2 with key field1 = wa_itab1-field1

    into wa_itab2.

    if sy-subrc = 0 and wa_itab2-field2 = ' 21 ' .

    do the required operations.

    endif.

    Hope this will help.

    Regards,

    Swarna Munukoti.

    Edited by: Swarna Munukoti on Jul 25, 2008 8:34 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      i am trying to use this code but the second modify statement is not working

      LOOP AT i1_bsak.

      READ TABLE i2_bsak WITH KEY augbl = i1_bsak-augbl.

      IF sy-subrc = 0.

      i1_bsak-wskto = i1_bsak-wskto - i2_bsak-wskto.

      MODIFY i1_bsak TRANSPORTING wskto.

      MODIFY i_bsak FROM i1_bsak TRANSPORTING wskto WHERE bschl = '31' and augbl = i1_bsak-augbl.

      DELETE i_bsak WHERE bschl = '21' and augbl = i1_bsak-augbl.

      ENDIF.

      ENDLOOP.

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.