cancel
Showing results for 
Search instead for 
Did you mean: 

how can i trigger new page for new po no

Former Member
0 Kudos

Hi abap gurus,

present iam working on a requirement that i have to print 5

purchase order details using smartform .

Here iam displaying it on main window.

What iam requsting is i want to print 1st po in first page with item details

2nd po in next page with item details

3rd po in other next page with item details

-


ie, for each new po i have to trigger new page -


can anybody give solution for this one.......

best regards,

phani.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In SMART FORMS, when you are using LOOP node create PROGRAM LINES under LOOP node where you check whether New PO number encountered.

IF itab-po_no NE w_po_no. 
  move itab-po_no to w_po_no.
  w_flag = 'X'.      " set flag
ENDIF.

when w_flag is 'X', then call COMMAND node to trigger new page.

Hope you understand.

Thanks,

Phani Diwakar.

Former Member
0 Kudos

Hi phani,

Thanks for your fast reply can you please explain in detail

ie what iam not understanding is here i had two pages and

i want to trigger new page when new po

So where i have to write this code?? can you

please explain in detail.

regards,

phani.

Former Member
0 Kudos

Hi,

suppose you have data in the internal table itab in SMART FORMS.

create node LOOP in MAIN WINDOW.

under this LOOP node, create PROGRAM LINES.

There you have to write the code.

create COMMAND node where in CONDITION tab, write w_flag = 'X'.

and in GENERAL ATTIBUTE give the next page .

If you have any doubt ask me.

Thanks,

Phani Diwakar.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi phaneendra punukollu,

In your driver program do like this

loop po_header.

call Smartform with po_header and wa_items.

end loop.

or

loop po_header.

on change po_header-banfn.

call smartform with po_header and wa_items.

endon.

endloop.

Regards,

sg.