10-16-2008 6:06 AM
hai abap gurus,
My requirement is to create a sales order and create a delivery with sales order reference.
I done both.But now i want to update my delivery with material and quantity.
Is there is any bapi or function module.
can any one help for my request.
with regards,
mallik
10-16-2008 6:48 AM
Hi,
BAPI:
BAPI_INB_DELIVERY_CHANGE
BAPI_OUTB_DELIVERY_CHANGE
SHP_BAPI_DELIVERY_CHANGE
FM:
SD_DELIVERY_CUMULATIVE_CHANGE
10-16-2008 7:00 AM
Hi,
You're on good way while using FM SERNR_ADD_TO_LS and SERIAL_LISTE_POST_LS .
In the second function module you don't need to pass anything.
Don't forget to make a commit work to avoid database error during synchronisation.
I had also one case of updating the serial to the document. It was the Sales order. I have worked with the function module SERNR_ADD_TO_AU which is internally using the function module SERNR_ADD_TO_DOCUMENT. The following is the sample code for it:
CALL FUNCTION 'SERNR_ADD_TO_AU'
EXPORTING
sernr = w_sernr
profile = c_zd01
material = w_matnr
quantity = '1'
document = w_vbeln
item = '00010'
debitor = fs_header-sap_ship_to
vbtyp = 'C'
sd_auart = w_doc_type
sd_postyp = w_item_cat
IMPORTING
anzsn = w_anzsn
zeilen_id = w_zeile
serial_commit = w_serial_commit
EXCEPTIONS
konfigurations_error = 1
serialnumber_errors = 2
serialnumber_warnings = 3
no_profile_operation = 4
OTHERS = 5.
IF sy-subrc eq 0.
CALL FUNCTION 'SERIAL_LISTE_POST_AU'.
COMMIT WORK.
ENDIF.
And one more thing, don't forget to have the call to the function module 'SERIAL_LISTE_POST_AU' amd commit work if the return code is 0. This is also mandatory.
regards
Satish