cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_MOSRVAPS_CREATESNPORDER only creating an order to a PDS.

Former Member
0 Kudos

Hi experts.

I'm having problems using the function module BAPI_MOSRVAPS_CREATESNPORDER in a LOOP, for creation of production orders per month, the program only creates the first order.

The structure of the PDS is as follows:

Main product - Validity: 01/01/2011 to 12/31/9999 - 1000 TO

Component Input 1 - Validity: 01/01/2011 to 01/31/2011 - 10 TO

Component Input 1 - Validity: 02/01/2011 to 02/28/2011 - 13 TO

Component Input 1 - Validity: 03/01/2011 to 03/31/2011 - 20 TO

Component Input 2 - Validity: 01/01/2011 to 01/31/2011 - 1010 TO

Component Input 2 - Validity: 02/01/2011 to 02/28/2011 - 1030 TO

Component Input 2 - Validity: 03/01/2011 to 03/31/2011 - 1020 TO

In each iteration to the BAPI, i'm filling the Head valid for 1 month.

ti_head-order_end_date = Always 1 month

ti_head-order_number = An Index.

ti_head-master_product = Main product.

ti_head-master_plant = Plant.

ti_head-master_order_quantity = Value.

ti_head-master_loctype = '1001'.

ti_head-master_atpcat = 'EE'.

ti_head-coproduct_atpcat = 'EM'.

ti_head-input_atpcat = 'EL'.

ti_head-source_name = PDS.

For the PDS above, the BAPI should have created three orders, but has created only the first.

BAPI call.

CLEAR: ti_return, ti_mapp.

REFRESH: ti_return, ti_mapp.

CALL FUNCTION 'BAPI_MOSRVAPS_CREATESNPORDER'

EXPORTING

logical_system = gc_logsys

order_type = '5'

ext_number_assignment = ' '

commit_control = 'E'

planning_version = st_otimiza-versnp

change_if_exists = ' '

check_ppm_existence = 'X'

snp_planning_profile = ' '

TABLES

order_head = ti_head

mapping_data = ti_mapp

return = ti_return.

Please Help.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197994
Active Contributor
0 Kudos

Hi Denis,

Do you see something in the return table in debugger?

Do you see three orders with different components if you create them in SNP book directly?

If you call the BAPI three times without a loop, can the orders with different components be created correctly?

What if you call it with 02/28/2011 as the first entry in a loop?

BR/Tiemin

Former Member
0 Kudos

Do you see something in the return table in debugger?

R: No, the return table is always empty. The headers of the orders have been created correctly.

Do you see three orders with different components if you create them in SNP book directly?

R: YES.

If you call the BAPI three times without a loop, can the orders with different components be created correctly?

R: In the same execution of the program, BAPI is not working. It only creates the first complete order of each main product. This happens even in SE37 calling the BAPI in the test run. I opened a call at SAP for this problem.

What if you call it with 02/28/2011 as the first entry in a loop?

R: Same problem. The first order is OK, the others have just headers....

Tks.

Answers (0)