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

scripts

Former Member
0 Likes
509

i have 10 line items in my itab. i want to print first 6 line items in first page of script and rest of in second page how can we do this?

Regards

Kiran kumar

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
485

Hi,

Use PROTECT...ENDPROTECT keywords to print the text in single page.

The text which you want to place in one page, the use the text b/w these two keywords, and it will be printed on a single page

Regards,

Tarun

3 REPLIES 3
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
486

Hi,

Use PROTECT...ENDPROTECT keywords to print the text in single page.

The text which you want to place in one page, the use the text b/w these two keywords, and it will be printed on a single page

Regards,

Tarun

Read only

Former Member
0 Likes
485

Hi,

Try the following code snippet.



loop at itab.
if sy-tabix  eq 7.
new-page.
endif.
print : itab-data.

endloop.

Regards,

Mansi.

Edited by: SAP USER on Mar 6, 2009 6:05 AM

Read only

Former Member
0 Likes
485

Hi,

for this you need trigger NEW-PAGE conditionally.

so in script write a perform to manipulate Flag:

In SCRIPT:

/:   DEFINE wa_flag = ' '
/:   PERFORM update_count IN PROGRAM zrep
/:   CHANGING wa_flag.
/:   IF wa_flag EQ 'X'
/:       NEW-PAGE
/:   ENDIF

In PROGRAM zrep:

DATA : g_int TYPE i,
           g_cnt TYPE i.

FORM update_count 
     TABLES input_table  STRUCTURE itcsy
                 output_table STRUCTURE itcsy.
  IF g_int = 0.
     g_cnt = 1.
  ELSE.
     g_cnt = g_cnt +1.
  ENDIF.
  IF g_cnt > 6.
       READ TABLE output_table WITH KEY name = 'WA_FLAG'.
       if sy-subrc = 0.
           MOVE 'X' TO output_table-value.
          CONDENSE output_table-value.
          MODIFY output_table INDEX sy-tabix.
          CLEAR output_table.
      endif.
   ENDIF.
ENDFORM.

Regards,

Neha

Edited by: Neha Shukla on Mar 6, 2009 10:53 AM