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: 

smartform number of pages increases based on internal table values.

former_member225134
Participant
0 Kudos

Hi,

  In my smartfrom am getting value from driver program..

so in smartform  i want to display the number of line items in single page.

but here it_tab[] = 1 value means displayed in single page ..

but it_tab[] = 2 means for (same material ) also displaying in 2 page ..like wise 3 means 3 page....

I want to display in single page for single material  and single vendor as per selection screen values.

so i created command  as go to new page,...But still not working.

Any one give suggestion????

3 REPLIES 3

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Anitha,

Kindly confirm whether condition is created for the command as shown below.

  1. Create a Global variable L_MATNR
  2. During Looping, Read the next row material and and assign to Global variable inside the Loop/Table
  3. Inside command, in condition tab, compare current row(wa_matnr) with next row(l_matnr).

Regards

Rajkumar Narasimman

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Anitha,

Sort internal table by matnr.

Declare a global variables.

LOOP AT ITAB.

AT NEW  MATNR.

CLEAR FLAG.

ENDAT.

AT END OF MATNR.

FLAG = 'X'.

ENDAT.

ENDLOOP.

Pass the flag  variable  to the command.

Hope it helpful.

Regards,

Venkat.

romit_raina
Active Participant
0 Kudos

Hello Anitha ,

Another solution of your concern is  follows:

  1) In the  Table inside the main window --> Tab "DATA"--> SORT CRITERIA --> Check the EVENT SORT END checkbox  and put MATNR in filed name (this field should be in you Internal table). Check the below screenshot :

2 ) Once you will check the Event sort end Checkbox you will get an event inside in your Table, please see the below image ,

Need to put a Command inside the event and set the NEXT PAGE.

So what exactly it will do, for each different Material it will print the details in different Page .

Kindly try this and let me know if you need any more information from my end.

Thanks

Romit Raina