Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

General
How to create IMG transaction PDF Print E-mail
User Rating: / 5
Written by Pavan   
Tuesday, 06 October 2009
This updates on how to create an IMG transaction for all the customization needed for your project
Read more...
 
List of System Variables PDF Print E-mail
User Rating: / 5
Written by Anon.   
Thursday, 17 September 2009
The following is a comprehensive list of system variables 
SY-ABCDE - Constant: Alphabet (A,B,C,...)
SY-APPLI - SAP applications
SY-BATCH - Background active (X)
SY-BATZD - Background SUBMIT: Daily
SY-BATZM - Background SUBMIT: Monthly
SY-BATZO - Background SUBMIT: Once
SY-BATZS - Background SUBMIT: Immediately
SY-BATZW - Background SUBMIT: Weekly
SY-BINPT - Batch input active (X)
SY-BREP4 - Background SUBMIT: Root name of request report
SY-BSPLD - Background SUBMIT: List output to spool
SY-CALLD - CALL mode active (X)
SY-CALLR - Print: ID for print dialog function
SY-CCURS - Rate specification/result field (CURRENCY CONVERT)
SY-CCURT - Table rate from currency conversion
SY-CDATE - Date of rate from currency conversion
SY-COLNO - Current column during list creation
SY-CPAGE - Current page number
SY-CPROG - Runtime: Main program
SY-CTABL - Exchange rate table from currency conversion
SY-CTYPE - Exchange rate type 'M','B','G' from CURRENCY CONVERSION
SY-CUCOL - Cursor position (column)
SY-CUROW - Cursor position (line)
SY-DATAR - Flag: Data received
SY-DATLO - Local date for user
SY-DATUM - System: Date
SY-DATUT - Global date related to UTC (GMT)
SY-DAYST - Summertime active ? ('daylight saving time')
SY-DBCNT - Number of elements in edited dataset with DB operations
SY-DBNAM - Logical database for ABAP/4 program
SY-DBSYS - System: Database system
SY-DCSYS - System: Dialog system
SY-DSNAM - Runtime: Name of dataset for spool output
SY-DYNGR - Screen group of current screen
SY-DYNNR - Number of current screen
SY-FDAYW - Factory calendar weekday
SY-FDPOS - Location of a string
SY-FMKEY - Current function code menu
SY-HOST - Host
SY-INDEX - Number of loop passes
SY-LANGU - SAP logon language key
SY-LDBPG - Program: ABAP/4 database program for SY-DBNAM
SY-LILLI - Number of current list line
SY-LINCT - Number of list lines
SY-LINNO - Current line for list creation
SY-LINSZ - Line size of list
SY-LISEL - Interact.: Selected line
SY-LISTI - Number of current list line
SY-LOCDB - Local database exists
SY-LOCOP - Local database operation
SY-LOOPC - Number of LOOP lines at screen step loop
SY-LSIND - Number of secondary list
SY-LSTAT - Interact.: Status information for each list level
SY-MACDB - Program: Name of file for matchcode access
SY-MACOL - Number of columns from SET MARGIN
SY-MANDT - Client number from SAP logon
SY-MARKY - Current line character for MARK
SY-MAROW - No. of lines from SET MARGIN statement
SY-MODNO - Number of alternative modi
SY-MSGID - Message ID
SY-MSGLI - Interact.: Message line (line 23)
SY-MSGNO - Message number
SY-MSGTY - Message type (E,I.W,...)
SY-MSGV1 - Message variable
SY-MSGV2 - Message variable
SY-MSGV3 - Message variable
SY-MSGV4 - Message variable
SY-OPSYS - System: Operating system
SY-PAART - Print: Format
SY-PAGCT - Page size of list from REPORT statement
SY-PAGNO - Runtime: Current page in list
SY-PDEST - Print: Output device
SY-PEXPI - Print: Spool retention period
SY-PFKEY - Runtime: Current F key status
SY-PLIST - Print: Name of spool request (list name)
SY-PRABT - Print: Department on cover sheet
SY-PRBIG - Print: Selection cover sheet
SY-PRCOP - Print: Number of copies
SY-PRDSN - Print: Name of spool dataset
SY-PREFX - ABAP/4 prefix for background jobs
SY-PRIMM - Print: Print immediately
SY-PRNEW - Print: New spool request (list)
SY-PRREC - Print: Recipient
SY-PRREL - Print: Delete after printing
SY-PRTXT - Print: Text for cover sheet
SY-REPID - Program: Name of ABAP/4 program
SY-RTITL - Print: Report title of program to be printed
SY-SAPRL - System: SAP Release
SY-SCOLS - Columns on screen
SY-SLSET - Name of selection set
SY-SPONO - Runtime: Spool number for list output
SY-SPONR - Runtime: Spool number from TRANSFER statement
SY-SROWS - Lines on screen
SY-STACO - Interact.: List displayed from column
SY-STARO - Interact.: Page displayed from line
SY-STEPL - Number of LOOP line at screen step
SY-SUBRC - Return value after specific ABAP/4 statements
SY-SUBTY - ABAP/4: Call type for SUBMIT
SY-SYSID - System: SAP System ID
SY-TABIX - Runtime: Current line of an internal table
SY-TCODE - Session: Current transaction code
SY-TFDSN - Runtime: Dataset for data extracts
SY-TFILL - Current number of entries in internal table
SY-TIMLO - Local time for user
SY-TIMUT - Global time related to UTC (GMT)
SY-TITLE - Title of ABAP/4 program
SY-TLENG - Line width of an internal table
SY-TMAXL - Maximum number of entries in internal table
SY-TSTLO - Timestamp (date and time) for user
SY-TSTUT - Timestamp (date and time) related to UTC (GMT)
SY-TVAR0 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR1 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR2 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR3 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR4 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR5 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR6 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR7 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR8 - Runtime: Text variable for ABAP/4 text elements
SY-TVAR9 - Runtime: Text variable for ABAP/4 text elements
SY-TZONE - Time difference from 'Greenwich Mean Time' (UTC) in seconds
SY-UCOMM - Interact.: Command field function entry
SY-ULINE - Constant: Underline (---------...)
SY-UNAME - Session: SAP user from SAP logon
SY-UZEIT - System: Time
SY-VLINE - Constant: Vertical bar
SY-WAERS - T001: Company code currency after reading B segment
SY-WILLI - Number of current window line
SY-WINCO - Cursor position in window (column)
SY-WINDI - Index of current window line
SY-WINRO - Cursor position in window (line)
SY-WINSL - Interact.: Selected window line
SY-WINX1 - Window coordinate (column left)
SY-WINX2 - Window coordinate (column right)
SY-WINY1 - Window coordinate (line left)
SY-WINY2 - Window coordinate (line right)
SY-WTITL - Standard page header indicator
SY-XCODE - Extended command field
SY-ZONLO - Time zone of user
 
