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

one Z program - three smart forms printing.

Former Member
0 Likes
563

Dear SAP All,

I am working to Purchase Order Mass Printing through Z program in which i am using 3 Smart forms . these smart forms will be  processed one by one for single PO No. and after again repeat for next PO No.

The reason  is that i can't create multiple main window in a single smart form and i needed three main window to display PO printout as per client requirement so i am using three smart forms in  z program.

smart form 1   for tax related data ( Summary )

smart form 2   for PO line item

smart form 3   for Header Text, terms of delivery and some term of condition

Now my z program is able to print more than one purchase order at single spool number.

But  problem is that

when i can pass multipal po for printing then for first po no. showing  only pages of smartform3  and for second PO showing pages of smartforms1 and smartforms3.

and i did debug this, i found that data will pass properly through Zprogram to all smartforms.

but i can't understand  that why pages are not showing.

Guide me ........


4 REPLIES 4
Read only

Former Member
0 Likes
526

Hello,

Check following code............

LOOP AT it_tab.

control_parameters-no_dialog = 'X'.
control_parameters-no_open   = 'X'.
control_parameters-no_close  = 'X'.

AT FIRST.
       control_parameters-no_dialog = ' '.
       control_parameters-no_open = ' '.
ENDAT.

AT LAST.
       control_parameters-no_close = ' '.
ENDAT.

CALL FUNCTION fm_sform
       EXPORTING
         control_parameters = control_parameters
       TABLES
         po_item            = it_ekpo.

ENDLOOP.

Regards,

Vj

Read only

Former Member
0 Likes
526

Hi Saurabh,

you could have nested loops in your smartform main window instead of creating 3 smartforms.

if you need further details let me know

Regards,

Yakub Shah

Read only

former_member420878
Active Participant
0 Likes
526

Hi,

Please check sy-pagno while debugging of each smartform.

keep your page no in some local variable inside the form and display that variable as page no.

Thanks.

Read only

arindam_m
Active Contributor
0 Likes
526

Hi,

First you design is a bit complex unnecessarily. You can have all the data in single smartform I think. But as you have done this suggestions from vijay would help. Learn a bit more on spool control parameters before you get on. Should help you.

Cheers,

Arindam