08-25-2008 2:39 PM
hi,
i need to get value field from table bseg for the same document number.
for the same document number, there are several line item. i just want to get :
where hkont = '400000' get the value and put in wa_itab-dmbtr1.
where hkont = '700000' get the value. and put in wa_itab-dmbtr2.
may i know how to use the select statement to get both value?
thanks
08-25-2008 2:42 PM
Hi
where hkont = '400000' get the value and put in wa_itab-dmbtr1.
where hkont = '700000' get the value. and put in wa_itab-dmbtr2.
Select
field1
field2
from <tablename>
into ( w_temp)
where HKONT eq '400000' OR HKONT EQ '700000'.
if HKONT EQ '400000' .
wa_itab-dmbtr1 = w_temp.
elseif HKONT EQ '700000'
wa_itab-dmbt2 = w_temp.
endif.
endselect.
" You need to use OR and one temporary variable
.
Regards
Pavan
08-25-2008 2:42 PM
Hi,
Select dmbtr from bseg into ( wa_itab-dmbtr1 ) where belnr = p_belnr and ( hkont = '700000' or hkont = '400000' ).
endselect.
Regards
Lekha.
08-25-2008 2:42 PM
Hi
where hkont = '400000' get the value and put in wa_itab-dmbtr1.
where hkont = '700000' get the value. and put in wa_itab-dmbtr2.
Select
field1
field2
from <tablename>
into ( w_temp)
where HKONT eq '400000' OR HKONT EQ '700000'.
if HKONT EQ '400000' .
wa_itab-dmbtr1 = w_temp.
elseif HKONT EQ '700000'
wa_itab-dmbt2 = w_temp.
endif.
endselect.
" You need to use OR and one temporary variable
.
Regards
Pavan
08-25-2008 2:46 PM
SELECT *
FROM bseg
INTO TABLE it_tab
WHERE hkont IN (''400000' ,'700000' ).
and then pass it to the work area..........
Regards
Anbu
08-25-2008 2:51 PM
If you are using select........endselect, try this,
SELECT hkont
dmbtr
FROM bseg
INTO (w_hkont,
w_dmbtr)
WHERE hkont IN ('400000','700000').
IF w_hkont EQ '400000'.
wa_itab-dmbtr1 = w_dmbtr.
ELSEIF w_hkont EQ '700000'.
wa_itab-dmbtr2 = '700000'.
ENDIF.
ENDSELECT.