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

OPEN_FORM

Former Member
0 Likes
1,171

Hi All,

can we call multiple OPEN_FORM...CLOSE_FORM

in one drvier program ?

One more,

I know that for printing multiple form layouts we will go as below.

OPEN_FORM.

START_FORM.

END_FORM.

START_FORM.

END_FORM.

..................

CLOSE_FORM.

Please let me know whether my assumption is correct or not.

thanks in advance.

U.Khan.

10 REPLIES 10
Read only

Former Member
0 Likes
979

Hi Ubedulla,

Check out some details: Hope it helps you in better understanding.

Open form printing - Must be called before working with any of the other form function modules.

call function 'OPEN_FORM'.....

Must be ended with function module CLOSE FORM

*To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM

call funtion 'START_FORM'.....

Write text elements to a window of the form

call function 'WRITE_FORM'.....

Ends form

call funtion 'END_FORM'.....

Closes form printing

call function 'CLOSE_FORM'....

Examples of function calls

OPEN FORM

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

DEVICE = 'PRINTER'

DIALOG = 'X'

  • FORM = ' '

  • LANGUAGE = SY-LANGU

OPTIONS = OPTIONS

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJECT =

  • RAW_DATA_INTERFACE = '*'

IMPORTING

  • LANGUAGE =

  • NEW_ARCHIVE_PARAMS =

  • RESULT =

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

OTHERS = 10

.

START_FORM

CALL FUNCTION 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

FORM = 'MY_FORM'

  • LANGUAGE = ' '

  • STARTPAGE = ' '

  • PROGRAM = ' '

MAIL_APPL_OBJECT =

IMPORTING

  • LANGUAGE =

EXCEPTIONS

FORM = 1

FORMAT = 2

UNENDED = 3

UNOPENED = 4

UNUSED = 5

OTHERS = 6

WRITE_FORM

See 'WRITE_FORM'

END_FORM

CALL FUNCTION 'END_FORM'

IMPORTING

  • RESULT =

EXCEPTIONS

  • UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

OTHERS = 3

CLOSE_FORM

Structure for Print options (return values) - Pages selected for printing, Number of copies etc.

DATA BEGIN OF RESULT.

INCLUDE STRUCTURE ITCPP.

DATA END OF RESULT.

CALL FUNCTION 'CLOSE_FORM'

IMPORTING

RESULT = RESULT

  • RDI_RESULT =

TABLES

  • OTFDATA =

EXCEPTIONS

  • UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

  • SEND_ERROR = 3

  • OTHERS = 4.

Reward points if this helps..

Manish

Read only

Former Member
0 Likes
979

Hi,

We can use only one Open_Form and Close_Form.

But we can use as many as Start_form and End_Form.

Regards,

Ram

Pls reward points if helpful

Read only

Former Member
0 Likes
979

Within one transaction, you can open and close several forms using OPEN_FORM and CLOSE_FORM, however not simultaneously. You can use parameters in the OPEN_FORM to control whether the output is stored in the same print request.

Read only

gopi_narendra
Active Contributor
0 Likes
979

Hi Ubedullah,

you can not use multiple open_form and close_form

but where as you can use multiple start_form and end_form

Regards

- Gopi

Read only

Former Member
0 Likes
979

Hi,

We can open other Form only when the first one is close.

we cannot have Open_form within a Open_form. we need it to close it.

Like: Open_form.

Close_form.

Open_form.

Close_form.

Regards,

Hemanth

Read only

Former Member
0 Likes
979

Hi

You can use like this:

Open_Form

Start_Form

Write_Form

End_form

Start_form

Write_form

End_form

Close_form.

Regards

Haritha.

Read only

0 Likes
979

Ok friends,

Please let me clear these things first.

1) I have 2 different lay out sets such as a.Electrical Bill

b.Telephone Bill.

can I print 2 different lay out sets using one print program ?

if so how?

2) If I need to print one lay ou set for 2 customers such as I need to give

Electrical bill to X and anotehr Elctrical bill to Y, data in the layout set will be

different for both X & Y.

Please help to resolve.

Many thanks for all of you in advance.

U.khan.

Read only

0 Likes
979

i suppsoe u can do that way.

open_form

start_form

end_form

start_form

end_form

.......

close_form

open_form

start_form

end_form

start_form

end_form

.......

close_form

in the same driver program

Regards

- Gopi

Read only

Former Member
0 Likes
979

Hello ubedulla,

U can use as many OPEN FORMS in one driver program. However each OPEN form should have associated CLOSE FORM.

Each pair allows allows u to write output to several spool.

Ans to ur assumption is yes.

Read only

Former Member
0 Likes
979

got good response. and my I am clear with these answers.