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

smart forms

Former Member
0 Likes
1,426

Hi I need Small answers as m writing a test its only for one mark or 2 marks question

What are the differences between the function modules "OPEN_FORM" "CLOSE_FORM" and "START_FORM, End_Form in sap scripts?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,255

Hi,

Open_form - - - > Techically it is used to open a spool request, spool request is a print request.

CLose_form - - - > Used to Close the Spool request or end a request.

Start_form - - - > is to call form layot to ur current script layout.

End_form - - - > is to terminate or close tat called form layout.

Open_form & Close_form is mandatory & its not required tat this open & close will contain a start & end form .

but when ever u use a start & end form, its mandatory tat it shud be called only between an open form & a close Form...

Simple explanation...

<b>Reward Points if USEFUL*</b>

9 REPLIES 9
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,255

<b>OPEN_FORM</b>

Open a form

<b>CLOSE_FORM</b>

Close a form

All printings should happen between these two events.

<b>START_FORM</b>

Start a form

<b>END_FORM</b>

Terminate a form

Start_form changes the layout, end_form must happen before setting a new layout. used to use several layout in one print. must be enclosed in Open_form, Close_form.

Regards

Read only

Former Member
0 Likes
1,255

Form functions

OPEN_FORM

Opens the form output.

CLOSE_FORM

Ends the form output.

START_FORM

Starts a new form.

WRITE_FORM

Calls a form element.

WRITE_FORM_LINES

Writes text lines into a form.

END_FORM

Ends the current form.

CONTROL_FORM

Sends a control statement to the form.

READ_FORM_ELEMENTS

Finds the elements of a form.

READ_FORM_LINES

Passes the lines of a form elements into an internal lines table.

<b>Rewards point for helpful answer.</b>

Read only

Former Member
0 Likes
1,255

Hi,

Open_form => It assign the form and printer, It should be first.

Start_form => It start Writing mode. You can use write_form in loop to write more than one lines befor End_form.

End_form => It end writing mode of current page and will require to start again through Start_form.

Close_form=> it end the Form. After this you can not start again for created file.

Regards,

Divya.

Read only

Former Member
0 Likes
1,255

Hi,

Open_form is mandatory while start_form is optional.

(ii) Open_form is used to open the layout set output. It should have a close_form, else we will face an error while running the script.Close_form ends the layout set output.

Start_form is used to start a new layout set.In case if we have more than one form then we have to use the start_form. It has to be followed by an end_form.

Regards,

Padmam.

Read only

Former Member
0 Likes
1,255

hi,

Open_Form (Mandatory)

Start_Form (Optional)

Write_Form (Mandatory)

End_Form (Optional)

Close_Form (Mandatory)

If Start_Form is present then End_Form also should be there.

One more function module which is useful is Control_Form. This is also optional.

OPEN_FORM: This function module opens layout set printing. One must call this function module before he uses any of other layout set function modules like Write_Form, Start_Form, Control_Form etc., You need specify a layout set name in the export parameters of this function module. If nothing is passed to Open_Form then one should use Start_Form function module to open layout set before starting the output. The layout set opened by Open_Form should be closed by Close_Form function module, other wise output doesn’t appear. We can use any number of Open_Form, Close_Form functions in one single program. But Close_Form must be there for every Open_Form in the program.

Some of the important export parameters we have to pass to Open_Form function module.

Form: Enter the Layout set name here, which then controls the output formatting. If nothing is specified then we must use Start_Form for opening layout set.

Language: Layout sets are Language dependent. Enter the desired language here. If the entered layout set is not in that language, then the function tries to open the Form entered in its original language. The default value is SY-LANGU.

Device: SAP Script can format a text on different device types. The device can be ‘PRINTER’ or ‘TELEX’, ‘TELEFAX’, ’ABAP’ and ‘SCREEN’.

Dialog: Use parameter DIALOG to determine whether to display a dialog box before printing, in which the user can set several spool parameters for print formatting. Possible values: SPACE displays no print parameter screen. 'X' display print parameter screen. Default value: 'X'

Options: Use parameter OPTIONS to set several options for print formatting. The parameter has the structure ITCPO. The user can change some of the defined settings on the print control screen. The default value for Options is ‘ ‘. We will discuss about ITCPO structure in detail later.

Other Export, Import and Exceptions are self-explanatory.

Close_Form: The function module closes the layout set opened using OPEN_FORM. The system executes any terminating processing steps for the last opened layout set. No Export parameters for this Function Module.

