Skip to Content
author's profile photo Former Member
Former Member

How to print custom documents through custom program

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2011 at 10:25 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.