Skip to Content
Feb 13, 2020 at 12:12 PM

BAPI_SALESORDER_SIMULATE V1524 Only quantity 1 ST is allowed (Item 000001)

639 Views Last edit Feb 13, 2020 at 12:16 PM 4 rev

We are creating an order using BAPI_SALESORDER_CREATEFROMDAT2 and it's working fine.
Now, the requeriment is to make a simulation before the creation of the order, in order to get the price calculations and perform some checks.

So I've created a new method to pass the tables used in bapi BAPI_SALESORDER_CREATEFROMDAT2 and fill the tables of BAPI_SALESORDER_SIMULATE.
But I always get this error "V1524 Only quantity 1 UN is allowed (Item 000001)"

Values in tables are the same, and are working for creation bapi.

I guess I need to fill some other field in the schedule table, now i'm only passing ITM_NUMBER and REQ_QTY (it's working fine in the creation bapi). I've tried passing also SCHED_LINE = 0001 and REQ_DATE = sy-datum, but same error...

This is the code i'm using (data comes from tables I use in creation bapi)

METHOD simulate_order.

    lv_salesorder   TYPE bapivbeln-vbeln,
    ls_header_in    TYPE bapisdhead,
    ls_items_in     TYPE bapiitemin,
    ls_partners_in  TYPE bapipartnr,
    ls_schedule_in  TYPE bapischdl,
    ls_return       TYPE bapireturn,
    lt_item_in      TYPE STANDARD TABLE OF bapiitemin,
    lt_partners_in  TYPE STANDARD TABLE OF bapipartnr,
    lt_schedule_in  TYPE STANDARD TABLE OF bapischdl,
    lt_item_out     TYPE STANDARD TABLE OF bapiitemex,
    lt_cond         TYPE STANDARD TABLE OF bapicond,
    lt_messagetable TYPE STANDARD TABLE OF bapiret2.

    <ls_items_in>     TYPE bapisditm,
    <ls_partner>      TYPE bapiparnr,
    <ls_schedule>     TYPE bapischdl.

  MOVE-CORRESPONDING is_header_in TO ls_header_in.

  LOOP AT it_items_in ASSIGNING <ls_items_in>.
    MOVE-CORRESPONDING <ls_items_in> TO ls_items_in.
    APPEND ls_items_in TO lt_item_in.

  LOOP AT it_partner ASSIGNING <ls_partner>.
    MOVE-CORRESPONDING <ls_partner> TO ls_partners_in.
    APPEND ls_partners_in TO lt_partners_in.

  LOOP AT it_schedules ASSIGNING <ls_schedule>.
    MOVE-CORRESPONDING <ls_schedule> TO ls_schedule_in.
    APPEND ls_schedule_in TO lt_schedule_in.

      order_header_in    = ls_header_in
      salesdocument      = lv_salesorder
      return             = ls_return
      order_items_in     = lt_item_in
      order_partners     = lt_partners_in
      order_schedule_in  = lt_schedule_in
      order_items_out    = lt_item_out
      order_condition_ex = lt_cond
      messagetable       = lt_messagetable.


Any clue ?

Thanks !