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

Update Purchase Requisition Material via Function Module/ BAPI

Former Member
0 Likes
3,657

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,176

Hi Tee,


the Filed VEND_MAT in structure BAPIEBANV for Transfer Structure: Change Requisition: Item is useing the Material Number..

Regards,

Prabhudas

10 REPLIES 10
Read only

Former Member
0 Likes
2,177

Hi Tee,


the Filed VEND_MAT in structure BAPIEBANV for Transfer Structure: Change Requisition: Item is useing the Material Number..

Regards,

Prabhudas

Read only

0 Likes
2,176

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

Read only

Former Member
0 Likes
2,176

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

Read only

0 Likes
2,176

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

Read only

0 Likes
2,176

*         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
Read only

Former Member
0 Likes
2,176

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

Read only

Former Member
0 Likes
2,176

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

Read only

Former Member
0 Likes
2,176

Hi,

Could you please have a try with function FMFG_MM_REQ_CHANGE where exists provision for material number.

Regards,

Prasanth

Read only

Former Member
0 Likes
2,176

Hi,

I am now trying on the BAPI_PR_CHANGE.

Tee

Read only

Former Member
0 Likes
2,176

Hi,

It's good. The BAPI_PR_CHANGE is the answer.

Thanks.

Tee