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: 

PO change with Sub-contracting BOM Components through BAPI_PO_CHANGE

Former Member
0 Kudos

Dear Experts,

Our requirement is to change PO through the usage of FM "BAPI_PO_CHANGE" where we are passing BAPICOMPONENTS and BAPICOMPONENTSX data records to create/Insert BOM components for "item category" = 3 [Sub-Contracting]. As an outcome, error message throws = "Not possible to determine any components’".

However, if we creates BOM components manually through ME22N, and try to change the same PO through FM "BAPI_PO_CHANGE then no error at all.

While debugging, i'd come across few FM ME_COMPONENTS_MAINTAIN,  MD_LESEN_KOMPONENTEN_RSNUM .... that are involved in BOM components management.

However, i am looking forward for any help or insight on this subject if someone out there happened to resolve this case.

Best regards,

Rahul Agarwal

1 ACCEPTED SOLUTION

Former Member
0 Kudos

After regressive days of analysis, i have found the solution.


FM = ME_COMPONENTS_MAINTAIN

Highlighted block of code if is commented [Line Number 93 to 96], then we can explode the BOM Components which results in successful Material purchase Order update through IDoc post. This code modification requires SAP Access key.


This solution works in both the cases [BAPI IDOC post + PO update through ME22N]. i didn't notice any other objects functionality if obstructed by this change. If anyone, happen to find out please post that to assist us.

Thank you.

Best regards,

Rahul Agarwal

13 REPLIES 13

Former Member
0 Kudos

There are numerous inputs and tables for that BAPI besides the one that you specified..  In your manual debug, did you check all of these to see that you are sending everything?

Neal

0 Kudos

Hello Neal,

Yes, we are passing other relevant export parameters too to this BAPI FM. it seems Sub-contracting components are transferring to BAPI but not 'ME_COMPONENTS_MAINTAIN'.

i happen to came across other posts on similar subject and observed that below SAP Notes needs to be implemented to perform source code corrections.

1100337  BAPI_PO_CREATE1

918880   BAPI_PO_CHANG

i've downloaded these SAP notes in our SAP system, where, as a result it states the message "Implementation status: Cannot be implemented". Since, these notes are valid for SAP Application release 600. Whereas, our SAP Application release is 701.

What would you like to suggest in this regard ?

Thank you.

regards,

Rahul Agarwal

0 Kudos

You can report a problem to OSS and see if they need to extend for that purpose.  However, the default meaning of that is that they think your version already takes that into consideration.

Note:  They've been wrong before.  Thus there are notes...

Neal

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Rahul,

Please check BOM for the header material.

Arivazhagan S

0 Kudos

Hello Arivazhagan,

Could you please explain what are the per-rquisite BOM checks required for header material ?

Thank you.

Regards,

Rahul Agarwal

0 Kudos

Hi Rahul,

Suppose you are going to get Material A.

For A Material, I need to B material.

So you need to maintain BOM A material using CS01.

You can create a PO for Material A. This material called header material.

Arivazhagan S

Former Member
0 Kudos

After regressive days of analysis, i have found the solution.


FM = ME_COMPONENTS_MAINTAIN

Highlighted block of code if is commented [Line Number 93 to 96], then we can explode the BOM Components which results in successful Material purchase Order update through IDoc post. This code modification requires SAP Access key.


This solution works in both the cases [BAPI IDOC post + PO update through ME22N]. i didn't notice any other objects functionality if obstructed by this change. If anyone, happen to find out please post that to assist us.

Thank you.

Best regards,

Rahul Agarwal

0 Kudos

Hi Rahul

I am facing the same issue. I want to create a subcontracting PO with list of components as we do via me21n. But BAPI_PO_CREATE1 is giving same error if BOM doesn't exist but i dnt want to create BOM. Could you pleaae advise of you found any solution for the same.

Thanks,

Shweta

0 Kudos

Hello Shweta,

SAP note - 197958 [already meant for such error] but no help so far. We already addressed this issue to SAP but no reply yet.

Thus, the corrective step i did in my case is :-

1) Ask for SAP access key for FM - ME_COMPONENTS_MAINTAIN since thsi FM triggered at both cases PO Create / Change.

2) Since, this problem occurs at IDOC processing so..i am passing a flag from the calling program through ABAP Stack.

3) Capture this flag stat in this FM just before line number 93.

4) If this FM triggered from your program then this flag will be X, otherwise NULL.


so, you can write code like this.

if lf_actif = 'X'.

lb_ok= 'X'.  "Change the OK field manually

endif.


where, same flag  lf_actif = 'X', mark in your calling program.


Since, lb_ok is no longer equal to space then error message will not trigger. and PO can be created / change without BOM components, without any impacting the Standard transaction flow like ME21N or ME22N.


I understand the implication of this change / SAP modification. It may create problem while SAP upgradation.


This only solution i realized until now, do you have better suggestion on your mind ?


Thank you.


best regards,

Rahul Agarwal


0 Kudos

Hi Rahul,

Thanks for the reply.

Actualy its difficult to get access key for me. so I found below 2 options :

1) Create normal PO via BAPI_PO_CREATE1 then change PO to subcontracting PO and add components by passing in POCOMPONENTS and POCOMPONENTSX via BAPI_PO_CHANGE.

2) Create normal PO via BAPI_PO_CREATE1 . Add components via ME_COMPONENTS_UPDATE and change PO to subcontracting PO by ME_UPDATE_DOCUMENT.

I am thinking to implement first solution.  If you have any suggestions , let me know.

Thanks,

Shweta

0 Kudos

Hello Shweta,

Creating a PO without Subcontracting [item category - 3] ..definitely works well; since BOM components demands only if item category = 3...

Indeed Point 1 sounds good to me...because BAPI_PO_CHANGE in turn calls FM's to update BOM components.

I'll be at your disposal if you need any more help.

Thank you.

Best regards,

Rahul Agarwal

0 Kudos

Hi Rahul,

Thanku so much..

Regards,

Shweta

Former Member
0 Kudos

Hi Rahul,

Thanks a lot for posting the solution to this pretty common issue being faced by a lot of us, including myself. Haven't implemented the solution you have given, but I'm pretty sure it would work.

Really grateful to you.