Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create correction delivery in schedule agreement

sharon_mcclure
Explorer
0 Kudos

Hi all -

I am loading legacy data into SAP and am creating schedule agreements. I create the agreement using SD_SALESDOCUMENT_CREATE, then COMMIT, then update the schedule lines using BAPI_SALES_DEL_SCHEDULE_CREATE also followed by a COMMIT. This works, and creates the schedule agreement with schedule lines.

At this same time, or even in another BAPI or function call if need be, I need to create a CORRECTION DELIVERY for this schedule agreement. I am populating the CORR_CUM_QTY_IN and CORR_CUM_QTY_INX in BAPI_SALES_DEL_SCHEDULE_CREATE with values in every field, and the return tells me 'CORR_CUMQTY_IN has been processed successfully', but when I look at the schedule agreement in VA32, there is no cum. issued qty or cum. delv qty, and no correction delivery has been created.

What am I missing??

Thanks so much...

Sharon

2 REPLIES 2

Former Member
0 Kudos

Hi Sharon,

I am assuming you have called 'BAPI_TRANSACTION_COMMIT' function module after the BAPI_SALES_DEL_SCHEDULE_CREATE call. Also, first check in SE37 (menu Function Module>Test>Test Sequences) by calling these two funciton modules in sequence. Once the function module works, then you can change the parameters in the program accordingly.

Is the return table having just one message?

Regards,

Shyam

0 Kudos

Hi Shyam -

I am calling the BAPI_TRANSACTION_COMMIT function right after the BAPI_SALES_DEL_SCHEDULE_CREATE function. When I call that create function, I am adding schedule lines, so my return table has all of the other successful messages you would expect -

ORDER_HEADER_IN has been processed successfully

CORR_CUMQTY_IN has been processed successfully

DEL_SCHEDULE_IN has been processed successfully

SCHEDULE_IN has been processed successfully

Sched. Agr. w/ Rel. 1030000058 has been saved.

It even says the corrective cum qty was successful....but when I open the schedule agreement, and go to the Forecast Delivery Schedule tab on the line item, the Cml. iss. qty and Cml. dlv. qty fields are blank, and there are no deliveries associated with the order.

Do I have to use a seperate BAPI to create the correction delivery? I've looked at BAPI_OUTB_DELIVERY_CREATE_SLS, but I don't see how to specify that this is a correction delivery and not a 'regular' delivery.

Thanks,

Sharon