Vous êtes sur la page 1sur 3

Standard Conversion Exits

Most conversion exits used in screens by SAP are actually function modules. You can find them by searching for
CONVERSION_EXIT_name_INPUT and CONVERSION_EXIT_name_OUTPUT.

Finding a transaction code via SE93


Go to Transaction SE93 and press F4 and then Press All selections button. It will give you a better search to look for a transaction
than directly going to table TSTC. (Submited by Ram Mullapudi)

List of ways to transport variants


There are at least three ways that I know of that you can transport a variant for a program.
When you first transport a program, all elements of a program are transported along with the source code. This includes any
variants that have been created at this time
After the first time a program has been transported, there are two ways to move a variant. The first method is to manually add
an entry to the transport for the variant you want to move. The format of the entry is LIMU VARX
xxxxxxxxName_of_the_variant where xxxxxxxx is the program name.
The last method is the easiest, in that you do not have to remember any arcane codes. Go to the ABAP editor, and go to the
variant screen. Under the Utilitles menu is Transport Variant. This allows you to choose the variants to transport, and the
transport to put them in.

List of methods to FTP from within SAP


SAP supplied function modules (See example)
Write a unix script and call it via CALL SYSTEM
Create a command through transaction SM69 (and execute via SXPG_CALL_SYSTEM) that call the script with parameters.
Use the FILTER option on the OPEN DATASET command
Have an external step in your job that runs after the dataset has been created. The external step will call a script with
parameters to do the ftp.

NOTE: ftp can accept commands from a file, and it is often useful to create a file containing the commands, and pipe the file into the
ftp command.

How to Archive (and delete) Material Master Records


This document was provided by Jon Davatz of Homepage for SAP Professionals. Having been through the archiving process before
(but not fully documenting it), I have found this document to be very thorough and accurate. It is in PDF format, so you must have
the Adobe Acrobat viewer installed. Download the document here.

User Status Tip


If you have several status for a program that are nearly identical, it can be easier to setup and maintain a single status, and just hide parts of it as
required. Rember, this is sample code only. It is a snippet from a real program, and I may have forgotten to include some things.
EG:
data: BEGIN OF MTAB_UCOMM_EXCLUDE OCCURS 0,
VALUE(4) TYPE C,
END OF MTAB_UCOMM.
AT USER-COMMAND.
PERFORM SET_PF_STATUS.
...
*---------------------------------------------------------------------*
* FORM SET_PF_STATUS *
*---------------------------------------------------------------------*
* Set up the menus/buttons for the report *
*---------------------------------------------------------------------*
FORM SET_PF_STATUS.
CLEAR MTAB_UCOMM_EXCLUDE.
REFRESH MTAB_UCOMM_EXCLUDE.
CASE MI_CURRENT_PAGE.
WHEN 1.
*-- Do not want any pushbuttons that point to items to the right

*-- since the list is at its rightmost position


MTAB_UCOMM_EXCLUDE-UCOMM = FRST.
APPEND MTAB_UCOMM_EXCLUDE.
MTAB_UCOMM_EXCLUDE-UCOMM = PREV.
APPEND MTAB_UCOMM_EXCLUDE.
WHEN MI_TOTAL_PAGES.
*-- Do not want any pushbuttons that point to items to the left
*-- since the list is at its leftmost position
MTAB_UCOMM_EXCLUDE-UCOMM = LAST.
APPEND MTAB_UCOMM_EXCLUDE.
MTAB_UCOMM_EXCLUDE-UCOMM = NEXT.
APPEND MTAB_UCOMM_EXCLUDE.
WHEN OTHERS.
*-- Want all pushbuttons to appear on any other page
ENDCASE.
SET PF-STATUS MAIN EXCLUDING MTAB_UCOMM_EXCLUDE.
ENDFORM. " SET_PF_STATUS

Editor Tips (*EJECT and *$*$)


