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

Web Dynpro output downloaded to PDF using Adobe Forms

Former Member
0 Likes
857

Hi Eeveryone,

My requirement is as follows:

1) User enters one parameter in a Web Dynpro screen and clicks a Submit button.

2) The system then calculates some parameters as per a report layout.

3) The system then prompts the user for a download location.

4) The report is then downloaded in PDF format.

I have presently developed the Web Dynpro screen, and on the button click event, I have performed the calculations.

I have also designed an Adobe form as per the report layout.

Now, I'm not sure how I must proceed: how do I call my Adobe Form and pass the calculated parameters to it, and then trigger the PDF download without displaying the form? I am a bit new to Dynpros and Adobe Forms as such, so please suggest a suitable approach.

Kind Regards,

Shailesh.

Hi Eeveryone,

My requirement is as follows:

1) User enters one parameter in a Web Dynpro screen and clicks a Submit button.

2) The system then calculates some parameters as per a report layout.

3) The system then prompts the user for a download location.

4) The report is then downloaded in PDF format.

I have presently developed the Web Dynpro screen, and on the button click event, I have performed the calculations.

I have also designed an Adobe form as per the report layout.

Now, I'm not sure how I must proceed: how do I call my Adobe Form and pass the calculated parameters to it, and then trigger the PDF download without displaying the form? I am a bit new to Dynpros and Adobe Forms as such, so please suggest a suitable approach.

Kind Regards,

Shailesh.

4 REPLIES 4
Read only

JerryWang
Product and Topic Expert
Product and Topic Expert
0 Likes
755

Hello Shailesh,

as you have already developed an Adobe form, things are easier now. You can generated the PDF with the calculated result as parameters by the following codes:

lf_formname = '/SF0A0001/PF_BADI_LOG'.------specify your own template name here
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name               = lf_formname
        IMPORTING
          e_funcname           = ls_function
          e_interface_type     = fp_interfacetype.
  fp_outputparams-nodialog = abap_true.
  fp_outputparams-noprint = abap_false.
  fp_outputparams-getpdf = abap_true.
  CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
      ie_outputparams = fp_outputparams
    EXCEPTIONS
      cancel          = 1
      usage_error     = 2
      system_error    = 3
      internal_error  = 4
      OTHERS          = 5.
  CLEAR: fp_docparams.
  fp_docparams-fillable = abap_false.
  CALL FUNCTION ls_function
    EXPORTING
        /1bcdwb/docparams = fp_docparams
        error_log = lt_input --------------------- define your own parameter in your template interface and pass them here
        user_name = sy-uname ---------------
        work_mode = lv_work_mode --------
    IMPORTING
      /1bcdwb/formoutput = ls_fp_result.
  lv_pdf = ls_fp_result-PDF.-------this is binary data of generated PDF

then you can bind the lv_pdf to your webdynpro form control, then in the runtime when the webdynpro page is rendered, the PDF will be generated and displayed there. And there is a built-in button "Save" which enables users to specify a local store location and download the PDF, you needn't to develop that functionality yourself.

Hope this can help.

Best Regards,

Jerry

Read only

Former Member
0 Likes
755

Hello Jerry,

>then you can bind the lv_pdf to your webdynpro form control,

could you describe this step in more details? I put an "InteractiveForm" element in a view`s container, but I cannot understand which element`s property I should use for binding.

Read only

Former Member
0 Likes
755

I understood!

The property'` name is "pdfSource". The next properties: "dataSource" and "templateSource" must be empty!

Read only

chengalarayulu
Active Contributor
0 Likes
755

Hi Jerry,

As you said, using "Save" option we can provide the path. But in our requirement, there are lot of pdf files to download, in this situation we need not to Click Save again and again. We need to write Own "Save" functionality passing "Path" i.e. 'C:\Profiles'. Can you please help us on this.