TIP: Display shared memory PDF Print E-mail
User Rating: / 1
Written by Kevin Wilson   
Friday, 11 September 2009
Transaction AL13 : RSTUNSHM Display Shared Memory (Expert mode)
 
Maths in ABAP PDF Print E-mail
User Rating: / 2
Written by Voice   
Wednesday, 02 September 2009
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.
 
Logs and Traces - transactions PDF Print E-mail
User Rating: / 1
Written by Kevin Wilson   
Wednesday, 02 September 2009

The major transactions for Trace Options in SAP are :-

  1. System Log (SM21).
  2. Dump Analysis(ST22).
  3. System Trace(ST01).
  4. Performance Trace(ST05).
  5. Developer Trace(ST11).

SYSTEM LOG(SM21)

a) Can be used to detect and correct errors in our SAP system and its Environment.
b) SAP application servers record events and problem in system logs.
c) Every SAP application Server has a local log that contains the messages output by this server.

Local System Log :- /usr/sap//D*/log/SLOG

Central System Log:- /usr/sap//SYS/global/SLOGJ

central system log feature - Available in Unix ,not possible in Windows and Iseries.

profile parameter (RZ10) :-

rslg/local/file :- local log file
rslg/central/file:-Central file

Invoked by tools-->Administration-->Monitor -->System Log or Call transaction SM21.

