‎2007 Sep 08 7:52 PM
hello experts,
I am uploading the data. For one field I am getting the value like 1341. So i have to equate this values to the first 4 charecters of LFA1-BAHNS
I have to get the LFA1-LIFNR where the value 1341 matches to the first 4 chars of LFA1-BAHNS and update the corrsponding field.
Its urgent plz
Thanks & Regards,
Naveen
‎2007 Sep 08 8:06 PM
See the below logic :
suppose you have data at internal table itab.
loop at itab.
select single * from lfa1 into lfa1
where BAHNS+(4) = itab-fld3. -> itab-fld3 contains value like 1341
if sy-subrc eq 0.
update lfa1 from itab.
endif.
endloop.
Thanks
Seshu
‎2007 Sep 08 8:17 PM
Seshu,
thanks a lot for your valuable time.
Actually I did the same coding but it is giving me the error like "FIELD BAHNS+(4) IS UNKNOWN"
can exactly tell me where i am going wrong...
here is the statement
select single lifnr from lfa1 into vndno where bahns+(4) = wa_data-mkfct.
‎2007 Sep 08 8:22 PM
Try This:
select single lifnr from lfa1 into vndno where bahns+0(4) = wa_data-mkfct.
Sri
‎2007 Sep 08 8:43 PM
‎2007 Sep 08 9:42 PM
Hello Nitesha,
offset will not work in select query ..
Try to use below logic :
tables : lfa1.
data v_data(5) type c.
data i_lfa1 like lfa1 occurs 0 with header line.
start-of-selection.
refresh i_lfa1.
clear v_data.
concatenate itab-fld3 '%' into v_data.
select * from lfa1 into table i_lfa1
where BAHNS like v_data.
loop at i_lfa1.
if i_lfa1-bahns+(4) = itab-fld3.
update table .
exit.
endif.
endloop.
Thanks
Seshu
‎2007 Sep 09 4:38 PM
Hi,
Try to use "LIKE" operator in update statement.
update <table> set <field> = <value> where <field> like '1341%'
Reward if answer is useful...
Regards,
Hema