Skip to Content
0
Former Member
Jun 09, 2008 at 12:29 PM

How to create instance :

52 Views

Hai gurues,

I have one modification project, in that one line is declared like this.

go_infty = cl_hrsen_read_infotype_fmri=>get_instance( ).

Here i don't know about which one is instance and how it's act etc.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(EMPLOYEE_NO) TYPE P_PERNR

*" TABLES

*" ET_EMP_QUALIFICATION STRUCTURE ZEMP_QUALIFICATION OPTIONAL

*"----


DATA: go_infty TYPE REF TO if_hrsen_read_infotype.

DATA: gt_prelp_tab TYPE prelp_tab .

DATA: gt_0024 TYPE TABLE OF p0024,

wa_p0024 TYPE p0024,

lt_t574b TYPE TABLE OF t574b,

wa_t574b TYPE t574b,

lt_t777q TYPE TABLE OF t777q,

wa_t777q TYPE t777q.

go_infty = cl_hrsen_read_infotype_fmri=>get_instance( ).

*---- Fetch the data from p0024----


CALL METHOD go_infty->read

EXPORTING

pernr = employee_no

infty = '0024'

begda = '18000101'

endda = '99991231'

no_auth_check = space

IMPORTING

infotype_tab = gt_prelp_tab

EXCEPTIONS

e_assertion = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

*----


Type conversion of Pnnnn structures into PRELP

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn_tab

EXPORTING

prelp_tab = gt_prelp_tab

IMPORTING

pnnnn_tab = gt_0024.

*----


Qualification Names -


IF gt_0024[] IS NOT INITIAL.

SELECT * FROM t574b INTO TABLE lt_t574b

FOR ALL ENTRIES IN gt_0024

WHERE quali = gt_0024-quali AND

langu = sy-langu.

ENDIF.

*----


Proficiency Texts -


IF gt_0024[] IS NOT INITIAL.

SELECT * FROM t777q INTO TABLE lt_t777q

FOR ALL ENTRIES IN gt_0024

WHERE chara = gt_0024-auspr AND

langu = sy-langu.

ENDIF.

LOOP AT gt_0024 INTO wa_p0024.

READ TABLE lt_t574b INTO wa_t574b

WITH KEY quali = wa_p0024-quali

langu = sy-langu BINARY SEARCH.

READ TABLE lt_t777q INTO wa_t777q

WITH KEY chara = wa_p0024-auspr

langu = sy-langu BINARY SEARCH .

et_emp_qualification-employeeno = wa_p0024-pernr.

et_emp_qualification-startdate = wa_p0024-begda.

et_emp_qualification-enddate = wa_p0024-endda.

  • ET_EMP_QUALIFICATION-QUALI_KEY = wa_p0024-QUALI.

et_emp_qualification-quali_text = wa_t574b-qtext.

et_emp_qualification-proficiency = wa_t777q-chara_text.

APPEND et_emp_qualification TO et_emp_qualification

SORTED BY startdate .

ENDLOOP.

ENDFUNCTION.