cancel
Showing results for 
Search instead for 
Did you mean: 

How to create new orders with 'Date Fixed' set as true

former_member367551
Participant
0 Kudos

Dear experts,

I am currently working on a custom report that creates new orders via the FM, /SAPAPO/RRP_ORDER_CREATE_FINDS.

How can I create a new orders by also setting the Date Fixed (technical name: DATE_FIXED) order status as true?

Apparently, setting the importing parameter, IV_FIRMED as true in the FM, /SAPAPO/RRP_ORDER_CREATE_FINDS will not set the Date Fixed order status as true. Would you please advise me on how I can achieve this instead?

Thanks in advance for all your inputs.

Deborah

Accepted Solutions (0)

Answers (1)

Answers (1)

rajkj
Active Contributor
0 Kudos

Hi Deborah,

You can check BAPI (BAPI_MOSRVAPS_SAVEMULTI3) that allows you fix the date while creating or changing the planned order.

On of the tables referred by this BAPI is ORDER_HEAD (BAPI10503ORDHEADIN) that has a reference to DATE_FIXED (APO_BAPIDATEFIX).

Thanks,
Rajesh

former_member367551
Participant
0 Kudos

Hi Rajesh,

Thanks for your input here. Seems like the 'Date Fixed' attribute can be set as true via the proposed FM, BAPI_MOSRVAPS_SAVEMULTI3.

If I would like to still maintain the use of the FM, /SAPAPO/RRP_ORDER_CREATE_FINDS to create orders in the report program, how can I subsequently change the newly created orders via the FM, BAPI_MOSRVAPS_SAVEMULTI3? I think I should populate the tables parameters, ORDER_HEAD and ORDER_HEAD_X, is that right? But should I also set the importing parameter, NO_CREATE = X?

Appreciate your advice here if you've had any experience on this.

Thanks again~!

Deborah

rajkj
Active Contributor
0 Kudos

Hi Deborah,

That's correct.

Probably, you can refer the report APO_BAPI_MOSRVAPS_SAVEMULTI for some useful code.

Thanks,

Rajesh

former_member367551
Participant
0 Kudos

Hi Rajesh,

Thanks for your tips.

However, I've tried working on this almost all day long, but I still can't set the 'Date Fixed' attribute as true for a planned order.

Any idea on what I might have missed out on the codes below (lines in bold letters)?

Thanks.

CALL FUNCTION '/SAPAPO/RRP_ORDER_CREATE_FINDS'

             EXPORTING

               iv_pegid            = this_order-pegid

               iv_quantity         = qty_i

               iv_rqmtti           = '99991230000000'

               iv_startti          = startti_i

               iv_configuration    = cfg

               iv_application      = app

               is_source           = ls_source

               iv_no_source_popup  = 'X'

               iv_outcat           = 'AJ'

             IMPORTING

               ev_ordid            = ev_ordid_i

               ev_ordno            = ev_ordno_i

               et_changed_io_nodes = et_io_i

               et_changed_orders   = et_orders_i.

           CLEAR: st_ordhead, lt_ordhead, st_ordhead_x, lt_ordhead_x.

           st_ordhead-order_number = ev_ordno_i.

           st_ordhead-date_fixed = 'X'.

           APPEND st_ordhead TO lt_ordhead.

           st_ordhead_x-order_number = ev_ordno_i.

           st_ordhead_x-date_fixed = 'X'.

           APPEND st_ordhead_x TO lt_ordhead_x.

           CALL FUNCTION 'BAPI_MOSRVAPS_SAVEMULTI3'

             EXPORTING

               logical_system         = mylogsys

               order_type             = '5'

               ext_number_assignment  = ' '

*             COMMIT_CONTROL         = 'E'

*             PLNG_VERSION           = '000'

*             STRATEGY_PROFILE       =

               no_create              = 'X'

               check_source_existence = ' '

*             PLANNING_MODE_USAGE    =

*             EVENT_CONTROL          = ' '

             TABLES

               order_head             = lt_ordhead

               order_head_x           = lt_ordhead_x

*             CFG_HEADERS            =

*             CFG_INSTANCES          =

*             CFG_PART_OF            =

*             CFG_VALUES             =

*             CFG_VAR_KEYS           =

*             CFG_BLOB               =

*             CFG_REF_OBJECT         =

*             MAPPING_DATA           =

               return                 = lt_return.

The internal table, LT_RETURN will always be populated with the error message, ‘Order/schedule line does not exist and will not be created automatically’ and the execution got rolled-back.

Appreciate any assistance with this, as I can't quite figure out what could be missing here.

Thanks again.

Deborah

rajkj
Active Contributor
0 Kudos

Hi Deborah,

Based on error message, I am not sure whether the planned order created and saved in liveCache/database at the point where you are trying to call the BAPI. Otherwise, this pretty much standard BAPI and should not give such trouble.

Thanks,
Rajesh

former_member367551
Participant
0 Kudos

Hi Rajesh,

Unfortunately, I am still unable to have a breakthrough in this.

This is what I have also tried several times:-

1) Create an order via the FM, /SAPAPO/RRP_ORDER_CREATE_FINDS via the report program

2) Exit the report program

3) Checking in /SAPAPO/RRP3, the newly created order can be seen here too

4) Go to the transaction, SE37 and then run the FM, BAPI_MOSRVAPS_SAVEMULTI3 here with the same data inputs - for the newly created planned order in step 1

5) The same error messages are still returned from the FM, and the newly created order's Date Fixed attribute is still marked as false

Should I perhaps try on a different FM instead?

Please advise.

Thanks.

Deborah