2007 Jan 29 12:37 PM
hi all,
may i know if can select into variable and itab or into variable and working area in the same select statement?
if cannot then what should do.
select x y into ( l_x , l_y ) a b c into corresponding field of table itab .......
or
select x y into ( l_x , l_y ) a b c into correspondinf field of working area .....
thanks
hi all,
may i know if can select into variable and itab or into variable and working area in the same select statement?
if cannot then what should do.
select x y into ( l_x , l_y ) a b c into corresponding field of table itab .......
or
select x y into ( l_x , l_y ) a b c into correspondinf field of working area .....
thanks
2007 Jan 29 12:41 PM
I think into is valid for one area , Two 'INTO'S cannot be simultaneously accessed in a select .
In my opinion this is not possible .
regards,
vijay
2007 Jan 29 1:03 PM
what about following:
select x y into (l_x, l_y ).
wa-x = l_x.
wa-y = l_y.
append wa to itab.
or
select x y into wa.
l_x = wa-x.
l_y = wa-y.
Message was edited by:
Florian Kemmer
2007 Jan 29 1:25 PM
Hi,
select x y <b>into </b>( l_x , l_y ) a b c <b>into</b> corresponding field of table itab .......
or
select x y <b>into</b> ( l_x , l_y ) a b c <b>into </b>correspondinf field of working area .....
It is not possible to use into twice in select statement
The different possibilities are
Report zex33.
tables : likp.
select-options : s_vbeln for likp-vbeln.
data : begin of itab occurs 0,
vbeln like likp-vbeln,
vstel like likp-vstel,
end of itab.
data : v_vbeln like likp-vbeln,
v_vstel like likp-vstel.
data : wa_itab like itab.
****Method 1**************
select vbeln vstel into (v_vbeln , v_vstel)
from likp
where vbeln in s_vbeln.
itab-vbeln = v_vbeln.
itab-vstel = v_vstel.
append itab.
clear itab.
endselect.
******************************
********Method 2***********
*select vbeln vstel into wa_itab
* from likp
* where vbeln in s_vbeln.
*insert wa_itab into table itab.
*endselect.
**********************************
**********Method 3*************
*select vbeln vstel into table itab
* from likp
* where vbeln in s_vbeln.
*********************************
loop at itab.
write : / itab-vbeln , itab-vstel.
endloop.
2007 Jan 29 1:39 PM
cannot have two into clauses.
use the logic as suggested above.
kiran
2007 Jan 29 1:42 PM
just for the memory:
in ABAP you as well can NO`T do following
Data:
a type c,
b type c,
c type c.
a = b = c.
2007 Jan 29 1:56 PM
You can do something like this:
SELECT SINGLE VBELN ERNAM ERDAT VSTEL
INTO (I_TAB-VBELN, I_TAB-ERNAM, V_ERDAT, V_VSTEL)
FROM LIKP
WHERE VBELN = V_VBELN.
2007 Jan 29 1:56 PM
Hi,
You can not have two INTO in one SELECT clause. In your case, along with a variable, use fields of work area & then append the work area to an internal table.
TABLES : vbap.
DATA : it_vbap TYPE TABLE OF vbap.
DATA : x_vbap TYPE vbap.
DATA : v_vbeln TYPE vbeln.
DATA : v_mandt TYPE mandt.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.
SELECT mandt vbeln posnr matnr
FROM vbap
INTO (v_mandt, v_vbeln, x_vbap-posnr, x_vbap-matnr)
WHERE vbeln IN s_vbeln.
IF sy-subrc = 0.
APPEND x_vbap TO it_vbap.
ENDIF.
ENDSELECT.
Reward points if the answer is helpful.
Regards,
Mukul
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |