Payslip Function

Hi all,
Plz help me out to sort out this issue.
For generation of Payslip, I use function 'GET_PAYSLIP'.
I passed all the importing parameters as well as exporting parameters. I get the result also, but it gives me only current period payslip, eventhough i passed the perfect SEQNR in function. Does anybody have solution for it??? or any function module or any class->method. If u have please tell me how to use that.
Thanks & Regards,
Sagar

Hi Ashish,
    I have used Get_Payslip Function Module to get Pay Slip in Internal table. But After that how to send payslip to email id. How to convert that internal table data in OTF format. Please please tell me the procedure.I am finding on SDN but not getting how to do.
Thanks.
Pradip Pawar

Similar Messages

  • ESS Payslip Functionality

    Hello Community,
    Please assist a customer on the following questions:
    A) On ESS Paylist there is the link "Show Overview". When clicking on the link it will expand and provide a list
    with previous remuneration statements. Is it possible that this link/list is shown in expanded status per default(in standard this link/list is collapsed)?
    B) Is it possible to pick the form depending on the period that is being printed?
    Thank you all.

    Mauricio Ghem wrote:
    > Hello Community,
    >
    > Please assist a customer on the following questions:
    >
    > A) On ESS Paylist there is the link "Show Overview". When clicking on the link it will expand and provide a list
    > with previous remuneration statements. Is it possible that this link/list is shown in expanded status per default(in standard this link/list is collapsed)?
    >
    > B) Is it possible to pick the form depending on the period that is being printed?
    >
    > Thank you all.
    ad B.)
    Yes it is possible. For the solution you need two things.
    (Implicit) Enhancement to class CL_HRXSS_REM, Method L_SET_CURRENT_PAYSLIP
    ENHANCEMENT 1  ZPESS_ENH_REM_VDATE.    "active version
    * INS ABNMK190510
      " Der aktuelle Gehaltsnachweis (Index) ist für Auswertung in
      " Merkmal HRFOR zu sichern
      data lo_rem_vdate type ref to zp_cl_ess_rem_vdate_api.
      lo_rem_vdate = zp_cl_ess_rem_vdate_api=>get_instance( ).
      lo_rem_vdate->set_current_period_indx( a_frontend_index ).
    ENDENHANCEMENT.
    This implementation just stores the index of the current selected period in a attribute of my own class (singleton).
    Using a program in feature HRFOR iinstead of the static HRForms return parameter
    *& Report  ZPA_PAYSLIP_HRFOR
    *& Report für das Merkmal HRFOR (Gehalstnachweis)
    report  zpa_payslip_hrfor.
    *&      Form  EXT_CALL_F
    *       text
    *  -->  NAMEN        text
    *  -->  STATUS       text
    *  -->  PME95        PME95
    *  <-->  BACK        text
    form ext_call_f using namen back status pmehf structure pmehf.
      " INS ABSMK190510
      data lo_rem_vdate type ref to zp_cl_ess_rem_vdate_api.
      data lv_hrform type hrf_name.
      " Handler ermittelt
      lo_rem_vdate = zp_cl_ess_rem_vdate_api=>get_instance( ).
      " Formular ermitteln
      lv_hrform = lo_rem_vdate->get_form( ).
      back = lv_hrform.
    endform.                    " EXT_CALL_F

  • I need help in payslip

    I need to user payslip function on the self service but I am doing implementation
    on global international hrms setup we are working on so there is no standard localization
    from oracle.
    Edited by: user5321329 on Mar 1, 2011 6:30 AM

    I need to user payslip function on the self service but I am doing implementation
    on global international hrms setup we are working on so there is no standard localization
    from oracle.
    Edited by: user5321329 on Mar 1, 2011 6:30 AM

  • Payslip UAE from Custom Responsibility

    Hi,
    We are running Oracle Payslip for UAE Legislation. I am able to run the Payslip from HRMS seeded Menu but able to run the Payslip from custom menu. It gives me a error saying Payslip Functions is not available for current responsibility.
    Any ideas will be helpful
    Regards
    Shashwat

    I mean seeded Responsibility i.e. Employee Self Service I can see the Payslip but if I make my custom Responsibility and add the Payslip Menu to it, I get the error message as said previously

  • KM as database for achives ?

    Hello,
    Our customer plans to archive their pay slips in pdf format with the aim to consult them via portal.
    As our content server was uninstalled, is it possible (technically - legally) to use the KM database to archive the pay slips ?
    Thank you in advance for your answers.

    I am not sure of the legal issues around that, but then I doubt there would be any unless the state/  country. legislation says something about it
    You can use SAP-EP-KM to store any kind of documents, but if you are putting in the employee pay slips, there is a major security area you would have to look into.
    I would like to ask do you have ESS also implemented. If yes you could use the payslips functionality available there which generate the payslip of the requested month (provided the payroll for that month for that employee was run on ECC) on the fly and given to the user as a PDF document.
    Thanks,
    GLM

  • HR form: Add functionality to add comments to payslip via IT0128

    Hi,
    I am very new to the HR forms. Not having any experience of any transaction or table etc.
    My requirement is: I need to add functionality to add messages to payslip via IT0128 to a HR form having specific group.(Add comment to payslip)
    Can you please give me the steps to be followed to fulfill this requirement?

    Hi Ankit,
    You have so many threads on same question.before you raise a forum question do enough R & D
    some threads for you.......
    https://forums.sdn.sap.com/click.jspa?searchID=21696631&messageID=6879933
    https://forums.sdn.sap.com/click.jspa?searchID=21696631&messageID=6627148
    https://forums.sdn.sap.com/click.jspa?searchID=21696631&messageID=6546304
    Kindly go through the below steps for Inserting Logo in SmartForm :
    1) In Smart Forms Editor, In left pane, right Click any Page (say Page1) and select Create -> Window, Give it a name and Description (Say Window1)
    2) Right Click on Window (Window 1) and select Create -> Graphics, Give it a name and description
    3) In general Attributes, Select Name, get search help (F4) , you will find a list of pictures
    4) Select any picture and set its Resolution in DPI
    5) Press F9 to open Smart Forms Builder, Select window (Window1) and In Output options window set, size and position of the Logo
    6) Set any other parameters if required, save and activate.
    7) If there is only 1 Window in the forms, set it as Main Window in general attributes.
    8) User TCode SE78 to upload new pictures and logos.
    I hope it helps you!!!
    Thanks
    Cheera

  • Wrong display of No. of days worked in Payslip for mid-month joining

    Dear Experts,
    We use PE51, form editor for payslip for indian payrol. Our issue is when an employee joins mid of the month or say 4th of any month, still in payslip it shows no. of working days as 30/31 days instead of actual days worked. But pay results are correctly being calculated on factoring basis.
    Please let me know how to resolve it, we use PCR ZNP1 for factoring which is written as follows
    ZNP1 Partial factors for India - /801(CD), /802(WD), /803(WH),/804(Nom)
          /801 Partial period factor 1
            RTE=TKSOLL Set
            RTE-TKAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TKDIVI Division
            ADDWT *    OT   Output table
          /802 Partial period factor 2
            RTE=TASOLL Set
            RTE-TAAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TADIVI Division
            ADDWT *    OT   Output table
          /803 Partial period factor 3
            RTE=TSSOLL Set
            RTE-TSAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TSDIVI Division
            ADDWT *    OT   Output table
          /804 Partial period factor 4
          /805 Partial period factor 5
          /806 Partial period factor 6
          /807 Partial period factor 7
    Please guide, if i need to modify it for getting correct working days display in payslip
    Regards
    Tan

    in that case the Requirement is to display no of working days of employee in a month
    Here working days means
    Total Calendar Days - Unpaid days - Paid days =  working days ( please check the said one again since i have inculded the paid days and unpaid days if u want u can remove paid days)
    so in order to fetch this
    we need Calendar days that is TKSOLL
    Unpaid days   check the technical wage types /845  Paid days /846  ( you can have custom wage types too)
    Copy a wage type from standrad overtime wage type  that will be  1555
    The PCR is as follows
    NUM=TKSOLL  (calendar Days)
    NUM-E  /846      Paid days
    NUM-E /845
    ADDWT 15555
    Use ACTIO function and insert it any where in Sub Schema XT00

  • Issue in payslip calculation.

    Hi Experts,
    I am facing problem in payslip
    new employees who joined in the middle of this months
    1) DOJ 5.9.2011 in the slip only Basic calculation showing correctly.
    2.  DOJ 15.9.2011 in the slip only Basic Calculation showing correctly
    In previous month payslip of new employees there is no issue in the calculation. but in this month salary slip  except Basic  all monthly component i e. HRA, Special .Allwn, Tran,Edu, CAR Allwn are showing wrong calculation .
    Note: few days ago we I maintain PCR ZNP1 from INP1, for present days in payslip. is this problem come due to this?
    Please guide me..
    Regards,
    Raj

    If you do a Payroll Simulation with the "Display Log" box checked, you will then be able to look at the partial period parameters calculated for that employee (function PARTT).
    If you use t-code pe04, enter Payroll Operation AMT, and look at it's documentation > for 6 places operands > for 2nd Variant: Table Fields > for type T tables, you will find the link to the Partial Period Parameters, of which the following is only the first few lines:
    Partial Period Parameter for the Partial Period (Operand Prefix T)
      Object
        Additional operation documentation
      Explanation
        1.  Planned working time in accordance with employee's personal work
            schedule with exact reference to basic pay period
            KSOLL : Planned working time measured in calendar days
            ASOLL : Planned working time measured in work days
            SSOLL : Planned working time measured in working hours
        2.  Total working time in payroll period in line with employee's work
            schedule with exact reference to basic pay period
            KDIVI : Total working time measured in calendar days
            ADIVI : Total working time measured in working days
    ... and there are many threads on this site and on the web relating to this issue.

  • How to Send Internal table to SAP Spool using Function Modules or Methods?

    Hi Experts,
    How to Send Internal table to SAP Spool using Function Modules or Methods?
    Thanks ,
    Kiran

    This is my code.
    I still get the no ABAP list data for the spool, even tho I can see it sp01?
    REPORT  Z_MAIL_PAYSLIP.
    * Declaration Part *
    tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
    infotypes: 0000, 0001, 0105, 0655.
    data: begin of ITAB occurs 0,
      MTEXT(25) type C,
      PERNR like PA0001-PERNR,
      ABKRS like PA0001-ABKRS,
      ENAME like PA0001-ENAME,
      USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
          P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
          MY_MONTH type T549Q-PABRP,
          STR_MY_MONTH(2) type C,
          MY_YEAR type T549Q-PABRJ,
          STR_MY_YEAR(4) type C,
          CRLF(2) type x value '0D0A'.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
          ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
            INDEX type I,
    end of P_INDEX.
    constants: begin of F__LTYPE, "type of line
       CMD like PC408-LTYPE value '/:',  "command
       TXT like PC408-LTYPE value 's',   "textline
    end of F__LTYPE.
    constants: begin of F__CMD, "commands
      NEWPAGE like PC408-LINDA value '',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    *data: OBJBIN like SOLISTI1 occurs 10 with header line,
    data: OBJBIN like  LVC_S_1022 occurs 10 with header line,
          DOCDATA like SODOCCHGI1,
          OBJTXT like SOLISTI1 occurs 10 with header line,
          OBJPACK like SOPCKLSTI1 occurs 1 with header line,
          RECLIST like SOMLRECI1 occurs 1 with header line,
          OBJHEAD like SOLISTI1 occurs 1 with header line,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_buffer type string,
          l_no_of_bytes TYPE i,
          l_pdf_spoolid LIKE tsp01-rqident,
          l_jobname     LIKE tbtcjob-jobname.
    data: file_length  type int4,
          spool_id     type rspoid,
          line_cnt     type i.
    *-------------------------------------------------------------------* * INITIALIZATION *
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    data: S_ABKRS like PV000-ABKRS.
    data: S_PABRP like T549Q-PABRP.
    data: S_PABRJ like T549Q-PABRJ.
    * SELECTION SCREEN                                                  *
    selection-screen begin of block BL1.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    START-OF-SELECTION.
      s_ABKRS = PNPXABKR.
      S_PABRP = PNPPABRP.
      s_pabrj = PNPPABRJ.
      w_begda = PN-BEGDA.
      w_endda = PN-ENDDA.
    get pernr.
    *                                 "Check active employees
      rp-provide-from-last p0000 space pn-begda  pn-endda.
      CHECK P0000-STAT2 IN PNPSTAT2.
    *                                 "Check Payslip Mail flag
      rp-provide-from-last p0655 space pn-begda  pn-endda.
      CHECK P0655-ESSONLY = 'X'.
      rp-provide-from-last p0001 space pn-begda  pn-endda.
    *                                 "Find email address
      RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
      if p0105-usrid_LONG ne ''.
        ITAB-PERNR      = P0001-PERNR.
        ITAB-ABKRS      = P0001-ABKRS.
        ITAB-ENAME      = P0001-ENAME.
        ITAB-USRID_LONG = P0105-USRID_LONG.
        append itab.
        clear itab.
      endif.
      "SY-UCOMM ='ONLI'
    END-OF-SELECTION.
    *------------------------------------------------------------------* start-of-selection.
      write : / 'Payroll Area        : ', S_ABKRS.
      write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
      write : / 'System Time         : ', SY-UZEIT.
      write : / 'User Name           : ', SY-UNAME.
      write : / SY-ULINE.
      sort ITAB by PERNR.
      loop at ITAB.
        clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
        refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
    *                                                  Retrieve Payroll results sequence number for this run
        select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
                                        and FPBEG ge W_BEGDA
                                        and FPEND le W_ENDDA
                                        and SRTZA eq 'A'.
    *                                                  Produce payslip for those payroll results
        if SY-SUBRC = 0.
          call function 'GET_PAYSLIP'
            EXPORTING
              EMPLOYEE_NUMBER = ITAB-PERNR
              SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
              PAYSLIP_VARIANT = PAY_VAR
            IMPORTING
              RETURN          = RETURN
              P_INFO          = P_INFO
            TABLES
              P_FORM          = P_FORM.
          check RETURN is initial.
    *                                                 remove linetype from generated payslip
          loop at p_form.
            objbin = p_form-linda.
            append objbin.
            line_cnt = line_cnt + 1.
          endloop.
          file_length = line_cnt * 1022.
    *                                                 create spool file of paylsip
          CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
            EXPORTING
              i_file_length = file_length
            IMPORTING
              e_spoolid     = spool_id
            TABLES
              it_textdata   = objbin.
          IF sy-subrc EQ 0.
            WRITE spool_id.
          ENDIF.
          DESCRIBE table objbin.
          DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
          CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = spool_id
              NO_DIALOG                      = ' '
              DST_DEVICE                     = 'MAIL'
    *      PDF_DESTINATION                =
    *    IMPORTING
    *      PDF_BYTECOUNT                  = l_no_of_bytes
    *      PDF_SPOOLID                    = l_pdf_spoolid
    *      LIST_PAGECOUNT                 =
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
            TABLES
              PDF                            = pdf
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
              OTHERS                         = 12
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *Download PDF file C Drive
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:\itab_to_pdf.pdf'
          filetype = 'BIN'
        TABLES
          data_tab = pdf.
    * Transfer the 132-long strings to 255-long strings
    *  LOOP AT pdf.
    *    TRANSLATE pdf USING ' ~'.
    *    CONCATENATE gd_buffer pdf INTO gd_buffer.
    *  ENDLOOP.
    *  TRANSLATE gd_buffer USING '~ '.
    *  DO.
    *    it_mess_att = gd_buffer.
    *    APPEND it_mess_att.
    *    SHIFT gd_buffer LEFT BY 255 PLACES.
    *    IF gd_buffer IS INITIAL.
    *      EXIT.
    *    ENDIF.
    *  ENDDO.
          OBJHEAD = 'Objhead'.
          append OBJHEAD.
    * preparing email subject
          concatenate W_ENDDA(6)
                    ' Payslip-'
                    ITAB-ENAME+0(28)
                    ITAB-PERNR+4(4) ')'
                 into DOCDATA-OBJ_DESCR.
          DOCDATA-OBJ_NAME = 'Pay Slip'.
          DOCDATA-OBJ_LANGU = SY-LANGU.
          OBJTXT = 'Pay Slip.'.
          append OBJTXT.
    *prepare email lines
          OBJTXT = DOCDATA-OBJ_DESCR.
          append OBJTXT.
          OBJTXT = 'Please find enclosed your current payslip.'.
          append OBJTXT.
    * Write Attachment(Main)
    * 3 has been fixed because OBJTXT has fix three lines
          read table OBJTXT index 3.
    *    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
          clear OBJPACK-TRANSF_BIN.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = 3.
          OBJPACK-DOC_TYPE = 'RAW'.
          append OBJPACK.
    * Create Message Attachment
          ATT_TYPE = 'PDF'.
          describe table OBJBIN lines TAB_LINES.
          read table OBJBIN index TAB_LINES.
    *    OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
          OBJPACK-TRANSF_BIN = 'X'.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = TAB_LINES.
          OBJPACK-DOC_TYPE = ATT_TYPE.
          OBJPACK-OBJ_NAME = 'ATTACHMENT'.
          OBJPACK-OBJ_DESCR = 'Payslip'.
          append OBJPACK.
    * Create receiver list refresh RECLIST.
          clear RECLIST.
          RECLIST-RECEIVER = itab-USRID_long.
          translate RECLIST-RECEIVER to lower case.
          RECLIST-REC_TYPE = 'U'.
          append RECLIST.
    * Send the document
    *SO_NEW_DOCUMENT_ATT_SEND_API1
          call function 'SO_DOCUMENT_SEND_API1'
            exporting
              DOCUMENT_DATA = DOCDATA
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK = 'X'
    * IMPORTING
    *   SENT_TO_ALL =
    *   NEW_OBJECT_ID =
            tables
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = pdf
              CONTENTS_TXT  = OBJTXT
    *   CONTENTS_HEX =
    *   OBJECT_PARA =
    *   OBJECT_PARB =
              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 = 'Message Not Sent to : '.
          else.
            ITAB-MTEXT = 'Message Sent to : '.
          endif.
    *    else.
    *      ITAB-MTEXT = 'Message Not Sent to : '.
    *    endif.
        else.
          "SY-SUBRC Not = 0
          ITAB-MTEXT = 'Payroll data not found : '.
        endif.
        "end of SY-SUBRC = 0.
        modify ITAB.
      endloop. "end loop at ITAB
      sort ITAB by MTEXT PERNR.
      loop at ITAB.
        at new MTEXT.
          uline.
          write : / ITAB-MTEXT color 4 intensified on.
          write : / 'Emp. Code' color 2 intensified on,
                 12 'Emp. Name' color 2 intensified on,
                 54 'Email ID' color 2 intensified on.
        endat.
        write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
      endloop.

  • Problem while sending the o/p of payslip report through mail

    Hi ,
             I am trying to mail the output of ZHINACALC0 (copy of standard program HINCALC0 for payslip display)
            In the report code of ZHINCALC0, there is a form named xform which contanis the o/p of the employee's payslip.
    CALL FUNCTION 'HR_PL_APPEND_FORM'
               EXPORTING
                    imp_pernr  = pernr-pernr
                    imp_period = rgdir-inper                "XMS note 386560
               TABLES
                    imp_form   = *xform*
               EXCEPTIONS
                    OTHERS     = 0.
    I am using the following function module to get the o/p from memory.
    SUBMIT ZHINCALC0  EXPORTING LIST TO MEMORY AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
           TABLES
                LISTOBJECT = LISTOBJECT
           EXCEPTIONS
                NOT_FOUND  = 1
                OTHERS     = 2.
      IF SY-SUBRC <> 0.
      WRITE  'Error in list_from_memory.'.
      ENDIF.
    after this i am using SO_NEW_DOCUMENT_ATT_SEND_API1 to send the o/p through mail.
    However i am not getting the desired result as the  function module LIST_FROM_MEMORY takes an o/p list as input,but this is not the case here as xform is not an o/p list. How do i send the xform into memory and then get it back. Kindly help.
    Thanks and Regards,
    Subhabrata.

    Hi,
    Please check with the following code.
    TABLES: KNA1.
    data for send function
    DATA DOC_DATA  LIKE SODOCCHGI1.
    DATA OBJECT_ID LIKE SOODK.
    DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
    DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
      WRITE:/ KNA1-KUNNR, KNA1-ANRED.
    send data internal table
      CONCATENATE KNA1-KUNNR KNA1-ANRED
                             INTO OBJCONT-LINE SEPARATED BY SPACE.
      APPEND OBJCONT.
    ENDSELECT.
    insert receiver (sap name)
      REFRESH RECEIVER.
      CLEAR RECEIVER.
      MOVE: 'any_email'_ TO RECEIVER-RECEIVER,                " SY-UNAME
            'X'      TO RECEIVER-EXPRESS,
            'U'      TO RECEIVER-REC_TYPE.
      APPEND RECEIVER.
    insert mail description
      WRITE 'Sending a mail through abap'
                     TO DOC_DATA-OBJ_DESCR.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = DOC_DATA
         IMPORTING
              NEW_OBJECT_ID              = OBJECT_ID
         TABLES
              OBJECT_CONTENT             = OBJCONT
              RECEIVERS                  = RECEIVER
         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.

  • Display Payslip in PDF format on Screen

    Hi SAP Gurus...
    I have done the below to generate the SAP HR Reminaration statement in PDF.
      CALL FUNCTION 'BAPI_GET_PAYSLIP_PDF'
        EXPORTING
          employeenumber = p_pernr
          sequencenumber = it_rgdir-seqnr
          payslipvariant = p_forml
        IMPORTING
          return         = i_return
          payslip        = x_payslip
          pdf_fsize      = v_pdf_size.
    Now, I want to display it in PDF on the Screen.
    Please tell us how to proceed further.
    thanks in advance.
    regards,
    R R Suthar

    Dear Gurus...
    Thanks  for help.
    I have already done this,but I want to do it without using the FMs GUI_DOWNLOAD and GUI_RUN(which is obsolute).
    Instead I want to display PDF data using any other method.
    Can any body suggest how to do using class / method.
    thanks in advance.
    regards,
    R R Suthar

  • Convert payslip to PDF format  , for e-mailing to employees

    HI with respect to my previous post 'Salary slip delivery thru email'
    I have been able to send the email out in the html format. I want the employee to recieve the mail in the PDF format. I would like your assistance on this.
    Here is the code.
    tables: PV000,
    T549Q,
    PA0001,
    V_T514D,
    HRPY_RGDIR,
    PA0002,
    PA0105.
    data: begin of ITAB occurs 0,
    MTEXT(25) type C,
    PERNR like PA0001-PERNR,
    ABKRS like PA0001-ABKRS,
    ENAME like PA0001-ENAME,
    USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
    P_FORM like PC408 occurs 0 with header line,
    P_P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
    MY_MONTH type T549Q-PABRP,
    STR_MY_MONTH(2) type C,
    MY_YEAR type T549Q-PABRJ,
    STR_MY_YEAR(4) type C.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
    ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
    INDEX type I,
    end of P_INDEX.
    constants:
    begin of F__LTYPE, "type of line
    CMD like PC408-LTYPE value '/:', "command
    TXT like PC408-LTYPE value 's', "textline
    end of F__LTYPE.
    constants:
    begin of F__CMD, "commands
    NEWPAGE like PC408-LINDA value '<NEW-PAGE>',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    data: OBJBIN like SOLISTI1 occurs 10 with header line,
    DOCDATA like SODOCCHGI1,
    OBJTXT like SOLISTI1 occurs 10 with header line,
    OBJPACK like SOPCKLSTI1 occurs 1 with header line,
    RECLIST like SOMLRECI1 occurs 1 with header line,
    OBJHEAD like SOLISTI1 occurs 1 with header line.
    INITIALIZATION *
    initialization.
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    SELECTION SCREEN *
    selection-screen begin of block BL1.
    parameters: S_ABKRS like PV000-ABKRS obligatory default 'ZA'.
    parameters: S_PERMO like T549Q-PABRP obligatory default '02'.
    parameters: S_PABRP like T549Q-PABRP obligatory.
    parameters: S_PABRJ like T549Q-PABRJ obligatory.
    select-options: S_PERNR for PA0001-PERNR.
    select-options: S_ORGEH for PA0001-ORGEH.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default
    'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    AT SELECTION-SCREEN *
    at selection-screen.
    if SY-UCOMM ='ONLI'.
    if S_PABRP > 24 or S_PABRP < 1.
    message E999(YHR) with 'Improper Payroll Period'.
    endif.
    if S_PABRP > 9.
    MY_MONTH = S_PABRP - 10 + 1.
    STR_MY_MONTH = MY_MONTH.
    MY_YEAR = S_PABRJ + 1.
    STR_MY_YEAR = MY_YEAR.
    else.
    MY_MONTH = S_PABRP + 3.
    STR_MY_MONTH = MY_MONTH.
    MY_YEAR = S_PABRJ.
    STR_MY_YEAR = MY_YEAR.
    endif.
    modified by Coul
    if S_PERMO NE '2'.
    message E999(YHR) with 'Improper Payroll Period Parameters'.
    endif.
    MY_YEAR = S_PABRJ.
    STR_MY_YEAR = MY_YEAR.
    shift STR_MY_MONTH left deleting leading SPACE.
    shift STR_MY_MONTH right deleting trailing SPACE.
    translate STR_MY_MONTH using ' 0'.
    get payrol period first and last dates _ added by Coul
    SELECT SINGLE *
    FROM T549Q
    WHERE PERMO = S_PERMO "Period param.; 02 = semi-monthly
    AND PABRJ = S_PABRJ "Payroll period year
    AND PABRP = S_PABRP. "Payroll period no.
    W_BEGDA = T549Q-BEGDA.
    W_ENDDA = T549Q-ENDDA.
    concatenate STR_MY_YEAR STR_MY_MONTH '01' into W_BEGDA.
    call function 'HR_HCP_GET_LAST_DAY_OF_MONTH'
    exporting
    IM_DATE = W_BEGDA
    importing
    EX_DATE_IS_MONTHEND =
    EX_LAST_DAY_OF_MONTH = W_ENDDA.
    select PA0001PERNR PA0001ABKRS PA0001~ENAME
    into corresponding fields of table ITAB
    from PA0001
    join PA0000
    on PA0000PERNR eq PA0001PERNR
    join HRPY_RGDIR
    on PA0001PERNR eq HRPY_RGDIRPERNR
    where PA0001~PERNR in S_PERNR
    where PA0001~ORGEH in S_ORGEH
    and PA0001~ABKRS eq S_ABKRS
    and PA0000~STAT2 eq '3'
    and PA0001~ENDDA ge '99991231'
    and PA0001~PLANS ne '99999999'
    group by PA0001PERNR PA0001ABKRS PA0001~ENAME.
    if SY-SUBRC <> 0.
    message E999(YHR) with 'No record(s) found.'.
    endif.
    endif. "SY-UCOMM ='ONLI'
    START-OF-SELECTION *
    start-of-selection.
    write : / 'Payroll Area : ',S_ABKRS.
    write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR.
    write : / 'System Date : ', SY-DATUM.
    write : / 'System Time : ', SY-UZEIT.
    write : / 'User Name : ', SY-UNAME.
    write : / SY-ULINE.
    sort ITAB by PERNR.
    loop at ITAB.
    clear : P_INFO, P_P_FORM, P_FORM, P_INDEX, P_LIST, OBJBIN,
    DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
    refresh : P_P_FORM, P_FORM, P_INDEX, P_LIST, OBJBIN,
    OBJTXT, OBJPACK, RECLIST.
    select single *
    from HRPY_RGDIR
    where PERNR eq ITAB-PERNR
    and FPBEG ge W_BEGDA
    and FPEND le W_ENDDA
    and SRTZA eq 'A'.
    if SY-SUBRC = 0.
    call function 'GET_PAYSLIP'
    exporting
    EMPLOYEE_NUMBER = ITAB-PERNR
    SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
    PAYSLIP_VARIANT = PAY_VAR
    importing
    RETURN = RETURN
    P_INFO = P_INFO
    tables
    P_FORM = P_FORM.
    check RETURN is initial.
    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.
    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.
    call function 'LIST_FROM_MEMORY'
    tables
    LISTOBJECT = P_LIST.
    call function 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    tables
    IN = P_LIST
    OUT = OBJBIN
    exceptions
    others = 1.
    OBJHEAD = 'Objhead'.
    append OBJHEAD.
    preparing subject
    concatenate W_ENDDA(6)
    ' Payslip-' ITAB-ENAME0(28) '(' ITAB-PERNR4(4) ')'
    into DOCDATA-OBJ_DESCR.
    DOCDATA-OBJ_NAME = 'Pay Slip'.
    DOCDATA-OBJ_LANGU = SY-LANGU.
    OBJTXT = 'Pay Slip.'.
    append OBJTXT.
    OBJTXT = DOCDATA-OBJ_DESCR.
    append OBJTXT.
    OBJTXT = 'Have a nice day.'.
    append OBJTXT.
    Write Packing List (Main)
    3 has been fixed because OBJTXT has fix three lines
    read table OBJTXT index 3.
    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
    clear OBJPACK-TRANSF_BIN.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = 3.
    OBJPACK-DOC_TYPE = 'RAW'.
    append OBJPACK.
    Create Message Attachment
    Write Packing List (Attachment)
    ATT_TYPE = 'ALI'.
    describe table OBJBIN lines TAB_LINES.
    read table OBJBIN index TAB_LINES.
    OBJPACK-DOC_SIZE =
    ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
    OBJPACK-TRANSF_BIN = 'X'.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TAB_LINES.
    OBJPACK-DOC_TYPE = ATT_TYPE.
    OBJPACK-OBJ_NAME = 'ATTACHMENT'.
    OBJPACK-OBJ_DESCR = 'Payslip'.
    append OBJPACK.
    Create receiver list
    refresh RECLIST.
    clear RECLIST.
    select single *
    from PA0105
    where PERNR eq ITAB-PERNR
    and SUBTY eq 'MAIL'
    and SUBTY eq '0001'
    and USRID ne ''
    and PA0105~ENDDA ge '99991231'.
    if SY-SUBRC = 0.
    RECLIST-RECEIVER = PA0105-USRID.
    translate RECLIST-RECEIVER to lower case.
    ITAB-USRID_LONG = RECLIST-RECEIVER.
    RECLIST-REC_TYPE = 'U'.
    append RECLIST.
    Send the document
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    exporting
    DOCUMENT_DATA = DOCDATA
    PUT_IN_OUTBOX = 'X'
    PUT_IN_OUTBOX = ''
    COMMIT_WORK = 'X'
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    tables
    PACKING_LIST = OBJPACK
    OBJECT_HEADER = OBJHEAD
    CONTENTS_BIN = OBJBIN
    CONTENTS_TXT = OBJTXT
    CONTENTS_HEX =
    OBJECT_PARA =
    OBJECT_PARB =
    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 <> 0.
    ITAB-MTEXT = 'Message Not Sent to : '.
    else.
    ITAB-MTEXT = 'Message Sent to : '.
    endif.
    else.
    ITAB-MTEXT = 'Message Not Sent to : '.
    endif.
    else. "SY-SUBRC Not = 0 HRPY_RGDIR
    ITAB-MTEXT = 'Payroll data not found : '.
    endif. " end of SY-SUBRC = 0. HRPY_RGDIR
    modify ITAB.
    endloop. "end loop at ITAB
    sort ITAB by MTEXT PERNR.
    loop at ITAB.
    at new MTEXT.
    uline.
    write : / ITAB-MTEXT color 4 intensified on.
    write : / 'Emp. Code' color 2 intensified on,
    12 'Emp. Name' color 2 intensified on,
    54 'Email ID' color 2 intensified on.
    endat.
    write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
    endloop.

    hi,
       You can send the list output to spool.
    print-on ...
    PERFORM REPORT_OUTPUT.
    print-off.
    From there, you can convert that to pdf.
    fm CONVERT_ABAPSPOOLJOB_2_PDF
    Getting that pdf conversion done, you can send thE same to mail..
    fm SO_NEW_DOCUMENT_ATT_SEND_API1
    Regards,
    Sailaja.

  • Payslips to be converted into individual PDF file & sent to email of emp

    Dear Friends,
    My client wants that the Payslips generated by Transaction- PC00_M40_CEDT, to be converted into separate individual PDF files based on Personnel Numbers, and sent to their Individual Email Ids as maintained in Infotype - 0105.
    There should be no printing of payslips from hereon at the client.
    Need some help and guidance, regarding the details for it. Where to start and what needs to be implemented to get the above required objective. We are using Z layouts for Remuneration statements.
    Thanks & Regards,
    Sunny

    Hi Sunny,
    you don't have to implement or be using ESS to take advantage of its features.
    Take a look at the code that generate the ESS payslip, this contains all you need to be able to write a program to generate a PDF payslip per employee. There is no need to get SCOT or Adobe Acrobat to generate the PDF - there exist standard SAP function modules that can do this.
    From this it is then a simple step to enhance the program to generate an email and attach the payslip.
    I have written a program to do exactly this in the past, so I know that it is possible. I will not send you the code for the program, please do not ask.
    However, it is possible and SAP have already done the greatest part of the work for you by building the ESS code - take advantage of it!
    Hope this helps,
    Chris

  • How to send a payslip of the emp in the email body in R12

    Hi All,
    Would like to know how can we send the payslip of an employee in the email.
    How can one do the above mentioned function in Oracle Payroll in R12.
    Please note that the payslip amounts should be in the email body and not as an attachment.
    thanx,
    Chetan

    Open the workflow process you are using.
    Open the notification.
    In the notification you will see there will be a message given
    Open the message and in that there will different parts of message like Subject, Body as text and HTML.
    See the HTML body you can find the there must be some attributes defined there. Create you own attribute say a URL (which is OA Page, a function in Apps)
    and test.
    e.g in OTL Workflows for Employees (HXCEMP) workflow, there is a message template "Inline Timecard Approval" in which a URL attribute is used.
    I think some workflow experts can help you more.
    HTH

  • Payslip to be sent as mail in PDF Format

    Dear All,
               Please help me in solvong this
               I need to send Payslip to Users ( Employees) in mail as a PDF file in 4.7 version.
    Thanks in Advance.
    Regards,

    REPORT  yacpr0013                               .
    PARAMETERS: p_rec TYPE somlreci1 DEFAULT '[email protected]' LOWER CASE OBLIGATORY,
                p_spool LIKE tsp01-rqident OBLIGATORY.
    CONSTANTS: c_true TYPE boolean_flg VALUE 'X'.
    TYPES: ty_tab_pdf TYPE tline OCCURS 0.
    Type for binary attachment table.
    TYPES: ty_tab_objbin TYPE solisti1 OCCURS 0.
    DATA: i_objbin TYPE ty_tab_objbin.
    START-OF-SELECTION.
      PERFORM f_convert_to_pdf CHANGING i_objbin.
      PERFORM f_send_email USING p_rec i_objbin.
    *&      @FORMS
    *&      Form  send_email
    Subroutine to be able to send a simple email.  Check transaction
    SOST for output.  If it makes it to SOST, it's then just a matter
    of ensuring BASIS has done the appropriate config.
    FORM f_send_email USING pv_rec TYPE somlreci1
                          pi_objbin TYPE ty_tab_objbin.
      DATA: li_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
      DATA: li_objtxt    LIKE solisti1 OCCURS   0 WITH HEADER LINE.
      DATA: li_objpack   LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      DATA: ls_doc_chng  LIKE sodocchgi1.
      DATA: li_objhead   LIKE solisti1 OCCURS   0 WITH HEADER LINE.
      DATA: lv_tab_lines LIKE sy-tabix.
    Creation of the document to be sent
    File Name
      ls_doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
      ls_doc_chng-obj_descr = 'Email header'(em1).
    Completing the recipient list
      li_reclist-receiver = pv_rec.
      li_reclist-rec_type = 'U'.
      APPEND li_reclist.
    Mail Contents
      li_objtxt = 'line 1 of the email body'(bd1).
      APPEND li_objtxt.
      CLEAR li_objtxt.     " put in a blank line
      APPEND li_objtxt.
      li_objtxt = 'line 2 of the email body'(bd2).
      APPEND li_objtxt.
      li_objtxt = 'line 3 of the email body'(bd3).
      APPEND li_objtxt.
    Calculate email size in bytes
      DESCRIBE TABLE li_objtxt LINES lv_tab_lines.
      READ TABLE li_objtxt INDEX lv_tab_lines.
      ls_doc_chng-doc_size = ( lv_tab_lines - 1 ) * 255 + STRLEN( li_objtxt ).
    Creation of the entry for the compressed document
    for the email text
      CLEAR li_objpack-transf_bin.
      li_objpack-head_start = 1.
      li_objpack-head_num = 0.
      li_objpack-body_start = 1.
      li_objpack-body_num = lv_tab_lines.
      li_objpack-doc_type = 'RAW'.
      APPEND li_objpack.
    Creation of the document attachment
    (Assume that the data in OBJBIN is in BMP format)
      DESCRIBE TABLE pi_objbin LINES lv_tab_lines.
      li_objhead = 'Save as name.PDF'(em5).
      APPEND li_objhead.
      CLEAR li_objpack.
    **/ Creation of the entry for the compressed/attached document
      li_objpack-transf_bin = c_true.
      li_objpack-head_start = 1.
      li_objpack-head_num = 1.
      li_objpack-body_start = 1.
      li_objpack-body_num = lv_tab_lines.
      li_objpack-doc_type = 'PDF'.
      li_objpack-obj_name = 'Possibly hover name'.
      li_objpack-obj_descr = 'Real Name'(em6).
      li_objpack-doc_size = lv_tab_lines * 255.
      APPEND li_objpack. "/ .
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' "/ .
        EXPORTING
          document_data              = ls_doc_chng
          put_in_outbox              = 'X'
        TABLES
          packing_list               = li_objpack
          object_header              = li_objhead
          contents_bin               = pi_objbin
          contents_txt               = li_objtxt
          receivers                  = li_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc <> 0.
        WRITE: / 'unsuccessful', sy-subrc.
      ELSE.
        WRITE:  / 'successful'.
      ENDIF.
    **/Take_note it is a requirement to do a commit work for the
    email to go into transaction SOST.
      COMMIT WORK.   "/Take_note .
    ENDFORM.                    "send_email
    *&      Form  convert_to_pdf
    Convert the spool number on the screen to a PDF
    FORM f_convert_to_pdf CHANGING pi_objbin TYPE ty_tab_objbin.
      DATA: li_pdf TYPE ty_tab_pdf,
            lv_spool LIKE tsp01-rqident.
      lv_spool = p_spool.
    **/ Call the standard function
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid                    = lv_spool "/ .
            no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
         IMPORTING
           pdf_bytecount                  = numbytes
           pdf_spoolid                    = pdfspoolid
          LIST_PAGECOUNT                 =
           btc_jobname                    = jobname
           btc_jobcount                   = jobcount
          TABLES
            pdf                            = li_pdf
          EXCEPTIONS
            err_no_abap_spooljob           = 1
            err_no_spooljob                = 2
            err_no_permission              = 3
            err_conv_not_possible          = 4
            err_bad_destdevice             = 5
            user_cancelled                 = 6
            err_spoolerror                 = 7
            err_temseerror                 = 8
            err_btcjob_open_failed         = 9
            err_btcjob_submit_failed       = 10
            err_btcjob_close_failed        = 11.
      IF sy-subrc <> 0.
        WRITE: / 'error', sy-subrc.
      ENDIF.
    **/ Convert the PDF format to the table type required for the attachment.
      CALL FUNCTION 'QCE1_CONVERT' "/ .
        TABLES
          t_source_tab         = li_pdf
          t_target_tab         = pi_objbin
        EXCEPTIONS
          convert_not_possible = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        WRITE: / 'error', sy-subrc.
      ENDIF.
    ENDFORM.                    "convert_to_pdf
    Hope this helps.......

Maybe you are looking for