Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

clear the value

Former Member
0 Likes
1,022

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

7 REPLIES 7
Read only

Former Member
0 Likes
986

try this....

loop at it_train.

clear it_train-bahns.

endloop.

Regards

Vasu

Read only

Former Member
0 Likes
986

Try:


loop at it_train
  clear it_train-bahns.
  modify it_train.
endloop.

Rob

Read only

0 Likes
986

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

Read only

0 Likes
986

LFA1 is a standard SAP table. Use a BAPI or BDC to do this.

Rob

Read only

0 Likes
986

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.

Read only

0 Likes
986

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

Read only

Former Member
0 Likes
986

loop at it_train.

update lfa1 : set bahns = ' ' where lifnr = it_train-lifnr.

endloop.

or change where condition...as per ur requirement......

Regards

Vasu