When describing Abap development matters in detail, there are topics which don't actually belong anywhere, or they would relate to many other articles. AbapcadabrA Cookies is where stand-alone articles find their home. Until a better home if offered to them of course...
Quickly search all the coding that was done on the system, with a standard SAP tool.
The Abap editor (SE38
) is where our creations are developed. Here's an overview of handy shortcuts that you really should know about. From toggle between upper and lower cased to statement option suggestions to bookmarks.
There are more than 1000 icons in SAP, which can be used for menu's in screens or on reports. To get an overview of these Icons, report SHOWICON
can be used. Have you been peeking at the output of this report in the past ? AbapcadabrA holds an alternative to the SHOWICON
which will help you selecting the right Icons
Everybody knows the "*" acts as a wildcard value in SAP's data entry fields. Did you also know that the "+" character does the same thing, but just for a single character ? It's common knowledge which is used in all modules and the *-character is probably the most used keyboard button - except for most alphabet keys. So how do you find the "*" value itself ? Anyone ?
SAP functionality can be called/started via transaction codes and reports. The main transaction codes also live in SAP's menu,s but when you want a short-cut to certain functionality, use the transaction code. They are listed in table TSTC
which can be viewed with transaction code SE16
(or SE16N
or similar).
Function modules can return an error code which will populate the value of SY-SUBRC
, much like many statements will do (READ TABLE, SELECT * FROM ...
and even after ENDLOOP
). The exception handling usually goes hand-in-hand with
Many of the settings on how the system opterates are setup in a parameter file, very high level and with very interesting values. Check out report RSPARAM
to list all values. Would you like to know how long your program can run before a TIME_OUT
occurs ?
You are sharing the system with other users, working in their own sessions. Table USR41
holds user logon session information, which is cleared again when users log off.
Timer, clock, animations, automatic refresh, trigger - just some hype words that would help you find this article. If you want to refresh something or you want to ensure a certain task is not on the screen for too long - you will have to wonder: Business Application Relevant ? If it is: here's how
If there is a colleague locking something and you need a quick way to draw his/her attention, you can "send a message" from the system. Check who's online and what's happening on your or the other application servers.
There are several ways to determine if a system is a test or productive system. I found that the following code is the most robust way.
Having your Abap coding operate all over the world could mean some adaptions need to be done. There is a Unicode check setup available as transaction UCCHECK
- Check a Program Set for Syntax Errors in Unicode Environment. The transaction operates as code inspector, checking the health of your ABAP developments. Unicode matters become important when talking to the outside world, so the interface side of developments is outlined here.
Editing Abap coding can be done in Notepad as well, but it would of course lack a lot of Abap editor functionality. I like to use freely downloadable Notepad++ (download here) for my off-system editing or viewing Abap coding.
There is a nice way to pimp up a comment block, given that Abap coding (any coding) is often shown in a mono-spaced font, for Obvious reasons. Personalize your coding with an easy to implement tekst-based super font. In fact, there's over 100 such fonts available.
Business relevant documents can be changed, and changes may need to be traced. SAP has Change Documents to cater for this, a document in itself which hold the change log of another document. The setup can be applied to existing SAP objects, documents, but also custom build ones. Here's how.
Online documentation on Abap matters is available from the Abap editor by pressing F1 on the Abap coding element you want help on. There's another way to this excellent documentation: transaction ABAPDOCU
- ABAP Documentation and Examples
You must have heard of the system log, which keeps track of a wide variety of things that have happened on the system. Transaction SM21
reveals the system log, which will hold information about dumps, failed login attempts or even debugger change actions in which the variable that was changed is outlined. Want to make your own mark ?
There is a standard SAP report that can be used to download a report or module pool with it's includes and screens. It's a report that is part of the SAP workbench and it's ready for you to use. Report REPTRAN
- Report and module pool transporter, can be a great help in sharing developments and comparing versions of reports for different systems.
So which user-ID's have developer access on your system ? To be a developer an access key needs to be obtained from SAP, and table DEVACCESS
lists the users with such key.
This is rather uncommon: but it is used in HR for transaction PA30
to hide or show screen fields controlled via customizing. In effect a list of fields that is available on the screen (dynpro) is made available in a customizing table (T588M
) and from there the system can hide fields or make them readonly. A special statement is available for this.
You may not realize it, but you have used the GOS toolbar on SAP's standard documents already. GOS or Generic Object Services is a suite of functionality that allows the end user to add / maintain attachments. It's the button that can be found just to the left of the application title. A personal note can be added to the document, as can attachments. It is even possible to have the system add an attachment document, when .e.g. the shopping cart was created for a web site through which the attachment was uploaded.
For non-SAP documents, Archive-link does what its name suggests: link your .PDF or .DOCx documents to SAP, but store them on an external archive. A brief introduction to this enormous suite of functionality will take you through the concepts.
There is a very easy way te refer to an internet or intranet site from an Abap: call function OPEN_BROWSER
and pass the URL to it. Check the coding within while you are at it - it too holds interesting functionality.
Abap allows you to modularize your coding in many ways. Making (parts of) your coding re-usable and chopping up your logic into eatable chunks is always a good idea.
You are likely to be using CTRL-X and CTRL-Y all day long, copy and paste texts or other objects using the windows clipboard. Reading this clipboard and setting it's content can be done with function modules CLPB_IMPORT
and CLPB_EXPORT
. Texts only.
In some cases it would make sense to just wait. An update was done in the previous step and you want to continue processing, but you need to make sure all update steps are properly executed, just inform the system to wait.
The Abap editor is packed with options and tooling and integration with other tools. Here's a list I've come across so far - you may find things you've not seen before...
In case you need to store sensitive information such as access codes or passwords, you can build you're own encryption routines, or use a ready-available one in the form of a C-routine.
Is there a way to execute a Unix command and see the results, as if it was executed from a Unix prompt ? There is, with a little help of a small report.
You can type in a transaction code or stop the current transaction. Is there more ? How can the command window be adressed on popups ?
SAP sessions can become part of a development solution, though this is not a common thing. Session control is a subject that should be controlled by the overall system and not from your specific development. Having said that - there are means to control sessions from an Abap development.
You want to give your end user the option to start a new session: think again. Starting a new session is a standard option on every menu and can even be done with SHIFT-*, so you don't need to do that anywhere else. Or should your new session start a specific transaction ? Here's how:
Why not help your end user through the day by hanging on to relevant information by means of defaults ?
Prehistoric, but still quite useful. The batch input session works much like a macro on R/3 applications, allowing screen by screen field input and menu actions...
Recording sessions is backed by quite a bit of tooling, which can be confusing. That's a petty, because the tooling is available to you or your end user, it works and it has enormous potential. A brief article on how it all associates to each other. What's SM35
relation to SHDB
?
Article predades the millenium bug...
A BDC session can also be processed as a group of sessions, for which transaction SHDB
- transaction recorder: Recording overview - is available. From an Abap the use of BDC groups is also supported.
Ever wondered how transaction SE16
builds it's selection screen and report ? Generate a report "on the fly".
Leave, exit, check, continue, return and reject... These statements sound alike, but differ considerably.
Your end user needs to log on and make himself known. But there is also terminal information on where the user is. Check out function module TH_USER_INFO
, which will return a terminal ID as well as session information. C-call to ThUsrInfo
. But that's not all the TH_*
modules have to offer. Check out function group THFB
for MANY more interesting function modules.
There is a statement which will help you get rid of duplicate entries from an internal table - and it may be good to know which entry is actually removed, the original one or the actual duplicate ? It's the duplicate of course, however, you do have control...