cancel
Showing results for 
Search instead for 
Did you mean: 

How to print custom documents through custom program

Former Member
0 Kudos

Hi,

I am printing custom documents like Commercial Invoice, Shipper's Letter of Instructions, Shipper's Export Declaration , using communication tab of custom declarations. SInce user wanted output with a changed layout( different from standard), so new Activity messages ( like ZP100 in place of standard P100) are created to call Z forms ( new PDF from created using SFP and called for this Message type). This part is done our fucntional team. This customize message type is calling my custom Z forms. But all these Z forms are not allowing printing of the document from Preview of PDF. Print Icon become disabled in the preview. Used wants to print from preview of PDF itself.

There is a parameter in BADI DOC_PERSONALIZE_BCS method parameter 'NOPRINT', which is passed with value 'X' in the function module to create PDF. SInce this is set to 'X' it is not letting us print from preview.

So, can anyone help me in finding what can I do to get this print enabled from preview. If I need to change this method, then what are the steps and how standard configurations will be changed to call Zprogram in place of standard.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Swati,

The Badi you mentioned should help you, try changing the importing parameter in your local structure and pass this local variable, instead of the imported (IS_outputparams-noprint = 'X' ) to the function below. This is an example, you`ll need to declare data as well :

Method IF_EX_DOC_PERSONALIZE_BCS~PERSONALIZE_PDF_DOC_PDFIF

ls_output_options = is_outputparams.

IF NOT ls_output_options-preview IS INITIAL.

ls_output_options-noprint = ' ' . " Allow printing

ENDIF.

call function '/SAPSLL/PRN_FORM_PROCESS_PDF'

exporting

iv_guid_cuhd = lv_guid_cuhd

iv_function_name = ip_function_name

iv_form_name = ip_form_name

iv_appl_log_handle = ip_application_log

is_output_options = ls_outputparams " put your LOCAL structure here ....

importing

es_formoutput = es_formoutput

es_joboutput = es_joboutput

changing

cs_docparams = cs_docparams

exceptions

output_canceled = 1

others = 2.

Hope this helps,

Regards,

Branislav Petricek

Former Member
0 Kudos

Thanks Branko,

only problem is that I am not calling Z program to print form, It is printed by standard program. So, it seems that only solution for me to to implement / Enhance this BADI to change method.

Thanks for your help.

Answers (0)