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: 

Performance issue

Former Member
0 Kudos

hi folks,

Here I have the following select statement which is posing a performance issue. I just need a single field record from this table

hence the query goes like this..

select name_org1 INto adname from

but000 where partner = adnumber.

endselect.

If I do not include endselect statement the query poses an error, and select .... endselect poses performance issue.

How can i improve this query without using the internal table. Because I have to create another internaltable just to get one field of data. Is there a better way of doing it?

Thanks

Santhosh

15 REPLIES 15

Former Member
0 Kudos

select single name_org1 INto adname from

but000 where partner = adnumber.

0 Kudos


select single name_org1 INto adname 
      from but000 
             where partner = <u>adnumber</u>.

Are sure that your where clause is right, does adnumber have a partner number. I was thinking that adnumber was an address number.

Regards,

Rich Heilman

0 Kudos

It is not working. I have delcared this select statement within a FORM ..... PERFORM statement and it is shwoing me an error Incorrect nesting.. you have to use end select statement.

santhosh

0 Kudos

the adnumber is a partner number and while I use endselect the query works but when populating large amounts of data it is taking alot of time to execute.

leading to short dump.

santhosh

0 Kudos

No you don't use ENDSELECT for a SELECT SINGLE. Post the code of the form.

example....



*---------------------------------------------------------------------*
*       FORM test                                                     *
*---------------------------------------------------------------------*
form test.

  data: adname(30) type c.
  data: adnumber type kunnr.

  select single name_org1 into adname
        from but000
               where partner = adnumber.


endform.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

0 Kudos

If you use SELECT SINGLE then NO NEED to give the ENDSELECT. You may be getting the error due to some other problem. Please let me know the exact error.

You can also use SELECT ..... UPTO 1 RECORD.

0 Kudos

Now I took of that FORM... ENDFORM it is asking to end the select statement by endselect.

0 Kudos

r u sure you spotted the SINGLE keyword in the answers

0 Kudos

Here is the code... where I am using this slect statement

types: begin of boxdata,

inserent type zzjhtfp-inserent,

regulierer type jhaga-regulierer,

end of boxdata.

data: boxdataitab type standard table of boxdata WITH HEADER LINE,

adnumber type JHAGA-INSERENT,

agencynumber type JHAGA-REGULIERER,

adname type but000-name_org1,

agencyname type but000-name_org1,

bphone type kna1-telf1.

select single * from jhaga INTO corresponding fields of boxdataitab where jhaga~inserent = p_advnum.

adnumber = boxdataitab-inserent.

agencynumber = boxdataitab-regulierer.

write:boxdataitab-inserent.

select name_org1 INto adname from

but000 where partner = adnumber.

endselect.

select name_org1 INTO agencyname from but000

where partner = agencynumber.

endselect.

select telf1 into bphone from kna1 where kunnr = p_custid.

endselect.

0 Kudos

Try this way.

select single * INTO corresponding fields of boxdataitab from jhaga where jhaga~inserent = p_advnum.

Vinod

0 Kudos

hi Vinod,

I hope you did not get my point, the other queries are fine From the other query i am getting the 'adnumber' and 'agency number'That works fine.

using this data I have to pull the corresponding 'adname' and the 'agency name' from but000 table.

It is a single field data I need to pull using the separate query statements.

Santhosh

0 Kudos

Thanks guys,

There was a probelm in some other area. I fixed it.

Able to figure it out.

Santhosh

0 Kudos

Infact I was anwering your problem regarding the error 'Missing Endselect'.

Your SELECT statement is like this.

select single * from jhaga INTO corresponding fields of boxdataitab where jhaga~inserent = p_advnum.

adnumber = boxdataitab-inserent.

agencynumber = boxdataitab-regulierer.

And in this the variable boxdataitab is an internal table. Such cases you have to give INTO CORRESPONDING FIELDS OF TABLE boxdataitab.

I do not have access to system now. I think the syntax should be;

select single * INTO corresponding fields of boxdataitab from jhaga

where ....

Not

select single * from jhaga INTO corresponding fields of boxdataitab

where ....

0 Kudos

Were there no helpful answers here?

Regards,

Rich Heilman

0 Kudos

I am sorry folks, I shall award the points.