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: 

ABAP HR: Read data from q0006

Former Member
0 Kudos

Hi,

I want to read the records from q0006. Please the req below.

Concatenate Telephone number area code (Q0006-AREAX) and Telephone number (Q0006-TELNX) where Address Type (P0006-ANSSA) = "1" (Permanent residence) and Communications Type (P0006-COMXX) = "TEL1".

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use FM

HR_READ_INFOTYPE


  DATA RETCD LIKE SY-SUBRC.
  DATA: P0006 LIKE P0006 OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'HR_READ_INFOTYPE'
       EXPORTING
            TCLAS           = 'A'
            PERNR           = EMPLOYEENUMBER
            INFTY           = '0006'
            BEGDA           = TIMEINTERVALLOW
            ENDDA           = TIMEINTERVALHIGH
       IMPORTING
            SUBRC           = RETCD
       TABLES
            INFTY_TAB       = P0006
       EXCEPTIONS
            INFTY_NOT_FOUND = 1
            OTHERS          = 2.

split for Area code and number is

wa_ca-areac = wa_ca-telnr+0(3).
        wa_ca-telnr = wa_ca-telnr+3(11).

5 REPLIES 5

Former Member
0 Kudos

Use FM

HR_READ_INFOTYPE


  DATA RETCD LIKE SY-SUBRC.
  DATA: P0006 LIKE P0006 OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'HR_READ_INFOTYPE'
       EXPORTING
            TCLAS           = 'A'
            PERNR           = EMPLOYEENUMBER
            INFTY           = '0006'
            BEGDA           = TIMEINTERVALLOW
            ENDDA           = TIMEINTERVALHIGH
       IMPORTING
            SUBRC           = RETCD
       TABLES
            INFTY_TAB       = P0006
       EXCEPTIONS
            INFTY_NOT_FOUND = 1
            OTHERS          = 2.

split for Area code and number is

wa_ca-areac = wa_ca-telnr+0(3).
        wa_ca-telnr = wa_ca-telnr+3(11).

0 Kudos

Thanks for the quick reply... How can I connect this two tables... and get the data..

0 Kudos

All the data is stored in table PA0006. you can use the above function module to read the table. This FM will return you a table in which all the info you need is there.

A

0 Kudos

Hi,

when we go to the infotype 0006 from pa30 and select f1 help on Q0006-AREAC,

but Q0006 is a structure and there is no field with name AREAC in the table PA0006,

how can we fetch the data for that and what is the table for that structure.

plz help me to know this.

Thanks and Regards

Zarah

0 Kudos

Hi

Answers for all your questions are available in the above posts. Let us know if you need anything else apart from this.

Regards

Ranganath