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

CALL FUNCTION

Former Member
0 Likes
1,266

How do we get this function, can anybody expalin the below function please.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

APPLICATION = 'TX' -


> explain

  • ARCHIVE_INDEX = ' '

  • ARCHIVE_PARAMS = ' '

DEVICE = 'PRINTER' -


> explain

DIALOG = ' '

FORM = 'Z_TESTSCRIPT'

LANGUAGE = SY-LANGU

OPTIONS = ZOPTION -


> explain

IMPORTING

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,153

Hi shakheen,

This function module is used to open the form. the form defines the format .i.e layout.

Here application defines the Text editor interface normally for SAp scripts we use 'TX' means Standard Text.

Device defines where the out put should go i.e Printer ,Fax, E-mail etc.

Here options defines Print options.Ex: Number of copies,print immediately can be set from here.

Regds,

Vinsa.R

8 REPLIES 8
Read only

Former Member
0 Likes
1,153

Hi Shaheen ,

This is the FM for using a Sapscript in our program.

Regards

Arun

Read only

0 Likes
1,153
Read only

Former Member
0 Likes
1,153

Hi,

This is one of th fun module used in writing the scrpts along wih START_FORM, WRITE_FORM,END_FORM and CLOSE_FORM.

In this fun module OPEN_FORM

only parameter FORM = 'Z_TESTSCRIPT' is compulsory to pass, upon which it will take your own script to print.

In the program, first call this fun module them fetch data, write using Write_form.

Reward if useful

regards,

Anji

Read only

Former Member
0 Likes
1,154

Hi shakheen,

This function module is used to open the form. the form defines the format .i.e layout.

Here application defines the Text editor interface normally for SAp scripts we use 'TX' means Standard Text.

Device defines where the out put should go i.e Printer ,Fax, E-mail etc.

Here options defines Print options.Ex: Number of copies,print immediately can be set from here.

Regds,

Vinsa.R

Read only

Former Member
0 Likes
1,153

Hai

OPEN_FORM only use for SAP script description as above

CALL FUNCTION 'OPEN_FORM'

EXPORTING

<b>APPLICATION = 'TX' -


> explain</b>

<i>For the device type SCREEN, the system displays the text formatting on the screen. This requires an interface in which the different menu entries are defined. The same applies if the user chooses to display a print view on the screen for the other device types.

Enter one of the interface names provided by SAPscript. You usually use the interface that is assigned to the respective text object in table TTXOB.

Reference field: TTXOB-TDAPPL

Default value: 'TX'</i>

  • ARCHIVE_INDEX = ' '

  • ARCHIVE_PARAMS = ' '

<b>DEVICE = 'PRINTER' -


> explain</b>

<i>The parameter DEVICE contains an invalid device type.</i>

DIALOG = ' '

FORM = 'Z_TESTSCRIPT'

LANGUAGE = SY-LANGU

<b>OPTIONS = ZOPTION -


> explain</b>

<i>The parameter OPTIONS contains invalid values for the formatting options.

Possible errors:

The output device specified in field TDDEST does not exist.

The field TDPAGESLCT for selecting the pages to be printed contains invalid characters.</i>

IMPORTING

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

<i><b>Purpose</b></i>

OPEN_FORM function: After selecting the data, you open the layout set in which you want to display the data. In the OPEN_FORM function we mention the Layout set name to open.

**Please reward suitable points***

With Regards

Navin Khedikar

Read only

Former Member
0 Likes
1,153

Hi,

APPLICATION refers to the interface you want to use. there are different input options available for the it, they are DS - for hypertext environment, TO - for office environment, TD - for Documentation environment and TX - for all other text.

DEVICE refers to the device you are going to use i.e. printer, fax, mails etc......

OPTIONS - Different variants can be defined for the output via the parameter Options. The structure is described in table ITCPO. Some of the fields contained in this structure can be changed by the user via the print dialog.

for more details on other you can refer the function module documentation in SE37

Regards,

Kunajl

Read only

Former Member
0 Likes
1,153

hi,

this function will open the form u have given in the exaporting parameters.

whenever u open a form.ushould close that also.

for that the function module is "close_form".

for this u have to pass the language also because all the scripts are language dependent.

this FM is used for exaporting the functional texts from print program to the scripts.for that we need to use FMs:start_form,write_form,end_form.

regards,

bharat.

Read only

Former Member
0 Likes
1,153

