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

SAP script WRITE_FORM

devrajsingh
Active Participant
0 Likes
981

<b>FU WRITE_FORM

____________________________________________________

Short text

SAPscript: Output text element in form window

The specified element of the layout set window entered is output. The element must be defined in the layout set.

Parameter

ELEMENT

FUNCTION

TYPE

WINDOW

PENDING_LINES

Exceptions

ELEMENT

FUNCTION

TYPE

UNOPENED

UNSTARTED

WINDOW

BAD_PAGEFORMAT_FOR_PRINT

SPOOL_ERROR

Function group

STXC</b>

hi frds can any one tell me where i can get the details of these Parameter in write_form function module

<i><b>ELEMENT

FUNCTION

TYPE

WINDOW

PENDING_LINES</b></i>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

Here is a sample program from SAP on print form:

RSTXCDM1 and you can use transaction SE71 to display the default form S_CA930_DEMO_1.

4 REPLIES 4
Read only

tamra_walstrom
Explorer
0 Likes
795

I can't help with all the parameters but I can help with a few.

The element is the text element within your form. And the window is the window defined in the form.

For example, I have a form we'll call Z_ORDER and it contains a window called TITLE. That window has a text element called NAME. It is defined in the window as /E NAME.

So, if I wanted to send information to that part of the form, I would call the function as so:

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'NAME'

window = 'TITLE'

EXCEPTIONS

element = 1

window = 2.

I haven't used the other parameters so I'm afraid I can't help with those.

Best of luck.

Read only

Former Member
0 Likes
796

Here is a sample program from SAP on print form:

RSTXCDM1 and you can use transaction SE71 to display the default form S_CA930_DEMO_1.

Read only

Former Member
0 Likes
795

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. The parameter FUNCTION specifies how to merge the text lines to be output with any existing contents in the window. In this case, there are differences between the different window types or areas.

Function call:

-


CALL FUNCTION 'WRITE_FORM'

EXPORTING ELEMENT = SPACE

WINDOW = 'MAIN'

FUNCTION = 'SET'

TYPE = 'BODY'

IMPORTING PENDING_LINES =

EXCEPTIONS ELEMENT =

FUNCTION =

TYPE =

UNOPENED =

UNSTARTED =

WINDOW =

Export parameters:

ELEMENT

Specify the name of the text element you want to output into the form window specified in the parameter WINDOW. The element must be defined in that form window. If you specify no element, the system uses the default element, if one is defined in the form.

Default value: SPACE

WINDOW

Specify the name of the window into which you want to output the form element specified in the parameter ELEMENT.

Default value: 'MAIN'

FUNCTION

The parameter determines how to output the text element into the respective window. The output type depends on the window type and area:

Window type MAIN, area BODY:

'SET' append to previous output

'APPEND' same as SET

'DELETE' no effect

Window type MAIN, areas TOP and BOTTOM;

all other windows:

'SET' delete old window or area contents and

output the element

'APPEND' append the element to the existing elements 'DELETE' delete the specified element from the window

or area

DELETE in the TOP area (headings) takes effect only on the next page. You can no longer delete any heading from the TOP area after outputting text to the BODY area.

Default value: 'SET'

TYPE

The system interprets this parameter only for output to the main window.

The parameter determines the area of the main window into which you want to output the element.

Possible values:

'TOP' header area

'BODY' main area

'BOTTOM' footer area

Default value: 'BODY'

Import parameters:

PENDING_LINES

If a text is output to the BOTTOM area of the main window (TYPE = 'BOTTOM'), there may be not enough space left on the current output page. The system then internally flags this text for output into the BOTTOM area of the next page. The actual output is pending.

If output is pending, the parameter PENDING_LINES contains 'X', and the print program can react accordingly. For example, an explicit page break at the text end (NEW-PAGE) could implicitly trigger the pending BOTTOM output on the next page.

Exceptions:

ELEMENT

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

Possible reasons:

The element does not exist.

An element refers to a window, and the specified window does not contain the element. If no window is specified, the system searches for the element in the main window.

The specified element is not defined in the form.

The form version that contains the text element in the specified form window is not active.

FUNCTION

The function specified in parameter FUNCTION is unknown.

For this parameter, the following values are allowed:

SET

APPEND

DELETE

TYPE

The type of window area specified in parameter TYPE is invalid.

Depending on the window type, these entries are valid:

BODY: for all windows

TOP: only for the main window

BOTTOM: only for the main window

UNOPENED

The current form function could not be executed, since the form output was no yet initialized using OPEN_FORM.

UNSTARTED

No form was opened yet.

Possible reasons:

The form processing was started using OPEN_FORM without specifying a form name, but no form was opened yet using START_FORM.

The last used form was closed using END_FORM, but no new form was opened using START_FORM.

The last filled page of the current form has no subsequent page. In this case, the system automatically terminates form printing after this page. You need no explicit END_FORM call.

In the current form, no page contains a main window, but a text element shall be output in the main window.

WINDOW

The form window specified in parameter WINDOW does not exist in the current form.

Possible reasons:

A wrong window name was specified.

The form version, which contains the specified window, is not active.