‎2007 Sep 11 4:22 PM
hello experts,
I want to clear the bahns field value from the lfa1 table.
here I am trying to write the code for it.... I got struck in the middle can anyone help me comeplete this code....
data: BEGIN OF it_train,
lifnr type lifnr,
bahns type bahns,
END OF it_train.
data: it_vend like STANDARD TABLE OF lfa1 WITH HEADER LINE.
select lifnr bahns into table it_train.
clear it_train-bahns.
Thanks a lot for your anticipation
Nitesha
‎2007 Sep 11 4:25 PM
try this....
loop at it_train.
clear it_train-bahns.
endloop.
Regards
Vasu
‎2007 Sep 11 4:25 PM
Try:
loop at it_train
clear it_train-bahns.
modify it_train.
endloop.
Rob
‎2007 Sep 11 4:27 PM
Thanks a lot for your replies guys
I want to update this same blank value in lfa1 for all the vendors
Can anyone guide me to do this
‎2007 Sep 11 4:32 PM
LFA1 is a standard SAP table. Use a BAPI or BDC to do this.
Rob
‎2007 Sep 11 4:37 PM
data : itab like standard table of lfa1 with header line.
select * from lfa1 into table itab .
if sy-subrc eq 0.
loop at itab.
clear itab-bahns .
modify itab index sy-tabix.
endloop.
<b>modify LFA1 from table itab.</b>
endif.
‎2007 Sep 11 4:43 PM
Mahesh and Vasu - it is very dangerous to do direct updates on SAP tables. In this case, how will central address management be affected?
Rob
‎2007 Sep 11 4:40 PM
loop at it_train.
update lfa1 : set bahns = ' ' where lifnr = it_train-lifnr.
endloop.
or change where condition...as per ur requirement......
Regards
Vasu