Hello all,
I want to modify a layout set that we use for our accounts payable checks. Currently the stub has one line for each document that makes up this check. Now additional detail from each documents distribution lines has also been requested.
If there was a consistent number of detail lines for every document, I understand how this could be accomplished. But since the number of distribution lines varies for each document, I don't see any way that this can be done within the form itself because Sapscript does not have any syntax for looping (While.....Endwhile Loop....endloop Do....Endo).
A form could be performed in an external program to determine the number of distribution lines, but how would you move through those distribution lines and write information on the check stub?
I do not want to modify RFFOUS_C or copy this program and make a commodification to it.
Is anyone aware of any looping syntax for Sapscript in version 4 .7?
Thanks
Bruce
I know this syntax doesn't work, but this is what I am trying to accomplish.
/*>> Build ditribution line
/: DEFINE &V_DISTRIB& '123456789012345678901234567890'
/*>> Create a counter to keep track of Distrib line #
/: DEFINE &V_COUNT& '001'
/: WHILE V_DISTRIB& > ' '
/: &V_COUNT& = &V_COUNT& + 1
/: PERFORM 'Z_DISTRIBUTION' IN PROGRAM 'ZFM05A01'
/: USING ®UP-BUKRS&
/: USING ®UP-BELNR&
/: USING ®UP-GJAHR&
/: USING &V_COUNT&
/: CHANGING &V_DISTRIB&
/: ENDPERFORM.
/*>> Write distribution line fields, from external program
T1 &V_DISTRIB&
/: ENDWHILE