on 03-04-2008 2:03 PM
Hi,
How do I write a loop inside a SAPSCRIPT?
I was trying the following but they do not work:
/: LOOP.
...
...
...
/: ENDLOOP.
/: DO.
...
...
...
/: ENDDO.
Please help.
hi
check the following link
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
regards,
Sreelatha gullapalli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i would like to add a specific question here.
i have a case where in dunning, i would replace the rejected payment with the invoices related to that payment.
for each rejected payment (DD) there would be multiple invoices (2A).
my problem now is what is the best approach to retrieve the 2A documents and output it in the layout.
i am thinking of the following solutions:
A:
copy the f150 (dunning) program and modify the MHND and MHNK tables to include the 2A documents of each DD document.
(if this is not the only solution, I would prefer not to opt for this)
B:
is it possible to call a subroutine from sapscript and in that subroutine, i will get the 2A documents, and output these in form?
(considereing that i cant perform loop in the Form)
Regards,
R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
u can not write loop in form text elements.
u can only write if statements in text elements.
if u need to print the data u need to fetch it from the driver program only.
and mention those fields in text elements.
with in &&.like &itab-fld1&.
and pass this text element name to the function module in driver program.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
Loop endloop doesnt work in a SAPscript, instead use a subroutine inside the script and get the data from the print program( here you can use loop endloop ) for that script. If u need any further explanation please mention that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for the response.
But my problem is that the print program is a standard program and I cannot modify it. It does not retrieve the data that I need for the SAPSCRIPT. So I tried to do the following inside the sapscript (which does not work):
LOOP.
PERFORM F_GET_DATA IN program ZTEST
USING &V_KEY&
CHANGING &COLUMN1&
CHANGING &COLUMN2&
CHANGING &COLUMN3&
ENDPERFORM.
Display COLUMNS
&COLUMN1& &COLUMN2& &COLUMN3&
ENDLOOP.
Do you have suggestions on how to solve my problem? Do I need to change the standard print program?
Hi Joseph,
You need to copy the standard print program into a Z program then make changes to it i.e. add the custom application logic as per your requirement in this Z program.
Also you would need to change the related SapScript configuration via the IMG to replace the standard program name with your new Z program name so that when the Form is generated the system goes through your Z print program and not the standard print program.
Hope this answers your question.
Cheers,
Sougata.
Hi,
The LOOP logic of a SAPscript is held in the print program, not the form. Your ABAP print program will typically extract the data, open the form, loop through the data, call elements in the main window then close the form.
There is no LOOP statement in SAPscript.
Regards,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.