cancel
Showing results for 
Search instead for 
Did you mean: 

page break in smart form

Former Member
0 Kudos

Hi ,

I want to do the page break on basis of material no (matnr) . I have sorted the internal table by matnr and i want to do the pgae break whenever the material no changes in the internal table .

EX:

matnr:

A

A

A

A

page break

B

B

B

B

page break

c

c

page break.

Neetesh.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hai Neetesh

I think u have all the materials in one internal table which u are passing to smartform, and i think u have already declared internal table in the smartforms form interface and work area in global definitions.

you should display the internal table data in the main window of smartform by creating a table, and in the table data section loop at it_mara into wa_mara.

now u declare a variable matno in global definitions and in the initialisation tab of global definitions write the below code .

read table it_mara into wa_mara index 1.

if sy-subrc = 0.

matno = wa_mara-matnr.

endif.

after that u goto main window-> table->create ->flow logic->program lines

in the program line u write

matno = wa_mara-matnr.

means u are updating the value of variable matno everytime u run the loop.

then in the main window u create->flowlogic->command.

inside the command u check the checkbox and write 'page1' in goto page field.

in the conditions tab of command write

matno != wa_mara-matnr.

I think this will definitely work.

Former Member
0 Kudos

hi Neetesh,

Use COMMAND Node to have a page break...

Use this COMMAND node inside loop node and put a condition on COMMAND node...

for that u will have to define a flag in program lines...so when the material will change set this flag else reset...

hope this would help u...

Regards

Prashant

poornimal_nathan
Explorer
0 Kudos

hi,

I tried creating the command... just that the event node appears... but under Flow Logic, i get only loop.. i need the command submenu... any help?

Message was edited by:

Poornima L Nathan

Former Member
0 Kudos

Hi Niteesh,

As Vidya said, try it out... it should work.

Thanks

Dinakar.

Former Member
0 Kudos

inside your FORM, create program lines as follows

if not itab-matnr is not initial.

if count = 0.

count = itab-matnr.

elseif count = itab-matnr

flag = ' '

else

flag = ' x '

count = itab-matnr

endif.

endif.

and the create a command in line items window where give condition if flag = 'x' goto next page.

this will surely work

Former Member
0 Kudos

Hi Neetesh,

In the table node ->Data ->sort criteria give the field name 'MATNR' and select the checkbox 'Event on sort end'. A new node will be displayed for that event. Under this node create a COMMAND node and select 'Go To New Page' checkbox and give the same page no.

Regards,

Vidya.

Former Member
0 Kudos

Thanks its working

former_member480923
Active Contributor
0 Kudos

Inside the Loop of the Internal table in the SF use the begin of Sort - filedname and this will be your at new event of the Smartform, use this event inside the loop give the page break command.

Hope that Helps

Anirban M.

Former Member
0 Kudos

Hi santosh ,

Is it possible to use on change of ot AT new to trigger page break in smartforms.

Former Member
0 Kudos

I am sorry I tght that was a report...

Use 'Alternative' or 'Command'.

Option..

santhosh

Former Member
0 Kudos

hi in the case of smart forms defalty page break is applicable

Former Member
0 Kudos

report xyz...line-count 35.

At new matnr.

If sy-linno(line no) <> sy-linct(linecount).

sy-linno = 35 or try 36.

endif.

endat.

sorry that was for report.

use 'alternative' or 'command'

santhosh

Message was edited by:

Kaluvala Santhosh