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: 

Problem with Write_FORM

Former Member
0 Kudos

Hi Guys,

Through print program i am trying to display the values of an internal table in the scripts. I am looping this internal table and writing the WRITE_FORM inside this loop.

types: begin of ty_mail,

mail type so_rec_ext,

end of ty_mail.

data: it_mail type standard table of ty_mail,

wa_mail type ty_mail.

loop at it_mail into wa_mail.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'MAIL'

window = 'WINDOW19'

EXCEPTIONS

OTHERS = 0.

endloop.

and in the scripts inside WINDOW19 under element /: MAIL i am writing

/ &wa_mail-mail&

but what is happening is that only the last record of the internal table is getting displayed.

if the internal table has values

AAA

BBB

CCC

DDD

only DDD is getting displayed in the output. Can any1 please help me out in this.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

What type of window (WINDOW19 ) it is?

14 REPLIES 14

Former Member
0 Kudos

Hi,

Write internal table data in Window instead of Workarea.

Thank U,

Jay....

Former Member
0 Kudos

in the scripts inside WINDOW19

u write like this...

/E MAIL

  • &wa_mail-mail&

' * ' means defaullt paragraph..

Edited by: Chaithanya A on Mar 10, 2009 9:10 AM

0 Kudos

Hi Chaitanya,

I have written it as /E Mail only. i wrote it wrong in my previous message. I even tried doing as you have suggested. But still I am not able to get it

Former Member
0 Kudos

Hi,

Your code looka perfect, just wanted to know have you selected the all the data from the table into the intrenal table before calling the write_form?

Pooja

0 Kudos

Hi Pooja,

in the debuggin mode in the report i see that the data is there in the internal table and also debugging mode in Scripts also i see that the data is present in that work area.

0 Kudos

Is your Window19 large enough to display more than one records?

Just a wild guess if you also pass other 2 exporting parameter in WRITE_FORM as

FUNCTION = 'SET'

TYPE = 'BODY'

Pooja

0 Kudos

yes, my window is larege enough to display more than 2 records. However, i will try adding the 2 additional parameters as you suggested and check...

0 Kudos

Hi Buddy,

Your code looks fine,

I dont know the exact solution but i have a alternate for this problem, Coz I got the same problem Once.

I will explain my problem then you can solve this by your self.

I have a label printing program, 6 windows each window is each label, contains diff material no's. for each window, and all the material No's are in only one internal table lets say ITAB1.

My ITAB1 data is,

001

002

003

004

005

006

007

008

...............

now when I tried, I am getting 006 in all the windows, and in next page 008.

I written the code just like you.

had no option but i did a alternate like this

ITAB2[] = ITAB1[].

loop at itab1 .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ELEMENT1'

window = 'MAIN'

EXCEPTIONS

OTHERS = 0.

delete itab1. exit.

endloop.

loop at itab1 .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ELEMENT2'

window = 'MAIN'

EXCEPTIONS

OTHERS = 0.

delete itab1. exit.

endloop.

loop at itab1 .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ELEMENT3'

window = 'MAIN'

EXCEPTIONS

OTHERS = 0.

delete itab1. exit.

endloop.

loop at itab1 .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ELEMENT4'

window = 'MAIN'

EXCEPTIONS

OTHERS = 0.

delete itab1. exit.

endloop.

Because I know my window size so I repeated my code like this.

Which perfectly shown the output, It seems to be silly, But worked very fine for me.

I even dont know whether this is a solution or alternate.

Try this at the worst case when you dont have any solutions.

Thanks & Regards,

Dileep .C

Former Member
0 Kudos

What type of window (WINDOW19 ) it is?

0 Kudos

it is a variable window

0 Kudos

Hi,

Pass the data to a MAIN window type ...then it should display the data .

Pooja

0 Kudos

but i dont want to display this in MAIN window.. i want to display this another window before the main window or after the main window

0 Kudos

You have to pass the data to a MAIN window if you want to display the result as per your requirement, else in othe rtype of windows it won't display the result.

If you serach or press F1 on different types of windows then the definition says

MAIN: A spl WINDOW where item lines are to be printed.Every page has to have a MAIN WIndow .

VAR: Content of this window is regenerated on evry new page.ALL WIndows which contains diffeent information different pages must of type 'VAR'.

I have executed the code provided by you and result is only displayed in MAIN tyoe window only else in other type only last entry is displayed.

Pooja

Edited by: Pooja Gupta on Mar 10, 2009 12:35 PM

0 Kudos

Hi Pooja,

Thanks for you inofrmation.

You are right,

The Above code I mentioned is the same. But without knowing the reason I mentioned it.

Now thanks that i have a clear Idea why it happend to me and happening to him.

Thanks & Regards,

Dileep .C