on 05-04-2007 11:53 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi santosh ,
Is it possible to use on change of ot AT new to trigger page break in smartforms.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.