on 08-29-2007 7:57 AM
Hi gurus.
With a 'Perform Statement' in SAP Script, how can i get to print values from a loop statement in the ABAP code.(OR there is another way)
I have a challenge because it appears like the 'Perform Statement' only retrieves one value yet I need to print all the values from a table.
Ponit will be awarded for valuable answers.
Thanks.
You are correct, any loop processing in SAPscript takes place in the print program, not in the form itself. Smartforms has the concept of looping through data, but SAPscript does not.
I don't know your specific requirements, but if feels like you will need to change you print program.
Regards,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try with
loop
endloop
regards
Giridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
when using a perform there are opions like
using
changing and tables
try using tables
you will get multiple values at 1 go.
thanks
vivekanand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vivekanand's suggestion is from regular ABAP, not SAPscript. The TABLES option is not available in the SAPscript version of PERFORM.
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM
And even if you could return a table from this PERFORM the SAPscript would not be able to loop around it.
Regards,
Nick
I also have the same situation of getting one entry always instead of multiple entries for vendor number in the output sap script form. This is my code in the form routine in driver program.
LOOP AT it_suz.
SELECT SINGLE name1 INTO l_name1 FROM lfa1
WHERE lifnr = l_mfrnr.
READ TABLE out_tab WITH KEY 'JO_MAN'.
out_tab-value = l_name1.
APPEND out_tab.
CLEAR l_mfrnr.
CLEAR l_name1.
ENDLOOP.
JO_MAN is the output variable in form &JO_MAN&
I am always getting the same JO_MAN value (Vendor number) for multiple entries in the LFA1 table for LIFNR in the output form. which is the last one in the out_tab-value. How to loop through and get all the values in the out_tab-value and form output
Thanks
Try to loop your window in the driver program... to display all values in the table..
Ex:
LOOP <internal table>
WRITE_FORM............
ENDLOOP.
Note: Perform Statement, used mostly to get the values when your driver program is not in your control.. it is not used to display group of all line items(if it is not looped in driver program)... in such case to display group of line items which are not controlled in your dirver program..good to customize your driver/print program
regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.