08-30-2016 7:04 AM
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
08-30-2016 7:11 AM
Seems you forget to refresh it_buztab, so the last call update every processed item.
(Same behavior expected during debug)
08-30-2016 7:11 AM
Seems you forget to refresh it_buztab, so the last call update every processed item.
(Same behavior expected during debug)
08-30-2016 8:17 AM
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
08-30-2016 8:24 AM
You could only refresh it after call of FI_ITEMS_MASS_CHANGE.
Regards,
Raymond
08-30-2016 8:33 AM
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