Application Development 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: 

open_form in SAP script

Former Member
0 Kudos

hi,

I was trying script program for single page. so when I was calling the function 'open_form' ...i mean when i double clicked on it....i was taken to the module page....after executing it i am not getting the module code into my source program......what cud be the possible error.

I get something like this in the module result screen

"close_form is missing for the layout".

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you closing the form?

basis program code should look like this.



  call function 'OPEN_FORM'
       exporting
            device   = 'PRINTER'
            dialog   = ' '
            form     = print_co-forml
            language = print_co-spras
            options  = itcpo
       exceptions
            canceled = 01
            device   = 02
            form     = 03
            options  = 04
            unclosed = 05.

  call function 'START_FORM'
       exporting
            startpage = 'PAGE1'
       exceptions
            others    = 7.

  call function 'WRITE_FORM'
       exporting
            window = 'MAIN'
       exceptions
            others = 9.

  call function 'END_FORM'
       exceptions
            others = 4.

  call function 'CLOSE_FORM'
       exceptions
            others = 01.

Regards,

Rich Heilman

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you closing the form?

basis program code should look like this.



  call function 'OPEN_FORM'
       exporting
            device   = 'PRINTER'
            dialog   = ' '
            form     = print_co-forml
            language = print_co-spras
            options  = itcpo
       exceptions
            canceled = 01
            device   = 02
            form     = 03
            options  = 04
            unclosed = 05.

  call function 'START_FORM'
       exporting
            startpage = 'PAGE1'
       exceptions
            others    = 7.

  call function 'WRITE_FORM'
       exporting
            window = 'MAIN'
       exceptions
            others = 9.

  call function 'END_FORM'
       exceptions
            others = 4.

  call function 'CLOSE_FORM'
       exceptions
            others = 01.

Regards,

Rich Heilman

0 Kudos

thank you.....working on it

0 Kudos

hi rich,

Therez something like element in the WRITE_FORM.

I know that i am supposed to define the element in the layout set.....but i donno where to and how to define....

can u plz guide me

Regards,

scien

0 Kudos

In the main window, define your elements.

in sapscript......

/E  ELEMENT_NAME

in program.

  call function 'WRITE_FORM'
       exporting 
            window = 'MAIN'
            elment = 'ELEMENT_NAME'
       exceptions
            others = 9.

REgards,

Rich Heilman

0 Kudos

If your problem is solved and these answers have been helpful, please award points and close post. Thanks

Regards,

Rich Heilman