Khan,

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.

Function call:

CALL FUNCTION 'OPEN_FORM'

EXPORTING FORM = SPACE

LANGUAGE = SY-LANGU

DEVICE = 'PRINTER'

DIALOG = 'X'

OPTIONS = SPACE

APPLICATION = 'TX'

ARCHIVE_INDEX = SPACE

ARCHIVE_PARAMS = SPACE

IMPORTING LANGUAGE =

RESULT =

NEW_ARCHIVE_PARAMS =

EXCEPTIONS CANCELED =

DEVICE =

FORM =

OPTIONS =

UNCLOSED =

Export parameters:

FORM

You can enter the name of a form here, which then controls output formatting. After calling OPEN_FORM, you can immediately output texts to the form using other function modules.

If you leave the parameter blank, you must call START_FORM with a valid form name before starting any output functions.

Default value: SPACE

LANGUAGE

Forms are language-dependent. Enter the desired language. If a form does not exist in this language, the system tries to call the form in its original language.

Reference field: THEAD-TDSPRAS

Default value: SY-LANGU

DEVICE

SAPscript can format a text for output on different device types. Enter the desired device type here.

Possible values:

'PRINTER' print output

'TELEX' telex output

'TELEFAX' telefax output

'ABAP' screen output as ABAP list

(interface of the calling program)

'SCREEN' screen output as ABAP list

(interface controlled by SAPscript,

can be set with parameter APPLICATION)

The user can display output formatted for PRINTER, TELEX, or TELEFAX as print view on the screen. From within the program, you can set the field TDPREVIEW (structure ITCPO) in the parameter OPTIONS, or the user can call the function on the print control screen.

The fields TDSENDTIME and TDSENDDATE designed for fax output (structure ITCPO) will be used for future enhancements; they are not used at present.

Default value: 'PRINTER'

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:

' ' display 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.

Structure: ITCPO

Default value: SPACE

APPLICATION

For the device type SCREEN, the system displays the text formatting on the screen. This requires an interface in which the different menu entries are defined. The same applies if the user chooses to display a print view on the screen for the other device types.

Enter one of the interface names provided by SAPscript. You usually use the interface that is assigned to the respective text object in table TTXOB.

Reference field: TTXOB-TDAPPL

Default value: 'TX'

ARCHIVE_INDEX

Enter the index information for the print output you want to archive. This information (DARA line) is stored in the archive together with the print output. Thus, you can use the index information to access the print output directly in the archive.

Structure: TOA_DARA

Default value: SPACE

ARCHIVE_PARAMS

The system interprets the settings passed in this parameter when archiving the output. The archive parameters have the ABAP Dictionary structure ARC_PARAMS.

Structure: ARC_PARAMS

Default value: SPACE

Import parameters:

LANGUAGE

The parameter tells you which language variant of the form the system actually used.

Reference field: THEAD-TDSPRAS

RESULT

The parameter contains results of the print formatting process. By comparing the corresponding fields of parameter OPTIONS with those of parameter RESULT, you can determine whether the user made changes to any settings on the print control screen.

Structure: ITCPP

NEW_ARCHIVE_PARAMS

The parameter contains results of the archiving process, including the archive parameters the user changed on the print control screen. The parameter has the ABAP Dictionary structure ARC_PARAMS.

Structure: ARC_PARAMS

Exceptions:

CANCELED

When starting SAPscript print formatting, the system displayed a selection screen, on which the user can enter settings for the output, such as:

Printer name

Information on the cover page

Page selection

Number of copies

The user did not call any subsequent actions allowed on this screen, but canceled the output formatting instead. The function module was ended without further action. No form is open for output anymore.

DEVICE

The parameter DEVICE contains an invalid device type.

FORM

The parameter FORM contains the name of a form that the system could not find.

Possible reasons:

The form does not exist.

There is no active version of this form.

SAPscript first searches for the form in the current client and in the specified language. If the form does not exist there, it tries the original language of the form. If the form is still not found, it searches in client 0, first in the specified language, than in the original form language.

OPTIONS

The parameter OPTIONS contains invalid values for the formatting options.

Possible errors:

The output device specified in field TDDEST does not exist.

The field TDPAGESLCT for selecting the pages to be printed contains invalid characters.

UNCLOSED

The system was told to open a new form even though an old form is still active. The old form must be closed first (CLOSE_FORM or END_FORM).

Don't forget to reward if useful