Start_Form: In-between the function modules OPEN_FORM and CLOSE_FORM, we can use different layout sets. This allows us to combine several different layout sets into one print output. However, we can combine only those layout sets that have the same page format. To switch layout sets, use the function module START_FORM. If another layout set is still open, we must close it first using END_FORM. If we specify no layout set name when calling START_FORM, the system restarts the last open layout set. If after OPEN_FORM no layout set was activated yet, the system leaves the function module with the exception UNUSED. Some of the important export parameters for this function module are

Form: The parameter contains the name of the layout set you want to use for printing. If you specify no layout set here, the system restarts the last active layout set.

Language: Layout sets are language-dependent. Enter the desired language here. If the layout set does not exist in this language, the system tries to call the layout set in its original language. If the parameter LANGUAGE is empty, the system uses the language of the last active layout set.

Startpage: Usually, SAP script starts with the page specified as start page in the layout set definition. If we want to start output with another layout set page, enter the name of the desired layout set page here. If the desired page is not defined, the system uses the start page defined in the layout set.

Program: To replace program symbols, SAP script must know which active program contains the work areas for the values to be passed. If we omit the parameter, the system searches for the field values in the program that was specified in the parameter OPTIONS (field TDPROGRAM) of OPEN_FORM. If we enter a program name, the system replaces the program symbols with the values from this program up to the next END_FORM.

Exceptions and other Export, Import parameters are self-explanatory.

END_FORM: END_FORM ends the currently open layout set and executes the required termination processing. After calling this function module, no more layout set is active. For further output, we must start a new layout set using START_FORM. No Export parameters.

Read only

Former Member
0 Likes
1,255

Hi Dear,

Open Form : Open's the Form

Write Form: Prints the data in output with the help of element.

Close Form: Used for closing the Form.

Reward Points.

Bohra.

Read only

Former Member
0 Likes
1,256

Hi,

Open_form - - - > Techically it is used to open a spool request, spool request is a print request.

CLose_form - - - > Used to Close the Spool request or end a request.

Start_form - - - > is to call form layot to ur current script layout.

End_form - - - > is to terminate or close tat called form layout.

Open_form & Close_form is mandatory & its not required tat this open & close will contain a start & end form .

but when ever u use a start & end form, its mandatory tat it shud be called only between an open form & a close Form...

Simple explanation...

<b>Reward Points if USEFUL*</b>

Read only

Former Member
0 Likes
1,255

in print program, we declare TABLES which are used for extracting data in declaration part.

you write the SELECT statement for extracting data before calling the script function modules....

these are the function modules which are freequently used in print program.

OPEN_FORM

The function module OPEN_FORM opens form printing. You must call this function module before you can use any other form function (WRITE_FORM, START_FORM, CONTROL_FORM...).

You need not specify a form name. If you omit the name, you must use the function module START_FORM to open a form before starting the output.

You must end form printing by using the function module CLOSE_FORM. Otherwise, the system does not print or display anything.

Within a program, you can use several OPEN_FORM.. CLOSE_FORM pairs. This allows you to write output to several different spool requests from within one program.

syntax:

CALL FUNCTION 'OPEN_FORM'

EXPORTING

FORM = ' ' " specifies the form name

LANGUAGE = SY-LANGU

DEVICE = 'PRINTER'

CLOSE_FORM

The function module closes the form opened using OPEN_FORM. The system executes any terminating processing steps for the last opened form.

You must use this function module to close form printing. Otherwise, no output appears on printer or screen.

CALL FUNCTION 'CLOSE_FORM'.

there is no mandatory parameters to this function module.

START_FORM

In-between the function modules OPEN_FORM and CLOSE_FORM, you can use different forms. This allows you to combine several different forms into one print output. However, you can combine only those forms that have the same page format.

To switch forms, use the function module START_FORM. If another form is still open, you must close it first using END_FORM.

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = < > "specifies the form name

LANGUAGE = < > "specifies the language

STARTPAGE = ' ' "specifies the page name which you

" want print

END_FORM

END_FORM ends the currently open form and executes the required termination processing. After calling this function module, no more form is active. For further output, you must start a new form using START_FORM.

CALL FUNCTION 'END_FORM'.

WRITE_FORM

The system outputs the form element specified in parameter ELEMENT into the currently opened form.

In the parameter WINDOW you can specify the name of a window for the output. Remember that the form element must be defined in this window.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = < > "specifies the element name

WINDOW = < > " name of the window

TYPE = 'BODY' "specifies the output location

CONTROL_FORM

Use CONTROL_FORM to pass SAPscript control statements to the form.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = < > "specifies the name of the control command

follow this sequence.

OPEN_FORM.

START_FORM.

WRITE_FORM.

END_FORM.

CLOSE_FORM.

Reward all helpfull answers