Skip to Content
author's profile photo
Former Member

Converting Payslip With Retro Value To PDF Formet

Hi Frnds ,

I have to convert payslip (retro value) to PDF form and then i have to do

Display Results

Send Mail

Download In PDF Form .

(OR)

1) I Am using FM Get_payslip . I want to convert the output of this FM into pdf form.

2) The Function Module "Convert_payslip_to_pdf"

after using above two FM i m getting some output but it is not correct.

3) BAPI_GET_PAYSLIP_PDF is giving me "pdf string" but i need to convert into pdf file .

4) I checked with the function module "Convert_OTF " & "Convert_OTF_To_PDF" .

I have confusion that what value i have to pass there , Plz check it out.

This is my problem mates .

Almost all post i checked but didnt got pakka Ans .

Plz give me some useful answers,

<removed by moderator>

Thanx & Regards

Mr Biswas

Edited by: Thomas Zloch on May 3, 2011 3:14 PM - please do not ask for ...

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on May 03, 2011 at 12:05 PM

    Hi,

    You can use below smartform will convert to pdf and downloaded into some file.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'ZFORM'

    • VARIANT = ' '

    • DIRECT_CALL = ' '

    IMPORTING

    fm_name = w_fmodule

    • EXCEPTIONS

    • NO_FORM = 1

    • NO_FUNCTION_MODULE = 2

    • OTHERS = 3

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    w_cparam-no_dialog = 'X'.

    w_cparam-preview = space. " Suppressing the dialog box

    " for print preview

    w_cparam-getotf = 'X'.

    w_outoptions-tddest = 'LP01'.

    CALL FUNCTION w_fmodule

    EXPORTING

    • ARCHIVE_INDEX =

    • ARCHIVE_INDEX_TAB =

    • ARCHIVE_PARAMETERS =

    control_parameters = w_cparam

    • MAIL_APPL_OBJ =

    • MAIL_RECIPIENT =

    • MAIL_SENDER =

    output_options = w_outoptions

    • USER_SETTINGS = 'X'

    IMPORTING

    • DOCUMENT_OUTPUT_INFO =

    job_output_info = t_otf_from_fm

    wa_final = wa.

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    FORMAT = 'PDF'

    MAX_LINEWIDTH = 132

    • ARCHIVE_INDEX = ' '

    • COPYNUMBER = 0

    • ASCII_BIDI_VIS2LOG = ' '

    • PDF_DELETE_OTFTAB = ' '

    IMPORTING

    BIN_FILESIZE = W_BIN_FILESIZE

    • BIN_FILE =

    TABLES

    OTF = T_OTF

    LINES = T_PDF_TAB

    EXCEPTIONS

    ERR_MAX_LINEWIDTH = 1

    ERR_FORMAT = 2

    ERR_CONV_NOT_POSSIBLE = 3

    ERR_BAD_OTF = 4

    OTHERS = 5

    .

    IF SY-SUBRC <> 0.

    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    *WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    DATA:G_FULL_PATH TYPE STRING.

    CONCATENATE P_DOWN '\' WA-EMP_NAME '_' WA-EMP_ID '_' P_MONTH '_' P_YEAR INTO G_FULL_PATH.

    CONCATENATE G_FULL_PATH '.pdf' INTO G_FULL_PATH.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    BIN_FILESIZE = W_BIN_FILESIZE

    FILENAME = G_FULL_PATH

    FILETYPE = 'BIN'

    TABLES

    DATA_TAB = T_PDF_TAB.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CLEAR:WA,T_PDF_TABt

    Add comment
    10|10000 characters needed characters exceeded