‎2006 Aug 22 11:43 AM
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
‎2006 Aug 22 11:46 AM
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
‎2006 Aug 22 11:49 AM
hi,
look this:
CREATE DATA dwa TYPE (itab-tabname).
ASSIGN dwa->* TO <wa>.
SELECT SINGLE * FROM (itab-tabname) INTO <wa>
WHERE (wtab).
‎2006 Aug 22 11:52 AM
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
‎2006 Aug 22 12:07 PM
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