2)Dump Analysis(ST22)

a) If unpredictable errors occurs during run-time when you call an ABAP program , a run-time error that generates a short dump can occurs.
b) By default, short dump are stored in the system for 14 days.
c) You can delete short dumps in accordance with a time specification using the reorganize function ,which you call by choosing Goto -->Reorganize .
d) one can save a short dump without a time limit using the KEEP function ,which one can choose from detail view under short Dump -->KEEP/RELEASE.

Characteristics of Dump Analysis:-

1) If a run time error occurs ,a short dump is generated.You can use transaction ST22 to analyzer this short dump.
2) Dump data is stored in the database.
3) Dump data can be reorganized.
4) Individual short dump can be flagged for retention.

System Trace (ST01)

to record the internal SAP activities ,such as authorization checks,database access ,kernel functions and RFC calls.
The system trace is used for analyzing:
a) Authorization checks
b) Kernel functions
c) Kernel modules
d) DB accesses (SQL Trace)
e) Accesses to table buffers
f) Lock operations (client-side).

PERFORMANCE TRACE(ST05)

The Performance trace is used for analyzing:

a) Database calls
b) Lock management calls
c) Accesses to table buffers
d) Remote calls of reports and transactions
e) Individual trace records
f) SQL statements.

DEVELOPER TRACE(ST11)

Developer traces are recordings that contain technical information and that are used if errors occur.

a) Can be read by using Transaction AL11.
b) Browse to directory usr/sap//d*/work.
c) Developer trace can be viwed at dev_* files.
d) Can be accessed in Transaction: SM50. Process → Trace → Display File.
 
Handling SAP Performance issues in General PDF Print E-mail
User Rating: / 1
Written by Kevin Wilson   
Thursday, 30 April 2009

The following are some known reasons for a decrease in performance:

Ø  Use of user exits (Note 178328)

Ø  Obsolete statistics (Note 103212)

Ø  Very large data volumes (Notes 118743 and 111813)

Ø  Inefficient table buffering. High CPU consumption (E.G. copying, sorting and searching in large internal tables) (Note 185530)

 

Pre-Requisites

Ø  Authorizations to

o   STAD

o   ST05

o   ST06

o   SE30

o   SM50

o   SM66

 

Overview

The analysis steps should follow this order:

1.    Examine the statistical individual records (Statistical analysis (STAD / STAT))

Ø  Used to isolate the areas in which performance problems occur in individual programs.

Ø  Transaction STAD (or Transaction STAT if you have a release higher than 4.6C)

2.    Use the Performance Trace (ST05)to examine SQLs, database accesses, RFCs and lock operations (enqueues) in detail.

3.    Use the ABAP Trace (SE30)

4.    Use the ABAP Debugger

5.    Runtime Overview (SM50)

 

Details

1.    Statistical analysis (STAD / STAT)

Statistical information comprises:

Ø  response times,

Ø  main memory requirement,

Ø  database accesses, etc.

The records are saved on the application servers for approximately one day.

The statistical records can be grouped by transactions and then analyzed.

 

On the selection screen, you enter the user name, transaction name or program name as well as the time period to be analyzed. Also note the Server Selection switch. By default, the data is collected by all application servers.

 

You can use the following option switches to select the display type of the individual record statistics:

Ø  Show all statistic records, sorted by start time

Ø  Show all records, grouped by business transaction

Ø  Show business transaction sums (-> this is recommended for SD transactions)

 

Statistical Analysis (STAD / STAT)

Ø  Response times

o   Are the response times the same or do high response times occur sporadically?

o   You can use the Fcod column, which displays the function code within a transaction, to determine whether high response times only ever occur for one screen within a transaction. The records in question can be selected by double-clicking an individual statistical record. To display all of the details concerning the individual record, choose All details.

Ø  High database times (DB req time)

o   In principle, this is a database problem that can be analyzed using a SQL trace (STO5). You can use the value for 'kbytes transferred' or 'Database rows' to distinguish between two types of database problems:

