12-20-2014 11:19 AM
Hi all,
I'm new at sapscripts and I want to know how to pass values into sapscript via a loop. the requirement is like below,
Invoice No.: Invoice No.1, Invoice No.2, Invoice No.3, and so on......
Invoice Date: date1, date2, date3 and so on......
the invoice numbers and invoice dates are coming from loop. but the problem is the labels are also getting printed for each loop iteration, as shown below.
Invoice No. :
Invoice Date:
Invoice No. :
Invoice Date:
Invoice No. :
Invoice Date:
in the script it is like below
Tax Invoice No.: &V_INVNO&,
Tax Invoice Date: &V_INVDATE&
So plz suggest me where I should write the labels so that they will appear once. Thanks.
12-20-2014 12:44 PM
Hi -
Segregate the Invoice & Invoice in to two different internal table in the driver program.
1. First print the invoice no label In the command box of the SAP script there is a command to handle to continue printing in the same line.
2. Then loop over invoice number internal table then print the invoice no using WRITE_FORM . In the command box of the SAP script there is a command to handle to continue printing in the same line.
3. Next print the invoice date label In the command box of the SAP script there is a command to handle to continue printing in the same line.
4 Then loop over invoice date internal table then print the invoice no using WRITE_FORM . Similarly in the command box of the SAP script there is a command to handle to continue printing in the same line.
Let us know, if it helps.
12-20-2014 8:26 PM
Hi Debapriya Gupta,
it's hard to create a Form from scratch if you are new to sapscript.
You may check Example of a Print Program
You will use text elements in the FORM and trigger them via FUNCTION 'WRITE_FORM', i.e. create a text element for invoice no and one for invoice date, then loop at invoices and call the two elements.
Sorry for the bad formatting - always dangerous to use sap scn. Never expect it will be user-friendly.
Regards Clemens
12-22-2014 5:19 PM