*EJECT - If you put *EJECT at the start of a line, it will force a new page when you print your source code. This comes in real
handy when you would like to have subroutines start at the top of a new page.
*$*$* - By placing *$*$ at the beginning of a comment line will lock the line for editing. You are able to edit the line until you hit
the enter key.

Change the font on the X_65_255 paper size


This tip was taken from the SAP-R3 mailing list, and is by Sheila Tichener.
If you need to use a large line-size to get all your data in I know the sap version of X_65_255 for hp laser jet 4 gives an unnecessarily
small font .
You can change it in SPAD (or copy to Y_65_255) as follows.
Choose Device formats, Change
hplj4
x_65_255
Execute
Double click on printer initialisation
Change from:# select Courier 16.67 CPI normal font
\e(s0p16.67h0s0b4099T
to:# select arial 24 cpi 15 point normal
\e(s0p24h15v0s0b16602T
................
Also bold as follows:# select arial 24 cpi 15 point bold
\e(s0p24h15v0s3b16602T
it still fits and looks better.
Also the error you get when changing a format in the output screen is only a warning and can be overidden by pressing the green tick.
If the sap standard formats don'fit your requirements you can create your own eg Y_65_170 . It seems to be the numbers in the
t
name that somehow triggers which one the abap chooses.
Sheila

How to find a single quote within a string


Use 4 single quotes to find one quote in a string. The following code snippet will replace a single quote with a double quote.
replace ' with ' into field
'
'
'
"'

Helping the DBMS find the correct index

Sometime, you may find that the a SELECT that you have coded is very slow, even though you have put all the fields needed for an
index in your where clause. Usually, this means that the DBMS is selecting the wrong index, you can tell if this is the case by doing
an SQL trace (System - Utilities - SQL Trace). You can help the DBMS select the correct index by providing hints, include all fields
from the index, and make sure that the fields are in the same order as they appear in the index.

Saving screens created with Screen Painter


(Provided by Paul Kjaer)
You can not download code for the Screens (except for the ABAP part), but at least you can download a printout of what you set up.
If you are in Object Browser looking at the module program, you can highlight the screens and click the print button. Click no to print
immediately, then go into System -- Services -- Output Control to select the spool request and then go into List -- Save -- Local File.
(Of course, you can send it to a printer to see documentation on your screen).

Help Views
(Provided by Paul Kjaer)
For instance, I set this up in a multi-language environment when you have a code and text combination you want to set up. Typically,
you have to set up two tables: One with just the valid codes i.e. Zxxx where the only field is the code field, the second is ZxxxT
which contains the code and language as the primary index with the description as the data field. In this case, then you usually define
a view H_Zxxx which is a join on these two tables. The key thing is that the Foreign Key definition for the code field in the ZxxxT
must have the must have the type "Key Fields of a Text Table". This results in the Table Maintenance generator (SM30) generating a
screen that allows you to maintain the code and description together for the system language.
In a related note, to set up a customer transaction for a Table Maintenance generated dialog, use SE80 and enter the function group
used for the table maintenance dialog. Then Create a transaction (Zxxx) of type parameter. Fill in text, specify Transaction SM30,
click on "skip initial screen" and set up default values of VIEWNAME set to Zxxx and UPDATE set to X.

Field Exits
(Provided by Paul Kjaer)
You cannot debug a field exit. You can at best create a small module pool with a screen that has the appropriate fields and in your
PAI, call a module which calls your function that is the field exit and debug the small module pool. Good idea to keep as much of one
around if you do field exits regularly.
I used CNEX0007 and CNEX0006 to add fields to the PRPS and PROJ tables respectively in the PS Module. As probably the case
with most of these exits, have fun trying to figure out how to protect the fields in display mode. We lived with the fact that the save
was disabled so it could not save the changes anyway. A test of the transaction code would not be complete. Use transaction SMOD
to do SAP enhancements/field exits. In SMOD, you can get list of SAP enhancements that exist by Utilities - SAP Enhancements.
Trying to figure out what they can be used for and how to accomplish the desired results is a major challenge.