Application Development and Automation 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: 
Read only

Question

Former Member
0 Likes
639

Hello Experts,

I am trying to join tables CATSCO and query it to get me the personnel number, sender cost center, hours worked. But i also need to join it to PA0001 to get me the personnel name and CSKS to get me the responsible person for the sender cost center.

My issue is that i am able to join CATSCO and CSKS but however, when i try to join the table CATSCO and PA0001 i get a duplication for the entry. For Example,

I get 3 lines with the same entry whereas it should have been just one. Also,

i am wondering whether we can join CATSCO and PA0001? Any help will be appreciated.

Thanks,

R

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

Hi

You will get multiple records for a single PERNR from PA0001 because records are maintained on Time period basis.

so while joining the tables CATSCO and PA0001 in the where condition use the condition

where PA0001~ENDDA = '99991231'. so that you will get the last record for that PERNR, which is needed.

Reward points if useful

regards

Anji

4 REPLIES 4
Read only

suresh_datti
Active Contributor
0 Likes
611

ie b'coz PA0001 is driven by time constraint that doesn't allow any overlaps.. since you are picking only ename from pa0001, there could always exitst more than one record for the same prenr & ename but with with a diff begda & endda.. obviously all the records get picked by you r query.. try if you can use the DELETE ADJACENT DUPLICATES by using the add code option like in an Infoset Query.

~Suresh

Read only

0 Likes
611

Hi Suresh,

What would be the statement i need to code in ABAP to acheive the same.

Thanks,

R

Read only

Former Member
0 Likes
612

Hi

You will get multiple records for a single PERNR from PA0001 because records are maintained on Time period basis.

so while joining the tables CATSCO and PA0001 in the where condition use the condition

where PA0001~ENDDA = '99991231'. so that you will get the last record for that PERNR, which is needed.

Reward points if useful

regards

Anji

Read only

Former Member
0 Likes
611

Hello,

Thanks for your replies. I tried it but when i am doing the select into pa0001 from catsco it is asking for PA0001-SUBTYP, PA0001-OBJPS, PA0001-SPRPR and PA0001-SEQNR.

Please let me know your thoughts.

Thanks,

Rohit