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

BDC for FB02

I am using t-code FB02 with BDC to update the accounting documnets.

Requirement is to update the item text if it is empty.

In an internal table, I have a list of the document items which are to be updated.

I have recorded FB02 with a random item number. Now it may be required to update any of the document item each time which may not be the same as the recorded one.

So, the issue is how to determine the item number to be changd from the list of item numbers on the screen.

Please suggest a relevant solution.

Thanks!!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2009 at 07:10 AM

    the best way is use LSMW

    Object 0100 Financial documents

    Method 0000

    Program Name RFBIBL00

    Program Type D Direct Input

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2009 at 07:31 AM

    Hi,

    Insted of BDC goo for BAPI BAPI_ACC_DOCUMENT_POST

    for more info go throught this link:[FB01 and BAPI_ACC_DOCUMENT_POST;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 20, 2009 at 09:24 AM

    Hello,

    if it has to be BDC - you could use the option EDIT - > Display from Item inside FB02.

    This put the selected item at the top line of the table.

    You could just make another recording of FB02 using this option.

    Regards Wolfgang

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2009 at 09:55 AM

    go throw bdc session method i think in that no problem comes

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2009 at 08:26 AM

    Hi,

    better to choose calltransaction method ,run with A (all screen mode).

    Regards,

    Madhu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21, 2009 at 08:59 AM

    Hi Abhinav,

    while recording in SHDB for transaction FB02 for selecting line item goto EDIT->Display from item and do the bdc accordingly.while collectng data in int table decide on line item accordingly...

    Hope it solve ur problem.....

    Regards,

    Anil N.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2009 at 09:05 AM

    Hi Abhinav,

    You need to include the below standard code to determine the Item Number.

    lv_winfk         = 'ZKO'.
      lv_mpool         = 'SAPMF05L'.
    *----- Assign Constant data to T019W table
      t019w-mpool      = lv_mpool.
      t019w-winfk      = lv_winfk.
    
      CLEAR : lv_winfk.
    
      IF lv_umskz NE space.
        t019w-winfk+3  = c_char_x.
        TRANSLATE t019w-winfk TO UPPER CASE.
      ELSE.
        t019w-winfk+3  = lv_koart.
      ENDIF.
    
      lv_winfk         = t019w-winfk.
    
    
    *----- Fetch the Screen Number from table T019W
      SELECT SINGLE winnr
      FROM          t019w
      INTO          lv_winnr
      WHERE         mpool = lv_mpool
      AND           winfk = lv_winfk
      AND           buvar = space.
    
      t019w-winnr     = lv_winnr.

    For the financial screen

     CLEAR : t019.
    
    *------ Pass data to T019 table
      t019-dyncl = c_char_a.
      t019-koart = lv_koart.
      t019-umskz = lv_umsks.
      t019-buvar = lv_buvar.
    
    *------ Check for A, W Transaction Types
      IF ' AW' NS t019-umskz.
        t019-umskz = c_char_x.
        translate t019-umskz to upper case.
      ENDIF.
    
    *------ If Transaction Screen Variant is null
      IF  lv_umsks NE space
      AND lv_buzei EQ it_bseg-buzei.
        t019-umskz = c_char_w.
        translate t019-umskz to upper case.
      ENDIF.
    
    *------ If the Document Status is 'S'
      IF  lv_umsks = c_char_w
      AND lv_bstat = c_char_s.
        t019-umskz = c_char_f.
        translate t019-umskz to upper case.
      ENDIF.
    
    *------ If the Special G/L Ind. from BSEG is not Zero
      IF  lv_umskz <> space
      AND lv_bstat = c_char_s
      AND lv_buzid = c_char_p.
        t019-koart = space.
        t019-umskz = c_char_p.
        t019-buvar = space.
        translate t019-umskz to upper case.
      ENDIF.
    
    *------ Read Table and if it not null, pass null to Transction Variant
      READ TABLE t019.
      IF sy-subrc NE 0.
        t019-buvar = space.
      ENDIF.
    
    *------ Get the Screen Number
      SELECT SINGLE dynnr FROM t019
      INTO   lv_dynnr
      WHERE  dyncl = t019-dyncl
      AND    koart = t019-koart
      AND    umskz = t019-umskz
      AND    buvar = t019-buvar.
    
    *------ Assign the Screen Number to table T019.
      t019-dynnr = lv_dynnr.

    Just try to analyse the code and get understanding on the same. If you need any other detail, revert back.

    Regards,

    -Syed.

    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.