§  The database time is too high even though relatively little data is read! (Avg.time/row (ms) = sequential read).
The optimal read time is 1 msec per data record for 'sequential read'). Select-* clauses check whether all or some of the fields are required in the program.
Where clauses, which should only read one row at most in order to check whether certain information exists, for example, should contain the addition 'UP TO 1 ROWS':
SELECT * FROM dbtable UP TO ROWS WHERE field1 = x1.
ENDSELECT.

§  The database time is high because the volume of data transferred is high, but the rate at which data is read (approximately 1 msec per record) is optimal.
The Where clause is used to keep the number of records read by the database for each SQL statement as low as possible.
If, for example, CHECK statements for table fields are contained in SELECT .. ENDSELECT loops, they should be replaced with a suitable Where clause, if possible.
If there are SELECT statements without a Where clause on tables that are constantly increasing in size, that is, BSEG or VBRK, the program design must be revised.
Is identical data read repeatedly?
To determine this, use the 'GoTo.Identical Selects' function in the SQL trace. Here, you have to check whether identical accesses can be avoided.

§  High roll wait times (wait time)
There are probably communication problems here. The RFC trace (ST05) is used to analyze problems of this type.

§  High CPU times (CPU time)
High CPU times imply that there are time-consuming calculations in the ABAP code or frequent accesses to the table buffer. Programs with a CPU time greater than 50% should be examined using the ABAP trace or the ABAP debugger.

 

2.    Performance Trace (ST05)

During program runtime, the following operations can be recorded:

SQL statements of a user, RFC calls, enqueue operations and accesses to the SAP buffer.

 

On the initial screen, there are start (Trace on), stop (Trace off) and analysis switches.

Another user for whom the trace is to be activated can also be predefined here. Your own user is proposed by default.

 

For standard program analysis, activate the SQL trace, the enqueue trace and the RFC trace.

When creating a trace (this also applies to the SQL and ABAP TRACE), note the following points:

Ø  Since the analysis is transparent, the user should only run one activity (no other background jobs or update requests).

Ø  Make sure that Transaction ST05 runs on the same application server as the programs to be monitored. If, for example, you want to record an update request or a background job and you are working in a system with a distributed update or distributed background processing, you must start a trace on all relevant application servers.

Ø  You can use the SQL trace to record SQL statements. There may be considerable differences between the SQL statement formulated from the ABAP and the SQL statement sent to the database.
Furthermore, you have to use the buffer trace to activate SAP buffer accesses.

Ø  In the SQL trace, the buffer loading processes are also written during the first program run, therefore first execute the program without a trace, so that reloading processes concerning the R/3 table buffers, program buffers, and so on, are not recorded.

Ø  During the trace, note the following monitors: For the general check, note the work process overview, the operating system monitor for monitoring possible CPU bottlenecks and the database process monitor for directly monitoring the SQL statements. This does not work if the trace is activated under your own user because otherwise the SQL statements of the monitors would appear on the trace and are illegible

Ø  SQL trace analysis

For analysis, choose List Trace on the initial screen. Use the Trace Mode field to select the subsequent analysis and then choose Execute:

o   SQL Trace
Database operations:

§  Open/Reopen The fields specified in the Where condition are the key fields of the table. The result of the request is exactly one record (Rec=1) or no record found (Rec=0).
SQL statements for which all key fields are specified with 'equal' are called fully 'qualified access'es or 'Direct Reads'. A fully qualified database access should not last any longer 2-10 ms. However, if the hard disk reloads data blocks, for example, times of 100 ms are acceptable.

If you place the cursor on the OPEN/REOPEN statement, you can navigate to the Explain SQL. When you double-click the table names, the system displays a dialog box that contains statistical information about the table and information about all of the table indexes. If you double-click the index, you receive statistical information about the index used.

You can choose Analyze to refresh the statistical information about a table and its indexes. To define the behavior of the cost-based optimizer, you must refresh the statistical information each time a change is made to a table or its indexes. Index Statistics provides an overview of the statistical information about all indexes. Choose Explain with hint to use hints to view the execution plan of a SQL statement.

§  Fetch The data records are transferred in packages to the application server in one or more fetches. The select clause of the SQL statement determines the number of records transferred with a Fetch .
If the number of fields to be transferred by the database are restricted using the SELECT command, or listed directly, more records fit into a Fetch than if you use a 'SELECT *' command.
Here the optimal pick/pack times are 10 ms/record.

