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

Select & Join; Combine 2 Standard Table Into Internal Table

azlanmn
Explorer
0 Likes
1,157

Hi ABAPers Guru,

i try to joint selected fields from 2 standard table into internal table. I also input some parameter into the program.

But the data not loaded to my internal table. Can any of you advise me, where is the failure?

REPORT zmn_pflegen_benutzer_drucker.

*Input parameter

PARAMETERS: p_pfzz TYPE b919-zzuser,

p_pfldne TYPE nach-ldest,

p_pfta TYPE i.

*Data declaration

TYPES: BEGIN OF s_pflegen_benutzer_drucker,

benutzer TYPE b919-zzuser,

konditionssatz TYPE b919-knumh,

drucker TYPE nach-ldest,

END OF s_pflegen_benutzer_drucker.

DATA: ls_pflegen_benutzer_drucker TYPE s_pflegen_benutzer_drucker,

lt_pflegen_benutzer_drucker TYPE TABLE OF s_pflegen_benutzer_drucker.

*Combine b919-zzuser, b919-knumh/nach-knumh and nach-ldest

SELECT b919~zzuser b919~knumh nach~ldest

FROM b919 INNER JOIN nach ON b919~knumh = nach~knumh

INTO CORRESPONDING FIELDS OF TABLE lt_pflegen_benutzer_drucker

WHERE b919~zzuser = p_pfzz.

Thanks in advance for the helpful advice!

1 ACCEPTED SOLUTION
Read only

azlanmn
Explorer
0 Likes
1,067

Thank you for your tips. I found the ‘bug’! My original statement is correct. The failure is due to parameter that I use is in small capitals! If I write the input in the parameter with all capital, it work!

Hi ABAPers Guru,

i try to joint selected fields from 2 standard table into internal table. I also input some parameter into the program.

But the data not loaded to my internal table. Can any of you advise me, where is the failure?

REPORT zmn_pflegen_benutzer_drucker.

*Input parameter

PARAMETERS: p_pfzz TYPE b919-zzuser,

p_pfldne TYPE nach-ldest,

p_pfta TYPE i.

*Data declaration

TYPES: BEGIN OF s_pflegen_benutzer_drucker,

benutzer TYPE b919-zzuser,

konditionssatz TYPE b919-knumh,

drucker TYPE nach-ldest,

END OF s_pflegen_benutzer_drucker.

DATA: ls_pflegen_benutzer_drucker TYPE s_pflegen_benutzer_drucker,

lt_pflegen_benutzer_drucker TYPE TABLE OF s_pflegen_benutzer_drucker.

*Combine b919-zzuser, b919-knumh/nach-knumh and nach-ldest

SELECT b919~zzuser b919~knumh nach~ldest

FROM b919 INNER JOIN nach ON b919~knumh = nach~knumh

INTO CORRESPONDING FIELDS OF TABLE lt_pflegen_benutzer_drucker

WHERE b919~zzuser = p_pfzz.

Thanks in advance for the helpful advice!

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
1,067

Do a SELECT only on table B919 to see if you get rows with ZZUSER = P_PFZZ.

If yes, take the value of KNUMH of the first line of B919, and do a SELECT on table NACH to see if there's at least one line with same KNUMH.

Read only

azlanmn
Explorer
0 Likes
1,068

Thank you for your tips. I found the ‘bug’! My original statement is correct. The failure is due to parameter that I use is in small capitals! If I write the input in the parameter with all capital, it work!