on 01-29-2007 3:34 PM
Hi,
My requirement is to develop a script and get print(data should tranfer to script main window or body) from a Report.
i.e ALV report contains a button for print, when we click this, the report output should be printed in a script format which is designed for it.
am quite new to script development. Could you please provide some inputs here?
Thanks
Hi,
Please close your other thread. Do not post duplicate threads.
Regards,
Vara
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
when u r displaying the alv output means u have final internal table.
when u press print button in alv .. add the code to print sapscript for that button.
here is sample code..
<b>
REPORT z_script_prog .
TABLES: mseg.
DATA: itab LIKE mseg OCCURS 3 WITH HEADER LINE.
SELECT * FROM mseg INTO TABLE itab.
SORT itab BY matnr.
DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr.
CLEAR itab.
PERFORM oform. "OPEN FORM
PERFORM sform. " START FORM
LOOP AT itab INTO mseg.
PERFORM wform. " WRITE FORM
ENDLOOP.
PERFORM eform. " END FORM
PERFORM cform. " CLOSE FORM
&----
*& Form oform
&----
text
----
FORM oform.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZSAB' " UR FORM NAME
language = sy-langu.
ENDFORM. "oform
&----
*& Form sform
&----
text
----
FORM sform.
CALL FUNCTION 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
form = 'ZSAB' "UR FORM NAME
language = sy-langu
startpage = 'PAGE1'
.
ENDFORM. "sform
&----
*& Form wform
&----
text
----
FORM wform.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'DATA' " UR TEXT ELEMENT IN MAIN WINDOW
function = 'SET'
type = 'BODY'
window = 'MAIN'.
ENDFORM. "wform
*form tform.
*
FORM eform.
CALL FUNCTION 'END_FORM'
.
ENDFORM. "eform
&----
*& Form cform
&----
text
----
FORM cform.
CALL FUNCTION 'CLOSE_FORM'
.
ENDFORM. "cform</b>
Please close the thread if the problem is solved and please do not post duplicate threads.
Regards
SAB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.