If a SQL statement was identified as having a long runtime, the trace should be performed when the system load is high and low.
If the response times for a database access are only negative at certain times, this implies that there are throughput problems in the network or when accessing the database. If, on the other hand, it is difficult to reproduce the response times for a database access, the SQL statement is probably inefficient.

You can distinguish between two types of SQL statements that perform poorly:
Suitable access path:
The SQL statement checks a lot of data blocks in the database and is time-consuming because a lot of data records are transferred from the database to the application server. The database performance is then satisfactory if you can see that the SQL statement requires less than 10 ms for each data record transferred. Generally, performance can only be improved by changing the business process or ABAP code.
Unsuitable access path:
The SQL statement checks a lot of data blocks, but only transfers a few of them from the database to the server. The database performance is less than optimal if you can see that the SQL statement requires more than 10 ms for each data record transferred. You can make it more optimal by changing the ABAP code (unsuitable access strategy - to a complex or incorrect WHERE clause) or by changing the index design (unsuitable access strategy incorrect index or no index).

To recognize network problems between the database and the application server, execute the SQL trace repeatedly, on the one hand on the application server of the connected database and, on the other hand, on an application server that is connected to the database via the TCP/IP network.
If the response times on the server, which is connected to the database via the network, are considerably higher, there is a network problem.

In the trace list, choose the Summary function to obtain an overview of the intensity and time required to access the tables listed in the SQL performance trace.
Goto.Summary.Summarize:
The SQL statements are sorted according to their runtime.
You should optimize SQL statements that have a relatively high runtime in comparison with the total runtime.

You can use the Goto.Identical.selects operation to identify SQL statements that have the same value, that is, the database reads identical data repeatedly and in quick succession. Identical SQL statements return identical results.
In this respect, the SQL statement results are buffered, for example, in an internal table of the calling ABAP program.

On the trace list screen, you can choose ABAP display to jump to the section in the source code from which the SQL statement was executed. The ABAP display is displayed for the SQL statement on which the cursor is currently positioned in the trace list and it is possible for the PREPARE, OPEN and REOPEN database operations.

o   RFC Trace
The RFC trace records RFCs that were received and sent.
By double-clicking a row in the RFC trace or by choosing Details, you receive, for example, the names and IP addresses of the sender and recipient, the name of the RFC module and the volume of data transferred. To display the ABAP source code, choose ABAP DISPLAY.

o   Enqueue Trace
The enqueue trace records R/3 lock requests or releases (including the lock keys and the objects in question).

 

3.    ABAP Trace (SE30)

Use this function if you experience problems with high CPU consumption.

Unlike the SQL trace, this function also provides time measurements for operations on internal tables (LOOP, READ, SORT, APPEND, and so on) , as well as the runtime of database accesses (SELECT, EXEC SQL, and so on) and the time required for individual modularization units (MODULES, PERFORM, CALL FUNCTION, SUBMIT, and so on).

Alternatively, if programs have long runtimes, you can call the ABAP debugger from the work process overview (Transaction SM50, see below) and trace the program in debugging.

On the initial screen, you can enter a transaction code, a program name or a function module. To start the trace, you choose Execute. If you exit the program, transaction or function module in the usual way, the trace returns to the initial screen and displays the measurement data file that was just created in the lower area.


You can use the Analyze switch to display the various views for the measurement results:


Hit list
(in the menu under'Goto') displays the execution time for each statement. It is sorted in descending order according to gross times. Sorting the net time provides an overview of statements that have the highest net times.

The gross time is the total time required for a call. The net time is the gross time minus the time required for the module called (MODULE, PERFORM, CALL FUNCTION, and so on) and separate ABAP statements.

The gross time is the same as the net time for basic statements such as APPEND and SORT.


Hierarchy
displays the chronological sequence of the transaction or program.

 

4.    ABAP Debugger

This tool is used to identify errors in programs.

Note that processing may terminate during debugging, which will automatically trigger a database commit. In this case, the work process (the LUW) is interrupted and this may result in some data inconsistencies (see Note 859240). We therefore recommend that you only debug the test system, if possible.

