‎2009 Apr 16 3:01 PM
Dear Experts,
I have created the Purchase Requisition via the BAPI_REQUISITION_CREATE.
But, is there any Function Module to change the Material of the Purchase Requisition?
I tried on the BAPI_REQUISITION_CHANGE, but the none of the parameters is receiving Material?!
Thanks.
Tee
‎2009 Apr 16 3:18 PM
Hi Tee,
the Filed VEND_MAT in structure BAPIEBANV for Transfer Structure: Change Requisition: Item is useing the Material Number..
Regards,
Prabhudas
‎2009 Apr 16 3:18 PM
Hi Tee,
the Filed VEND_MAT in structure BAPIEBANV for Transfer Structure: Change Requisition: Item is useing the Material Number..
Regards,
Prabhudas
‎2009 Apr 16 3:23 PM
Hi Tee,
Read 'BAPI_REQUISITION_GETDETAIL' and get the material number
In FM-'BAPI_REQUISITION_GETDETAIL' in the Structure--requisition_account_assignment(BAPIEBAN) is returning the Material..(field--BAPIEBAN-MATERIAL)
Pass MAterial Number to BAPIEBANV-VEND_MAT field in FM---BAPI_REQUISITION_CHANGE..
in FM---BAPI_REQUISITION_CHANGE..requisition_items_new(BAPIEBANV-VEND_MAT ) Pass Material..
the Filed VEND_MAT in structure BAPIEBANV for Transfer Structure: Change Requisition: Item is useing the Material Number..
Regards,
Prabhudas
‎2009 Apr 16 4:19 PM
Prabhudas,
Thanks for your reply. I will try on it.
By the way, do you know how to pass the ACCTASSCAT into the BAPI_REQUISITION_CHANGE?
Thanks.
Tee
‎2009 Apr 16 4:26 PM
Hi Tee,
for account assignment..
you need to do manually no other alternative is available..
SELECT * FROM eban INTO TABLE lt_eban WHERE banfn = w_banfn . "Purchanse requstion number
IF sy-subrc = 0.
LOOP AT lt_eban .
lt_eban-knttp = 'J'. "assign your Own account type
MODIFY eban FROM lt_eban.
COMMIT WORK.
ENDLOOP.
ENDIF.
Regards,
Prabhudas
‎2009 Apr 16 4:30 PM
* New values are present in t_acct_send
* Move & Append account assignment details
wa_acct_send-preq_item = wa_acct-preq_item.
wa_acct_send-serial_no = wa_acct-serial_no.
wa_acct_send-preq_qty = wa_acct-preq_qty.
wa_acct_send-g_l_acct = wa_acct-g_l_acct.
wa_acct_send-co_area = wa_acct-co_area.
wa_acct_send-prof_segm = wa_acct-prof_segm.
wa_acct_send-profit_ctr = wa_acct-profit_ctr.
* Assign Sales order & line item to each line of STR number
CALL FUNCTION 'BAPI_REQUISITION_CHANGE'
EXPORTING
number = w_banfn "Purchase requisition
TABLES
requisition_items_old = t_items_save "Old item details fetched from 'BAPI_REQUISITION_GETDETIAL
requisition_items_new = t_items_send "New item details
requisition_account_old = t_acct_save "Old Account
"assignment details fetched from 'BAPI_REQUISITION_GETDETIAL
requisition_account_new = t_acct_send "New Account
"assignment details
return = t_return. "Messages
‎2009 Apr 16 4:54 PM
Dear Prabhudas,
I guess the PLANT can't be changed via the BAPI_REQUISITION_CHANGE as well?
I am wondering if i should use this BAPI to change the purchase request? Or is there any other better way to change the purchase request, not via TCODE.
Thanks.
Tee
‎2009 Apr 16 5:35 PM
Dear Prabhudas,
I tried to update the Material field of the line item using the VEND_MAT.
But, only the vendor material got updated, not the material.
Thanks.
Tee
‎2009 Apr 17 6:39 AM
Hi,
Could you please have a try with function FMFG_MM_REQ_CHANGE where exists provision for material number.
Regards,
Prasanth
‎2009 Apr 17 6:50 AM
‎2009 Apr 17 5:33 PM