‎2010 Sep 04 5:19 AM
Hi gurus,
My requirement is for line item add reason for rejection and create a new line item with the remaining Qty.( becos changing the Plant)
plant is chnaging, reason for jejection is also ading,
a new line item is also adding
but for that qty is not adding .. i am not getting an yerror messages from BAPI
can you please help me..
adding a new line itm ,,
using BAPI_SALESORDER_CHANGE
xorder_items_in-itm_number = w_posnr.
xorder_items_in-material = wa_final-matnr.
xorder_items_in-plant = 'PT02'."wa_final-PLANT.
xorder_items_in-target_qty = wa_final-kwmeng - wa_final-rfmng.
xorder_items_in-target_qu = 'EA'.
APPEND xorder_items_in.
*
xorder_item_inx-itm_number = w_posnr.
xorder_item_inx-material = 'X'.
xorder_item_inx-plant = 'X'.
xorder_item_inx-target_qty = 'X'.
xorder_item_inx-target_qu = 'X'.
xorder_item_inx-updateflag = 'I'.
APPEND xorder_item_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = w_vbeln
order_header_in = wa_head
order_header_inx = wa_headx
TABLES
return = t_return
order_item_in = xorder_items_in
order_item_inx = xorder_item_inx
.
IF sy-subrc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
MOVE wa_final-vbeln TO wa-vbeln.
MOVE w_posnr TO wa-posnr.
wa-message = 'New LineItem Added Successfully'.
APPEND wa TO it.
CLEAR wa.
ELSE.
MOVE wa_final-vbeln TO wa-vbeln.
MOVE w_posnr TO wa-posnr.
LOOP AT t_return INTO wa_return
WHERE type EQ c_e.
wa-message = wa_return-message.
APPEND wa TO it.
CLEAR wa.
ENDLOOP.
ENDIF.Edited by: kishan P on Sep 4, 2010 9:55 AM
‎2010 Sep 04 8:08 AM
Hi,
I have also faced similar problem but it was while creating Sales Order using 'BAPI_SALESORDER_CREATEFROMDAT2'. You have to enter the quantity in BAPISDITM-TARGET_QTY then only system will update the same.
Hope this will help.
Thanks & Regards,
Rock.
‎2010 Sep 04 5:37 AM
‎2010 Sep 04 8:08 AM
Hi,
I have also faced similar problem but it was while creating Sales Order using 'BAPI_SALESORDER_CREATEFROMDAT2'. You have to enter the quantity in BAPISDITM-TARGET_QTY then only system will update the same.
Hope this will help.
Thanks & Regards,
Rock.