cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Invoice Printing in SF

Former Member
0 Kudos

Dear Experts,

I have a problem printing SMARTFORM. I have created a driver program in which i am doint the whole logic. I am not doing any coding in the Smartform. I have passed my header and item level details into 2 Internal tables which i am passing to smartform as shown below

FORM CALL_FORM .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME                 = formname
 IMPORTING
   FM_NAME                  = fm_name
          .
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION FM_NAME
  TABLES
    TTAB                       = TTAB
    ATAB                       = ATAB
 EXCEPTIONS
   FORMATTING_ERROR           = 1
   INTERNAL_ERROR             = 2
   SEND_ERROR                 = 3
   USER_CANCELED              = 4
   OTHERS                     = 5
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.

In the smartform i have passed the above Tables in FORM INTERFACE.

In GLOBAL INTERFACE i have defined a work area for my item details table.

In the Smartform i am looping only my ITEM DETAIL DATA in the MAIN WINDOW.

The problem is in SELECTION-SCREEN i give document number from say 001 to 005.

Normally when you give a print preview for multiple documents you get all the documents one below the other in the Preview. It will show you like "PAGE 001 of 005".

but in my case it is showing first page. After that when i click BACK ARROW it goes to the second document and then again click on BACK ARROW it goes to third document and so on...

Also when i print it only prints the document which is there on the page instead of all the 5 documents.

I hope i have been successful in presenting my case to you. Can anyone please suggest how to get through this problem??? It is very critical requirement.

Please note that the program was earlier created in SAPSCRIPT for preprinted stationery. now they are discontinuing it and hence we recreated it in SmartForm.

Regards,

JMN

Edited by: jiteshmnair on Jul 28, 2009 12:52 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try giving page break after end of each invoice

Answers (3)

Answers (3)

Former Member
0 Kudos

Used SSF_OPEN SSF_CLOSE and in between but CALL FM_NAME in LOOP and into spool

Former Member
0 Kudos

Hi,

Dont use these FMs like SSF_OPEN and SSF_CLOSE and dont call CALL FM_NAME in LOOP.

This concept works only in sapscript. In smartforms you need to call only two FMs in this way.

1. Call FM. SSF_FUNCTION_MODULE_NAME.

it will generate the function module name for the created smartform and store that into FM_NAME.

2. Then call the generated function module name and replace that with FM_NAME. and pass the internal tables in the appropriate paramenters.

and remain other things unchanged.

Hope it will help you.

Regards

Former Member
0 Kudos

hi jiteshmnair,

kindly check the general attributes of the last page of your smartforms. the next page of your last page should be the last page itself.

br

ranilo

Former Member
0 Kudos

You may have to supress the print preview option, let the form run in the background for all the pages and finally see the output in the spool.