0% found this document useful (0 votes)
83 views

Ok Codes

This document provides information about various OK code values and commands that can be used in SAP transactions and ABAP programs. It discusses commands for terminating and starting transactions, sessions, and batches. It also covers commands for debugging ABAP programs, resetting buffers, and starting transactions while skipping screens.

Uploaded by

mailto114
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Ok Codes

This document provides information about various OK code values and commands that can be used in SAP transactions and ABAP programs. It discusses commands for terminating and starting transactions, sessions, and batches. It also covers commands for debugging ABAP programs, resetting buffers, and starting transactions while skipping screens.

Uploaded by

mailto114
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

OK Code values

This tip has been copied from SearchSap.com


Tip submitted by: Chimou Chim

Direct call of transactions, session handling

/nxxxx This terminates the current transaction, and starts


transaction xxxx

/n This terminates the transaction. This generally corresponds to


pressing F15 to go back.

/nend This terminates all separate sessions and logs off (corresponds
to System - Logoff

/nex This terminates all separate sessions and logs off immediately
(without any warning!)

/oxxxx This opens a new session and starts transaction xxxx in This
session.

/o This lists existing sessions and allows deletion or opening of a new


session.

/i This terminates the current session (corresponds to System End

/i1, /i2,... This terminates the session with the number given.

.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus.
This type of navigation is
uncommon and is provided more for emergencies (such as a
defective mouse).
Batch input. The following commands can be entered in correction
mode ('Process in foreground' or
'Display errors only') when processing a batch input session

/n This terminates the current batch input transaction and


characterizes it as

/bdel This deletes the current batch input transaction.

/bend This terminates batch input processing and sets the session to
Failed

/bda This switches from Display errors only to Process in


foreground

/bde This switches from Process in foreground to Display errors


only

ABAP

/h This switches into debugging mode.


/hs This switches into debugging mode and activates the debugging
of system functions.

Buffer

WARNING: Resetting buffers can significantly change the


performance of the entire system for a
long time. It should therefore only be used where there is a good
reason tdso. As of release 3.0B
system administator authorization is required (authorization object
(S_ADMI_FCD). The action is
noted in the system log.
/$SYNC This resets all buffers of the application server

/$CUA This resets the CUA buffer of the application server

/$TAB This resets the TABLE buffers of the application server

/$NAM This resets the nametab buffer of the application server

/$DYNP This resets the screen buffer of the application server

/*xxxx starts transaction xxxx and skips the first screen. So, it has
the same effect as /nxxxx
followed by ENTER.

=xxxx This entry is still possible for compatibility reasons, but is no


longer supported.

%sc Searches character patterns in lists

%pc Downloads lists

%pri Prints lists

Improve performance of SELECT

This tip has been copied from SearchSap.com


Tip submitted by: Ben Meijs
As you all know, it is important to use as many key
fields as possible in WHERE clauses of SELECT
statements. Sometimes you are not sure about the
value of some key
fields. They seem to be empty (Initial value) but
you are afraid to use this in your ABAP coding.

Using the option GE (greater equal) in your coding


can improve your performance considerably
without the risk of table lines not being selected.

Code

REPORT ZZBM_SELECT_1 .
TABLES: S001.
CONSTANTS: SSOUR_INI LIKE S001-SSOUR VALUE
IS INITIAL,
VRSIO_INI LIKE S001-VRSIO VALUE IS INITIAL,
SPMON_INI LIKE S001-SPMON VALUE IS INITIAL,

SPTAG_INI LIKE S001-SPTAG VALUE IS INITIAL,


SPWOC_INI LIKE S001-SPWOC VALUE IS INITIAL,
SPBUP_INI LIKE S001-SPBUP VALUE IS INITIAL.

DATA: TA_S001 TYPE STANDARD TABLE OF S001.


DATA: WA_S001 TYPE S001.
SELECT-OPTIONS:
SO_SPTAG FOR S001-SPTAG OBLIGATORY,
SO_KUNNR FOR S001-KUNNR OBLIGATORY,
SO_VKORG FOR S001-VKORG OBLIGATORY,
SO_VTWEG FOR S001-VTWEG OBLIGATORY,
SO_SPART FOR S001-SPART OBLIGATORY,
SO_MATNR FOR S001-MATNR OBLIGATORY.

START-OF-SELECTION.

SELECT * FROM S001

INTO TABLE TA_S001


WHERE SSOUR GE SSOUR_INI "Greater Equal
initial value
AND VRSIO GE VRSIO_INI " idem
AND SPMON GE SPMON_INI " idem
AND SPTAG IN SO_SPTAG
AND SPWOC GE SPWOC_INI " idem
AND SPBUP GE SPBUP_INI " idem
AND KUNNR IN SO_KUNNR
AND VKORG IN SO_VKORG
AND VTWEG IN SO_VTWEG
AND SPART IN SO_SPART
AND MATNR IN SO_MATNR.

Another way to find user exits


Here is a small addition to a tip from Matthew
Billingham on how to locate user exits. Instructions
are
relevant to 4.6B but I'm pretty sure I've used it in
earlier versions. It's been a while though.

If you goto the SAP Application hierachy (SE81)you


can go down into individual modules.

Select the area you are interested. (It should turn


yellow).

Choose Information System button.

Select Environment--->Exit Techniques-->Customer


Exits--->Enhancements.

You should now belooking at a selection screen


with the DEV classes filled in from the Application
hierachy.

If you hit Execute you will get the exits for the
selected part of the hierachy!

Have a play around with SE81 / Info system it can


be very usefull in finding all sorts of interesting
things!
Above all Enjoy!

User exits

1. Introduction
2. How to find user exits
3. Using Project management of SAP
Enhancements

1. Introduction

User exits (Function module exits) are exits


developed by SAP. The exit is implementerd as a
call to
a functionmodule. The code for the function
module is writeen by the developer. You are not
writing
the code directly in the function module, but in the
include that is implemented in the function
module.

The naming standard of function modules for


functionmodule exits is: EXIT_<program name><3
digit suffix>

The call to a functionmodule exit is implemented


as: CALL CUSTOMER.-FUNCTION <3 digit suffix>

Example:

The program for transaction VA01 Create


salesorder is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i


program SAPMV45A you will find ( Among other
user
exits):

CALL CUSTOMER-FUNCTION '003'


exporting
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits

Display the program where you are searching for


and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction


CMOD. Choose menu Utillities->SAP
Enhancements.
Enter the exit name and press enter.

You will now come to a screen that shows the


function module exits for the exit.

3. Using Project management of SAP


Enhancements

We want to create a project to enahance


trasnaction VA01

Go to transaction CMOD
Create a project called ZVA01
Choose the Enhancement assign radio button and
press the Change button
In the first column enter V45A0002 Predefine sold-
to party in sales document . Note that an
enhancement can only be used i 1 project. If the
enhancement is allready in use, and error message

will be displayed
Press Save
Press Components. You can now see that
enhancement uses user exit EXIT_SAPMV45A_002.
Double click on the exit.
Now the function module is displayed. Double click
on include ZXVVAU04 in the function module
Insert the following code into the include:
E_KUNNR = '2155'.

Activate the include program. Go back to CMOD


and activate the project.
Goto transaction VA01 and craete a salesorder.
Note that Sold-to-party now automatically is
"2155"

LUW - Logical Unit of Work

A Logical Unit of Work (LUW or database


transaction) is an inseparable sequence of
database
operations which must be executed either in its
entirety or not at all. For the database system, it
thus constitutes a unit.

LUWs help to guarantee database integrity. When


an LUW has been successfully concluded, the
database is once again in a correct state. If,
however, an error occurs within an LUW, all
database
changes made since the beginning of the LUW are
canceled and the database is then in the same
state as before the LUW started.
An LUW begins

o each time you start a transaction

o when the database changes of the previous


LUW have been confirmed (database commit) or

o when the database changes of the previous


LUW have been cancelled (database rollback)

An LUW ends

o when the database changes have been


confirmed (database commit) or

o when the database changes have been


canceled (database rollback)

You might also like