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 from view

Former Member
0 Likes
2,587

hallow

i try to do select from view and i get erorr ,what i miss?

LOOP AT zem_rec INTO wa_zem.

SELECT SINGLE ktext

FROM v_cskr_s

INTO wa_zem-ktext

WHERE resrc = g_r_resrc.

IF sy-sybrc = 0.

MODIFY zem_rec FROM wa_zem TRANSPORTING ktext.

ENDIF.

ENDLOOP.

<b>"V_CSKR_S" is not defined in the ABAP Dictionary as a table, projection

view, or database view.</b>

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,047

hi

check whether a view with that name exists or not if not create one with that name

9 REPLIES 9
Read only

Former Member
0 Likes
1,047

Hi!

v_cskr_s is a database view. Just check it out in SE11 transaction. It is a join of the tables

CSKR

CSKV

CSKR MANDT = CSKV MANDT

CSKR KOKRS = CSKV KOKRS

CSKR RESRC = CSKV RESRC

CSKR DATBI = CSKV DATBI

Put your select single, outside of the loop to increase the performance, if it is not using the wa in the where conditions. It will select always the same thing so it is not needed to run within the loop.

Regards

Tamá

Read only

0 Likes
1,047

hi Tamás Nyisztor

u can give me example i new with this topic?

Regards

Read only

Former Member
0 Likes
1,048

hi

check whether a view with that name exists or not if not create one with that name

Read only

0 Likes
1,047

hi Premalatha G

this view is exists in database.

Thanks

Read only

0 Likes
1,047

have you declared the view in the top of you're abap program in the table section ?

tables: v_cskr_s.

Message was edited by:

A. de Smidt

Read only

0 Likes
1,047

hi A

i declare it and i have the same eroorr.

Regards

Read only

0 Likes
1,047

check if you can get values if you use se16n on that view otherwise use the joins instead for you're select.

Read only

0 Likes
1,047

hi a

u can give me example how to use join for that?

i reward

Regards

Read only

0 Likes
1,047

you don't need the join since all the fields are in cskv that you need

SELECT SINGLE ktext

FROM cskv

INTO wa_zem-ktext

WHERE resrc = g_r_resrc.

Message was edited by:

A. de Smidt