Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sapscript

Former Member
0 Likes
702

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
671

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

5 REPLIES 5
Read only

Former Member
0 Likes
672

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

Read only

0 Likes
671

Hi Divya,

One would be sufficient ..

REgards,

santosh

Read only

Former Member
0 Likes
671

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

Read only

Former Member
0 Likes
671

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

Read only

Former Member
0 Likes
671

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.