2007 Sep 04 5:22 AM
what is the label in script? how ti use it?how to create it?
how we debug smartform?
what is the difference between user exits and customer exits?
what is the difference between select single and select upto 1 rows?which is useful?
if we debug the select and endselect it goes to dump?what is the reason?
what is the difference between template and table in smartform?
how to declare parameters in smartform?
when i am running a report.it is taking long time for execution.what steps will u do to reduce the execution time.?
what is the label in script? how ti use it?how to create it?
how we debug smartform?
what is the difference between user exits and customer exits?
what is the difference between select single and select upto 1 rows?which is useful?
if we debug the select and endselect it goes to dump?what is the reason?
what is the difference between template and table in smartform?
how to declare parameters in smartform?
when i am running a report.it is taking long time for execution.what steps will u do to reduce the execution time.?
2007 Sep 04 5:41 AM
Hi,
Welcome To SDN.
1.The template node is also suited for label printing
Ex.: standard smartform BC470_FLOWD_LABELS
SAP Scripts:
http://www.henrikfrank.dk/abapuk.html
Smart forms
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
2.For smartforms debugging you can do this.
1. Execute the smartform (execute button in SMARTFORMS transaction)
2. Take the generated function module and display it in SE80.
3.Find the smartforms Elements (text elements, windows, code lines, loops) in this and set Soft break points.
Correct name is SMARTFORM_TRACE. You have lots of options for adequate analysis
Tcode - SFTRACE
3.http://groups.ittoolbox.com/archives/archives.asp?l=SAP-R3-DEV&i=503784
4.Difference Between Select Single and Select UpTo One Rows
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.
5.https://forums.sdn.sap.com/click.jspa?searchID=4996453&messageID=1496844
6.Check page 8 of this PDF.
http://help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
and
Template Displays texts for table cells of a static table
Table Display table contents
and also
when you define a table, in fact you define row type.
After that, you use a row type with data.
when you define a template, you have the whole struture in statitc.
Example: you have items, but for some item, you would like to print text. The row type will be different, you don't know the size (number of line) of your text. So you can only use the table.
Regards
2007 Sep 04 6:02 AM
Hi,
Welcome to SDN .........
Search the forms you will get lots of material for all subjects you want to know.
All the Best!
Regards
Gokul
2007 Sep 04 6:04 AM
Hi,
1.to debug smartforms create a program line node in sf and enter the 'BREAK-POINT' statement...you can debug it.........
2.User-exits and customer-exists stands for the same purpose 'enhancement'....
if you double-click on the user-exit you can see a customer function...
3. select upto 1 rows ,selects all records which satisfies the condition into a temporary buffer and from there the first row is selected..
select single,selects the record directly which satisfies the condition and the by checking the keys....
select single is more faster....
4. debugging select-endselect causes the dumb because you are interuupting the SQL command which is not allowed
5.Template cannot process dynamic entries ,its static.But table can handle dynamic entries.
6.You can declare interface parameters in global interface and local variables in the global definition.
7.You must do the performance test,sql trace and also the syntax check test.transaction : slin.
<b>Reward points if helpful.</b>
regards ,
jinesh.
2007 Sep 04 6:08 AM
Hi
what is the label in script? how ti use it?how to create it?
how we debug smartform?
what is the difference between user exits and customer exits?
<b>there is no diffrenece b/w these two</b>
what is the difference between select single and select upto 1 rows?which is useful?
<b>I use the SELECT SINGLE statement when I need a single entry from a database table where I have all key field values availabe. After executing the statement I have the details of the entry available (i.e. stored in a variable).
I use the SELECT UP TO ONE ROWS statement if I need to check that at least a single entry having certain values exists in the database table. Since I am not interested in details of the entries I do not have any variable filled with details
select single is used for validation perpouse better to use select single</b>
if we debug the select and endselect it goes to dump?what is the reason?
what is the difference between template and table in smartform?
how to declare parameters in smartform?
<b>Required parameters: You have entered these in the SAP Form Builder. These are application data to
be output or used for calculations in the form.
� Optional parameters. These exist for each form. They are not ready for input on the form interface tabs
of the SAP Form Builder. They include:
- control_parameters: General output control
- output_options: Output options (see structure ssfcompop in the Dictionary)
- user_settings: If set to 'X', the user defaults for spool control are used. Otherwise, the
output_options values for the printer, immediate output and spool retention period are
evaluated.
- archive_index, archive_index_tab, archive_parameters: Parameters for
archiving
- mail_appl_obj, mail_recipient, mail_sender: Parameters of the Business Communication Interface for sending forms as e-mails.
- document_output_info: Number of pages output (field tdfpages)
- job_output_info, job_output_options: Structures with information on the output (for example, with XML output)</b>
when i am running a report.it is taking long time for execution.what steps will u do to reduce the execution time.?
<b>you have to go through the select querys
use this for select querys
Selection Criteria
1. Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement.
2. Select with selection list.
Note: It is suggestible to make at least on field mandatory in Selection-Screen as mandatory fields restrict the data selection and hence increasing the performance.
Points # 1/2
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
Select Statements
Select Queries
1. Avoid nested selects
2. Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
3. When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
4. For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit.
5. Use Select Single if all primary key fields are supplied in the Where condition .
Point # 1
SELECT * FROM EKKO INTO EKKO_WA.
SELECT * FROM EKAN INTO EKAN_WA
WHERE EBELN = EKKO_WA-EBELN.
ENDSELECT.
ENDSELECT.
The above code can be much more optimized by the code written below.
SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
FROM EKKO AS P INNER JOIN EKAN AS F
ON PEBELN = FEBELN.
Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
Point # 2
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
Point # 3
To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
Point # 4
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
The above code is more optimized as compared to the code mentioned below for testing existence of a record.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
Point # 5
If all primary key fields are supplied in the Where condition you can even use Select Single.
Select Single requires one communication with the database system, whereas Select-Endselect needs two.</b>
Reward if usefull
2007 Sep 04 6:09 AM
<i>if we debug the select and endselect it goes to dump?what is the reason?</i>
During a select / endselect execution, the table is locked for that period of time
Hence, if you go into debug mode, the table is locked for a considerable period of time which may hamper other users from using the system efficiently
To prevent this, SAP has a setting which dumps the current program to unlock the table
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |