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

script

Former Member
0 Likes
607

1.how to load multiple forms into scripts?

2 .what is the diff b/w select single and select upto 1 row?

6 REPLIES 6
Read only

Former Member
0 Likes
578

1. by using start_form multiple times.

in the first start_form call one layout

if u want call on more layout use one more start_form.

2. SELECT SINGLE is a construct designed to read database records with primary key

using select single you can at most select one record

select up to 1 rows is used for non key fields

using select up to is having capability of selecting more than one row ,but we are selecting only 1 row

Read only

Former Member
0 Likes
578

select single, in this where clause should have keys

select upto 1 row will select the first record, there is no constraint of primary key in the where clause.

Read only

Former Member
0 Likes
578

Hi,

1. To upload multiple forms into scripts by using FM's OPEN_FORM,STAT_FORM,END_FROM and CLOSE_FORM.

2. The functionality wise both will give same result. It varies in performance only

SELECT...SINGLE query is used to if you are using full key of a table.

If not, USE SELECT ...UPTO 1 ROW (Paritial key fields in where clause)

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
578

2. According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.

select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.

The best way to find out is through sql trace or runtime analysis.

Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.

The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.

The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.

Mainly: to read data from

The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.

Mainly: to check if entries exist.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
578

hi,

1.how to load multiple forms into scripts?

u shud use the FM's

OPEN_FORM

START_FORM

END_FORM

START_FORM

END_FORM

START_FORM

END_FORM

--

---

---

--

CLOSE_FORM

2 .what is the diff b/w select single and select upto 1 row?

check these threads...

hope this helps,

do reward if it helps,

priya.

Read only

Former Member
0 Likes
578

HI

1.how to load multiple forms into scripts?

To load multiple forms into scripts we use the following function modules:

OPEN_FORM

START_FORM

END_FORM

START_FORM

END_FORM

START_FORM

END_FORM

--

---

---

--

CLOSE_FORM

here we can include many start forms.

2 .what is the diff b/w select single and select upto 1 row?

1.select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.

2.The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.

3.SELECT is mainly to read data from.

4.SELECT .... UP TO 1 ROWS mainly to check if entries exist.

5.Select single * requires WHERE condition

6.Select upto 1 row does not require any WHERE condition

Please go through this link:

Regards,

Gunasree.