Application Development 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: 

VF31 print invoices in multiple spool

Former Member
0 Kudos

Hello, Experts!

I have a problem in spool when executing the Tcode VF31.

I found that when Edit->Printer default-> 'Print immediately' is ticked, It is creating multiple spool request for multiple invoices.

And when the attribute is unticked, the invoices will in one spool request.

In my requirement, one spool request should be created for one invoice without print immediately. Please help me in this!?

Many thanks!

Regards,

May.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Thanks for all your reply. The problem was solved.

The enhancement need to be added into Processing Program of Output Type as below screenshot.

1. Find out the processing program. (T-code: NACE or Table: TNAPR)

2. Add implicit enhancement at the end of processing

program RLB_INVOICE->FORM SET_PRINT_PARAM

IF (condition)

    cs_composer_param-tddest     = ls_constant-zz_con_value." Output Device
    cs_composer_param
-tdnewid  = lc_x.    " New Spool Request
    cs_composer_param
-tdimmed = space" Print immediately cannot be set
    cs_composer_param
-tddelete  = lc_x.   " Delete after print
    cs_composer_param
-tdcopies = space. " Number of copies|single.

ENDIF.

16 REPLIES 16

Former Member
0 Kudos

Hi,

Can you check your communication settings! this is relavent to your print settings! By the way are you using the custom print program or standard?

0 Kudos

hi guy,

Thanks for your response.

Actually I want to get the invoices' page, then sort in specify order, then print out. So I don't want to print immediately.

I created an implicit Enhancement and using FM 'RSPO_OUTPUT_SPOOL_REQUEST' to print spool request.

Can you point out how to set 'dispatch time'?

0 Kudos

Hi May,

In the driver program for the output type used, while using CALL FUNCTION <SF name>,

Pass 'X' to the exporting parameter “User_Parameters”. this makes the form to print irrespective of print immediately.


Please Refer : http://scn.sap.com/docs/DOC-48710


Thanks,

Anil

0 Kudos

Hi Anil,

Thanks for your response.

In VF31, there has a setting about print immediately or not. And It's solved.

My problem is how to generate one spool request for one invoice when don't print immediately.

0 Kudos

Hi Kiran,

I saw the 'Dispatch time' is already set as 'Send with application own transaction'.

But it seems it's not useful. All the invoices was in one spool request.

0 Kudos

Hi,

That was I thought in my initial reply! However we need to do it program, searching from my side!

Former Member
0 Kudos

Hi May,

It is not possible via configuration. Have to be done programmatically.

Thanks

Leonard

0 Kudos

Hi May,

Further add to my earlier comment. You might want to refer to the message below which come with sample codes.  Nevertheless, tcpo-tdnewid = 'X' is value you need to create a new spool request.

http://scn.sap.com/message/5129785#5129785

Thanks

Leonard

0 Kudos

Hi,

Yes, you are right! but how he can link with the invoice number with the spool generation! if he is using the customized program can do it for each invoice to new spool id!

I guess, since he is using the standard program!

0 Kudos

My guess is that she is not using standard program. well, else she do not have to go through extra effort to "blank" out the Output Type and Descriptions.

0 Kudos

if this is the case pass the new ITCPO-NEWTDID for each invoice in the program

0 Kudos

Hi Leonard & Kiran,

I am using standard program(VF31) to generate SPOOL request.

In standard program, the spool request will be generated by FM

WFMC_MESSAGE_SINGLE.

CALL FUNCTION 'WFMC_MESSAGE_SINGLE'

       
EXPORTING

          pi_nast 
= nast

       
IMPORTING

          pe_rcode
= rcode.

0 Kudos

Hi May,

We are actually referring to the print program assigned to the output type.  E.g. RVADIN01.

Thanks

Leonard

Former Member
0 Kudos

Thanks for all your reply. The problem was solved.

The enhancement need to be added into Processing Program of Output Type as below screenshot.

1. Find out the processing program. (T-code: NACE or Table: TNAPR)

2. Add implicit enhancement at the end of processing

program RLB_INVOICE->FORM SET_PRINT_PARAM

IF (condition)

    cs_composer_param-tddest     = ls_constant-zz_con_value." Output Device
    cs_composer_param
-tdnewid  = lc_x.    " New Spool Request
    cs_composer_param
-tdimmed = space" Print immediately cannot be set
    cs_composer_param
-tddelete  = lc_x.   " Delete after print
    cs_composer_param
-tdcopies = space. " Number of copies|single.

ENDIF.

0 Kudos

Hy Sir, what position we need to add this code. Please tell the exact position to implement that code.

I am facing issue with user. I need to implement that logic.

Can you please provide that exact logic.

Please send code. And where to add it.

mohit_johri1
Explorer
0 Kudos

Please do as below

Before calling the smartform FM first time :

     control_paramaters-no_close = 'X'.

     control_paramaters-no_open = space.

Before calling the smartform FM last time:

     control_paramaters-no_close = space.

     control_paramaters-no_open = 'X'.

It will force the program to create single spool for all the form prints.