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: 

FM to create Production Order with no material number

Former Member
0 Kudos

Hi,

I need to create a production order (Tcde: CO07) with a text based material using a function module.

Tcode CO07 allows me to create this production order without entering any Material Number but just by entering the Material Text (could be any junk description say "Test material").

I tried the below function modules

1) BAPI_PRODORD_CREATE,

2) BAPI_PRODORD_CREATE_FROM_REF - By first creating the P.Ord from CO07 and then pass that number to this function module to create with reference to that.

3) CO_ZF_PRODUCTIONORDER_CREATE

4) CO2H_PROD_ORDER_CREATE

All the above function modules are error out saying "Fill in all the required fields"....which is material number.

Tcode CO07 doesn't seem to call any FM to create the Prod.Ord.

Can any one please advice?

7 REPLIES 7

former_member555112
Active Contributor
0 Kudos

Hi,

The BAPI internally calls FM CO_EXT_ORDER_ENTRY.

In FM CO_EXT_ORDER_ENTRY there is a enhancement spot ES_SAPLCOEXT.

In this try passing the material text in field KTEXT of importing parameter ORDPEX_IMP.

This should create the production order without the material number.

Regards,

Ankur Parab

0 Kudos

But looks like this function module is opening CO07 in SAPGUI...i actually need to call the function module from web application and create the add-on order. Please advise.

Besides..i can pass the KTEXT value during the function module call itself right? can you pls tell me the reason why i need to force this in the enhancement spot?

Regards,

Kumar.

Edited by: Kumar Kasavaraju on Aug 28, 2009 11:02 PM

0 Kudos

Hi,

Use the BAPI only. But in the enhancement spot pass the value of the text in the field KTEXT.

There is no other place where you can pass the value of the KTEXT as the BAPI does not have this field.

regards,

Ankur Parab

0 Kudos

Right. sorry. i checked it in _EXP parameter which is actually a export parameter i guess.

Can you please advice as to why this fucntion module is launching CO07 in SAP GUI? when i press back it goes back to SE37.

As i said i need to call this from a web application and hence this SAP GUI will not work. Please advice.

Regards,

Kumar.

0 Kudos

Hi,

Thats because of the parameter I_NO_DIALOG.

But I suggest you do not call this FM. Instead call the BAPI only.

The BAPI internally calls the same FM.

Just within the enhancement try to change the value of the field KTEXT.

Regards,

Ankur Parab

0 Kudos

This message was moderated.

0 Kudos

Hi Kumar,

Can you please let me know how you created production order without material.

I am using the FM  "CO_EXT_ORDER_CREATE" and  "CO_EXT_ORDER_ENTRY"

but its returning a generic production order number %000000001.

Kindly let me know ASAP.

Regards,

Srujana Mallu