Application Development 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: 

date selection help

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Clemenss
Active Contributor
0 Kudos

Rajeev,

I just don't believe you don't know [How to post code in SCN. |;

Clemens