cancel
Showing results for 
Search instead for 
Did you mean: 

Save HRFORMS data to PDF

Former Member
0 Kudos

Guru's,

I created a payslip via HRFORMS and it works just fine.

But know, the second step is, is that I need to start HRFORMS from another program and save the result of HRFORMS directly in a PDF-file.

I know how to do this for SMARTFORMS, but for HRFORMS I don't know how to start... (you've the problem that you need to have the object HRDATA filled in)

Anybody an idea?

greetings

Tom

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

altouth this question is rather old you can do that by using something like this:

CALL FUNCTION 'HRFORMS_CALL_INIT'
       EXPORTING
         hrform_name = ld_hrform
         begin_date  = ld_begda
         end_date    = ld_endda
       IMPORTING
         form_object = lo_hrform
       EXCEPTIONS
         form_error  = 1
         OTHERS      = 2.

CALL FUNCTION 'HRFORMS_CALL_PERNR'
       EXPORTING
         form_object        = lo_hrform
         pernr              = ld_pernr
         result_list        = lt_result_list[]
         molga              = ld_molga
         rgdir              = lt_rgdir
       EXCEPTIONS
         form_error         = 1
         payroll_read_error = 2
         reject             = 3
         no_form            = 4
         OTHERS             = 5.

CALL FUNCTION 'HRFORMS_CALL_PDF'
   EXPORTING
     form_object = lo_hrform
     "form_object_list = form_object_list
   IMPORTING
     pdf_xstring      = ls_pdf
   EXCEPTIONS
     form_error       = 1
     OTHERS           = 2.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
     EXPORTING
       buffer        = ls_pdf
     IMPORTING
       output_length = bin_size
     TABLES
       binary_tab    = pdf_data.