‎2006 Aug 09 11:28 AM
hi friends,
i am having 1 header and 1 main window in my form(script)
for that i am writing 4 single select statemets for retrive data for header fields(for 7 fields in that some fields having common tables ).
so my doubt is how many write_forms i need to write for 4 select statements in header.
is it need to create 4 individual elements or one element?
plz clarify.
points sure
sree
‎2006 Aug 09 11:29 AM
Only ONE is enough.
Call WRITE_FORM with the correct ELEMENT
Cheers
VJ
CALL FUNCTION 'WRITE_FORM'
EXPORTING
<b> ELEMENT = <ELEMENT NAME></b>* FUNCTION = 'SET'
* TYPE = 'BODY'
<b>WINDOW = 'MAIN'</b>* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
.
Message was edited by: Vijayendra Rao
‎2006 Aug 09 11:29 AM
Only ONE is enough.
Call WRITE_FORM with the correct ELEMENT
Cheers
VJ
CALL FUNCTION 'WRITE_FORM'
EXPORTING
<b> ELEMENT = <ELEMENT NAME></b>* FUNCTION = 'SET'
* TYPE = 'BODY'
<b>WINDOW = 'MAIN'</b>* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
.
Message was edited by: Vijayendra Rao
‎2006 Aug 09 11:30 AM
‎2006 Aug 09 11:30 AM
hi,
The single WRITE_FORM will work.
Get the data in single internal table and loop at this table and write the WRITE_FORM using the text elelment.
In the script, write all the 7 fields in a text element that you have called in the driver program with tab separated. Like...
&X_VBAP-VBELN&,,&X_VBAP-POSNR&,,&X_VBAP-MATNR&,,&X_VBAP-brgew&,,
Regards,
Richa
‎2006 Aug 09 11:36 AM
hi,
one WRITE_FORM for MAIN window is enough. remaining all other windows will be called automatically by the system.
so give the same varaibles in program & layout. system will print them directly on the layout.
normally how it works is, First MAIN window is called.once printing is completed in MAIN window of a page, then before going to 2nd page it will print data in all other windows.
regards
srikanth
‎2006 Aug 09 11:40 AM
Divya,
there's no relation betwneen SELECT statements in your printing program and WRITE_FORM function.
In general you have to call WRITE_FORM when all data contained in an element are provided and that's all.
Please, note that if the scripting rows in the form are not contained in an element you don't need to call a WRITE_FORM function at all.