Friday, 21 April 2017

IN HR employee designation Text and Status text

1. To get Employee Designation


rp-provide-from-last p0000 space pn-begda pn-endda.
  IF pnp-sw-found EQ '1'.
    status p0000-stat2.
  ELSE.
    REJECT.
  ENDIF.

  rp-provide-from-last p0001 space pn-begda pn-endda.
  IF pnp-sw-found 1.

    CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
      EXPORTING
        otype                   'S'
        objid                   p0001-plans
        status                  '1'
        begda                   pn-begda
        endda                   pn-endda
        langu                   sy-langu
      IMPORTING
        object_text             desig
      EXCEPTIONS
        nothing_found           1
        wrong_objecttype        2
        missing_costcenter_data 3
        missing_object_id       4
        OTHERS                  5.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.


2. To get Employee status Text

SELECT SINGLE text1 FROM t529u INTO status_text WHERE statn '2' AND  statv status AND sprsl 'E'.

No comments:

Post a Comment