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 query ?

Former Member
0 Likes
1,019

hai friends.

I want to select data in interactive list based on basic list. I want to display in the interactive list two columns vkgrp(s707) and bezei(tvgrt).

Can i give my select query like this:-

select vkgrp from s707

into table first_sec_list

for all entries in tbl_final

where vkbur = tbl_final-vkbur

and vkbur = fields-value.

here how should i select bezei which is in the table tvgrt for the corresponding vkgrp??

8 REPLIES 8
Read only

Former Member
0 Likes
979

For interactive lists you need to hide the field based on which you need to select the secondary list.So you need to hide the field <b>tbl_final-vkbur</b> for fetching the secondary list.

Read only

Former Member
0 Likes
979

Hi,

select bezei from tvgrt

into table it_tvgrt

for all entries in first_sec_list

where vkgrp = first_sec_list-vkgrp

and spras = sy-langu.

Reward points If helpful.

Regards

Amole

Read only

0 Likes
979

hi amole..

in my ALV

I hav to display VKGRP and BEZEI in one column. For this I hav to get the data based on basic list(tbl_final).

can i use

select vkgrp from s707

into table first_sec_list

for all entries in tbl_final

where vkbur = tbl_final-vkbur.

select single bezei from tvgrt into

first_sec_list where vkgrp = <b>s707</b>-vkgrp and

spras = sy-langu.

append first_sec_list.

Is where condition right ? Can v use select single..Plz correct me

Read only

0 Likes
979

HI Hari,

Yes the where condition looks OK. ONly thing is that you should either hide that field in the basic list or use get cursor field <fld> value <val> statement. then only you can use that where condition.

Yes you can use select single.

Regards,

Ravi

Read only

0 Likes
979

i m putting in where condition S707 which is database table.?? Is this ok.

One more question plz..how should i handle exceptions in..after call fm reuse_alv_grid_display.

exceptions

program_error = 1

others = 2

.

Read only

Former Member
0 Likes
979

Hi,

Select is fine. Just hide the field vkbur

when you display basic list.

loop at it_final.

hipe it_final-vkbur.

endloop.

Exception cab be handled in the following way.

Case sy-subrc .

when '1'.

message

when '2;.

message

endcase.

Reward points if helpful

Regards

Amole

Read only

0 Likes
979

Hi amole..

small doubt?

i hav given like this:-

CASE sy-subrc.

WHEN '1'.

MESSAGE e002.

WHEN OTHERS.

MESSAGE e003.

ENDCASE.

but when i m clicking back button...it is showing error in status bar. It's not going to my basic llist.

Read only

Former Member
0 Likes
979

Hi Hari,

What error you are getting ?

Regards

Amole