Performance analysis using the debugger begins when you start the program to be examined. In the second session, you start the work process overview (Transaction SM50, see below). From the work process overview, you choose the Debugging function to navigate to the debugger. By repeatedly navigating to the debugger in quick succession, you can identify the sections of source code in the program that have a high CPU requirement. Experience has shown that these are often LOOP..ENDLOOP loops over large internal tables.

The following programming errors always result in a high main memory and a large CPU requirement:

Ø  Missing REFRESH or FREE statements
You use these statements to delete internal tables and release the assigned main memory. If these statements are missing, resources are blocked unnecessarily.

Ø  Reading in internal tables:
The READ TABLE..WITH KEY.. ABAP statement without a further addition triggers a sequential search. This is very time-consuming if tables are large. Performance is improved considerably if the system uses the ..BINARY SEARCH.. addition to read the table.
For this, however, the table must be sorted beforehand. You can also optimize the performance of operations on large tables, for example, by using sorted tables (SORTED TABLE) or hash tables (HASHED TABLE).

 

5.    Runtime Overview (SM50)

Which program/function consumes the most time?

Ø  Is there a large number of sequential read accesses onto one table?

Ø  Does the program require too much memory space?

Ø  What is relationship between CPU consumption and runtime?
The reasons for high CPU consumption lie in the ABAP code whereas the reasons for low CPU consumption lie in the databases or the RFCs.

Read more...
 
Authorization groups PDF Print E-mail
User Rating: / 0
Written by Anon.   
Thursday, 26 February 2009
The access protection system must ensure that only authorized individuals have access to the system and to particular data. For achieving precise application security concerning authorization and to protect confidential data against unauthorized access it is very important to focus on the use of authorization groups.

The authorization group allows extended authorization protection for particular objects. The authorization groups are freely definable. They usually occur in authorization objects together with an activity.
The table that contains all authorization objects is TOBJ.
The table that contains all activities is TACT.
The table that contains definition of all authorization groups is TBRG.
TBRG -- Contains all authorization groups and gives information about relation between authorization object and authorization group. The description of the authorization groups is defined in table TBRGT.

The field name for authorization group -- BRGRU -- is used to make additional restrictions on authorizations /e.g. for document maintenance/. In authorization objects and authorization checks, there are fields which are checked to verify user authorizations. Customizing objects are combined in authorization groups, and the authorization group is one of the two authorization fields, for example, in authorization object S_TABU_DIS which is in the object class BC_A (Basis - Administration). This object is for displaying or maintaining tables. It controls access using the standard table maintenance tool (transaction SM31), enhanced table maintenance (SM30) or the Data Browser (SE16), including access in Customizing.

Authorization object S_TABU_DIS has the following fields: DICBERCLS - Authorization group, maximum field length is four characters; and ACTVT - Activity (02: Add, change or delete table entries, 03: Only display table contents).

Generally, SAP standard tables are assigned to authorization groups. These assignments can be changed. You can then assign tables manually to a suitable authorization group. To do this, start Transaction SM30 for maintenance view V_DDAT, and create an entry for each of these tables. In V_DDAT is stored the assignment of Tables/Views to Authorization Groups. V_DDAT is cross-client; therefore, it can be viewed and used in all clients.
Note: If you don't make a selection, all tables maintained in Customizing transactions are assigned to authorization groups
 
Function modules: Amount and Currency PDF Print E-mail
User Rating: / 0
Written by Anon.   
Wednesday, 25 February 2009
  • CURRENCY_AMOUNT_SAP_TO_IDOC - Convert currency to IDOC format
  • CONVERT_TO_LOCAL_CURRENCY - Conversion of currency
  • CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all
    character fields), not right justified as numbers normally are.
  • CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
  • CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

 

Example 1: Convert amount to/from string

Amount to string:

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
EXPORTING
betrg = 3000
WAERS = 'DKK'
* NEW_DECIMAL_SEPARATOR =
* NEW_THOUSANDS_SEPARATOR =
IMPORTING
STRING = slam.

