Application Development 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: 

How to add and Change the Components quantity in Production Order Using BAPI or Function Module??

hiriyappa_myageri
Participant
0 Kudos

Hi All,

I have Created Production order of Type PP01.

Now i want change the quantities  of all components  In Production Order.

is there any BAPI or function Module to achieve this requirement.

Regards,

Hiriyappa

1 ACCEPTED SOLUTION

former_member187748
Active Contributor
0 Kudos

Hi Hiriyappa,

i think you have to use BDC for the same purpose.

i think you ahve to use bapi BAPI_PRODORD_GET_DETAIL, to get the current list of components,

and then please use BDC for achieving your goal.

24 REPLIES 24

deependra_shekhawat3
Contributor
0 Kudos

Hi Hariyappa,

As per SAP Note 1694267 - BAPI_ALM_ORDER_MAINTAIN not for work orders you need to try with BAPI BAPI_PRODORD_CHANGE, CO_SE_PRODORD_CHANGE.

The corrections in SAP Note 1275923 check the order type data that is relevant

only for maintenance orders. Since this data is not available for work orders,

the use of BAPI BAPI_ALM_ORDER_MAINTAIN is not possible.

Thanks

Deependra

0 Kudos

Hi Deependra,

i tried All these Possibilities.  This bapis Will not Help In chnaging and Adding Components to the Production Order.

Regards,

Hiriyappa.

Former Member
0 Kudos

Check this :

BAPI_PLANNEDORDER_CHANGE.

For any bapi search you can check in T-Code BAPI.

Cheers,

Prakash

former_member187748
Active Contributor
0 Kudos

Hi Hiriyappa,

i think you have to use BDC for the same purpose.

i think you ahve to use bapi BAPI_PRODORD_GET_DETAIL, to get the current list of components,

and then please use BDC for achieving your goal.

0 Kudos

Hi Sanjeevv,

Thanks for your Reply.

I also Searched Many Posts For Updating Components and Adding Components,there I got Same Reply Like You.

I am also thinking to BDC. Is there Any other way to do using BAPI and Function Modules

Regards,

Hiriyappa.

0 Kudos

Hi Hiriyappa,

if you wants to do it through BAPI, please do these .

As i told you in previous post, use these function module

BAPI_RESERVATION_GETDETAIL1  and

BAPI_RESERVATION_GETDETAIL


from these function module, you will get the details (for your entries already in)

then use BAPI_RESERVATION_CHANGE

and when this will be used, after then use

call function 'BAPI_TRANSACTION_COMMIT'.


to make sure the commit of the changes you have done.


Hope it works for you.

0 Kudos

You proposed wrong function modules, it's applicable to reservations not for Production Orders!

I guess he should have to use BAPI*PROD*CHANGE or similar! what do you think

Rg, Kiran

0 Kudos

Hi kiran,

thanks a lot for your sujjestions, i may be wrong at this place,

i have just told him to get the details of components for that

material, may be its BAPI*PROD*CHANGE, as you have sujjested.

But the concern is that, the queries he has posted, i think the best solution is

the use of BDC, isn't it.

0 Kudos

Sanjeev, if no solution found in this case! Better to go for BDC ( this is the last option of a developer to fulfill the business needs )

Former Member
0 Kudos

Hi,

  Production order item will never get updated by their own BAPI. You have to play with corresponding reservation number. The BAPI to change reservation number is BAPI_RESERVATION_CREATE / BAPI_RESERVATION_CHANGE.

Cheers,

Prakash

0 Kudos

Hi Prakash Jha,

I have six items in my reservation number . now i need to change the Quantity of that components .

Is it Possible from this BAPI BAPI_RESERVATION_CHANGE.

if yes Can you give one Example and what are the parameters i need to pass in this bapi .

Regards,

Hiriyappa

0 Kudos

Hi Hiriyappa,

sorry for my previous post, the function module i have sujjested earlier was for

reservation purpose.

Now for production please see these function modules.

CO_XT_COMPONENT_CHANGE, it can be used to change about material quantity,


CO_XT_ORDER_PREPARE_COMMIT , to commit


CO_XT_COMPONENT_ADD , to add new components


if you didn't get how to do it, please see this link, here it is better briefed.

Please change is according to your use.


http://scn.sap.com/thread/3400096

0 Kudos

Hi Hiri,

  you need to fetch all the reservation number of a process order. This can be retrieved as :

select rsnum "Reservation number

          rspos "Item number matnr "Material Number

          bdter "Requirement Date for the Component

          meins "Base Unit of Measure

         aufnr "Order number

         bdmng "Requirement Quantity

         vmeng "Confirmed quantity for availability

from resb into table t_resb

for all entries in t_order

where aufnr = t_order-aufnr

and xloek eq space.

if sy-subrc = 0

* each entry in t_resb will give you one line item of Process order

* Call BAPI here by passing entries in t_resb........

*BAPI  Commit.

ENDIF.

Cheers,

Prakash

0 Kudos

Hi Prakasha and Sanjeeva,

I want change the Quantity of Components Present in component overview of Production order .

I have Tried these BAPIS CO_XT_COMPONENT_ADD ,

CO_XT_COMPONENT_CHANGE.

But No Use its not modifying and adding  the Component in this screen.

Regards,

Hiriyappa

0 Kudos

Hi Hiriyappa,

ok let me see, actually the problem is this, my company is not working on

PP so not having such stuffs, to check its consistency.

But still let me explore, if i can help you in any way.

0 Kudos

Hi Hiri,

  My suggestion was to use BAPI to change the reservation. I have already implemented the same and its working. Even the code example I have given was for BAPI_RESERVATION_CHANGE only. try this it will work.

Cheers,

Prakash

0 Kudos

Hi Hiriyappa,

as i have sujjested have you used

call function 'BAPI_TRANSACTION_COMMIT'.


so that the changes you have done, must get committed.

0 Kudos

Hi Prakash,

but as has sujjested it is for reservation purpose, and he needs for production order.

Are you sure that you have worked on the same for production order.

0 Kudos

Hi Used this BAPI_Resrvation_Change and Getting this Error

Reservation created automatically. No manual changes possible

I Passed the values like this .

Import parameter :-

Reservation number -1968

tables:-

RESERVATIONITEMS_NEW-material = '302168'.

RESERVATIONITEMS_NEW-PLANT= '1000'.

RESERVATIONITEMS_NEW-ENTRY_QNT = '8'.

RESERVATIONITEMS_NEW-ENTRY_UOM = 'EA'.

BUT WHEN I CHECKED in table level the record is not present .

Regards,

Hiriyappa

0 Kudos

Hi Sanjeev,

Each production order item linked with a reservation number. Please check the DB table RESB.

Also check the T-codes COR2 or COR3 with process order number. If you will analyse it at item level it will show you corresponding reservation number.

Also please check my previous post in this thread i have given how to fetch reservation number from a process order number.

Cheers,

Prakash

0 Kudos

have you fixed the indicators in other ITEM table used in BAPI ?

Cheers,

Prakash

0 Kudos

I Used this BAPI Also.

0 Kudos

Hi Prakasha Jha,

Can give You Sample data to pass int his BAPI.

One More  Thing Can u confirm this bapi is correctly updates Component over view of Production order.?

Regards,

Hiriyappa

0 Kudos

Hi Hari,

  I did it successfully in my last project. So currently I dont have that code. Can you check once in where used list of that BAPI ? You will get the proper code.

Sample:

In Bapi you have 2 item table. On ITEM and other ITEMX. In item you have to pass values and in ITEMX you have to put the corresponding FLAG = X , which value you want to update.

Cheers,

Prakash