Skip to Content
0
Feb 03 at 04:59 PM

BAPI_PR_CHANGE not updating EBAN table

394 Views

Hello Everyone ,

I am trying to update the FIXKZ field in EBAN ( From value 'X' to blank ) through BAPI_PR_CHANGE.

Any suggestions pls.

LOOP AT it_eban INTO DATA(wa_eban).
CALL FUNCTION 'BAPI_REQUISITION_GETDETAIL'
EXPORTING
number = wa_eban-banfn
account_assignment = 'X'
TABLES
requisition_items = lt_item
requisition_account_assignment = lt_acc
return = lt_return.
LOOP AT lt_item INTO ls_item.
ls_pritemx-preq_item = ls_item-preq_item.
ls_pritemx-preq_itemx = 'X'.
ls_pritemx-fixed = 'X'.
APPEND ls_pritemx TO lt_pritemx.
ls_pritem-preq_item = ls_item-preq_item.
* ls_item-fixed = ''.
* ls_pritem-fixed = ls_item-fixed.
APPEND ls_pritem TO lt_pritem.
CALL FUNCTION 'BAPI_PR_CHANGE'
EXPORTING
number = wa_eban-banfn
TABLES
return = lt_return2
pritem = lt_pritem
pritemx = lt_pritemx.
LOOP AT lt_return2 INTO ls_return2.
IF ls_return2-id = 'BAPI' AND ls_return2-number = '002'.
"Do not show this message
ELSE.
WRITE: / ls_return2-message.
ENDIF.
ENDLOOP.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_return2.