String to amount:

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
EXPORTING
string = slam2
DECIMAL_SEPARATOR = '.'
* THOUSANDS_SEPARATOR =

WAERS = 'HUF'
IMPORTING
BETRG = b2
* EXCEPTIONS
* CONVERT_ERROR = 1
* OTHERS = 2
.
 
Change documents and change pointers PDF Print E-mail
User Rating: / 0
Written by Anon.   
Tuesday, 24 February 2009

Tables

  • CDHDR Change document header
  • CDPOS Change document items
  • JCDS Change documents for System/User statuses (Changes to table JEST)

Function modules

Tables CDHDR and CDPOS can be read with function modules

  • CHANGEDOCUMENT_READ_POSITIONS
  • CHANGEDOCUMENT_READ_HEADERS

Transaction codes related to Change Pointers

  • BD21 Create IDOCs from change documents
  • BD50 Activate Change Ptrs for Mess. Type
  • BD54 Maintaining Logical Systems
  • BD61 Activate Change Pointers - Generally

Programs

RSDMIDOC: Generates IDOCS from change pointers

var fe = FindFrame("toc", top); if ((fe != null) && (chmtop.c2wtopf.jstree != null)) { if (chmtop.c2wtopf.FITEMS[chmtop.c2wtopf.pagenum] != chmtop.c2wtopf.pageid) chmtop.c2wtopf.jstree.OpenTreeNode("" + chmtop.c2wtopf.pageid); }
 
Language Dependent Formatting of Amount and Currency PDF Print E-mail
User Rating: / 0
Written by Anon.   
Tuesday, 24 February 2009
To format a currency amount with decimals according to the currency use WRITE and the CURRENCY option.

Currency keys an d numbers of decimals are defined in table TCURX Decimal Places in Currencies.

Example 1: Formatting an amount in Kuwatian Dinars:

Dmbtr = 123456.
Write dmbtr currency 'KUD'

123.456

Write dmbtr currency 'USD'

1234.56

Note that the formatting does not depend on the number of decimals in the number in the program.

Dmbtr = '12.3456'.

Write dmbtr currency 'USD'

1234.56


To format the decimal and thousand separators according to the settings for a specific country, use the statement SET COUNTRY <country key>

Settings for countries are defined in table T005 Countries.

The country key used in the statement is field LAND1

Example:.

set country 'US'
 
ABAP Questions PDF Print E-mail
User Rating: / 0
Written by Anon.   
Friday, 05 December 2008

1) Logical Directory path can be used to transfer files from Application server to SAP R/3 system? FALSE

2) At the most 30 breakpoints can be used in a ABAP Program? TRUE

3) Cluster Table can never be used in the table joins? TRUE

4) Lock object can be created individually for any Database table? TRUE

5) SAP memory does not use "Export to…" statement for internal sessions? TRUE

6) There are 4 types of transportable request FALSE

7) Asynchronous tasks in Workflow require terminating event. TRUE

8) BADI"s are Workbench specific Enhancements? FALSE

9) If you create a data object without explicitly specifying its type, it will become type C with length one. TRUE

10) If the Internal table is empty while using FOR ALL ENTRIES then all the records from the DB w.r.t the where clause are fetched? TRUE

11) At User-command event is not used to handle the Function code of the pushbutton on the selection screen? FALSE

12) ALV Object oriented routines are not stored in SLIS Type pool? TRUE

13) $Tmp objects do not have any version management?  FALSE

14) IDOCs are created, sent and posted in a specific order using Serialization? TRUE

15) Transport of Copies can be transported to only specific SAP system and are not transportable to any other system further ahead in the transport scenario. FALSE

16) Best way to populate a character, date and numeric field values BDCDATA internal table is by Write Left-Justified to BDCDATA-FVAL.  TRUE

17) Switch Framework enhances the standard system by activating the industry solutions and their repository objects. TRUE

18) Data element should be changed to edit the online help for a "customer transaction nos" on the screen. FALSE

19) STRING contains character-type data and XSTRING contains data in the form of uncoded bytes. TRUE 

20) BAPI is an object-oriented interface to integrate the external applications with SAP R/3 system. TRUE

