Sending  Payslip as PDF

Dear all,
I developed the Report program which will send  payslip as PDF attachement to all employees.i am able to receive the mail along with Payslip as PDF Format.
but i am unable to open  the PDF format.its showing  error message as
"Adobe reader could not open the PDF file because it is either not a supported file or because the file has been damaged (for example it was sent as an email attachment and was not correctly decoded"
Can any one help regarding this issue
Thanks in advance.
Sudheer

Dear Companions,
I would like to contribute on this subject which will be helpful to our SDN Society.
I have developed the program to send the standard remuneration statement thru eMail to the employees in PDF. Its working very fine and employees are very delighted owing to this facility. The code snapshot of sending mail form is as per below.
FORM send_email .
  DATA : g_totrec(4) TYPE n,
         g_ctr(4) TYPE n,
         v_prc TYPE string.
  DESCRIBE TABLE itab[] LINES g_totrec.
  LOOP AT itab.
    g_ctr = g_ctr + 1.
    CONCATENATE g_totrec ' - ' g_ctr ' : Emp. ' itab-pernr  INTO v_prc.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
      EXPORTING
        percentage = 100
        text       = v_prc.
    itab-ctr = 1.
    MODIFY itab TRANSPORTING ctr.
    IF p_ind = 'X'.
      IF itab-usrid_long IS INITIAL.
        itab-mtext = 'eMail-ID Not Found'.
        MODIFY itab TRANSPORTING mtext.
        CLEAR:itab.
        CONTINUE.
      ENDIF.
    ENDIF.
    CLEAR:v_pdf_size,x_payslip,i_return.
    CALL FUNCTION 'BAPI_GET_PAYSLIP_PDF'
      EXPORTING
        employeenumber = itab-pernr
        sequencenumber = itab-seqnr
        payslipvariant = pay_var
      IMPORTING
        return         = i_return
        payslip        = x_payslip
        pdf_fsize      = v_pdf_size.
    IF sy-subrc NE 0.
      itab-mtext = 'Payslip not Generated.'.
      MODIFY itab TRANSPORTING mtext.
      CLEAR:itab.
      CONTINUE.
    ENDIF.
    IF p_save = 'X'.
      CLEAR:data_tab.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer     = x_payslip
        TABLES
          binary_tab = data_tab[].
      CLEAR:fullpath,w_outlen.
      CONCATENATE 'C:\SAP\' itab-pernr '.PDF' INTO fullpath.
      DESCRIBE TABLE objhex LINES w_outlen.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize                  = w_outlen
          filename                      = fullpath
          filetype                      = 'BIN'
          APPEND                        = ' '
          CODEPAGE                      = ' '
          NO_BYTEORDER_MARK             = ' '
         IMPORTING
           FILELENGTH                    = c
        TABLES
          data_tab                      = data_tab[]
          FORMAT_TAB                    =
        EXCEPTIONS
          file_write_error              = 1
          no_batch                      = 2
          gui_refuse_filetransfer       = 3
          invalid_type                  = 4
          no_authority                  = 5
          unknown_error                 = 6.
      IF sy-subrc = 0.
        itab-mtext = 'ePayslip Saved.'.
      ELSE.
        itab-mtext = 'ePayslip Not Saved.'.
      ENDIF.
      MODIFY itab TRANSPORTING mtext.
      CLEAR:itab,docdata,objpack,objtxt,objtxt[],objhex,objhex[],objhex1,objhex[],objpack,objpack[].
      WAIT UP TO 5 SECONDS.
      CONTINUE.
    ENDIF.
Convert OTF to PDF
    CLEAR:x,x1,y,z,w_outlen,tab_lines,objhex1.
    x = v_pdf_size / 255.
    z = v_pdf_size - 255.
    DO x TIMES.
      IF x1 > z .
        EXIT.
      ENDIF.
      objhex1-line = x_payslip+x1(255).
      APPEND objhex1 TO objhex.
      x1 = x1 + 255.
    ENDDO.
    y = v_pdf_size - x1 .
    objhex1-line = x_payslip+x1(y).
    APPEND objhex1 TO objhex.
preparing subject
    CONCATENATE w_endda(6) '-Payslip-(' itab-pernr+0(8) ')- ' itab-atext ' ' itab-ename+0(35) '.' INTO docdata-obj_descr RESPECTING BLANKS.
    docdata-obj_name = 'Pay Slip'.
    docdata-obj_langu = sy-langu.
    CONDENSE itab-atext.
    CONDENSE itab-ename.
    CONCATENATE ' Dear ' itab-atext ' ' itab-ename '.' INTO objtxt RESPECTING BLANKS.
     objtxt = 'Pay Slip.'.
    APPEND objtxt.
    CLEAR:objtxt.
    APPEND objtxt.
     objtxt = docdata-obj_descr.
    objtxt = 'Please find enclosed herewith your Payslip in PDF format.'.
    APPEND objtxt.
    CLEAR:objtxt.
    APPEND objtxt.
    objtxt = 'Have a nice day.'.
    APPEND objtxt.
    CLEAR:tab_lines.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines TRANSPORTING ALL FIELDS.
