‎2006 Sep 11 11:53 AM
Hi All,
I want to create a remote enable function module which converts the employee's paylip to pdf file and store this file in a folder on the application server.
How can i do this please guide.
Rewards will be given for suitable answer.
Regards,
Bharat Mistry.
‎2006 Sep 11 11:55 AM
* get raw version of payslip
call function 'GET_PAYSLIP_SUBMODULE'
exporting
employee_number = i_tab-pernr
sequence_number = hrpy_rgdir-seqnr
payslip_variant = 'PAYSLIP' "PC00_M40_CEDT
importing
return = return
p_info = p_info
tables
p_form = p_form.
* any errors occured
check return is initial.
* get list of indices
loop at p_form where linda eq f__cmd-newpage and
ltype eq f__ltype-cmd.
p_index-index = sy-tabix.
append p_index.
endloop.
p_idx = 1.
refresh p_p_form.
append lines of p_form from p_idx to p_index-index to p_p_form.
p_idx = p_index-index.
<b>* create list
export p_p_form to memory id '%%_P_FORM_%%'.
export p_info to memory id '%%_P_INFO_%%'.
submit rpcedt_list_to_memory exporting list to memory and return.</b>
based on the Ur requirement ? check this code which gives the payslip Script format i.e nothing but output of the payslip.
here u can do two things
1.Convert this raw data into PDF as ravi said , by using Fms
2.or what u can do is ,Write these data into Application server.Whenever u want the data ? just read this data and convert into PDF.
Regards
Prabhu
‎2006 Sep 11 11:55 AM
* get raw version of payslip
call function 'GET_PAYSLIP_SUBMODULE'
exporting
employee_number = i_tab-pernr
sequence_number = hrpy_rgdir-seqnr
payslip_variant = 'PAYSLIP' "PC00_M40_CEDT
importing
return = return
p_info = p_info
tables
p_form = p_form.
* any errors occured
check return is initial.
* get list of indices
loop at p_form where linda eq f__cmd-newpage and
ltype eq f__ltype-cmd.
p_index-index = sy-tabix.
append p_index.
endloop.
p_idx = 1.
refresh p_p_form.
append lines of p_form from p_idx to p_index-index to p_p_form.
p_idx = p_index-index.
<b>* create list
export p_p_form to memory id '%%_P_FORM_%%'.
export p_info to memory id '%%_P_INFO_%%'.
submit rpcedt_list_to_memory exporting list to memory and return.</b>
based on the Ur requirement ? check this code which gives the payslip Script format i.e nothing but output of the payslip.
here u can do two things
1.Convert this raw data into PDF as ravi said , by using Fms
2.or what u can do is ,Write these data into Application server.Whenever u want the data ? just read this data and convert into PDF.
Regards
Prabhu
‎2006 Sep 12 7:28 AM
Hi Prabhu,
I seems that your code will help me. Can you just tell me the type of f__cmd-newpage, f__ltype-cmd and p_index?
Regards,
Bharat Mistry
‎2006 Sep 11 11:55 AM
check this program it converts and download the sapscript into PDF.
<b>RSTXPDFT4.</b>
and transaction <b>CG3Z</b> upload it into application server.
‎2006 Sep 11 11:56 AM
hi,
CONVERT_OTFSPOOLJOB_2_PDF
converts a OTF spool to PDF (i.e. Sapscript document)
regrds
anver
‎2006 Sep 11 11:58 AM
I think you can use the bapi BAPI_GET_PAYSLIP which Generates Remuneration Statement for Employee in SAPscript Format.
Then you can pass the form name to HRFORMS_CALL_PDF to get the pdf form for the script.
Regards,
Ravi
‎2006 Sep 11 12:11 PM
Hi Ravi,
The fm BAPI_GET_PAYSLIP returns the payslip in sapscript fomrat but how can i store it as sapscript and pass its name to the fm HRFORMS_CALL_PDF?
Regards
Bharat Mistry
‎2006 Sep 11 12:20 PM
the bapi BAPI_GET_PAYSLIP will return a tables parameter: PAYSLIP.
This will be in otf format.
then you can convert otf data into pdf using the fm:
CONVERT_OTF_2_PDF
then you can store it in the application server using
open dataset/transfer /close dataset statements.
regards,
ravi
‎2006 Sep 11 12:07 PM
Hi Bharath,
Check out the programs in package STXD, hope you get a program that suits your requirement there.
Cheers..
Santosh.
‎2006 Sep 11 12:11 PM
hi use this fm CONVERT_ABAPSPOOLJOB_2_PDF.
U can also use the fm CONVERT_OTFSPOOLJOB_2_PDF to convert otf to pdf.
Regards,
Ram