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

Issue with Smart form

Former Member
0 Likes
652

Hi,

I have a smart form where information regarding order needs to be printed, such that each order should get printed in one new page. I kept condition at the end of Main window such that if current line of order internal table is less than or equal to total lines in order internal table then same page is triggered.

But when I try to print more than one order, first order is printing properly, but for second order header part is being printed in a new page but Main window is not printing and printing gets stopped there.

Please help <removed by moderator>.

Thanks in Advance.

Edited by: Thomas Zloch on Feb 21, 2011 1:56 PM - no ASAP please

4 REPLIES 4
Read only

Former Member
0 Likes
623

try to use event and command combination....write click in a table / loop you will get in the list...

Thanks

Read only

Former Member
0 Likes
623

Hi Subbarao,

Check a few things:

1)There should be 2 pages defined in the smartform.

2) Creation of page 2 is by simple copying the main window of the page 1 into Page 2and any other window as desired.

Can you please explain what do u mean by " condition at the end of the main window".

Additionally,You need to add the condition in the command window by setting a variable and also in the "Genaral Attributes" set Go To New Page as Page2.

Hope this helps.

Thanks,

Varsha

Read only

tushar_shukla
Active Participant
0 Likes
623

I usually implement this kind of requirement ( printing Multiple Invoice,order,shipments etc) by explicitly opening and closing the smart form.

1. First Open the Smartform by calling FM 'SSF_OPEN'


   DATA :control type ssfctrlop .
    
   control-no_open   = 'X'.
    control-no_close  = 'X'.

 CALL FUNCTION 'SSF_OPEN'
     EXPORTING
        control_parameters       = control
   

2. Now call the generated smartform FM .


     LOOP AT ORDER_HEADER...
          call the generated smartform FM.          
    ENDLOOP. 
   

3. Close the smartform by calling FM 'SSF_CLOSE' .

Read only

Former Member
0 Likes
623

Hi,

But when I try to print more than one order, first order is printing properly, but for second order header part is being printed in a new page but Main window is not printing and printing gets stopped there.

Regarding on your query, Follow below code

Firstly create program lines inside your loop, program line should populate additional temp variable. and it shouldbe the first one to populate.

Ex: IF lv_vbeln is initial.

LV_VBELN = vbeln.

ENDIF.

Secondly, Place you command in the first line of your loop to trigger new page, with condition as LV_VBELN NE VBELN.

Display all line items in main window.

At the end of your loop.

IF LV_VBELN NE vbeln.

LV_VBELN = VBELN.

ENDIF.

I hope, It will helps to you.

Regards,

Sekhar