Application Development and Automation 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: 
Read only

Sap-script

Former Member
0 Likes
429

Hi,

I have an internal table it_account with the following pattern of data.

71 data data

71 data data

71 data data

72 data data

72 data data

72 data data

73 data data

73 data data.

i am looping at this internal table and printing the values in sapscript.

ie in the main window.

loop at it.

write from.

endloop.

My requirement is that the data corresponding to 71 should be printed in one page

72 in another page and so on...a new-page should be fired on number change...

Please help ...

Thankyou..

4 REPLIES 4
Read only

Former Member
0 Likes
398

in SAP Script...

after printing ITAB contents...

use NEW-PAGE cmd....

e.g. /E ITAB

P1 &ITAB-fld1& &ITAB-fld2&

/: NEW-PAGE

Read only

Former Member
0 Likes
398

Hi,

Try this..


loop at it.

ON CHANGE OF it-first field.

* call the function module CONTROL_FORM to force a new page.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
  COMMAND    =  'NEW-PAGE'
EXCEPTIONS
  UNOPENED   = 1
  OTHERS        = 3


ENDON.

write from.


endloop.

Thanks

Naren

Read only

Former Member
0 Likes
398

Hi,

1.Sort your internal table....

2. At new <field1>

Use command statement NEW-PAGE

Make sure for the first loop pass (index) this new page is not triggering

If the hint is useful… Say thanks by reward….

Regards,

Prabhu Rajesh

Read only

Former Member
0 Likes
398

U must hav used function START_FORM..

place it inside the loop after AT-NEW <fieldname>

Loop at it.

AT NEW <>

START_FORM

..

endat.

AT END OF <>

CLOSE_FORM.

enloop.

Hope it answers ur doubt.

Reward if helpful