21) A Unicode system has 
Double codepage
Single codepage
UTF-16     TRUE
Both Single codepage & UTF-16

22) Enhancement Framework is spread across –
System
Application     TRUE
Application & workbench
Application, Workbench & Kernel

23) The SELECT ... ENDSELECT statement is also known as the SELECT loop. Which of the following statements are true about SELECT upto N rows… ENDSELECT? (A).A work area is required for the selected rows. This work area can be given explicitly (with INTO) or implicitly (if a TABLES declaration is used). (B).The database will transfer individual rows to the database interface. (C).The database will transfer blocks of rows to the database interface. (D).The system field sy-tabix counts the number of selected table rows. – 
B&D
A   TRUE
C
A&C

24) Workflow Agents can be determined at which of the following levels? (A).Task Level, (B).Step Level – 
Neither
A   TRUE
B
Both

25) Which of the following is true for IDOC Message types? (A).Logical representation of IDOC Data, (B).Can be used for both Outbound and Inbound communication, (C).Can be used for Serialization – 
None
A    TRUE
A&B
All 3

26) Which of the below are true in case of OO ABAP? (A). A PRIVATE component of a class can be accessed in all methods of that class. (B). A PROTECTED method METH that is defined in a class SUPER can be overwritten (redefined) in an inherited class SUB. (C). All components of inherited classes are PUBLIC. (D). A programmer can, but need not, determine the visibility of a component. The default visibility of a component is PRIVATE. – 
C&D
A        TRUE
B
A&B

27) IDOCs can be generated by which object type and method in LSMW? (A).Batch Input Recording, (B).IDOC, (C).BAPI – 
A
B    TRUE
C
B&C

28) Deadline Monitoring in the Workflow can be done starting from which of the following ? A. WorkItem Creation B. Workflow Creation C. Some expression with calculated Date & Time D. Rule Resolution – 
D   TRUE
A&B
A&C
A, B & C

29) Which of these are enhancement Technologies? (A).Source Code Enhancement, (B).Function Group Enhancement, (C).Class Enhancement, (D).Workbench Enhancement – 
D
A   TRUE
A&B
A, B & C

30) In how many of the following areas would you rate yourself at 6/10 or better? (A). Core ABAP (Forms, Reports, Conversions), (B).ABAP CRM, (C).ABAP HR, (D).Advanced ABAP (IDOCs Interfaces and Workflow), (E).ABAP Enhancements with OO ABAP – 
A+D+E      TRUE   
A+ One other area
A+ two other area
All of the above

 
Transaction Related to Upgradation PDF Print E-mail
User Rating: / 0
Written by P. Renjith Kumar   
Monday, 03 November 2008
Last Updated ( Tuesday, 04 November 2008 )
Read more...
 
Keep trailing spaces in a file PDF Print E-mail
User Rating: / 0
Written by joyjit   
Monday, 03 November 2008

This tip will show us how to keep trailing blanks in a file.

Last Updated ( Tuesday, 04 November 2008 )
Read more...
 
Types of ABAP Processing Blocks PDF Print E-mail
User Rating: / 2
Written by Kevin Wilson   
Sunday, 20 July 2008
  • Types of ABAP Processing Blocks
    All ABAP programs are made up of processing blocks. You cannot nest processing blocks. When a program is executed, its processing blocks are called. All of the statements in an ABAP program, apart from its global data declarations, belong to a processing block.
Read more...
 
Types of Screens PDF Print E-mail
User Rating: / 1
Written by Kevin Wilson   
Saturday, 19 July 2008
    • Screens: Defined using the Screen Painter. Can be combined into screen sequences. You can use CALL SCREEN or a transaction code to call it. It can be processed in dialog modules.
    • Selection Screen: Defined within an ABAP program. Called by the runtime environment or by the CALL SELECTION-SCREEN statement. Processed in event blocks of the corresponding ABAP program.
    • Lists: Defined within an ABAP program. Called by the runtime environment. Processed in event blocks of the corresponding ABAP program.
 
<< Start < Prev 1 2 3 4 5 6 7 Next > End >>

Results 1 - 15 of 104

Google Search

Google Ads