Write Packing List (Main)
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num   = 0.
    objpack-body_start = 1.
    objpack-body_num   = tab_lines.
    objpack-doc_type   = 'RAW'.
    APPEND objpack.
pack to pdf.
    CLEAR:w_outlen.
    DESCRIBE TABLE objhex LINES w_outlen.
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num   = 1.
    objpack-body_start = 1.
    objpack-body_num   = w_outlen.
    objpack-doc_type   = 'PDF'.
    objpack-obj_name   = 'ATTACHMENT'.
    objpack-doc_size   = v_pdf_size.
    CONCATENATE itab-pernr '.PDF' INTO objpack-obj_descr.
       objpack-obj_descr  = 'payslip.pdf'.
    APPEND objpack.
Create receiver list
    REFRESH reclist.
    CLEAR reclist.
    IF p_adm = 'X'.
      reclist-receiver = admailid.
      TRANSLATE reclist-receiver TO LOWER CASE.
      itab-usrid_long = reclist-receiver.
      reclist-rec_type = 'U'.
      APPEND reclist.
    ELSEIF p_ind = 'X'.
      reclist-receiver = itab-usrid_long.
      TRANSLATE reclist-receiver TO LOWER CASE.
      itab-usrid_long = reclist-receiver.
      reclist-rec_type = 'U'.
      APPEND reclist.
    ENDIF.
Send the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = docdata
        put_in_outbox              = ''
        commit_work                = 'X'
      TABLES
        packing_list               = objpack
        contents_txt               = objtxt
        contents_hex               = objhex
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        document_type_not_exist    = 3
        operation_no_authorization = 4
        parameter_error            = 5
        x_error                    = 6
        enqueue_error              = 7
        OTHERS                     = 8.
    IF sy-subrc NE 0.
      itab-mtext = 'eMail Not Sent.'.
    ELSE.
      itab-mtext = 'eMail Sent.'.
    ENDIF.
    MODIFY itab TRANSPORTING mtext.
    WAIT UP TO 5 SECONDS.
    SUBMIT rsconn01 WITH mode = 'INT' AND RETURN. "This causes all the objects in SOST to be released.
    CLEAR:itab,docdata,objpack,objpack[],objtxt,objtxt[],objhex,objhex[].
  ENDLOOP. "end loop at ITAB
ENDFORM.                    " SEND_EMAIL
Regards,
R R Suthar

