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

scripts

Former Member
0 Likes
686

hi to all,

help me in this issue,

can any one tell what r the parameters to be paased in

open_form, write_form .

thanks in advance

kiran kumar.

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
663

call function 'OPEN_FORM'

exporting

DEVICE = 'PRINTER'

FORM = 'ZGL_PCLABELS3'

LANGUAGE = SY-LANGU

exceptions

CANCELED = 1

DEVICE = 2

FORM = 3

options = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

INVALID_FAX_NUMBER = 8

MORE_PARAMS_NEEDED_IN_BATCH = 9

SPOOL_ERROR = 10

CODEPAGE = 11

others = 12.

if SY-SUBRC <> 0.

message S208(00) with 'text-002'.

endif.

call function 'WRITE_FORM'

exporting

ELEMENT = 'T1'

WINDOW = 'LABLE'

exceptions

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

others = 10.

if SY-SUBRC <> 0.

endif.

Regards

- Gopi

5 REPLIES 5
Read only

gopi_narendra
Active Contributor
0 Likes
664

call function 'OPEN_FORM'

exporting

DEVICE = 'PRINTER'

FORM = 'ZGL_PCLABELS3'

LANGUAGE = SY-LANGU

exceptions

CANCELED = 1

DEVICE = 2

FORM = 3

options = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

INVALID_FAX_NUMBER = 8

MORE_PARAMS_NEEDED_IN_BATCH = 9

SPOOL_ERROR = 10

CODEPAGE = 11

others = 12.

if SY-SUBRC <> 0.

message S208(00) with 'text-002'.

endif.

call function 'WRITE_FORM'

exporting

ELEMENT = 'T1'

WINDOW = 'LABLE'

exceptions

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

others = 10.

if SY-SUBRC <> 0.

endif.

Regards

- Gopi

Read only

Former Member
0 Likes
663

Hi,

for open form,

call function 'OPEN_FORM'

exporting

application = 'TX'

device = 'PRINTER'

form = 'YUTAC_PO_V01' "form name

language = sy-langu

dialog = 'X'

exceptions

others = 1.

write form depends on the elements or without elements.

call function 'WRITE_FORM' "for logo

exporting

element = 'LOGO'

window = 'COMPANY'.

call function 'WRITE_FORM'

exporting

element = 'DISCO' "element name in main window

window = 'MAIN'.

without element

call function 'WRITE_FORM'

exporting

  • element = ' '

window = 'FOOTER'.

Regards,

Rajesh.

Read only

Former Member
0 Likes
663

hi kiran,

check these threads...

Cheers

Alfred

Reward with points for helpful answers

Read only

0 Likes
663

Hi,

i have coded as below

but it is giving error like bedor form period is missing

SELECT * FROM ZFI

INTO TABLE IT_ZFI

WHERE KUNNR EQ P_KUNNR

AND BUKRS EQ P_BUKRS.

CALL FUNCTION 'OPEN_FORM'

FORM = 'ZFI_INS'

LANGUAGE = SY-LANGU.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'INST'

  • FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

CALL FUNCTION 'CLOSE_FORM'.

Read only

Former Member
0 Likes
663

hi

good

open-form->

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 =

http://help.sap.com/saphelp_40b/helpdata/en/d6/0dba1a494511d182b70000e829fbfe/content.htm

-


WRITE_FORM->

CALL FUNCTION 'WRITE_FORM'

  • EXPORTING

  • ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

  • WINDOW = 'MAIN'

  • 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

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Some important parameters:

ELEMENT Specifies which textelement is printed

WINDOW Specifies which window is printed

TYPE Specifies the output area of the main window. This can be:

TOP - Used for headers

BODY

BOTTOM - Used for footers

FUNCTION Specifies whether text is to be appended, replaced or added

Example of how to use the WRITE_FORM function module together with a script.

Form layout of the MAIN window

/E INTRODUCTION

thanks

mrutyun^