on 09-28-2011 6:01 AM
Is it possible generate pdf into xstring without spool? The task is mass generating pdf files, about 100 per day. Any idea?
Hi,
I think it is not mandatory to open a job in order to get a PDF form as xstring.
Just call the FM for your form, and I think you will find the raw pdf in FPFORMOUTPUT-PDF.
If not, try using FP_JOB_OPEN with parameter GETPDF = X and NOPRINT = X.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In normal ABAP, I don't think this is possible since there are 4 standard steps.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' " to get your generate FM name in ls_function
CALL FUNCTION 'FP_JOB_OPEN'
CALL FUNCTION ls_function " returns your xstring
CALL FUNCTION 'FP_JOB_CLOSE'
I'm not sure, but there may be a parameter you can pass to CALL FUNCTION 'FP_JOB_OPEN' to keep it from storing in the spool. You can check there first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, here is the one variant, but i think it also create any jobs, work for me faster then standart algoritm pdf output:
1. We need two files XFD with the outputdata and XDP of our PDF Form.
2. XFD we can generate by transformation.
3. And the code:
DATA: l_fp TYPE REF TO if_fp,
l_pdfobj TYPE REF TO if_fp_pdf_object,
l_xft TYPE xstring,
l_xfd TYPE xstring,
pdfresult TYPE xstring,
l_dest TYPE rfcdest.
MOVE cl_fp=>get_ads_connection( ) TO p_dest.
* get FP reference
l_fp = cl_fp=>get_reference( ).
TRY.
* create PDF Object
l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).
* set template
l_locale = p_loc.
l_pdfobj->set_template( xftdata = l_xft locale = l_locale ).
* set data
l_pdfobj->set_data( formdata = l_xfd ).
* tell PDF object to create PDF
l_pdfobj->set_task_renderpdf( ).
* execute, call ADS
l_pdfobj->execute( ).
* get result
l_pdfobj->get_pdf( IMPORTING pdfdata = pdfresult ).
ENDTRY.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.