Quantcast
Channel: SCN : All Content - Output Management
Viewing all articles
Browse latest Browse all 1353

Dynamically merging PDF forms in web dypro ABAP

$
0
0

Hi

 

I have posted the same thread in Web dynpro Forum but not able to solve the issue from the responses.. Kindly help.

 

I have a requirement where I have to create various PDF forms dynamically from a web dynpro application and save them.

 

But now clients needs that all the forms genereated dynamically should be merged in one single PDF document dynamically as they generated.

 

I am able to generate PDF document dynamically but I want to know how to merge them into a single PDF document dynamically.

 

For eg,.

Suppose I have to create 3 PDFs dynamically so once I created the first one and it contains 3 pages so while creating next PDF i can set the printing  of second PDF from page four as so on..So that the final PDF created will have all the three PDF content.

 

Below is sample code.

 

 

loop .

//calculating data

lv_xml = lo_adobe->get_wd_context_as_

xml( data_source = lo_node ). //converting data source into XML

 


  "Print form
  CALL FUNCTION lv_funcname
    EXPORTING
       /1bcdwb/docparams  = ls_docparams
      /1bcdwb/docxml     = lv_xml
    IMPORTING
      /1bcdwb/formoutput = fpformoutput
    EXCEPTIONS
      usage_error        = 1
      system_error       = 2
       internal_error     = 3
      OTHERS             = 4.
  IF sy-subrc <> 0.

 

  ENDIF.

 

 

 

  ENDLOOP.

 

  "Close job
  CALL FUNCTION 'FP_JOB_CLOSE'
    IMPORTING
      e_result = ls_result
     EXCEPTIONS
      OTHERS   = 0.
*** saving form as zip***
  zip->add( name = lv_name_str
content = fpformoutput-pdf ).
  zip_xstring = zip->save( ).
************************************

 

the above code is current code ..in this way we are getting one PDF  for the last data.

 

I tried changing and now the code an concatinating all the XML data for various WBS element into one and finally passing it into the FM , below is modified code

 

loop .
//calculating data
lv_xml = lo_adobe->get_wd_context_as_xml( data_source = lo_node ). //converting data source into XML

 

concatenate lv_xml_temp lv_xml into lv_xml_temp in byte mode.

 

  ENDLOOP.

 


  "Print form
  CALL FUNCTION lv_funcname
    EXPORTING
      /1bcdwb/docparams  = ls_docparams
      /1bcdwb/docxml     = lv_xml_temp
     IMPORTING
      /1bcdwb/formoutput = fpformoutput
    EXCEPTIONS
      usage_error        = 1
      system_error       = 2
      internal_error     = 3
      OTHERS             = 4.
  IF sy-subrc <> 0.
   "Close job
  CALL FUNCTION 'FP_JOB_CLOSE'
    IMPORTING
      e_result = ls_result
    EXCEPTIONS
      OTHERS   = 0.
*** saving form as zip***
  zip->add( name = lv_name_str
content = fpformoutput-pdf ).
   zip_xstring = zip->save( ).
************************************

 

this also is not working..

 

 

 

Regards

 

Sumit


Viewing all articles
Browse latest Browse all 1353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>