Friday, 12 January 2018

HR Relationships in Organizational Management of HCM Module.


Tcode to maintain relationship is Po13
Relationship Table is  HRP1001.
Relationship description table is HRP1000
Organization Structure  Tcode is PPom_old

Po13















Position to Org unit Relationship:

CALL FUNCTION 'RH_PM_ENQUEUE'
    EXPORTING
      act_plvar              '01'
      act_otype              'S'
      act_objid              w_objid
   EXCEPTIONS
     ERROR_IN_ENQUEUE       1
     OTHERS                 2.
  IF sy-subrc 0.

DATA ls_1001    TYPE p1001.

CLEAR ls_1001.
  ls_1001-OTYPE 'S'.
  ls_1001-OBJID w_objid.
  ls_1001-PLVAR '01'.
  ls_1001-RSIGN 'A'.
  ls_1001-RELAT '003'.
  ls_1001-ISTAT '1'.
  ls_1001-BEGDA s_date.
  ls_1001-ENDDA '99993112'.
  ls_1001-INFTY '1001'.
  ls_1001-SCLAS 'O'.
  ls_1001-SOBID wa_hrp1000-objid.

 CALL FUNCTION 'RH_PNNNN_MAINTAIN'
      EXPORTING
        act_fcode                   'INSE'
        ACT_PLVAR                   '01'
        act_otype                   'S'
        act_objid                   w_objid
        ACT_INFTY                   '1001'
        ACT_SUBTY                   'A003'
       ACT_ISTAT                   '1'
       ACT_BEGDA                   s_date
       ACT_ENDDA                   '99991231'
        ACT_PNNNN                   ls_1001
       ACT_VTASK                   'S'
       ACT_COMMIT_FLG              'X'
       SUPPRESS_DIALOG             2
     EXCEPTIONS
       INFTY_NOT_VALID             1
       NO_PLVAR                    2
       OBJECT_NOT_DEFINED          3
       OTYPE_NOT_VALID             4
       NO_AUTHORITY                5
       ACTION_REJECTED             6
       NO_GDATE                    7
       FCODE_NOT_SUPPORTED         8
       OTHERS                      9.
    IF sy-subrc 0.
    endif.
clear :  ls_1001.


CALL FUNCTION 'RH_PM_DEQUEUE'
    EXPORTING
      act_plvar       '01'
      act_otype       'S'
      act_objid       w_objid.


endif.


Thursday, 4 January 2018

How to update JOB Object and Organizational Unit to Infotype 0001?


First need to fetch data from relationship table which is HRP1001.
All relationship object ( SOBID field )  description is available in HRP1000.





REPORT zchange_1001_pos_0001.

DATA gt_1001    TYPE STANDARD TABLE OF hrp1001,
       gs_1001    TYPE hrp1001,
       gs_0001    TYPE pa0001,
       gs_p0001   TYPE p0001,
       lv_plans   TYPE plans,
       ls_return  TYPE bapireturn1,
       lv_hrobjid TYPE hrp1001-objid.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS s_objid FOR lv_hrobjid.
PARAMETERS p_job RADIOBUTTON GROUP r1,
             p_org RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

  IF p_job IS NOT INITIAL.

    SELECT FROM hrp1001 INTO TABLE gt_1001 WHERE objid IN s_objid
                AND otype 'S'        AND sclas 'C'
                AND endda '99991231' AND subty 'B007'.
    IF sy-subrc 0.
      LOOP AT gt_1001 INTO gs_1001.
        CLEAR lv_plansgs_0001gs_p0001.
        lv_plans gs_1001-objid.
        SELECT SINGLE FROM pa0001 INTO gs_0001 WHERE plans lv_plans AND endda '99991231'.
        IF sy-subrc 0.
          MOVE-CORRESPONDING gs_0001 TO gs_p0001.
          gs_p0001-infty '0001'.
          IF gs_p0001-stell NE gs_1001-sobid.
            gs_p0001-stell gs_1001-sobid.
            CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
              EXPORTING
                number gs_0001-pernr
              IMPORTING
                return ls_return.
            IF ls_return IS INITIAL.
              CALL FUNCTION 'HR_INFOTYPE_OPERATION'
                EXPORTING
                  infty         '0001'
                  number        gs_0001-pernr
                  validityend   gs_0001-endda
                  validitybegin gs_0001-begda
                  record        gs_p0001
                  operation     'MOD'
                IMPORTING
                  return        ls_return.
              IF ls_return-type 'E'.
                WRITE / gs_0001-pernr'---Not Executed'ls_return-message.
              ELSE.
                WRITE / gs_0001-pernr'---Executed'.
              ENDIF.
              CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
                EXPORTING
                  number gs_0001-pernr
                IMPORTING
                  return ls_return.
            ELSE.
              WRITE / gs_0001-pernr'--Locked'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.

  ELSEIF p_org IS NOT INITIAL.

    SELECT FROM hrp1001 INTO TABLE gt_1001 WHERE objid IN s_objid
              AND otype 'S' AND sclas 'O'
              AND endda '99991231' AND subty 'A003'.
    IF sy-subrc 0.
      LOOP AT gt_1001 INTO gs_1001.
        CLEAR lv_plansgs_0001gs_p0001.
        lv_plans gs_1001-objid.
        SELECT SINGLE FROM pa0001 INTO gs_0001 WHERE plans lv_plans AND endda '99991231'.
        IF sy-subrc 0.
          MOVE-CORRESPONDING gs_0001 TO gs_p0001.
          gs_p0001-infty '0001'.
          IF gs_p0001-orgeh NE gs_1001-sobid.
            gs_p0001-orgeh gs_1001-sobid.
            CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
              EXPORTING
                number gs_0001-pernr
              IMPORTING
                return ls_return.
            IF ls_return IS INITIAL.
              CALL FUNCTION 'HR_INFOTYPE_OPERATION'
                EXPORTING
                  infty         '0001'
                  number        gs_0001-pernr
                  validityend   gs_0001-endda
                  validitybegin gs_0001-begda
                  record        gs_p0001
                  operation     'MOD'
                IMPORTING
                  return        ls_return.
              IF ls_return-type 'E'.
                WRITE / gs_0001-pernr'---Not Executed'ls_return-message.
              ELSE.
                WRITE / gs_0001-pernr'---Executed'.
              ENDIF.
              CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
                EXPORTING
                  number gs_0001-pernr
                IMPORTING
                  return ls_return.
            ELSE.
              WRITE / gs_0001-pernr'--Locked'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDIF.

