Application Development and Automation 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: 
Read only

BAPI_PR_CHANGE to change ordered

Former Member
0 Likes
2,572

I can get the bapi to change the fixed and closed flag but I cannot get the ordered (bsmng) field to update. I could not find a field in the pritemx structure for ordered.

i_pritem-preq_item = wk_bnfpo.

i_pritem-fixed = 'X'.

APPEND i_pritem.

i_pritemexp-preq_item = wk_bnfpo.

i_pritemexp-ordered = wk_menge.

APPEND i_pritemexp.

i_pritemx-preq_item = wk_bnfpo.

i_pritemx-fixed = 'X'.

APPEND i_pritemx.

CALL FUNCTION 'BAPI_PR_CHANGE'

EXPORTING

number = w_header-preq_no

TABLES

return = i_return

pritem = i_pritem

pritemx = i_pritemx

pritemexp = i_pritemexp.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Hi Robin,

Are you creating PO after PR.

Regards,

Madhu.

6 REPLIES 6
Read only

Former Member
0 Likes
1,316

Hi Robin,

Are you trying to update the Ordered quantity ? Wouldn't this field be normally updated when PO is created against the requisition? What is your requirement?

Also PRITEMEXP seems to be returned by BAPI (meaning it is output after the BAPI is executed)...


*- Outbound mapping to returning structures/tables
* get item data
  pritemexp[]      = lr_bapi->get_items_exp( ).

Read only

0 Likes
1,316

Hi Robin,

Are you creating PO after PR.

Regards,

Madhu.

Read only

0 Likes
1,316

Normally it would. We are combining quanitites from a pallet and not referencing the req on the STO because there can be many reqs and the business only wants one line item on the STO for the entire quantity. What we are trying to do is consume the req without referencing it on the STO.

Read only

0 Likes
1,316

If the PR is never going to be referred, you could potentially just reduce the Purchase requisition quantity (BAMNG) to zero or the quantity that you want it to be reduced to (which should also reduced your ordered quantity to zero) or if you are going to fully consume it, close the requisition.

I would try to see if the business can be convinced to have multiple items on STO, before going with this approach though..YOu would probably have audit nightmare with this approach if anyone ask where is the requisition for STO line item?

Read only

Former Member
0 Likes
1,316

HI Robin,

You cannot change Ordered Quantity(BSMNG) using BAPI_PR_CHANGE,only you can change quantity.

As Ordered quantity(BSMNG) is getting auto populated from your material master.

So to Confirm, Go to your PR in Change Mode that field is disabled.

Let me know incase you need more info.

Regards,

Ankit.

Read only

Former Member
0 Likes
1,316

Thanks for the help.