Application Development 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: 

Updating Assignment field in FB02

Former Member
0 Kudos

Hi,

I have a scenario where I need to change the assignment field for G/L accounts, Vendor accounts & Customer accounts in TCode FB02/FB09. I have written a BDC for this I am facing the following issue:

If there are additional fields for the G/L account the "more" field is ticked. After entering the data in the assignment when I press save a second screen pops up after the main screen where I have to press 'ENTER'.

But in case no additional fields are there this "more" field does not appear, so my BDC fails.

Please suggest how scenario this can be handled.

Is there any BAPI to change the FI doocuments?

Regards

Tejaswini

4 REPLIES 4

Former Member
0 Kudos

you can use LSMW method

Object 0100

Method 0000

Program Name RFBIBL00

Program Type D Direct Input

0 Kudos

Hi Chenna,

Thanks. LSMW will work, but is there any BAPI for this?

Best Regards

Tejaswini

0 Kudos

Hi Tejaswini,

I have the same requirement for FB02/FB09 BAPI.

If u find any kindly let me know.

Thanks.

Former Member
0 Kudos

Dear Tejaswini,

try following piece of code. I had exact similar requirement.

type-pools tpit .

*... interface to dialog RF_ZEILEN_ANZEIGE:

types: begin of tpit_buztab,

         bukrs             like bseg-bukrs,    " Buchungskreis

         belnr             like bseg-belnr,    " Belegnummer

         gjahr             like bseg-gjahr,    " Geschaeftsjahr

         buzei             like bseg-buzei,    " Buchungszeile

         koart             like bseg-koart,    " Kontoart

         umskz             like bseg-umskz,    " SHB-Kennzeichen

         bschl             like bseg-bschl,    " Buchungsschlüssel

         bstat             like bkpf-bstat,    " Buchungsstatus

         mwart             like bseg-mwart,    " Steuerart,

         mwskz             like skb1-mwskz,    " Steuerkategorie,

         flaen(1)          type c,     " X = Posten geaendert

       end of tpit_buztab.

types: tpit_t_buztab type tpit_buztab occurs 1.

*... table of fields in mass change:

types: begin of tpit_fname,

          fname    like t021-fname,

          aenkz(1) type c,                     " Aenderungskennzeichen

       end of tpit_fname.

types: tpit_t_fname type tpit_fname occurs 1.

*... table of errors in mass change:

types: begin of tpit_errdoc,

          doc type tpit_docmnt,

          err like bdcmsgcoll,

       end of tpit_errdoc.

types: tpit_t_errdoc type tpit_errdoc occurs 1.

DATA : it_buztab TYPE TPIT_T_BUZTAB ,

       it_fldtab  TYPE TPIT_T_FNAME WITH HEADER LINE.

DATA : it_errtab TYPE TABLE OF tpit_errdoc.

data  w_bseg TYPE BSEG.

"=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-==-==-=

*Select the BSEG records for which mass change should be applied

*-------------------------------------------------------------------------------------------------

SELECT bukrs belnr gjahr buzei koart bschl

  APPENDING CORRESPONDING FIELDS OF TABLE it_buztab

  FROM bseg

  WHERE bukrs = '1015'

  AND   belnr =  '0150000275'

  AND   gjahr = '2013'

  AND   koart = 'K'.    "____________Change only Vendor Line Item - Assignment Filed

  w_bseg-ZUONR = 'UTR12345'.   "____________UTR no to be updated

  it_fldtab-fname = 'ZUONR'.         "____________Column name

  APPEND it_fldtab.

  CLEAR it_fldtab.

*Update payment block

*--------------------------------

  IF NOT it_buztab[] IS INITIAL.

    CALL FUNCTION 'FI_ITEMS_MASS_CHANGE'

         EXPORTING

              s_bseg     = w_bseg

         IMPORTING

              errtab     = it_errtab[]

         TABLES

              it_buztab  = it_buztab[]

              it_fldtab  = it_fldtab[]

         EXCEPTIONS

              bdc_errors = 1

              OTHERS     = 2.

    IF sy-subrc eq 0.

      MESSAGE 'Assignment Field successfully updated' TYPE 'I' DISPLAY LIKE 'S'.

    ENDIF.

    ENDIF.

*-------------------------------------------------------------

Regards,

NG