How to Create Position and How to Create Relationship for position object to job and organisational unit - Part1


step1: Po13  Tcode is used to create  Position Object or Maintain position.

or via below program.

dataw_objid type hrobjid.
data:s_date type sy-datum.
datas_pos type char40.
CONCATENATE gs_input-begda+6(4gs_input-begda+3(2gs_input-begda(2)  into s_date.

     s_pos gs_input-plans.


  call function 'RH_OBJECT_CREATE'
  exporting
    plvar               '01'
    otype               'S'
    stext               s_pos
    begda               s_date
    endda               '99991231'
  importing
    objid               w_objid
  exceptions
    text_required       1
    invalid_otype       2
    invalid_date        3
    error_during_insert 4
    error_ext_number    5
    undefined           6
    others              7.


if sy-subrc eq 0.
COMMIT work.

endif.



Step 2:

ppom_old   Tcode is used to create organisational Plan or Organizational structure.

or
ppom for  Tcode is used to create all objects ( Position, Job, Orgunit etc. )








Step 3:


Create relationship in Tcode  P013 or PP01 

Note : PP01 is used to maitain all objects and P013 is used to maintain only position objects.








Monday, 11 December 2017

How to change released TR into Unreleased TR and How to unlock objects in TR which is Locked



SE03 - To unlock objects
SLG1 - To view Log of all Released or error TR.
Hi Experts,
I will explain the procedure for changing released TR into unrelased TR. i.e; modifiable state. There is no option given explicitly for chaning the released TR into unreleased TR in STMS or SE01 Transactions. we have to follow the below steps.
1. Go to SE38
2. execute the report RDDIT076
To_Blog_1.JPG
3. now, we will get the below screen which asks for TR/Tasks . give the released TR number and execute (F8)
To_blog_2.JPG
4. Once executed, you will get the below window,
To_blog_3.jpg
5. first we need to change the task to unreleased. double click on the task number. now, click on the pencil button to enter edit mode.then click on input help on the filed “Status”
To_Blog_4.jpg
6. change the status from “R” to “D” and save
To_blog_5.jpg
7. now repeat the steps 5 and 6 for Transport request. finally the status column should be in “D” as shown in below. To_blog_6.jpg
8. now goto SE01 or SE09, type the TR number and check. it will be in modifiable state.
Once you changed the TR into modifiable, you can change objects in the TR. you have to again release the task and TR.However, once we changed the released TR into modifiable, you can’t release the TR again and you will be getting an error “Request <Request ID> has the invalid attribute EXPTIMESTAMP”
you have to double click on the TR, navigate to the properties tab. enter into edit mode. you can see “Attribute” column in the screen.
Select the row “EXPORT_TIMESTAMP” and delete that row. save and come back. now you can release the TR. now the  datafile and cofile will be overwritten in OS level with same file name.

Cheers,
Siva.

Tuesday, 24 October 2017

Integration Engine Configuration Steps on Exchange Infrastructure or PI or PO


Tcode :
The heart of PI is Integration Engine that is used for integrating different technologies using Standard Messaging techniques, e.g XML

Go to SXMB_ADM transaction. Choose Integration Engine Configuration.


There can only be one Integration Server within an SAP system. In other words, the configuration of an Integration Server is limited to exactly one client.





 It receives XML message, determines the receiver, executes the mappings, and routes the XML message to the corresponding receiver systems. Thus configured Integration Engine is identified to be Central Configured Integration engine.



Application system The Application system will not execute the integration logic. It in turn calls the integration server to execute the integration logic if required. It acts as sender or receiver of XML messages. So, the Application system with a local Integration Engine requires the Integration server to execute the integration logic.
v      Two ways of Global configuration for configuring your business system to call an Integration Server (Other than your business system):
o        http://<host>:<port>/sap/xi/engine?type=entry
<host> - Integration Server host name
<Port> - HTTP port.
Note: Provide the user and password with the HTTP service (/sap/xi/engine) in the target system. All the XML messages on the Integration Server are processed using the above user details.
?     dest://<Integration Server-Destination>
      Create a RFC destination of type H in the current client and provide host name, port of the integration server and path prefix as
      /sap/xi/engine?type=entry
      Also provide the user and the password.