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: 

FI_ITEM_MASS_CHANGE is not working properly

sudarshan_d29
Active Participant
0 Kudos

Hi Friend,

Before coming to write discussion read lot of discussion.

I am updating BSEG-ZUONR.

This is my code below,

READ TABLE it_return into wa_return1 with key type = 'S'.   
if sy-subrc = 0.
  clear: wa_vbrk, wa_vbrk1, wa_bkpf, wa_bseg.
    WAIT UP TO 2 SECONDS.
    select single * from vbrk into wa_vbrk where vbeln = WA_RETURN1-MESSAGE_V1.
    if sy-subrc = 0.
      if wa_vbrk-FKART = 'ZEBO'.
        WAIT UP TO 2 SECONDS.
        select single * from bkpf into wa_bkpf where XBLNR = wa_vbrk-vbeln.
            WAIT UP TO 2 SECONDS.
             select * from bseg into table it_bseg where belnr = wa_bkpf-belnr.
              wa_fldtab-fname = 'ZUONR'.
              wa_fldtab-AENKZ = 'X'.
              append wa_fldtab to it_fldtab.
              Refresh it_change. clear wa_bseg.
              loop at it_bseg into wa_bseg.
                READ TABLE it_header into wa_header1 with key HEADER_ID = wa_header-header_id.     ""changing value
                select single
                bukrs belnr gjahr buzeI koart umskz bschl mwart mwskz
                from bseg into corresponding fields of wa_buztab
                where belnr = WA_BSEG-BELNR and
                bukrs = WA_BSEG-BUKRS and
                gjahr = WA_BSEG-GJAHR and
                BUZEI = WA_BSEG-BUZEI.
                  append wa_buztab to it_buztab.
                move wa_header1-POS_VBELN to wa_bseg-zuonr.
                CALL FUNCTION 'FI_ITEMS_MASS_CHANGE'
                  EXPORTING
                    S_BSEG           = wa_bseg
                 IMPORTING
                   ERRTAB           = it_errtab[]
                  TABLES
                    IT_BUZTAB        = it_buztab
                    IT_FLDTAB        = it_fldtab
                 EXCEPTIONS
                   BDC_ERRORS       = 1
                   OTHERS           = 2
                          .
                IF SY-SUBRC <> 0.

                ENDIF.
               clear wa_header1.
                endloop.
        endif.
      endif.
    endif.

while dubugging it works fine!!!!

But while Executing complete without debug, it update the data shown below.

Ztable which get data,

SD DOC. has to update at bseg-zuonr, but while executing it update all value with SC2184.

Below is First line updated with 3360697

Waiting for reply Bro's!!

Sudarshan D

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Seems you forget to refresh it_buztab, so the last call update every processed item.

(Same behavior expected during debug)

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

Seems you forget to refresh it_buztab, so the last call update every processed item.

(Same behavior expected during debug)

0 Kudos

Hi Raymon Giuseppi,

Thank you very much for quick reply.

I tried to refresh it_buztab before loop and inside loop.

it also made me clueless result like below picture.

Only first line getting updating instead of other lines. while debugging it work fine!!!

Sudarshan D

0 Kudos

You could only refresh it after call of FI_ITEMS_MASS_CHANGE.

  • Are you able to change the field with FB02, FB09 for each type of account (for each field status actually)
  • Are there some error(s) returned by FI_ITEMS_MASS_CHANGE in BDC_ERRORS

Regards,

Raymond

0 Kudos

Yes bro, I am able to change the field manually in fb02 and fb09.

There is no BDC error after function module,

and I also thought I will call FB09 call transaction inside loop but failed.

any suggestion!!! Bro

Regards,

Sudarshan D