cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript: why the window only show the LAST line

Former Member
0 Kudos

Dears,

In my form, one of the window only show the LAST line of the it.

I have set the window enough space, also when debuging the program , open_form, write_form,

all of those sy-subrc = 0.

both static texts and dynamic texts are set in the window, but only the last line shown.

Anyone could help me?

Thanks a lot.

Sincerely,

Julie Lv

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

the problem is not in your sapscript but in your print program.

it seems you loop through your (internal) table.

After that loop you do a write_form

eg.

loop at itab into wa_itab

endloop

write_form

That is wrong. On this way you only print the last line.

you have to put the write inside the loop so you will print all lines.

eg.

loop at itab into wa_itab

write_form

endloop

hope this helps.

Gr., Frank

Former Member
0 Kudos

Dear,

This is not for i use write_form outside my loop.

The really reason is use

loop at int_tab.
  write_form
endloop.

in the window which is not MAIN.

but I stilly can't resolve this problem, And I have to use loop in the window not MAIN.

Anyone who can help me?

really really appreciate it.

Thanks a lot.

Julie

Former Member
0 Kudos

Hi,

There are several possibilities to resolve your problem.

You can work with 2 main windows on in1 page.

With NEW-WINDOW you switch to the next main-window

How to use it.

make an item in main window with that /: NEW-WINDOW command

if you are ready with first loop call a WRITE_FORM with that NEW-WINDOW statement.

to cojntinue in the other main.

Other possibility is. (in case there are not ot many lines)

Use for every line other variable names.

Fill these in the loop. And after loop WRITE FORM

eg. (if maximum is 3 lines)

  • &VAR1_1& &VAR1_2& &VAR1_3& &VAR1_4&

  • &VAR2_1& &VAR2_2& &VAR2_3& &VAR2_4&

  • &VAR3_1& &VAR3_2& &VAR3_3& &VAR3_4&

Hope this helps.

Gr., Frank

Former Member
0 Kudos

Hi,

Would you please tell me how to build 2 main window in 1 page?

seems a little difficult, Thanks a lot.

Sincerely

Julie

Former Member
0 Kudos

Normally you will have already in window of type MAIN.

It is very easy.

create new window with type MAIN. Then you will get a new MAIN WINDOW with name MAIN_01 or something.

you can put upto 99 MAIN windows in 1 page

you can do it.

Gr., Frank

Former Member
0 Kudos

Dear,

Thanks a lot for your kindly suggestion.

It works, but I still have another question:

could I set the window MAIN_01 with different size from window MAIN?

Expecting for your kindly help, and thanks a lot,

Sincerely,

Julie

Former Member
0 Kudos

Hi

Sorry i did not mention it.

The width of all 'MAIN' window must be the same.

but you can change the heigth, left margin and upper margin.

Besides that you can let if overlap with another window if you do not use the total width.

So that has not to be a big problem. Only if you are working with BOX/FRAMES you have to resize the BOX.

Success,

Gr. Frank

P.S.: i mostly never reply on email sent unexpected by SDN users.

Former Member
0 Kudos

Hi

Sorry i did not mention it.

The width of all 'MAIN' window must be the same.

but you can change the heigth, left margin and upper margin.

Besides that you can let if overlap with another window if you do not use the total width.

So that has not to be a big problem. Only if you are working with BOX/FRAMES you have to resize the BOX.

Success,

Gr. Frank

P.S.: i mostly never reply on email sent unexpected by SDN users.

Former Member
0 Kudos

Hi,

I am very very apppreciate your kindly help, and it indeed help me.

Also it is not a big problem, but bothered me for long time.

And now, it's resolvesd.

Thanks again.

Sincerely,

Julie

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have similar problem in script where only the last line item is getting displayed.

Can you please help me.

I am using main window inside the loop.

but it is displaying only the last line item.

Former Member
0 Kudos

Hi,

Just check whether the write_form is inside the loop or not, if you are passing the data to the script from internal table.

Regards

Sarves