‎2009 Nov 13 6:58 PM
Hi all,
we have a table called t077k where we store the account group, I need to put a logic if the account grou ois ZTEMP then the address for the vendor in that particular group should come from table BSEC, for that I have written the following code. can you please tell me if tht's right or if I m missing something
read table t077k.
if t077k-ktokk eq 'ZTEMP'.
select single stras into addr1 from bsec
where adrnr eq lfa1-adrnr.
if sy-subrc eq 0 and not addr1 is initial.
move 'ADDRESS1' to out_par-name.
move addr1 to out_par-value.
modify out_par index 1.
endif.
endif.
Thanks,
Rajeev
‎2009 Nov 13 7:25 PM
Why are you READinga database table rather than using SELECT?
Why are you SELECTing BSEC without using any key fields?
And why is the subject of this thread about "date"?
Rob
Edited by: Rob Burbank on Nov 13, 2009 2:25 PM
‎2009 Nov 13 7:25 PM
Why are you READinga database table rather than using SELECT?
Why are you SELECTing BSEC without using any key fields?
And why is the subject of this thread about "date"?
Rob
Edited by: Rob Burbank on Nov 13, 2009 2:25 PM
‎2009 Nov 13 7:26 PM
Hi Rajeev ,
Use with key option with read statement.
You should also avoid select single statement , by fetch of records from table and then reading the records from internal table.
And , use read statement using binary search. i.e sort internal table and then read.
Hope it help you.
‎2009 Nov 13 11:22 PM
Hi Rajeev,
I believe the subject is data selection help instead of date selection help
back to your question you can do the below
select single ktokk from t077k into l_ktokk where ktokk eq 'ZTEMP'.
if l_ktokk is not initial.
select single stras into addr1 from bsec
where adrnr eq lfa1-adrnr.
move 'ADDRESS1' to l_out_par-name.
move addr1 to l_out_par-value.
append l_out_par to out_par.
endif.
where l_out_par is like line of out_par.
‎2009 Nov 14 12:52 AM