2011 Feb 21 9:47 PM
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'.
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'.
2011 Feb 21 10:00 PM
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( ).
2011 Feb 22 5:00 AM
2011 Feb 22 12:23 PM
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.
2011 Feb 22 2:37 PM
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?
2011 Feb 22 8:14 AM
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.
2011 Feb 22 2:40 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |