Skip to Content
0
Sep 12, 2014 at 05:56 PM

Subroutine in sapscript for net due date

130 Views

Hi,

This is the first time I am creating a subroutine for sapscript and I could not get it to work. I need to calculate the net due date using the baseline date plus cash discount days. But the form is just printing out 0000000. I am just trying to extract one due date here but I will have to get it for all line items then sort descending to get the latest one. Can anyone help me to see the gap why this is not working?

In the sapscript I have the following:

DEFINE &BASEDATE& = &REGUP-ZFBDT&

DEFINE &PAYTERMS& = &REGUP-ZBD1T&

PERFORM NET_DUE_DATE IN PROGRAM Z_SAPSCRIPT_FUNCTIONS

USING &BASEDATE&

USING &PAYTERMS&

CHANGING &DUEDATE&

ENDPERFORM

In program Z_SAPSCRIPT_FUNCTIONS

Thanks in advance!

Cholen

Attachments