Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR_READ_INFOTYPE

Former Member
0 Kudos

hi ,

In this function module HR_READ_INFOTYPE wat is the field for pernr

and infty , and infty_tab

can i get the answer as soon as possible

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

call function 'HR_READ_INFOTYPE'

exporting

TCLAS = 'A'

PERNR =

INFTY =

BEGDA = '18000101'

ENDDA = '99991231'

BYPASS_BUFFER = ' '

LEGACY_MODE = ' '

IMPORTING

SUBRC =

TABLES

INFTY_TAB =

EXCEPTIONS

INFTY_NOT_FOUND = 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.

Try This Report

TYPES: BEGIN OF TY_TAB,

FLD1 TYPE I,

FLD2 TYPE CHAR10,

FLD3 TYPE I,

FLD4 TYPE I,

END OF TY_TAB.

DATA: ITAB TYPE STANDARD TABLE OF TY_TAB, "Dynamic table

WA_ITAB TYPE TY_TAB.

DATA: L_CNT TYPE I.

FIELD-SYMBOLS: <FS> TYPE ANY.

WA_ITAB-FLD1 = 1.

WA_ITAB-FLD2 = 'test'.

WA_ITAB-FLD3 = 3.

APPEND WA_ITAB TO ITAB.

WA_ITAB-FLD1 = 1.

WA_ITAB-FLD2 = 'test'.

WA_ITAB-FLD3 = 3.

APPEND WA_ITAB TO ITAB.

LOOP AT ITAB INTO WA_ITAB.

DO.

L_CNT = L_CNT + 1.

ASSIGN COMPONENT L_CNT OF STRUCTURE WA_ITAB TO <FS>.

IF SY-SUBRC 0.

EXIT.

ENDIF.

IF <FS> IS INITIAL.

  • processing for initial.

ENDIF.

ENDDO.

CLEAR L_CNT.

ENDLOOP.

Thanks&Regards,

Naresh

5 REPLIES 5

Former Member
0 Kudos

Hi,

Check this sample code for details-


*"-------------------------------------------------------------------"*
*Tables Declaration.
*"-------------------------------------------------------------------"*
tables:
 pa0041.
*"-------------------------------------------------------------------"*
*Parameters Declaration.
*"-------------------------------------------------------------------"*
parameters:
 p_pernr type pa0000-pernr,            " Presonnel Number.
 p_date  type pa0041-dar01.            " Date type.
*"-------------------------------------------------------------------"*
*Internal Tables Declaration.
*"-------------------------------------------------------------------"*
data:
  t_pa0041 like standard table
        of p0041.
data:
   fs_pa0041 like line of t_pa0041,
   w_date type pa0041-dat01,
   w_dtype type pa0041-dar01,
   t_t548 like standard table of t548t,
   fs_t548 like line of t_t548.
*"-------------------------------------------------------------------"*
*                  START-OF-SELECTION.
*"-------------------------------------------------------------------"*
start-of-selection.
perform read_data.
*&---------------------------------------------------------------------*
*&      Form  read_data
*&---------------------------------------------------------------------*
*       This Subroutine Read data from Infotype 0041 Through FM.
*----------------------------------------------------------------------*
*       There Is No interface parameter to be passed in this subroutine
*----------------------------------------------------------------------*
form read_data .

 call function 'HR_READ_INFOTYPE'
    exporting
      pernr                 = p_pernr
      infty                 = '0041'
     begda                 = sy-datum
     endda                 = sy-datum
    tables
      infty_tab             = t_pa0041
   exceptions
     infty_not_found       = 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.                               " IF sy-subrc <> 0.

endform.                               " Read_data.

Regards,

Sujit

Former Member
0 Kudos

Hi,

Infity should be the Infotype for that particular HR Table. Check T528A table for this. and Infy_tab should be the internal table of the HR Infotype.

Thanks & Regards,

Ramana

Former Member
0 Kudos

Hi,

call function 'HR_READ_INFOTYPE'

exporting

TCLAS = 'A'

PERNR =

INFTY =

BEGDA = '18000101'

ENDDA = '99991231'

BYPASS_BUFFER = ' '

LEGACY_MODE = ' '

IMPORTING

SUBRC =

TABLES

INFTY_TAB =

EXCEPTIONS

INFTY_NOT_FOUND = 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.

Try This Report

TYPES: BEGIN OF TY_TAB,

FLD1 TYPE I,

FLD2 TYPE CHAR10,

FLD3 TYPE I,

FLD4 TYPE I,

END OF TY_TAB.

DATA: ITAB TYPE STANDARD TABLE OF TY_TAB, "Dynamic table

WA_ITAB TYPE TY_TAB.

DATA: L_CNT TYPE I.

FIELD-SYMBOLS: <FS> TYPE ANY.

WA_ITAB-FLD1 = 1.

WA_ITAB-FLD2 = 'test'.

WA_ITAB-FLD3 = 3.

APPEND WA_ITAB TO ITAB.

WA_ITAB-FLD1 = 1.

WA_ITAB-FLD2 = 'test'.

WA_ITAB-FLD3 = 3.

APPEND WA_ITAB TO ITAB.

LOOP AT ITAB INTO WA_ITAB.

DO.

L_CNT = L_CNT + 1.

ASSIGN COMPONENT L_CNT OF STRUCTURE WA_ITAB TO <FS>.

IF SY-SUBRC 0.

EXIT.

ENDIF.

IF <FS> IS INITIAL.

  • processing for initial.

ENDIF.

ENDDO.

CLEAR L_CNT.

ENDLOOP.

Thanks&Regards,

Naresh

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.