cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PR_CHANGE not updating EBAN table

0 Kudos
1,626

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Kartehiik
Explorer
0 Kudos

Please follow the enhancement for updating fixed indicator to 'X' when Purchase requisition is released from ME55n

 

Kartehiik_0-1745333757812.pngKartehiik_1-1745333860797.png

 

pataselano
Active Contributor
0 Kudos

If PR already released then you can't change PR and you will get return message ME664 - Change FIXKZ could not be effected from BAPI.

Please unrelease PR first before you change fixed indicator.

0 Kudos

Hi pataselano ,

PR is not released , FRGKZ / FRGZU is blank for the PR. Still not working and Bapi is returning success message. Update is not happening.

pataselano
Active Contributor
0 Kudos

Hi sxc8225,

Please check following sap note 1721189 - When is the fixed indicator set in requisitions?, fixed indicator cannot be removed manually for some PR.

0 Kudos

Hi pataselano ,

I understand that it can't be removed manually . But BAPI_PR_CHANGE should work for all of the PR cases.

pataselano
Active Contributor

Your statement is not correct.

BAPI should follow all validations of PR as same as standard tcode (ME52N).