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

START_FORM is invalid, OPEN_FORM is missing

vengadesh_r
Explorer
0 Likes
5,137

Hi All,

    I am getting "START_FORM is invalid, OPEN_FORM is missing " error message while printing a production order via CO03.

   CALL FUNCTION 'OPEN_FORM'

     EXPORTING

       device   = 'PRINTER'

       dialog   = space

       form     = print_co-forml

       language = print_co-spras

       OPTIONS  = print_opts

     EXCEPTIONS

       canceled = 01

       device   = 02

       form     = 03

       OPTIONS  = 04

       unclosed = 05.

    While debugging "OPEN_FORM" is giving exception FORM with sy-subrc value 3.

     This is arising because no entry with the form name is available in STXH table.

    What could be the problem? Please help me.

Thanks,

Vengadesh R

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,192

Hi,

SY-SUBRC = 3, this means that the SAP Script that you have provided is not present in the client in which you are writing the code.

SAP Scripts are client dependent. So first transport the SAP Script from the source client to target client using SCC1.

Hope this helps. If the problem still persists let me know.

Thanks,

Tooshar Bendale

Hi All,

    I am getting "START_FORM is invalid, OPEN_FORM is missing " error message while printing a production order via CO03.

   CALL FUNCTION 'OPEN_FORM'

     EXPORTING

       device   = 'PRINTER'

       dialog   = space

       form     = print_co-forml

       language = print_co-spras

       OPTIONS  = print_opts

     EXCEPTIONS

       canceled = 01

       device   = 02

       form     = 03

       OPTIONS  = 04

       unclosed = 05.

    While debugging "OPEN_FORM" is giving exception FORM with sy-subrc value 3.

     This is arising because no entry with the form name is available in STXH table.

    What could be the problem? Please help me.

Thanks,

Vengadesh R

6 REPLIES 6
Read only

Former Member
0 Likes
3,192

Hi boss,

For working with sap script you have to call the script first with FM OPEN_FORM . Please have a look below sample code.

** Open form function calling for initial use.
CALL FUNCTION 'OPEN_FORM'
   EXPORTING
     FORM = 'ZC101_CSD107'.


** Start looping to start printing the sap script
LOOP AT IT_VBAP.

** On change of VBELN start new page.
   AT NEW VBELN.
     CALL FUNCTION 'START_FORM'
       EXPORTING
         FORM      = 'ZC101_CSD107'
         STARTPAGE = 'P1'.

     CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT  = 'E1'
         FUNCTION = 'SET'
         TYPE     = 'BODY'
         WINDOW   = 'HEADER'.
   ENDAT.

** Calling function for printing the item details
   CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       ELEMENT  = 'E2'
       FUNCTION = 'SET'
       TYPE     = 'BODY'
       WINDOW   = 'MAIN'.

** Calling function for ending the form.
   AT END OF VBELN.
     CALL FUNCTION 'END_FORM'.

   ENDAT.

ENDLOOP.

** Call FM to close the form.
CALL FUNCTION 'CLOSE_FORM'.

Regards,

Praveen Chitturi

Read only

0 Likes
3,192

Thanks for the reply Praveen. My code is similar to this.

My problem is OPEN_FORM is giving me an exception with sy-subrc = 3. Due to this exception START_FORM is giving an error message "START_FORM is invalid, OPEN_FORM is missing".

Read only

0 Likes
3,192

hello,

Please check this for your sy-subrc = 3 error

FX OPEN_FORM                     FORM

____________________________________________________

Short Text

Form does not exist

The form specified in the parameter FORM does not exist or there is no active
version of this form.

Function Module

OPEN_FORM

best regards,

swanand

Read only

Former Member
0 Likes
3,193

Hi,

SY-SUBRC = 3, this means that the SAP Script that you have provided is not present in the client in which you are writing the code.

SAP Scripts are client dependent. So first transport the SAP Script from the source client to target client using SCC1.

Hope this helps. If the problem still persists let me know.

Thanks,

Tooshar Bendale

Read only

0 Likes
3,192

Thanks Tooshar. It was a problem because of clients. In my testing client script is not available. I transported it using SCC1. now it is working fine!

Read only

Former Member
0 Likes
3,192

Hi ,

Check output device in your printer settings.

is it LP01 or something else ?

Regard's

Smruti