I am trying to create delivery with reference to sales order number using bapi in my alv report. I am passing the parameters as:
IF GV_SALESDOCUMENT NE ''.
READ TABLE ITAB INTO WA INDEX 1.
GV_PLANT = WA-WERKS.
LOOP AT ITAB INTO WA WHERE CUSTOMER = WA-CUSTOMER.
GS_DELV-REF_DOC = GV_SALESDOCUMENT.
GS_DELV-REF_ITEM = WA-POSNR.
GS_DELV-DLV_QTY = WA-ZMENG.
GS_DELV-SALES_UNIT = WA-ZIEME.
APPEND GS_DELV TO GT_DELV.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_SLS'
SHIP_POINT = GV_PLANT
DUE_DATE = SY-DATUM
DELIVERY = GV_DELIVERY
SALES_ORDER_ITEMS = GT_DELV
RETURN = GT_DELRETURN.
COMMIT WORK AND WAIT.
IF SY-SUBRC EQ 0.
I am getting error in GT_DELRETURN while debuging - "No Schedule line due for delivery up to the selected date".
How can I handle this. Please correct me.
Sampath Adavelly replied
We all have been explaining the same thing that it was not a program error but ATP qty issue. Glad, you were able to solve the issue.
For your other issue, it is again not a program issue but it is master data issue. The message itself is self explanatory. Here is how to find and correct the error messages. You can ignore all info messages for now and the last error message is the result of the error message 'customer requested complete delivery'
It is a setting in the customer master. Goto transaction XD02 and enter the partner (first sold to and then ship to) - enter sales area data - Press enter to get into customer master data - choose 'Sales area data' on application toolbar - Go to 'Shipping' Tab - there is a field 'Partial Delivery Per Item'. in your case it would be something else other than just an empty... clear out value and enter maximum number in 'Max.partial deliveries' ... run your program again.
Reason for this error is again you dont have enough ATP available and only few or partial qty available for delivery.
Seems, you have got new system. I recommend you run online before you execute with your program so that you can easily differentiate the error between config and program.