2007 May 20 4:22 PM
2007 May 21 4:55 AM
Hi,
Give me your mail id.
So that i ll send some attachments, which may be useful for you.
Regards,
Archana
Hi,
It is not a problem to print table data in the main window of the script. Here is an example code snippet.
Populate internal table
SELECT * FROM <dbtab>
INTO TABLE itab
WHERE.................
CALL FUNCTION 'OPEN_FORM'
...............................................
...............................................
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
ENDLOOP
CALL FUNCTION 'CLOSE_FORM'
.................................................
.................................................
In the script you can refer to this itab.
However the same process will not work for a variable window in script. This is because unlike the main window, whenever we call write_form FM for variable window, values are not mapped to script from print program immediately, but when
close_form/end_form FM is called. This means if we loop at an internal table from print progeam and call a variable window inside the loop, only the last row of internal table will be mapped to that variable window of the script.
Award points if found useful.
Regards
Indrajit
2007 May 21 4:55 AM
Hi,
Give me your mail id.
So that i ll send some attachments, which may be useful for you.
Regards,
Archana
2007 May 24 12:24 PM
2007 Jul 17 3:19 PM
Hi Archana,
can u send me the processor for this question,
How touse the tables in scripts?
2007 May 21 5:10 AM
HI,
We can access structures and the tables tat are updated during runtime. Else you have to pass the structure values to the table in the print program.
<b>For more info check this URL.</b>
http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm
Reward if it useful.
Thanks.
2007 May 21 8:07 AM
Hi,
It is not a problem to print table data in the main window of the script. Here is an example code snippet.
Populate internal table
SELECT * FROM <dbtab>
INTO TABLE itab
WHERE.................
CALL FUNCTION 'OPEN_FORM'
...............................................
...............................................
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
ENDLOOP
CALL FUNCTION 'CLOSE_FORM'
.................................................
.................................................
In the script you can refer to this itab.
However the same process will not work for a variable window in script. This is because unlike the main window, whenever we call write_form FM for variable window, values are not mapped to script from print program immediately, but when
close_form/end_form FM is called. This means if we loop at an internal table from print progeam and call a variable window inside the loop, only the last row of internal table will be mapped to that variable window of the script.
Award points if found useful.
Regards
Indrajit
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |