Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC for FB02

Former Member
0 Likes
2,598

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!!!

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!!!

7 REPLIES 7
Read only

Former Member
0 Likes
1,807

the best way is use LSMW

Object 0100 Financial documents

Method 0000

Program Name RFBIBL00

Program Type D Direct Input

Read only

Former Member
0 Likes
1,807

Hi,

Insted of BDC goo for BAPI BAPI_ACC_DOCUMENT_POST

for more info go throught this link:[;

Read only

Former Member
0 Likes
1,807

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

Read only

Former Member
0 Likes
1,807

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

Read only

Former Member
0 Likes
1,807

Hi,

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

Regards,

Madhu

Read only

former_member438956
Active Participant
0 Likes
1,807

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.

Read only

Former Member
0 Likes
1,807

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.