cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Data twice in Script Form

Former Member
0 Kudos

Hi all,

I have created a form using SE71 and developed a script program. the information in main window is displayed twice... please tell me why is it so???

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196280
Active Contributor
0 Kudos

Debug and see your print program and see whether you are passing data twice to your main program.

OR

In form you are are displaying the items twice,

close the thread once your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

Thanks,,,

i created a very simple displaying only 'Hello'. n Simple print program..m nt passing data twice also...

former_member196280
Active Contributor
0 Kudos

Send me your print program, and what written in main window??

Regards,

SaiRam

Former Member
0 Kudos

please see the code and in the form i have written only Hello in the main window

***&----


*& Report ZSCRIPT_TEST

*&

&----


*&

*&

&----


REPORT ZSCRIPT_TEST_1.

data: begin of itab occurs 0,

id type pa0001-pernr,

name(40) type c,

end of itab.

*data: ABC(20) type c.

*

itab-id = '00000008'.

itab-name = 'Simran'.

append itab.

itab-id = '00000008'.

itab-name = 'Simran'.

append itab.

itab-id = '00000004'.

itab-name = 'kATTO'.

append itab.

*ABC = 'Hello'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

DEVICE = 'PRINTER'

  • DIALOG = 'X'

FORM = 'ZNIDHI_2'

  • LANGUAGE = SY-LANGU

  • OPTIONS =

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJECT =

  • RAW_DATA_INTERFACE = '*'

  • SPONUMIV =

  • IMPORTING

  • LANGUAGE =

  • NEW_ARCHIVE_PARAMS =

  • RESULT =

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

INVALID_FAX_NUMBER = 8

MORE_PARAMS_NEEDED_IN_BATCH = 9

SPOOL_ERROR = 10

CODEPAGE = 11

OTHERS = 12

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

  • ELEMENT = 'ABC'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'CLOSE_FORM'

  • IMPORTING

  • RESULT =

  • RDI_RESULT =

  • TABLES

  • OTFDATA =

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

SEND_ERROR = 3

SPOOL_ERROR = 4

CODEPAGE = 5

OTHERS = 6

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

former_member196280
Active Contributor
0 Kudos

Is both "HELLO" displaying from main window... Set break-point in your SAPscript (Utilities --> activate debugger) and see...

Regards,

SaiRam

Former Member
0 Kudos

Yeah,, i have only one window i.e main... i'll debug the SAP script n let u know....

Former Member
0 Kudos

i did a test printing of the form ,,,there it i sdisplaying 'Hello' once...then where is the problem

former_member196280
Active Contributor
0 Kudos

I guess it is problem with printer config. check with yout basis team.

Regards,

SaiRam

Former Member
0 Kudos

anything else which i should check out.....

former_member196280
Active Contributor
0 Kudos

Try to check the preview other in other printer.

Regards,

Sairam