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

Help with this SELECT

former_member384574
Active Participant
0 Likes
559

Hi to everybody!!

I need help or any idea that can help me to solve my problem... I've to make an ALV with two differents infotypes, PA0002 and PA0015, I have to print from PA0002 pernr, perid, vorna and nachn and from PA0015 I have to print BETRG.

I make this with an inner join, but doesn't work well, this is my select

SELECT

PA0002PERNR PA0002PERID

PA0002VORNA PA0002NACHN

PA0015~LGART

INTO

(wa_tabla-pernr, wa_tabla-perid, wa_tabla-vorna,

wa_tabla-nachn, wa_tabla-betrg)

FROM PA0002 INNER JOIN pa0015 ON

PA0002PERNR = PA0015PERNR

GROUP BY

PA0002PERNR PA0002PERID

PA0002VORNA PA0002NACHN

PA0015~LGART.

APPEND wa_tabla TO itab_tabla.

ENDSELECT.

DOes anybody tell me what happend? Or any other idea for do this?!

Thanks very much!

1 ACCEPTED SOLUTION
Read only

former_member787646
Contributor
0 Likes
525

Hi

Instead of using SELECT ...ENDSELECT you can save the records in the internal table at one go using

Array Fetch.

Try this....

SELECT

PA0002PERNR PA0002PERID

PA0002VORNA PA0002NACHN

PA0015~LGART

INTO TABLE itab_tabla FROM PA0002 INNER JOIN pa0015 ON

PA0002PERNR = PA0015PERNR.

Hope it helps.

Murthy

3 REPLIES 3
Read only

Former Member
0 Likes
525

Hi ,

Take an internal table with all required fields .

SELECT

PA0002PERNR PA0002PERID

PA0002VORNA PA0002NACHN

PA0015~LGART

INTO * table itab *

FROM PA0002 INNER JOIN pa0015 ON

PA0002PERNR = PA0015PERNR

After fetching the entire data use sort . This even increases the performance

Read only

former_member787646
Contributor
0 Likes
526

Hi

Instead of using SELECT ...ENDSELECT you can save the records in the internal table at one go using

Array Fetch.

Try this....

SELECT

PA0002PERNR PA0002PERID

PA0002VORNA PA0002NACHN

PA0015~LGART

INTO TABLE itab_tabla FROM PA0002 INNER JOIN pa0015 ON

PA0002PERNR = PA0015PERNR.

Hope it helps.

Murthy

Read only

0 Likes
525

Thanks a lot! It works perfectly