cancel
Showing results for 
Search instead for 
Did you mean: 

control the default pdf file name generated when saving

Yasin
Active Participant

Hi,

how can i control the default pdf file name generated (automatically) and change it as per my requirement

am using ABAP code and FM to generate the adobe form :

CALL FUNCTION 'FP_JOB_OPEN'

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

former_member259807
Active Participant

Those 2 function modules do not actually generate the adobe form.

Are you using getpdf in the output parameters when calling the actual form? Please refer to the next wiki:

Adobe print and download

Yasin
Active Participant
0 Kudos

Hi, Wallagh

am using

DATA:       fp_outputparams   TYPE sfpoutputparams. 

CALL FUNCTION 'FP_JOB_OPEN'                   "& Form Processing: Call Form
  CHANGING
    ie_outputparams = fp_outputparams
  EXCEPTIONS
    cancel          = 1
    usage_error     = 2
    system_error    = 3
    internal_error  = 4
    OTHERS          = 5.
IF sy-subrc <> 0.
*            <error handling>
ENDIF.

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'           "& Form Processing Generation
  EXPORTING
    i_name     = 'ZPUR_ORDER'
  IMPORTING
    e_funcname = fm_name.
IF sy-subrc <> 0.
*  <error handling>
ENDIF.

fp_docparams-langu   = 'E'.
fp_docparams-country = 'US'.

CALL FUNCTION fm_name
  EXPORTING
   /1BCDWB/DOCPARAMS        = fp_docparams
    HEADER                   = header
    ITEMS                    = itab
  "XSTRING                  =
*   LOGO                     =
   "STRING                   =
* IMPORTING
*   /1BCDWB/FORMOUTPUT       =
* EXCEPTIONS
*   USAGE_ERROR              = 1
*   SYSTEM_ERROR             = 2
*   INTERNAL_ERROR           = 3
*   OTHERS                   = 4
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
<br>
former_member259807
Active Participant
0 Kudos

OK. As you can see in the Wiki i'd posted, the getpdf parameter can be found in the fp_outputparams.

Next to this, add the importing parameter for the call fm_name (see wiki), call the job_close and download the file to the name and location you like.

So the main difference is that you do not let standard SAP handle the pdf storage, but you take control yourself.

If you do not want this, please check if this will help you.

Yasin
Active Participant
0 Kudos

Hi, B. Wallagh

my requirement exactly is to make the PDF file name generated = PO No
incase the user choice was to save it not to print.

in other words to replace the default name generated by the system with another default one
let us say: '100000013.pdf'

i went through the links, but i still don't which parameter is holding the file name so i can replace.

Regards

former_member259807
Active Participant
0 Kudos

For option 1 where you control the download yourself, there is no parameter for the filename. You will set the parameter for basically retrieve the pdf file instead of "printing" it (in your case: set fp_outputparams-getpdf to X or abap_true). This will return the output in /1BCDWB/FORMOUTPUT. This table you can then use to do a download to a server or presentation server in old school abap.

If you do not want to do this, go see if option 2 works for you. Again the link: download adobe forms webdynpro

0 Kudos

Hi Yasin,

I have exactly the same requirement as you : change the default PDF file name with the purchase order number.

With the use of outputparams-getpdf = X

we loose the standard form preview...

Did you find a solution ?

Best regards

Accepted Solutions (0)

Answers (0)