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: 

Sap script printing redundant lines

Former Member
0 Kudos

Hi All,

I am trying to print many pages of script. Each page contains should contain 1 item, but the script is printing 1 line on 1st page, 1st and second line on second page, 1st 2nd and third line on third page and so on. not able to sort out the problem. could anyone please help me?

regards,

Lavanya

4 REPLIES 4

former_member223213
Participant
0 Kudos

Hi Lavanya,

I think you are using WRITE_FORM_LINES try with WRITE_FORM.

FM:open_form,

loop at lt_final.

FM:start_form.

FM:write_form

FM:end_form.

endloop.

FM:end_form.

if it do not work !!

please show how you have done the code !

Thanks & Regards.

K.Manoj.

0 Kudos

Hi Manoj,

Thanks fo rthe response.

i am using write_form itself and not write_form_lines.

but after open_form i am using read_form_lines. will this make a difference?

0 Kudos

Hi Lavanya,

FM:Read_form_lines is used to transfer lines of the form elements to internal table.

if you used this in the loop then it may be the reason .

just try commenting the read_form_lines.

Thanks & Regards,

manoj.

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

Displaying the content in new page by the syntax.

/: NEW-PAGE

eg: create a element

/E  PAGE.

/: NEW-PAGE


CALL FUNCTION 'WRITE_FORM'

           EXPORTING

             ELEMENT                  = 'PAGE'

*           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.


Call the write form according to logic.


Hope it helpful,

Regards,

Venkat.V