cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript: How to WRITE_FORM in loop an internal table if window not MAIN

Former Member
0 Kudos

Dears,

I want to WRITE_FORM .........loop at 2 internal tables while the windows are not main?

I used

loop at int_tab1
            call fm write_form
          endloop.

but only can get the last line of the int_tab1

whether is the reason of FUNCTION = 'SET' in write_form?

How to deal with 2 internal tables?

Anyone could help me?

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It is not possible loop lines to a window which is not main.

2 possibilities.

1 use 2 MAIN windows.

with /: NEW-WINDOW you can switch to the other main.

or

2. use for every line other variables and fill them after filling print window

eg

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

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

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

success.

Gr., Frank

PS do you have 2 sdn userid's?

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

It is not possible using Variable window. So do one thing first save the data as text by using "SAVE_TEXT' Function module. And get this text to form using "INCLUDE <text> " Control Command. In this way we can get the internal table in variable window.

Regards,

Jagadeesh T.

Former Member
0 Kudos

Hi,

Do you have any relation with and the post ?

Do i smell something fishy here?

Regards

Karthik D

Former Member
0 Kudos

Dear,

Julie 2192 and Julie Lv both me.

since I use different computer in company and home, and unfortunately,

I couldn't logged in in company with my home name id AND couldn't log in at home with company id

so...........................ONLY can have two id.......in not, I would have to reser ID twice one day

Sincerely

Julie

matt
Active Contributor
0 Kudos

>

> Dear,

>

> Julie 2192 and Julie Lv both me.

>

> since I use different computer in company and home, and unfortunately,

>

> I couldn't logged in in company with my home name id AND couldn't log in at home with company id

>

>

> so...........................ONLY can have two id.......in not, I would have to reser ID twice one day

>

>

>

> Sincerely

>

> Julie

There isn't any rule about having more than one id. However, if one of your ids awards points to the other, then both will be deleted. It's also not permitted to post the same question from both ids, as we would then end up with lots of duplicate postings.

So long as the above is followed, then I don't see a problem.

matt

Former Member
0 Kudos

Hi,

You will not get the whole data if the window is not MAIN this is because a variable window cannot trigger a new page.

Reason why you are getting only single line is it is over writing the data every time on the same place that is the reason you get the last line item in your form.

If you want to deal with 2 internal tables do the loop 2 times and call the write_form FM twice with different text elements

loop at itab into wa.
call function 'WRITE_FORM'
  Exporting
     Element = 'TEST1'.
     Window = 'MAIN'
endloop.
loop at itab2 into wa2.
call function 'WRITE_FORM'
  Exporting
     Element = 'TEST2'.
     Window = 'MAIN'
endloop.

You can achieve like this.

Thanks&Regards

Sarves

Former Member
0 Kudos

Hi,

Question is not clear...could you plz ellaborate it little...

Rgds,

Pavan

Former Member
0 Kudos

I want to WRITE_FORM IN 2 internal tables, and the window isnot MAIN.

I used

loop at int_tab1
            call fm write_form
          endloop.

but the resule is only the last line of the int_tab1

whether is the reason of FUNCTION = 'SET' in FM 'WRITE_FORM'?

Could I set text_element in those window not MAIN?

how to deal with 2 internal tables in one winow? still window not MAIN

Anyone could help me?

Thanks a lot