ABAP Tips and Tricks -1
-
Upload
vijaykarri -
Category
Documents
-
view
230 -
download
0
Transcript of ABAP Tips and Tricks -1
-
8/3/2019 ABAP Tips and Tricks -1
1/15
CHANGING PACKAGE NAME
In the initial ABAP learning periods, I had faced the difficulty of transporting the Table
data from one system to another. I had to MANUALY copy, Master data from onesystem to another; as was unaware of this feature in SAP, that allow us to transport the
data/table contents automatically from one system to another.
Transport Request with Table Contents Attached
Lets check out the steps for the same.
Content of a table can be transported from Development to Quality and to Productionusing Transport System. First you need to attach the table entry to a transport and then
same procedure applies as in case of transporting abap changes.
Step 1: Open the content of table which you want to transport using transaction SE11.
Select Transport Entry from menu.
-
8/3/2019 ABAP Tips and Tricks -1
2/15
Select Transport Entries
Step 2 : If you already have a transport then enter in Request input otherwise click on
new button to create transport and follow normal procedure of creating new Request
and attach data to this new Request.
Create a Transport Request
Now if you see the transport in SE09 you will find that table content were attached to
transport. Follow the regular transport procedure to transport these table contect further in
your SAP landscape
ABAP prgrammer sometimes do workout on things locally (Technically, making theobject Local in nature). After all the changes done to the object, the object is ready to
transport to the next landscape for further testing.
Following steps defines how an ABAPer can reassign the Transport Package to the
Object to be transported.
-
8/3/2019 ABAP Tips and Tricks -1
3/15
In this case, lets say, we want to reassign the package to an ABAP program. Following
steps defines how to reassign the Package from Local to Transportable.
1. In SE38, enter your program name.
2. Use the menu option goto -> object directory entry.
3. Click on Change, and you can enter the new package. Youll be prompted for aworkbench request number also. The same technique can be used to change packages in
other objects.
You can also use transaction SE03 (or the tools option from SE09/SE10), but access issometimes restricted.
CUSTOMIZING SAP LOGIN SCREEN
-
8/3/2019 ABAP Tips and Tricks -1
4/15
There are times, when Client want to display some important / statutory message on SAP
Login Screen.
-
8/3/2019 ABAP Tips and Tricks -1
5/15
We can do that using some simple steps:
1. Goto SE61 and select GENERAL TEXT as Document Class and search forZLOGIN_SCREEN_INFO. Click Change button. (if not found, Create
-
8/3/2019 ABAP Tips and Tricks -1
6/15
Enter the text you want to display in free text field displayed. Save and exit.
Now the next time you click login on login pad, you will see the message you saved.
Note:
1. You can add Icons to the message. Use report RSTXICON to identify icon.
-
8/3/2019 ABAP Tips and Tricks -1
7/15
2. Refer to SAP Note 205487 for more on displaying text on login screen.
ADD COMPANY LOGO TO SAP EASY ACCESS INITIAL SCREEN
It is primarily required to display company logo instead of SAP standard wallpaper on
SAP Easy Access Initial Screen. you can do it by using SMW0.
-
8/3/2019 ABAP Tips and Tricks -1
8/15
Go to transaction SMW0 and click on Binary Data for Web RFC Applications,
Click on Right Tick Mark on above.
On next screen you will see a execute button dont select any package just execute it.
-
8/3/2019 ABAP Tips and Tricks -1
9/15
On the next screen create a new entry by selecting Create button. Enter Object Name andDescription. Press Enter to select the Image using File Browser. Select the Image andpress Import.
-
8/3/2019 ABAP Tips and Tricks -1
10/15
Then go to SM30. Select table SSM_CUST. There will be a perameter called
START_IMAGE. Enter parameter value (TEST IMAGE in our case).
It will ask for a Transport Request. Create a Local Request.
Log off and login again. You will see new logo.
-
8/3/2019 ABAP Tips and Tricks -1
11/15
LOCK OBJECTS IN SAP
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being
insert/change into database.
SAP Provide three type of Lock objects.
- Read Lock(Shared Locked)
protects read access to an object. The read lock allows other transactions read accessbut not write access to the locked area of the table
- Write Lock(exclusive lock)protects write access to an object. The write lock allows other transactions neither read
nor write access to the locked area of the table.
- Enhanced write lock (exclusive lock without cumulating)works like a write lock except that the enhanced write lock also protects from further
accesses from the same transaction.
Type of Locks
Steps:
Go to SE11 transaction and create a lock object for the table .Custom lock object
name should be start with EY or EZ.
-
8/3/2019 ABAP Tips and Tricks -1
12/15
Lock Object - Initial Screen
After activating lock object Function Module will be generated automatically.
Function Modules name will be like ENQUEUE_ and
DEQUEUE_.
-
8/3/2019 ABAP Tips and Tricks -1
13/15
Lock Modules
For Example:
For example you have created a lock object EZSFLIGHT for the SFLIGHT table .
So first lock the table , then update then release the lock.
Check this code
DATA : t_itab like table of SFLIGHT,
fs_itab like SFLIGHT.
fs_itab-carrid = AA.
fs_itab-connid = 0017.
.
.
.
APPEND fs_itab TO t_itab.
.
.
.
CALL FUNCTION ENQUE_EZSFLIGHT SET lock to the table
EXPORTING
CARRID = .
CONNID = .
.
.
-
8/3/2019 ABAP Tips and Tricks -1
14/15
IF sy-subrc eq 0.
INSERT sflight from table t_itab. Update the DB table
ENDIF.
CALL FUNCTION ENQUE_EZSFLIGHT Unlock the table
EXPORTING
CARRID = .
CONNID = .
.
SEARCH TRANSACTIONS BY TEXT IN SAP
Most of the ABAPer or who ever use SAP at some point stuck at the point to know or
remember Transaction codes.
Initial Screen of SAP provided standard T-Code for search
SAP given a simple Transaction code SEARCH_SAP_MENU which accepts text andgives the result input in all Transaction codes which are matched to that particular text.
-
8/3/2019 ABAP Tips and Tricks -1
15/15
Program Ouput
It even provides the details of all the preceding nodes to look at the path (from SAP
initial screen Navigation).