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: 

Need to set first date in order to ATP date

Former Member
0 Kudos

Hello,

I have a requirement to set the first date of the order line item to either the ATP date, or the ATP date + 25 days.  The user is prompted on if the 25 days need to be added or not.

I have most of my code in the MV45AFZB module under the USEREXIT_CHECK_VBAP form.  Looping at the XVBEP based on position of VBEP (POSNR), I read the schedule lines and set the first schedule line to the new date.  The first schedule line is also updated for the quantities.  The other schedule lines have the quantities set to zero, and the dates set to the same date as the first schedule line.  I also update the IVBEP1 table similarly.

This allows the date to be set, shows up properly in MD04, and does not abend because the VBEP and IVBEP1 are out of sync.

The problem is that the extra schedule lines don't look right to the user (somewhat confusing), and if you go to manually change the first date, you get an error message that must be answered, then ATP works again.

If I try to mark the 0 quantity schedule lines as deleted (XVBEP-UPDKZ = 'D') then I get abends.

None of the research I have done on the internet has shown how to set schedule line dates in the order while the order is being entered, most show how to change with a batch program.

Can someone point me in the correct direction with a decent example?

Regards,

Steven M Engel


1 REPLY 1

Former Member
0 Kudos

Hello All,

I found Ray Mannion's example of how to use

function 'SD_SALES_SCHEDULE_MAINTAIN' and that solved my issues.

Regards,

Steven M Engel