Business Add-Ins (BAdis) are a SAP enhancement technique based on ABAP Objects. Two parts - Definition and its Implementation - definition can either be SAP provided or user may also create it.
Here are some tips which may save some time for you. And it is always fun experimenting with the things you know.
Easy solution: Suppose you need to round it off to 1 decimal position, just use a variable having data element having one decimal position while storing the result. It will be rounded off automatically.
Problem: When you try to assign value from character to amount variable or quantity variable, it gives short dump.
Easy solution: Before assigning value, just assign any number to the required amount variable or quantity variable. Then use the assign the character value to amount variable. It will take the value.
Keep it in mind that value in the character field should be in the same format as the variable.
Problem: In Sap script, sometime it is required to print values only in the last page or first page. For this we use variables like “SAPSCRIPT-FORMPAGES” or “NEXT-PAGE”. It works fine but yet people find that their script is not printing properly.
For this I don’t have any easy solution. You can only use some text element which is either called in the beginning or in the end. But I will tell you the reason why it does not work. This problem arises when you try to use these variables in MAIN window and sadly in main window these variables do not work. So even you check your form and it seems logically foolproof, you will not get desired result. It is pain taking to debug a SAP Script so we do not even check it in debug mode and keep banging our heads. This tip can be useful for them. :)
I can give you another tip like, if you want to print any line or box something like that in the end page only and that has to be a part of main window, then I will suggest, use a pseudo window, over lapping the main window. You can use the variable in that window and can use to print something like box or line at the page you desire.
Anyways if such requirement is needed, then do let me know in the comment section; will try my best to give you some alternative logic to do so.
Problem: In Sap script, when we do amount calculation in sub routine pool program (a z program which is called from the Sap script to do data manipulation), even we use ‘(<)’ operator to shift the negative sign to the left of the amount, it does not work.
Solution: This is again one problem which makes developers bang their heads. The problem occurs because the variable which returns the value from the Z program is type “char”. So command like ‘(<)’ does not work. For this you have to whether the value is negative or not in the sub routine pool itself and then if it negative, then you have to remove negative sign from the right and have to concatenate minus sign in left of the value.
There are many tips like this which look small but are very effective. May be sometime later… and if you want to share something, please do in the comment section.
Expensive SQL statements:-
These are defined as sql statements that cause database to read many blocks from disk or buffer.
User point of view: when transactions using these statements are executed, the response time is large.
Systems point of view: A large number of Data Blocks are scanned to find the selected records.
Why checking Expensive SQL statements:
a. Work processes are blocked by reports, thereby increasing the wait time for other processes.
b. a.High CPU load on database server.
c. b.Many blocks are moved from database buffer which results into bad
cache hit rate for other SQL statement.
d. c.Data base busy reading large number of blocks.
so an Expensive SQL statement reduces the performance of SAP system
Finding out the culprits:-
1. SQL statements with higher number of buffer gets.
2. reports/transaction where t he database request time
of response time.
Once we are able to find out the statements, we need to find out following for each statement:-
a.Table name.
b.WHERE cluase
c.Index used
d. Name of transaction and report containing the statement.
To get the above details:-
- Goto DBACOCKPIT ->performance->SQL statement Analysis->shared cursor cache [sap net weaver]
- Goto ST04 -> Detailed Analysis Menu -> SQl Request -> Sort by disk reads/ buffer gets / executions.[for others]
SM 50/66, ST05 and ST03/STAD can also be used to find expensive SQL statement.
Expensive SQL statements can be categories under following heads:-
a) SQL statements which are used by ABAP programs. - These statements can be tuned.
b) SQL Statements used by database – cannot be tuned by us.
c) SQL statements selected from SAP Basis tables –can’ t be tuned by us
d) Recursive SQL statement - can’ t be tuned by us
Tuning the tunable statements …
It is done under two heads, depending on the scenarios:-
a) Case 1:- you see many buffer gets * but only few records per execution.
We can speed up the execution of SQL statements in such case by:-
- Updating the optimizer statistics.
- Creating/extending/dropping existing indexes.
- Optimizing the user input.
a) Case 2:- you see many buffer gets* and many records per execution.
In such cases, we can speed up the execution by:-
- Adapting the ABAP code, replacing “* “from the statements [“SELECT* FROM…..”]
With list of fields that are actually used by the program.
- Optimizing the user input.
- Tuning the business process.
· * you can see the buffer get @ DBACOCKPIT->performance->SQL statement Analysis->shared cursor cache (double click here)->new screen for selection criteria, put your value in buffer gets field.
WSDL file in SAP
by Raju | Tuesday, October 21, 2008 in sap binding, sap service, SAP_BC_WEBSERVICE_SERVICE_USER, soamanager, Web Applications | comments (12)
The content has been moved to below link. Please visit it at your convenience. Thank you for all your cooperation.
http://www.sapyard.com/wsdl-file-in-sap/
Creating Dynamic Internal Table
by Chinu | Tuesday, October 21, 2008 in Internal table | comments (1)
Automatic Population of Values during Table Maintenance
by Biswa | Tuesday, October 21, 2008 in TMG | comments (1)
This content has been moved to the below link. Please visit it at your convenience. Thank you for your patience and cooperation.
http://www.sapyard.com/
Being an Engineering student, I am bit inclined towards Mathematics. A few months ago when I wanted to write a program to find out prime numbers, I felt the need of ABAP command which can give me remainder (something like % in C). Finally I found it out and here are some compilations of such ABAP commands.
Finding the absolute value of a number: |a| -> ABS( a ).
Finding the lowest integer greater than a: CEIL( a ).
Finding the greatest integer less than a: FLOOR( a ).
For trigonometric operands, try ACOS, COS, etc
Finding the square root of a, a > 0: SQRT( a )
Finding the length of characters in the string: STRLEN( a )
Finding remainder a/b: a MOD b.
If you want to remove characters from any string which has both characters and numbers then there is an easy trick.
Suppose, you have an string like 12wer34op. Take a variable which is type NUMC and assign string to this variable and you will have only integers.
Data: v_string type char10,
v_num(10) type numc.
v_string = 12wer34op.
v_num = v_string.
Write: v_num.
Output: 1234.
Try it.
We all know ABAP is very simple language and help is present just with one click. Still I face problems now and then with all the help present on the net, I feel a quick tip from a friend/colleague is more helpful. We can help you with our experience. We can help and together we can learn.