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: 

How to check values inside a table?

siongchao_ng
Contributor
0 Kudos

Hi all, I have a list of pernr (personnel number) and a list of database tables (eg: pa0001, pa0002, pa0003....) I need to check the list of pernr against the pernr INSIDE all the tables.

*list of my tables

LOOP at t_infty INTO w_infty where begda = a_payperiod-begda

and endda = a_payperiod-endda.

*list of my pernr

READ TABLE a_pernr_tbl INTO w_a_pernr_tbl WITH KEY pernr = w_infty-pernr.

t_infty contains list of pa****-pernr but cannot loop it into w_infty.

Problem is the structure of w_infty is deep. I cant get the values of pernr from the tables to be checked.

7 REPLIES 7

Former Member
0 Kudos

What are the exact definitions of t_infy and w_infty?

0 Kudos

types: begin of ty_infty,

pernr type string,

begda type string,

endda type string,

end of ty_infty.

data t_infty type standard table of ty_infty.

data w_infty like line of t_infty.

pernr means pa0001-pernr, pa0002-pernr and so on...

Edited by: Siong Chao on Jan 26, 2010 10:51 AM

Sm1tje
Active Contributor
0 Kudos

What exactly is the problem you are facing here? Coding looks ok to me. You have personnel numbers inside internal table t_infty. For every personnel number you do a read on your internal table with personnel numbers.

t_infty contains list of pa****-pernr but cannot loop it into w_infty.

Problem is the structure of w_infty is deep.

w_infty is not deep, just a simple (flat) structure with personnel number and start- and end date.

I cant get the values of pernr from the tables to be checked.

So does this mean that your internal table a_pernr_tbl is not yet filled with the relevant personnel numbers?

I do have a question for you though. Are all personnel numbers from all PA*** tables in your internal table a_pernr_tbl or do you have a separate internal table per PA*** database table?

0 Kudos

a_pernr_tbl contain list of pernr (personnel numbers)

t_infty contains list of database tables (eg: pa0001 pa0002 and so on which in turn contains pernr field inside each of the tables)

Question: How do i check the list pernrtbl against another table that do not consist pernr but a list of database tables which have pernr fields inside its tables??

Former Member
0 Kudos

Hi,

IN HR-ABAP most of the structures are deep structure, so u have to loop it and make the personal number in one table.

OR

Please find the Standard SAP Function Module to get PERNER.

U can easily achieve it.

Regards

Arbind

former_member217316
Contributor
0 Kudos

Hi Siong

Even if the structure is deep, you'll have to loop over it and get the personnel nos in one table.

Else, you can use some of the standard FMs.

Depending upon your suitability, you can use any of these:

1) BAPI_USER_GET_DETAIL.

2) CATSXT_GET_USER_ID_OF_PERNR.

3) HR_USER_PERNR_CUT.

Hope this helps.

Harsh

siongchao_ng
Contributor
0 Kudos

Its done by:

loop at itab2 (the list of database tables name) into wa2.

select pernr into itab3.

loop at itab1 (list of pernr) into wa1

read table itab3 nto wa3 with key pernr = wa1