Similar Messages

  • Need to customize the text displayed while sending payslip as pdf in mails

    Gurus ,
       monthly we will run a report which will send the payslip as pdf to the employees . Now we need to edit the text that is getting displayed in the mail while we attaching the payslip as pdf and send .
    how to achieve this

    Hi Sarvan
    Go to messages >> communication method , change the field Cover Page Text with ur po number and send. This is a manual process which you will have to do it for each po.
    Now if you want to automate this then you can ask ur abaper to write a small program which will copy the po number to this field. 
    Table Name       NAST
    Field Name       TDCOVTITLE
    Regards
    Rajesh
    Do reward if useful.

  • Need to send Payslip in PDF form

    Dear All,
            I need to convert Payslip as PDF file
            Basically Payslip is of HR-Form and how to pass it as a PDF file.
            Can anyone tell me how to get the OTF format of the payslip.
            Thanks inAdvance,
    Regards,
    Satya.

    Hi,
    Check this link...May be it is useful..
    http://abapcode.blogspot.com/2007/09/hr-human-resource-tutorial.html
    Regards,
    Omkar.

  • Sending payslip as a PDF attachment with an email

    Hi Experts,
    I need to send an email with payslip as a PDF attachment. I wonder how this can be done for country China. The payroll driver program seems doesn't helps to send an email. Can any one tell me, if this can be achieved directly, else will have to write a code for the same.
    Thanks.
    Warm regards,
    Harshad. M

    Hi,
               Here two Z-program needs to be develop.One program is to convert payslip into PDF file & store the PDF file in a folder where you send as an E-Mail.
    Then create a spool request in Remunation statement. Maintain the Mail id's in Inftype-105.
    Develop one Z program which will Send Email with PDF attachment.
    Run this program  the second screen will display where you have to attach the spool request no & the mail ID. Then execute the program to send as email.
    Snita

  • Payslip in PDF through email

    Dear All
    i have written the program for send payslip through email and its working fine
    But problem is that i am not getting the correct format in PDF
    Regards
    Arun

    Hi All
    Plz find my code here which i am using to send Payslip through email, its working fine
    But when i received the email with attachment, PDF is not coming in correct format
    You can see the output of PDF given below after my code
    REPORT  zsendmail.
    TABLES:pa0001.
    DATA : BEGIN OF rgdir OCCURS 0.
            INCLUDE STRUCTURE pc261.
    DATA END OF rgdir.
    DATA : country LIKE t001p-molga VALUE 'IN',
    v_pabrj LIKE t549q-pabrj,
    v_pabrp LIKE t549q-pabrp,
    v_vabrj LIKE t549q-vabrj,
    v_vabrp LIKE t549q-vabrp,
    v_fpper1 LIKE rgdir-fpper,
    v_fpper2 LIKE rgdir-fpper,
    return LIKE bapireturn1,
    *payslip LIKE bapi7004_payslip OCCURS 0 WITH HEADER LINE,
    payslip TYPE xstring,
    *slip LIKE pc408,
    bin_file TYPE xstring,
    pdf_fsize TYPE i,
    x TYPE i,
    x1 TYPE i,
    v_srno LIKE pa0000-pernr.
    DATA BEGIN OF slip OCCURS 0.
            INCLUDE STRUCTURE pc408.
    DATA END OF slip.
    DATA BEGIN OF slip1 OCCURS 0.
            INCLUDE STRUCTURE pc407.
    DATA END OF slip1.
    DATA: BEGIN OF i_pernr OCCURS 0,
      pernr LIKE pa0000-pernr,
    seqnr LIKE hrpy_rgdir-seqnr,
    abkrs LIKE hrpy_rgdir-abkrs,
    fpper LIKE hrpy_rgdir-fpper,
    inper LIKE hrpy_rgdir-inper,
    ipend LIKE hrpy_rgdir-ipend,
    usrid_long LIKE pa0105-usrid_long,
    nachn LIKE pa0002-nachn,
    vorna LIKE pa0002-vorna,
    anred LIKE pa0002-anred,
    ename LIKE pa0001-ename,
    END OF i_pernr.
    DATA result TYPE pay99_result.
    DATA lv_buffer TYPE xstring. " added later
    DATA ihrpy LIKE hrpy_rgdir OCCURS 0.
    DATA whpr TYPE hrpy_rgdir.
    DATA : bt_header TYPE LINE OF hrpay99_bt,
    rt_header TYPE LINE OF hrpay99_rt.
    DATA : objhex LIKE solix OCCURS 0 WITH HEADER LINE,
    objhex1 TYPE solix.
    *************************Added Later
    DATA : objbin LIKE solix OCCURS 0 WITH HEADER LINE,
    objbin1 TYPE solix.
    DATA: y TYPE i ,
    z TYPE i,
    mname TYPE string.
    DATA: mail_attachment_lines TYPE i,
    lv_tablines LIKE sy-tabix.
    DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: i_reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
    wa_reclist TYPE somlreci1 .
    DATA: doc_chng LIKE sodocchgi1,
    l_date(10) TYPE c,
    l_time(8) TYPE c.
    DATA: objhead TYPE soli_tab.
    DATA : w_repid LIKE sy-repid,
    w_dynpro LIKE sy-dynnr.
    SELECTION-SCREEN BEGIN OF BLOCK b1 .
    PARAMETERS : p_bukrs LIKE pa0001-bukrs OBLIGATORY,
                 p_permo LIKE t549q-permo.
    SELECT-OPTIONS:s_date FOR pa0001-begda NO-EXTENSION OBLIGATORY,
                    s_abkrs FOR pa0001-abkrs OBLIGATORY,
                    s_persg FOR pa0001-persg,
                     s_pernr FOR pa0001-pernr.
    SELECTION-SCREEN END OF BLOCK b1.
    LOAD-OF-PROGRAM.
      MOVE sy-repid TO w_repid. MOVE sy-dynnr TO w_dynpro.
      WRITE: sy-datum TO l_date, sy-uzeit TO l_time.
    START-OF-SELECTION.
      PERFORM select_data.
    *& Form SELECT_DATA
    FORM select_data .
      SELECT SINGLE pabrj pabrp vabrj vabrp FROM t549q INTO (v_pabrj,v_pabrp,v_vabrj,v_vabrp) WHERE permo = p_permo AND begda >= s_date-low AND endda <= s_date-high.
      CONCATENATE v_pabrj v_pabrp INTO v_fpper1.
      CONCATENATE v_vabrj v_vabrp INTO v_fpper2.
      CASE v_pabrp.
        WHEN '01'. CONCATENATE 'APRIL' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '02'. CONCATENATE 'MAY' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '03'. CONCATENATE 'JUNE' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '04'. CONCATENATE 'JULY' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '05'. CONCATENATE 'AUGUST' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '06'. CONCATENATE 'SEPTEMBER' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '07'. CONCATENATE 'OCTOBER' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '08'. CONCATENATE 'NOVEMEBR' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '09'. CONCATENATE 'DECEMBER' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '10'. CONCATENATE 'JANUARY' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '11'. CONCATENATE 'FEBRUARY' s_date-high+0(4) INTO mname SEPARATED BY space.
        WHEN '12'. CONCATENATE 'MARCH' s_date-high+0(4) INTO mname SEPARATED BY space.
      ENDCASE.
    hrpy_rgdir table is getting filled once the payroll is run.
      SELECT hrpy_rgdirpernr hrpy_rgdirseqnr hrpy_rgdirabkrs hrpy_rgdirfpper hrpy_rgdirinper hrpy_rgdiripend pa0105usrid_long pa0002nachn pa0002vorna pa0002anred pa0001~ename
      FROM hrpy_rgdir
      JOIN pa0105 ON hrpy_rgdirpernr = pa0105pernr AND subty = '0010'
      JOIN pa0002 ON hrpy_rgdirpernr = pa0002pernr
      JOIN pa0001 ON hrpy_rgdirpernr = pa0001pernr
      INTO CORRESPONDING FIELDS OF TABLE i_pernr
      WHERE inper > v_fpper2
      AND inper <= v_fpper1
      AND fpper > v_fpper2
      AND fpper <= v_fpper1
      AND hrpy_rgdir~pernr IN s_pernr
      AND srtza = 'A'
      AND pa0105~endda >= s_date-high
      AND pa0002~endda >= s_date-high
      AND pa0001~endda >= s_date-high
      AND pa0001~bukrs = p_bukrs
      AND pa0001~abkrs IN s_abkrs
      AND pa0001~persg IN s_persg.
      LOOP AT i_pernr.
        REFRESH : objhex , objpack , objtxt ,i_reclist.
        CLEAR : objhex1, y,z,x1,x, mail_attachment_lines, wa_reclist, doc_chng , objhead.
        CALL FUNCTION 'BAPI_GET_PAYSLIP_PDF'
        EXPORTING
        employeenumber = i_pernr-pernr
        sequencenumber = i_pernr-seqnr
        payslipvariant = 'ZOFF'
        IMPORTING
    RETURN =
        payslip = payslip
        pdf_fsize = pdf_fsize.
        x = pdf_fsize / 255.
        z = pdf_fsize - 255.
        DO x TIMES.
          IF x1 > z .
            EXIT.
          ENDIF.
          objhex1-line = payslip+x1(255).
          APPEND objhex1 TO objhex.
          objbin1-line = payslip+x1(255).
          APPEND objbin1 TO objbin.
         x1 = x1 + 255.
        ENDDO.
        y = pdf_fsize - x1 .
        objhex1-line = payslip+x1(y) .
        APPEND objhex1 TO objhex.
        DESCRIBE TABLE objhex LINES mail_attachment_lines.
        doc_chng-obj_name = 'PAYSLIP'.
        CONCATENATE 'PAYSLIP FOR' mname INTO doc_chng-obj_descr SEPARATED BY space .
        CASE i_pernr-anred.
          WHEN 1.
            CONCATENATE 'Dear' 'Mr.' i_pernr-vorna i_pernr-nachn INTO objtxt-line SEPARATED BY ' '.
          WHEN 2. CONCATENATE 'Dear' 'Ms.' i_pernr-vorna i_pernr-nachn INTO objtxt-line SEPARATED BY ' '.
          WHEN 3. CONCATENATE 'Dear' 'Dr.' i_pernr-vorna i_pernr-nachn INTO objtxt-line SEPARATED BY ' '.
          WHEN OTHERS. CONCATENATE 'Dear' i_pernr-vorna i_pernr-nachn INTO objtxt-line SEPARATED BY ' '.
        ENDCASE.
        CLEAR objtxt.
        APPEND objtxt.
        CONCATENATE 'Please find attached payslip for' mname INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        CLEAR objtxt.
        WRITE: sy-datum TO l_date,
        sy-uzeit TO l_time.
        CONCATENATE 'SAP System generated statement (on' l_date 'At' l_time 'IST) enclosed which does not REQUIRE SIGNATURE.' INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        CLEAR objtxt.
    *--FOR EMPTY LINE APPEND objtxt.
        objtxt-line = 'Regards,'.
        APPEND objtxt.
        CLEAR objtxt.
        objtxt-line = 'TEAM HR.'.
        APPEND objtxt.
        CLEAR objtxt.
        CASE i_pernr-abkrs.
          WHEN 'ZO'.
            objtxt-line = 'ENGLISH LTD'.
          WHEN 'Z2'. objtxt-line = 'ENGLISH LTD'.
          WHEN 'Z8'. objtxt-line = 'ENGLISH LTD'.
          WHEN 'Z5'. objtxt-line = 'ENGLISH LTD'.
          WHEN OTHERS. objtxt-line = ''.
        ENDCASE.
        APPEND objtxt.
        CLEAR objtxt.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES lv_tablines.
        READ TABLE objtxt INDEX lv_tablines TRANSPORTING ALL FIELDS.
        doc_chng-doc_size = ( lv_tablines - 1 ) * 255 + STRLEN( objtxt ).
        CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 0.
        objpack-body_start = 1.
        objpack-body_num = lv_tablines.
        objpack-doc_type = 'RAW'.
        APPEND objpack.
    Pack to PDF.
        objpack-transf_bin = 'X'.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = mail_attachment_lines.
        objpack-doc_type = 'PDF'.
        objpack-obj_name = 'Noti'.
       objpack-doc_size = pdf_fsize.
        objpack-doc_size = mail_attachment_lines * 255.
        objpack-obj_descr = 'payslip.pdf'.
        APPEND objpack.
        CLEAR: wa_reclist.
        REFRESH i_reclist[].
        CLEAR wa_reclist.
        wa_reclist-receiver = i_pernr-usrid_long.
        wa_reclist-rec_type = 'U'.
        APPEND wa_reclist TO i_reclist.
        CLEAR wa_reclist.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
           object_header              =
            contents_bin               = objbin
            contents_txt               = objtxt
            contents_hex               = objhex
           contents_hex               = slip
            receivers                  = i_reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        IF sy-subrc = 0.
            * message i000 with 'Error When Sending the File'.
        ELSE.
          WAIT UP TO 5 SECONDS.
          SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
        ENDIF.
    ENDIF.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE : / 'Sucess','Emp No',
                 i_pernr-pernr.
      ELSE.
        WRITE : 'Not Sucess','Emp No',
                i_pernr-pernr.
      ENDIF.
    ENDFORM. " SELECT_DATA
    PDF Output
    Bank Name Account No. Amount = Earnings - Deductions +
    Adjustment
    UTI002 12112112 24,287.00 = 27,950.00 - 3,663.00
    + 0.00
    |----
    |Earnings |Deductions
    Perks/Other income/Exemptptions/Rebates
    -||--
    |
    Basic Salary
    18,000.00
    Income Tax
    3,663.00 ||Agg of Chapter VI | 122,000.00 |
    Children Education Allow
    1,200.00
    Special Allowance
    5,000.00
    Conveyance Allowance
    3,500.00
    Medical Allowance - T
    250.00
    Total
    27,950.00
    Total
    3,663.00 || | |
    Net Pay
    24,287.00 Recovery 0.00
    Form 16 summary |
    Gross Salary 335,400.00 |
    Balance 335,400.00 |
    Incm under Hd Salary 335,400.00 |
    Gross Tot Income 335,400.00 |
    Agg of Chapter VI 122,000.00 |
    Total Income 213,400.00 |
    Tax on total Income 42,680.00 |
    Tax payable and surcharg 43,960.00 |
    Tax deducted so far 3,663.00 |
    Income Tax 3,663.00 |
    |
    |
    |
    |
    |
    This is a computer generated statement and signature is not required.

  • Error when sending payslip to email

    HI,
    Any  HR-ABAP  Experts please help me my client requirement is sending payslip(smartform) to email , so i convert smartform to pdf and attche it to email for this i write one zprogram  its working means pdf file  attched to email  but getting error to open the document error like this "the file is damaged and could not be repaired ",
    i think getting problem in below FM  PAYSLIP_VARIANT = '   '  , how to write varient for CUSTOM SMARTFORMS.
    CALL FUNCTION 'GET_PAYSLIP'
    EXPORTING
    EMPLOYEE_NUMBER = WA_PERNR-PERNR
    SEQUENCE_NUMBER = WA_RGDIR-SEQNR
    PAYSLIP_VARIANT = '   '
    IMPORTING
    P_INFO          = P_INFO
    TABLES
    P_FORM          = P_FORM.

    Hi Venkat,
    Check OSS note 1430123.
    Hope this will help!
    Muktar

  • Multiple Payslips in PDF Document

    Hi All,
    We have a requirement of getting multiple Payslips in a single PDF document.
    Right now, we use the Java Webdynpro application to display payslips in ESS using a custom HR Form / Smartform.
    This allows us to display a single payslip in PDF format.
    Our requirement is to input a date range, and if that date range has 12 salary statements(assuming each statement is one page), we need a PDF document created with 12 pages in it.
    Upon analysis, I found the class CL_HRXSS_REM used to generate the standard payslips.
    Any guidance, in terms of how I can use this to meet our requirement would be highly appreciated.
    Thanks,
    Saleem

    you can control from here but having multiple payslips ? you mean different smartforms for each scenario??
    You can check these features
    1. HRFOR  - This feature decides whether to use HRFORMS or CEDT forms
    (configured in PE51) for the payslip. If HRFORMS, the name of HRFORM has
    to be mentioned here. If PE51 needs to be used then $CEDT$ should be
    specified.
    2. EDTIN - This should hold the value of the variant to be executed in
    the CEDT program (payslip program). The variant should be proper with
    the with the correct CEDT (payslip) form name and other parameters.
    3. EDPDF - The name of the smartform (standard smartform
    HR_ESS_PAYSLIP_TO_PDF or customer specific form) used to show the output
    in the ESS.
    Or you can check in method L_PRODUCE_FORM
    Default implementation of BADI XSS_REM_INTERFACE is stored in
    class CL_DEF_IM_XSS_REM_INTERFACE. If you go to SE24, enter this
    class and then select method PROVIDE_FILTERED_RGDIR, you will be able to
    see the default implementation regarding the 3 days I mentioned before:
    method IF_EX_XSS_REM_INTERFACE~PROVIDE_FILTERED_RGDIR .
    DATA: newest_date LIKE sy-datum.
    ex_filtered_rgdir] = im_in_rgdir[.
    CLEAR ex_message.
    remove all in-periods where not:
    a) paydt is at the past
    b) paydt is in the near future (3 days)
    newest_date = sy-datum + 3.
    DELETE ex_filtered_rgdir WHERE paydt GE newest_date.
    Please, when implementing this BADI do not forget to mantain the other
    methods as explained in note 901850.

  • How do I create a submit button for my form? I would like it to send the completed PDF to an email address

    Hi everyone,
    I recently upgraded to Adobe XI and I can't find a "submit by email" button for my form. I created a button and tried to set up some actions but, I can only get the button to direct the user to a URL. How do I make it send the completed PDF to our designated company email address? I'm not too familiar with JAVASCRIPTS so I haven't tried that plus I heard it may not work with users with adobe reader.
    Any help would be appreciated.
    Thanks,
    Matt

    Thanks for the input. I think you might have a different version of LiveCycle than the copy I have since it looks a little different. However, I found the answer in Adobe help. I had to type "mailto:" before the email address to indicate it's an email and not a URL. See below.
    To collect form data as attachments to email, type mailto: followed by the email address. For example, mailto:[email protected]

  • Send smartform as pdf attachment through Email on ECC 5.0

    I have been trying hard to do this, but am not able to send attachment. Below are the problems -
    1. If sometimes the mail goes, the attachment is empty.
    2. if i use COMMIT_WORK = 'X' in FM SO_NEW_DOCUMENT_ATT_SEND_API1 , it throws a dump - ' Invalid COMMIT WORK in an update function module.'
    3. If i comment COMMIT_WORK = 'X', it gets executed successfully but, in the program i get a dump 'UC_OBJECTS_NOT_CHAR' exception.
    Can someone suggest, what settings are required in SAP to send smartforms as PDF attachments. Also, please suggest how can i remove the dump. If anyone can give me a working program, it will be very very helpful.
    here is the code,
    REPORT  zrsmfmail.
    TYPE-POOLS: addi.
    Tables defination.
    TABLES : vbpa,vbak,nast, stxl, stxh.
    Data Decleration .
    DATA: lf_fm_name  TYPE rs38l_fnam,
          l_lines TYPE i.
    DATA: output_options TYPE ssfcompop.
    DATA: fcodem TYPE sy-ucomm.
    DATA: i_id LIKE thead-tdid VALUE 'V002',
          i_object LIKE thead-tdobject VALUE 'VBBK' ,
          i_tdname LIKE thead-tdname ,
          i_lang LIKE thead-tdspras VALUE 'E' .
    Internal Table declration.
    DATA: int_vbak LIKE vbak OCCURS 0 WITH HEADER LINE,
          int_vbap LIKE vbap OCCURS 0 WITH HEADER LINE.
    DATA : itline1 LIKE tline OCCURS 0 WITH HEADER LINE .
    DATA: retcode   LIKE sy-subrc.         "Returncode
    DATA: repeat(1) TYPE c.
    DATA: xscreen(1) TYPE c.               "Output on printer or screen
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    i_tline TYPE TABLE OF tline WITH HEADER LINE,
    i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
    i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    lt_att_content_hex LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    wa_objhead TYPE soli_tab,
    w_ctrlop TYPE ssfctrlop,
    w_compop TYPE ssfcompop,
    w_return TYPE ssfcrescl,
    wa_doc_chng TYPE sodocchgi1,
    w_data TYPE sodocchgi1,
    wa_buffer TYPE string,
    Variables declarations
    v_form_name TYPE rs38l_fnam,
    v_len_in LIKE sood-objlen,
    v_len_out LIKE sood-objlen,
    v_len_outn TYPE i,
    v_lines_txt TYPE i,
    v_lines_bin TYPE i.
    DATA: BEGIN OF zlines2 OCCURS 0,
    tline TYPE char255,
    END OF zlines2,
    size TYPE i,
    zdata TYPE sodocchgi1.
    *&      Form  entry
    FORM entry USING return_code TYPE i
                     us_screen TYPE c.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing.
      IF retcode NE 0.
        return_code = 1.
      ELSE.
        return_code = 0.
      ENDIF.
    ENDFORM.                    "ENTRY
    *&      Form  PROCESSING
          text
    FORM processing.
      SELECT *
      INTO   CORRESPONDING FIELDS OF TABLE int_vbak
      FROM   vbak
      WHERE  vbeln = nast-objky.
      LOOP AT int_vbak .
        i_tdname = int_vbak-vbeln .
        SELECT SINGLE * FROM stxh WHERE tdobject = i_object
                                    AND tdname = i_tdname
                                    AND tdid = i_id
                                    AND tdspras = i_lang.
        IF sy-subrc = 0 .
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id       = i_id
              language = i_lang
              name     = i_tdname
              object   = i_object
            TABLES
              lines    = itline1.
          IF sy-subrc NE 0 .
            APPEND itline1 .
          ENDIF .
        ENDIF .
        DESCRIBE TABLE int_vbak LINES l_lines.
        l_lines = l_lines .
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = 'ZORDER_QUOTE'
          IMPORTING
            fm_name            = v_form_name
          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_ctrlop-getotf = 'X'.
        w_ctrlop-no_dialog = 'X'.
        w_compop-tdnoprev = 'X'.
        CALL FUNCTION v_form_name
          EXPORTING
            l_lines            = l_lines
            control_parameters = w_ctrlop
            output_options     = w_compop
            user_settings      = 'X'
          IMPORTING
            job_output_info    = w_return
          TABLES
            int_vbak           = int_vbak
            int_vbap           = int_vbap
            itline1            = itline1
          EXCEPTIONS
            formatting_error   = 1
            internal_error     = 2
            send_error         = 3
            user_canceled      = 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.
        i_otf[] = w_return-otfdata[].
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = size
          TABLES
            otf                   = i_otf
            lines                 = i_tline
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            OTHERS                = 4.
    Fehlerhandling
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Change the PDF format from 132 to 255.
        CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
          EXPORTING
            transfer_bin = 'X'
          TABLES
            content_in   = i_tline
            content_out  = zlines2
          EXCEPTIONS
            err_line_width_src_too_long = 1
            err_line_width_dst_too_long = 2
            err_conv_failed = 3
            others = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Attachment
        REFRESH:
        i_reclist,
        i_objtxt,
        i_objbin,
        i_objpack.
        CLEAR wa_objhead.
        i_objtxt = 'TEST PDF ATTACHMENT'.
        APPEND i_objtxt.
        DESCRIBE TABLE i_objtxt LINES v_lines_txt.
        READ TABLE i_objtxt INDEX v_lines_txt.
        wa_doc_chng-obj_name = 'SMARTFORM'.
        wa_doc_chng-expiry_dat = sy-datum + 10.
        wa_doc_chng-obj_descr = 'SMARTFORM'.
        wa_doc_chng-sensitivty = 'F'.
        wa_doc_chng-no_change = 'X'.
        wa_doc_chng-obj_langu = sy-langu.
        wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
        CLEAR i_objpack-transf_bin.
        i_objpack-head_start = 1.
        i_objpack-head_num = 0.
        i_objpack-body_start = 1.
        i_objpack-body_num = v_lines_txt.
        i_objpack-doc_type = 'RAW'.
        APPEND i_objpack.
    (pdf-Attachment)
        i_objbin[] = zlines2[].
        i_objpack-transf_bin = 'X'.
        i_objpack-head_start = 1.
        i_objpack-head_num = 1.
        i_objpack-body_start = 1.
    Länge des Attachment ermitteln
        DESCRIBE TABLE i_objbin LINES v_lines_bin.
        READ TABLE i_objbin INDEX v_lines_bin.
        i_objpack-doc_size = v_lines_bin * 255 .
        i_objpack-body_num = v_lines_bin.
        i_objpack-doc_type = 'PDF'.
        i_objpack-obj_name = 'SMARTFORM'.
        i_objpack-obj_descr = 'TEST'.
        APPEND i_objpack.
        CLEAR i_reclist.
        i_reclist-receiver = 'abc at aa.com'.
        i_reclist-rec_type = 'F'.
        i_reclist-express = 'X'.
        APPEND i_reclist.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA = WA_DOC_CHNG
          PUT_IN_OUTBOX = 'X'
         commit_work = 'X'
        TABLES
          PACKING_LIST = I_OBJPACK
          CONTENTS_BIN = I_OBJBIN
          CONTENTS_TXT = I_OBJTXT
          RECEIVERS = I_RECLIST
        EXCEPTIONS
          TOO_MANY_RECEIVERS = 1
          DOCUMENT_NOT_SENT = 2
          DOCUMENT_TYPE_NOT_EXIST = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR = 5
          X_ERROR = 6
          ENQUEUE_ERROR = 7
          OTHERS = 8.
        CASE sy-subrc.
          WHEN 0.
          WHEN 1. RAISE too_many_receivers.
          WHEN 2. RAISE document_not_sent .
          WHEN 3. RAISE document_type_not_exist.
          WHEN 4. RAISE operation_no_authorization.
          WHEN 5. RAISE parameter_error.
          WHEN 7. RAISE enqueue_error .
          WHEN OTHERS. RAISE x_error.
        ENDCASE.
    COMMIT WORK.
      ENDLOOP.
    ENDFORM.                    "entry
    Please suggest ASAP, it has come to a critical stage now, a fruitful help will be a great saviour.
    Thanks !

    Hi Guys,
    You can even try this 'CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
          IMPORTING
            bin_filesize          = bin_filesize
            bin_file              = xstring
          TABLES
            otf                   = it_otf_final
            lines                 = it_pdfdata[]
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            err_bad_otf           = 4
            OTHERS                = 5.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            buffer                = xstring
          APPEND_TO_TABLE       = ' '
        IMPORTING
          OUTPUT_LENGTH         =
          TABLES
            binary_tab            = it_pdf
    Use Cl_BSC Class for easy way to send mail.
    Either u can Distribution list Tcode so23.
    This is the way i have implemted .. !

  • IBooks on iPad Sending 1 Page PDF as Part of Message Body in Email

    iBooks is sending 1 page PDF documents inline as photos in email messages and multi page PDF documents as attachments.  How do you get iBooks to send 1 page PDF documents as attachments in an email instead of as a photo inline in the message body?

    I am having the same problem and it is even bigger.
    When opening a 1-page PDF in iBooks and sending it via mail it is sent inline as preview, but the recipient cannot open the file anymore. Also on iPad and iPhone the is no "open in" possible.
    Somehow the mail app does destroy the file. What is going wrong?

  • How can I send a large pdf file (42MB) attachments by icloud ??

    How can I send a large pdf file (42MB) attachment by email in Icloud ???

    That's a bit excessive.  The website http://convert.neevia.com/pdfcompress/ can compress files up to 5 MB in size. You may want to print to PDF single smaller pages, or print the document and scan it one page at a time to PDF, and then use the PDF compress tools to shrink it further.

  • Problems with saving and sending info in PDF form

    Hi,
    I'm trying to make a PDF form in Indesign CS5, exporting it to PDF, opening in Acrobat 9 Pro, and get the form to be able to send the info I type in the fields.
    So far I've had no problems making the form, exporting it, opening it in Acrobat 9 Pro, getting Acrobat 9 Pro to recognize the fields and save the form.
    However, I'd opened the form and filled it out and attached it to an email, and when I got the email, the form was blank.
    How do I get the form to save the data so it can be emailed?
    thanks for any help.
    Phil

    (Acrobat Pro and Pro Extended) Choose Advanced > Extend Features In Adobe Reader.
    I have somehow solved the problem. I tried using the above direction and it seems to have fixed the problem. I don't seem to get the message about not being able to save anymore and can send a completed PDF form that retains the information typed into the form.
    Thanks for all who made suggestions.
    Phil

  • Send pdf file in an email by c# emailer, also sending a completed pdf file to server

    I am trying to achieve two things: First I want to have a submit button on my pdf that sends the completed pdf to a asp.net C# file that sends the completed pdf file, as an attachment to a hard coded email address by a mailer, which i have already created. Then, I want to save the completed pdf file to a directory on the sites server using c# code, so I can make the file name of the pdf one of the fields from the pdf. I have been trying to make this work now for a little over a month with no success. Some insight into this would be GREATLY appreciated.
    Thanks in advance.
    Doug

    You'd probably want the LiveCycle Forms ES product on the server to
    handle the merge from submitted XML data to a PDF on the web. Then you
    could e-mail or store the data.
    Aandi Inston

  • Workflow Step 'In Process'- Send mail with PDF attachment

    Hi,
    have to send mail with PDF attachment.
    I have written a function module with following steps,
    1. Convert SPOOL number to PDF using Function Module 'CONVERT_OTFSPOOLJOB_2_PDF'.
    2. Send mail with PDF attachment using Function Module 'SO_DOCUMENT_SEND_API1'.
    The Function Module is giving required output when tested and called in the report(Background Job).
    When I call this Function Module from Method-> Workflow Task the Workflow steps status is 'In Process' and not ending.
    Could you please help me on this??

    Hi shafath,
    When you try to send mail,  You need to call the function FP_JOB_OPEN before calling the function module to generate the pdf. ( /1B****)  . Is it missing in your code?

  • Send Invoice as PDF Attachment with variable Filename

    Hello!
    We got a requirement from one customer. We should send our invoices as PDF-Attachment via E-Mail but the attachment must have a variable filename. At the Moment we can send invoice as PDF-Attachment but only with a fix filename.
    How can we change the filename in our Adobe Forms?
    Best Regards
    Markus

    Hi Florian!
    Answer 1:
        The original Name is Druckdaten.pdf
    Answer 2:
         Our entry in NAST-NACHA = 1
    Answer 3:
         I can implement some ABAP-Code
    Here some Screenshots:
    Configuration  of printer E-MAIL:
    Best regards
    Markus

Maybe you are looking for

  • IPhoto not showing photos in Modified folder

    I have an issue uploading photos into facebook.  I use iPhoto to manage all of my photos on my iMac, and I created different albums to organize photos.  When I try to upload some photos into my facebook, only the photos in Original folders show up in

  • Query on Coded UI maps namespace

    Hi, I have query on CodedUI's UIMap namespace Lets say I have project "CodedUITestProject4". I am adding one UIMap into it. Bydefault namespace of this UIMap becomes " "CodedUITestProject4.UIMap2Classes" My question is this namespace correct? See the

  • Progress bar (app.thermometer) ???

    Need to display a progress bar using thermomter object while invoking a web service. Lets assume the function loadWebService() has the logic to connect and retrieve data from a web service. Can anyone drop a few lines of code to implement this logic?

  • Random Records are being skipped while uploading data in PSA from CSV File

    Hi Experts, I am facing issue in data uploading in PSA through CSV file, Random Records are being skipped while uploading data in PSA. First Load We have flat file (.txt in CSV format), which contains 380240 Records. We are uploading the flat file da

  • Which app should we use view photos installed by the pen drive.?

    which app shoul we use to view a photo installed by the pendrive?