cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching data from PA0105

Former Member
0 Kudos

Hi,

I have to fetch phone no,mobile and fax from PA0105.I am using HR_READ_INFOTYPE. I am getting the data into the internal table but not sure how to display the data on the screen.

I have declared the internal table as

DATA it_pa0105 TYPE STANDARD TABLE OF pa0105.

Please suggest how can I get phone no. mobile no and fax no.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

DATA DECLARE : USRID TYPE PA0105-USERID,

STATEMENT :

SELECT SINGLE USRID

FROM PA0105

INTO USRID

WHERE PERNR EQ WA_DEV-PERNR

AND ENDDA EQ '99991231'.

DISPLAY

WA_FCAT-FIELDNAME = 'USRID'.

WA_FCAT-REF_TABNAME = 'PA0105'.

WA_FCAT-REF_FIELDNAME = 'USRID'.

WA_FCAT-SELTEXT_L = 'EMAIL ID'.

WA_FCAT-SELTEXT_M = 'EMAIL ID'.

WA_FCAT-SELTEXT_S = 'EMAIL ID'.

WA_FCAT-OUTPUTLEN = '10'.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

Sheetal

sikindar_a
Active Contributor
0 Kudos

As said by our Guru dilek

u have not included the sub type inculde than u will get the desired results

Former Member
0 Kudos

Hi!

select single USRID_long from pa0105 into it_active-email where pernr = it_active-sapid and begda le pn-endda and

endda eq '99991231' and subty = '0010'.

Regards

Sheetal

Former Member
0 Kudos

Hi,

READ TABLE it_pa0105 WITH KEY SUBTY = '0002'. --> Write here the subty of phone

WRITE it_pa0105-USRID -- phone number

READ TABLE it_pa0105 WITH KEY SUBTY = 'CELL'.

WRITE it_pa0105-USRID -- mobile phone number

READ TABLE it_pa0105 WITH KEY SUBTY = '0005'.

WRITE it_pa0105-USRID -- fax number

Regards,

Dilek

Former Member
0 Kudos

Hi,

I tried this as below:

READ TABLE it_pa0105 into wa_pa0105 WITH KEY SUBTY = '0002'.

wa_card-phone = wa_pa0105-USRID.

But in the wa there is no value so it is not assigned to the screen field.Please suggest if there is some problem with the code or do I need to do something else.

Former Member
0 Kudos

Make sure that internal table it_pa0105 has a header line. If not, define it with the addition ... WITH HEADER.

Dilek

Former Member
0 Kudos

Its getting the data now. But in all the 3 fields there is only one value.

Former Member
0 Kudos

Could u pls elaborate?

Dilek

Former Member
0 Kudos

Now I have declared it as the table with the header line and I am using like this

READ TABLE it_pa0105 WITH KEY SUBTY = '0002'.

wa_card-phone = it_pa0105-USRID.

READ TABLE it_pa0105 WITH KEY SUBTY = 'CELL'.

wa_card-mobile = it_pa0105-USRID.

READ TABLE it_pa0105 WITH KEY SUBTY = '0005'.

wa_card-fax = it_pa0105-USRID.

But in the output I am getting L322546223 in all the 3 fields.Though al the fields have different value in the table.322546223 is the value in the cell field.L is getting appended on its own.the other values are 21255453(phone) and 12121(mobile).Please suggest the solution.

Former Member
0 Kudos

Try the code below.

And make sure that the subtypes are the right subtypes in your system and the personnel number you're trying has PA0105 records.

CLEAR wa_card-phone .

READ TABLE it_pa0105 WITH KEY SUBTY = '0002' ENDDA = "31129999".

wa_card-phone = it_pa0105-USRID.

CLEAR wa_card-mobile.

READ TABLE it_pa0105 WITH KEY SUBTY = 'CELL' ENDDA = "31129999".

wa_card-mobile = it_pa0105-USRID.

CLEAR wa_card-fax .

READ TABLE it_pa0105 WITH KEY SUBTY = '0005' ENDDA = "31129999".

wa_card-fax = it_pa0105-USRID.

Regards,

Dilek