cancel
Showing results for 
Search instead for 
Did you mean: 

Text getting printed twice in SAP Script

Former Member
0 Kudos

Hi All,

I have put text "Welcome to SAP" in text element of MAIN window. In print program I have used OPEN_FORM, WRITE_FORM (inputting window = MAIN), & CLOSE_FORM. After executing print program when I am looking at Print Preview, "Welcome to SAP" is printed twice. As I have given only once so why its getting printed two times.

How this is possoble??

Thanks in Advance...

Regards,

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sudhir,

I have called WRITE_FORM only once.

Its called as:

CALL FUNCTION 'WRITE_FORM'

EXPORTING

  • ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

But I am getting it twice.

Also If I prints same text i.e. "Welcome to SAP" in some variable window then that is printed only once in that variable window.

I am facing this problem only in case of MAIN window.

Regards,

Vijay

Former Member
0 Kudos

Hi Vijay,

A small modification in your write_form.

Just give an element as below:

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' XYZ'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'.

Now "Welcome to SAP" will be displayed only once in the main window.

Regards,

Sayee

Former Member
0 Kudos

Creat a text element in your script and then pass it to your WRITE_FORM FM by un commenting your ELEMENT

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = ' text element created in your script '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

Hope this will solve your problem

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks..

Former Member
0 Kudos

Hi All,

Thanks to all of u..

I was using default text element. Because of that internally 2 conditions were being satisfied in case of MAIN window. That's why it was being printed twice. But now after using text element with some name its coming only once.

Thanks agin..

Former Member
0 Kudos

Hi,

Can you check whether the text element/ main window called twice.

Br,

Laxmi.

Former Member
0 Kudos

Hi,

Check the code before the Write_form, if the Window/Element called twice then this will be printed twice.

Regards

Sudheer