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

Dynamic data statements

Former Member
0 Likes
486

Hi,

I need help regarding a dynamic data statement. I'm selecting data from a table like this:-

DATA: lv_table(20) type c.

lv_table = e_s_odstabname-c_log.

SELECT * FROM (LV_TABLE)

INTO lv_wa UP TO 1 ROWS

WHERE PARAM1 = p_parm1

AND PARAM2 = p_parm2.

ENDSELECT.

I need to declare the lv_wa the same as the value contained in lv_table but I don't know how to do this.

Any help would be great.

KR,

C

4 REPLIES 4
Read only

Former Member
0 Likes
460

hi C,

declare it as

data :  lv_wa like lv_table occurs 0 with header line.

or

data :  lv_wa like lv_table occurs 0.

Regards,

santosh

Read only

andreas_mann3
Active Contributor
0 Likes
460

hi,

look this:

 CREATE DATA dwa TYPE  (itab-tabname).
    ASSIGN dwa->* TO <wa>.
                                                                        
    SELECT SINGLE * FROM (itab-tabname) INTO <wa>
     WHERE (wtab).

Read only

athavanraja
Active Contributor
0 Likes
460

use field-symbol

data: begin of work, buffer(30000), end of work.

field-symbols: <wa> type any .

assign work to <wa> casting type (LV_TABLE).

SELECT * FROM (LV_TABLE)

INTO <wa> UP TO 1 ROWS

WHERE PARAM1 = p_parm1

AND PARAM2 = p_parm2.

ENDSELECT.

Regards

Raja

Read only

0 Likes
460

Hi Raja,

the problem I have now is I use a field from <wa> for another select and I'm getting a syntax error telling me <wa> has no structure and therefore no component called "REQUEST".

KR

C