" The role of the update work process is very important since it is responsible for recording the changes in the database. The process performs its functions when the ABAP applications are programmed with the statements in the UPDATE TASK. This type of updating is asynchronously performed, ie. The programs leave update records in a queue to be processed and then continue to the update process. Normally, it runs without any intervention from the SAP R/3 management, still R/3 includes utilities to monitor check and perform management operations on the updation processes. In case any updating error takes place, the system places a message to the user regarding the error and an alert is triggered in the CCMS monitor. For the update functions go to Administration menu bar option --> Monitor option ---> Update option. An initial update screen showing various functions appears. The initial update screen is used to display the system update records with error status or the records which have not yet been processed, activate and deactivate the updating in the whole SAP system. It is also useful to display the update statistics, to display the data on the erroneous update records and reprocess them, either in real or in test mode and to send waiting update records for processing after a deactivation/activations of the updating and delete update records. Many work processes of the type R/3 system update the database. A database interface is included by the dialog and background work processes, which can directly update the database. However, the update work processes ca also be used for updating the physical database in asynchronous way. If it is asynchronous updating, according to which the transactions are programmed in the ABAP business applications, then in the database commit phase, the transactions pass the update records to the update work processes."
"A subset of Standard SQL that is fully integrated in ABAP is Open SQL statements. Their role is to help you by giving permission to access data irrespective of the database system, which the R/3 installation is using. The Data Manipulation Language (DML) part of the Standard SQL is present in the Open SQL. In other words, it gives you the permission to read (SELECT) and change (INSERT, UPDATE, DELETE) data. In the R/3 system, the tasks of the Data Definition Language (DDL) and Data Control Language (DCL) parts of the Standard SQL are performed by the ABAP dictionary and the authorization system."
To find the length of character strings ABAP function STRLEN is used. This function returns the length of the string counting till the last character that is not a space. Please note that if you try to compute the length of a sentence like 'This is a sentence' then the length of the complete sentence is calculated ie 18. Consider the word 'FUNCTION ' in this example there are 2 spaces after the word FUNCTION but the STRLEN function will consider the length only for the word FUNCTION ie 8. If you put spaces preceding the word then the spaces are also counted for example ' SPACES' the length of this will be counted as 16.
In cases where you want to count just the number of characters it is better to use CONDENSE with the addition of NO-GAPS on field variable before using STRLEN.
CONDENSE statement is used to delete unwanted leading spaces in strings. To remove all the space even those between words use CONDENSE with NO-GAPS.
Example.
DATA: INT TYPE I, WORD1(20) VALUE '12345', WORD2(20), WORD3(20) VALUE ' 4', WORD4(20) VALUE ' ABCD EFGH', WORD5(20) VALUE 'ABCD ', WORD6(20) VALUE 'ABCD EFGH IJKL'.
INT = STRLEN( WORD1 ). WRITE INT.
INT = STRLEN( WORD2 ). WRITE / INT.
INT = STRLEN( WORD3 ). WRITE / INT.
INT = STRLEN( WORD4 ). WRITE / INT.
INT = STRLEN( WORD5 ). WRITE / INT.
INT = STRLEN( WORD6 ). WRITE / INT.
The output of the above program will be as follows.
String Length 5 0 7 10 4 14
In cases where you want to find the exact length of the the characters you can use CONDENSEwith the addition of NO-GAPS before finding the length. Please see the examples given below. Note that CONDENSE without the addition of NO-GAPS will remove only the leading spaces.
DATA: CHK_LEN(25) VALUE ' one two three four', LEN TYPE I.
* Will remove the leading and trailing spaces. CONDENSE CHK_LEN. LEN = STRLEN( CHK_LEN ). WRITE: CHK_LEN, '!'. WRITE: / 'Length: ', LEN.
* Will remove the spaces between the words as NO-GAPS is used CONDENSE CHK_LEN NO-GAPS. LEN = STRLEN( CHK_LEN ). WRITE: CHK_LEN, '!'. WRITE: / 'Length: ', LEN.
The output of the above program will be as follows.
Example on Condesne one two three four ! Length: 19 one two three four ! Length: 18 onetwothreefour ! Length: 15
Always specify your conditions in the Where-clause instead of checking
them yourself with check statements. The database system can then use an index
(if possible) and the network load is considerably less.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.