‎2007 Mar 19 6:37 PM
The information below is contained in bsak-sgtxt. I need to find all the entries in bsak that are associated with delivery 80022016.
80022016, DED $15 DETENTION & 25 FRO POD (is in field bsak-sgtxt)
If v_sgtxt = '80022016'.
select belnr into bsak-belnr from bsak where sgtxt ca v_sgtxt.
I get a syntax error.
How should this be done?
Thanks.
‎2007 Mar 19 6:56 PM
Hi,
Please try this.
data: v_vgbel like itab-vgbel.
move itab-vgbel+2(8) to v_vgbel.
data: v_sgtxt like bsik-sgtxt.
concatenate v_vgbel '%' into v_sgtxt.
select bukrs belnr gjahr dmbtr sgtxt
into (bsik-bukrs, bsik-belnr, bsik-gjahr, bsik-dmbtr,
bsik-sgtxt)
from bsik
where bukrs = '0010'
and sgtxt like v_sgtxt.
Regards,
Ferry Lianto
‎2007 Mar 19 6:40 PM
Hi,
Please try this.
data: lv_sgtxt like bsak-sgtxt.
If v_sgtxt = '80022016'.
lv_sgtxt = '80022016%'.
select belnr into bsak-belnr from bsak where sgtxt like lv_sgtxt.
endif.
Regards,
Ferry Lianto
‎2007 Mar 19 6:41 PM
Try this:
<b>data: begin of i_belnr occurs 0,
belnr like bsak-belnr,
end of i_belnr.
</b>If v_sgtxt = '80022016'.
<b>select belnr
into table i_belnr
from bsak where sgtxt ca v_sgtxt.
</b>
endif
Thanks,
Santosh
‎2007 Mar 19 6:42 PM
Hi Janet,
We may get more than one entry from BSAK table, so it needs an internal table to stroe all those values.So, Use internal table to get the result.
DATA:
BEGIN OF ITAB OCCURS 0,
BELNR TYPE BSAK-BELNR,
END OF ITAB.
SELECT BELNR
FROM BSAK
INTO TABLE ITAB
WHERE SGTXT LIKE '8022016%'.Thanks,
Vinay
‎2007 Mar 19 6:48 PM
How do I do that if v_sqtxt is really a field in an internal table?
data: v_vgbel like itab-vgbel.
move itab-vgbel+2(8) to v_vgbel.
select bukrs belnr gjahr dmbtr sgtxt
into (bsik-bukrs, bsik-belnr, bsik-gjahr, bsik-dmbtr,
bsik-sgtxt)
from bsik
where bukrs = '0010'
and sgtxt eq v_vgbel.
‎2007 Mar 19 6:56 PM
Hi,
Please try this.
data: v_vgbel like itab-vgbel.
move itab-vgbel+2(8) to v_vgbel.
data: v_sgtxt like bsik-sgtxt.
concatenate v_vgbel '%' into v_sgtxt.
select bukrs belnr gjahr dmbtr sgtxt
into (bsik-bukrs, bsik-belnr, bsik-gjahr, bsik-dmbtr,
bsik-sgtxt)
from bsik
where bukrs = '0010'
and sgtxt like v_sgtxt.
Regards,
Ferry Lianto