08-13-2015 1:33 PM
Hi,
In flat file 10 line items are there for a customer to create sales order. But 5 material are correct but 5 are incorrect. ( may be order quantity problem for incorrect material). Now sales order not creating. showing error like mismatch quantity.
Now my requirement is create order for materials what ever correct material and leave incorrect materials.
Please update how we can do this.
Regards,
Maruthi S
08-13-2015 1:41 PM
08-17-2015 1:36 PM
Hi Atul,
I used the above FM . But in this call in message tab not getting any error but while calling BAPI_SALESORDER_CREATEFROMDAT2 it showing error "Miss match in order and confirmed quantity"
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
order_header_in = lw_bapisdhead
* IMPORTING
* SALESDOCUMENT =
TABLES
order_items_in = lt_bapiitemin
order_partners = lt_bapipartnr
order_schedule_in = lt_bapischdl
messagetable = lt_messtab.
Regards,
Maruthi S
08-13-2015 1:48 PM
Hello,
Can you launch first the BAPI in test mode, if the return code is not Initial, you can fix the issue and launch again the BAPI.
thank you
best regards,
christophe
08-14-2015 6:53 AM
Hi,
I ran it in test mode 'x' but not giving any error in return but in non test mode it is showing error .
Regards,
Maruthi S
08-14-2015 7:14 AM
You could call the BAPI once for each line, but allways execute a BAPI_TRANSACTION_ROLLBACK. Then call a last time the BAPI will every correct lines and this table execute a BAPI_TRANSACTION_COMMIT if no error raised in RETURN.
Regards,
Raymond
08-17-2015 2:34 PM
Hi
There is a BAPI input parameter BEHAVE_WHEN_ERROR
With the value 'P' the order will be saved when errors occur and problematic items will not be saved.
The BAPI documentation gives a more detailed description.
Regards Jack
08-18-2015 5:48 AM
Hi Jack,
I passed the parameter behave_when_error = 'P' but still its giving same error 'Ordered and confirmed quantity mismatch'. sales document not creted.
Regards,
Maruthi S.
08-18-2015 5:56 AM
Hi,
Did you check the ORDER_ITEMS_IN-TARGET_QTY and ORDER_SCHEDULES_IN-REQ_QTY values match or not.
Hope this helps.
08-18-2015 5:57 AM
Hello Maruthi,
I am not sure - BAPI will ignore your wrong entries.
What SAP expect - give us correct data to post - if not SAP will return Error.
Either you do your validation first and remove Error materials and then go for BAPI call.
That is best way to process records.
Thanks,
SK