"In SAP for logging in to the system you need a user ID and a password. This user ID is created by the system administrator. The first time you login to the SAP system you need to change that password which has been assigned to you while creating the user ID. Every user ID will have certain roles assigned to it. The System Admin (Basis Administrator) is responsible for creating these roles after consulting the Functional team. Each user will typically have several roles assigned to their user ID. The user roles are predefined in the SAP system and each employee would have a combination of several roles which have been predefined in the SAP system. The roles are defined using the activity groups in the SAP system. A proper understating of the activity groups is necessary for creating and assigning Roles in the SAP system. Once a pre-defined user role is assigned to a user the system then automatically displays the appropriate User menu when the user logs on and provides the required authorization. An activity group can contain Transactions, Reports, Files, Web Links. Once the activity group has been assigned it defines the user specific menus. Once the user logs on to SAP a user specific menu is displayed this menu is controlled by the activity group that has been assigned to the user. To display a list of descriptions of the pre-defined user roles, select Tools---- Administration----User Maintenance--'Repository Infosys--' Activity Groups----' List of activity groups according to complex selection criterion---' Selection according to activity group name or call transaction S_BCE_68001418. The pre-defined user roles are delivered as templates and have names beginning with 'SAP_' and suffix _AG. Composite activity groups can be built with individual activity groups. A composite activity group does not contain any authorization."
"The flow of a program is determined by a sequence of screens in a dialog transaction. The screens that are called within a transaction, must belong to a single ABAP program, usually a module pool (Type M). You have to use the transaction maintenance transaction (SE93) to create a dialog transaction. Once you have entered a transaction code and a short description, chose transaction type program and screen. Then enter data on the next screen as required. The transaction code in a dialog program must be linked to the number of its initial screen. Finally enter this number in the screen number field."
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.
No comments:
Post a Comment