cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript wont open records over 30

Former Member
0 Kudos

Hello everyone!

I am new to this sapscript. My sapscript works ok but when I am viewing over 30 records of data I am getting this pop-up error:

<b>WRITE_FORM is invalid, START_FORM is missing</b>

When I am using less than or equal to 30 records, the sapscript works just fine. I know there is something I dont know yet because im just a <u>newbie</u>. Can you pls help me?

big thanks to all of you.

-


data: ITAB type table of STXL with header line.

select TDOBJECT TDNAME TDID CLUSTR
      from STXL
      into corresponding fields of table ITAB
      up to 36 rows.

CALL FUNCTION 'OPEN_FORM'
 EXPORTING
   APPLICATION                       = 'TX'
   FORM                              = 'Z_STXLSCRIPT'.

LOOP AT ITAB.
    CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       ELEMENT                        = 'RECORD1'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'.
ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

OK MY PROBLEM NOW IS SOLVED. THANKS TO <b>TAMAS </b>FOR HELPING ME TO FIGURE OUT. THANKS TO ALL OF YOU. but i got another problem.

What I did was, I have main window on page 1 and on page 2. I deleted the main window and I have no window on page 2. I did the print preview and it worked on 30, 40, 50, 60 records.

BUT when I tried 80 records, it gave me a new error message:

<b> Output is continuous or contains too many pages (>3)</b>

<b>Questions:</b>

1. With the new error message, could this be because I only have 2 pages?

2. on the Print preview, why i see only 1 page instead of 2? I do have 2 pages on the layout though.

Former Member
0 Kudos

Hi!

I'm glad, you solved it. If you satisfied with the answer, just click on the left side of the post, and give some points for it.

Answers:

1. No, it can't be, because you told to sapscript to print another PAGE2 style page after the second page. Thisis what you defined within the nextpage property.

The pages will come as the following list:

1. PAGE1 -> nextpage PAGE2

2. PAGE2 -> nextpage PAGE2

3. PAGE2 -> nextpage PAGE2

4. PAGE2 and so on...

2. On the print preview, you can switch between the pages with the PageUp and Pagedown buttons.

It's better if you open a new thread to a new question. More people will read it.

Regards

Tamá

Answers (5)

Answers (5)

Former Member
0 Kudos

<b>TAMAS: </b>I already updated that and it is posted above your post. I still have the same problem

the same image posted above:

http://i150.photobucket.com/albums/s116/painkiller2007/mypages.jpg

Former Member
0 Kudos

Hi!

Give the nextpage as PAGE2 even in PAGE2. This keeps the continuity in your SAPScript.

PAGE1 -> nextpage PAGE2

PAGE2 -> nextpage PAGE2 (it tells the sapscipt to print another PAGE2 style page after hes printing a PAGE2 page)

Is it working now?

Regards

Tamá

Former Member
0 Kudos

TAMAS: I tried putting PAGE2 onto the nextpage but still the same. =(

I made sure also that the RECORD1 element is only declared on page 1 layout. on page 2 layout, i only have the window but NO SETTING AT ALL.

<b>pls help</b>

Former Member
0 Kudos

Hi!

Have you set it to both pages?

PAGE1 -> nextpage PAGE2

PAGE2 -> nextpage PAGE2

If it is still not working, comment out the text element from your window.

Replace

/E RECORD1

with

/* RECORD1

/* means the comment in SAPScript.

SAVE and ACTIVATE

your SAPScript.

Are you testing it in the same system/client?

Regards

Tamá

Former Member
0 Kudos

I already updated the NEXT setting (on pages) and still the same.

see image:

http://i150.photobucket.com/albums/s116/painkiller2007/mypages.jpg

Former Member
0 Kudos

Hi!

Emm, sry, late post

What is your problem and error message exactly?

Maybe that text element is created in MORE windows. You can create it only once in a SAPScript.

Regards

Tamás

Message was edited by:

Tamás Nyisztor

Former Member
0 Kudos

<b>TAMAS:</b> my problem is stated at the top and the screenshots are above your post. pls help. thnks.

Former Member
0 Kudos

<b>VINAY</b>: the element "RECORD1" is existing. in fact, my sapscript is working good when using only 30 records or less than 30 records BUT when over 30 records, that error message is coming up.

window setting:

http://i150.photobucket.com/albums/s116/painkiller2007/my_windows.jpg

paragraph setting:

http://i150.photobucket.com/albums/s116/painkiller2007/my_paragraph.jpg

pages setting:

http://i150.photobucket.com/albums/s116/painkiller2007/my_pages.jpg

design code:

http://i150.photobucket.com/albums/s116/painkiller2007/my_designcode.jpg

<b>PLS HELP</b>. im really new to this field.<b> thanks. </b>

Former Member
0 Kudos

Hi!

Aha, I see your problem now. You don't have NEXT page, only PAGE1 and PAGE2.

At the PAGE1, please give the next page as PAGE2 and NOT NEXT.

Maybe that text element is created in MORE windows. You can create it only once in a SAPScript.

Personally I'm using text elements (/E) only in the MAIN window. In other windows it is not neccesary, because it is enough to address them by their window name.

Regards

Tamá

Former Member
0 Kudos

Hi Boy,

If you are calling any element with the WRITE_FORM function module, it should exists the element in the window in the layout, othewiese it will show the error stating that WRITE_FORM is invalid, START_FORM is missing.

Check whether you assigned NEXPAGE attribute in your layout??

<b>OPEN_FORM:</b> This form opens the script. The module OPEN_FORM opens layout set printing.

<b>WRITE_FORM:</b> This form is used to write the content mentioned in the windows of the SAP Script.

<b>START_FORM:</b> This form is dynamically call a page in the script. The layout set can be changed in the current print procedure with START_FORM. This may also be used to trigger a new-spool id.

<b>END_FORM:</b> This form is used to close the current layout set.

<b>CLOSE_FORM:</b> This form close the current SAP script form.

<b>You can have any number for WRITE_FORM, START_FORM and END_FORM, but for a script you can have only one OPEN_FORM and CLOSE_FORM.</b>

Thanks,

Vinay

Former Member
0 Kudos

another question. When do you use START_FORM?

former_member181962
Active Contributor
0 Kudos

HI,

YOu use START_FORM when you have multiple layouts for the same driver program.

like this:

open_form

start_form (for layout 1)

write_form

end_form

start_form (for layout 2)

write_form

end_form

close_form

Regards,

Ravi