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

ABAP SQL Doubt

Former Member
0 Likes
595

Hi ABAP Gurus,

Please help me in solving following ABAP SQL doubt.

In the table Zonfig there are two fields: FNAME and REQFLAG

FNAME.....REQFLAG

S1...........X

S2...........X

S3..........._

S4...........X

Other table T_Zconfig has one field : XNAME

XNAME

S1

S3

Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.

That is in this case for FNAME S1 and S2 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S2.

Points will be surly awarded...

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
566

Hi ABAP Gurus,

Please help me in solving following ABAP SQL doubt.

In the table Zonfig there are two fields: FNAME and REQFLAG

FNAME.....REQFLAG

S1...........X

S2...........X

S3..........._

S4...........X

Other table T_Zconfig has one field : XNAME

XNAME

S1

S3

Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.

That is in this case for FNAME S1 and S3 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S3.

Points will be surly awarded...

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
567

Hi ABAP Gurus,

Please help me in solving following ABAP SQL doubt.

In the table Zonfig there are two fields: FNAME and REQFLAG

FNAME.....REQFLAG

S1...........X

S2...........X

S3..........._

S4...........X

Other table T_Zconfig has one field : XNAME

XNAME

S1

S3

Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.

That is in this case for FNAME S1 and S3 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S3.

Points will be surly awarded...

Thanks.

Read only

0 Likes
566

Do a join...

Select zonfig~fname zonfig~regflag into table izonfig
      from zonfig
         inner join t_zconfig
            on zonfig~xname = t_zconfig~xname.

Regards,

Rich Heilman

Read only

0 Likes
566

HI Tushar,

Check this code.

SELECT REQFLAG

FROM ZCONFIG

INNER JOIN T_ZCONFIG

ON T_ZCONFIGXNAME = ZCONFIGFNAME

INTO TABLE ITAB

WHERE ......

Read only

Former Member
0 Likes
566

try this

data: itab like Zonfig occurs 0 with header line.

data: v_xname like T_Zonfig-xname.

select xname into v_xname T_Zonfig.

seleect FNAME REQFLAG appending itab from Zonfig.

enselect.

Let me know if it helped.