Академический Документы
Профессиональный Документы
Культура Документы
Step 1:
Select Radio button Table pool/Cluster Give table Pool Name: ZTBL_POOL.
Step 4:
Step 6:
Step 7:
Create a Z table.
Step 8:
Step 9:
Step 10:
Step 11:
Report: ZREP_SHUKS3
Transaction: ZTEST_SHUKS3
Using transaction ZTEST_SHUKS3 we will delete the table level lock and put row level lock so that
multiple users can maintain table at same time. Rows locked by one user will not be editable by other
user.
4. Now create a report ZREP_SHUKS3 and transaction code ZTEST_SHUKS3 to call this report. This
tcode will call table maintenance generator of table ZTEST_SHUKS3 .
5. Normally if a person opens table maintenance generator and tries to maintain the table, no one else
can maintain table at the same time. This is because of table level lock by default in SAP. Only one
user can maintain any table at a time. In report ZREP_SHUKS3 we will delete the table level lock and
put row level lock so that multiple users can maintain table at same time. Rows locked by one user
will not be editable by other user. Check the report and comments given below.
*&---------------------------------------------------------------------*
*& Report ZREP_SHUKS3
*&
*&---------------------------------------------------------------------
*& Author : Swetabh Shukla
*& Date : 05/22/2009
*& Description : To delete table level lock from table.
*&---------------------------------------------------------------------*
REPORT zrep_shuks3.
*We will search entry for table level lock for our table
LOOP AT lt_enq_read INTO lw_enq_read
WHERE gname EQ 'RSTABLE'
AND garg CS 'ZTEST_SHUKS3'.
MOVE-CORRESPONDING lw_enq_read TO lw_enq_del.
APPEND lw_enq_del TO lt_enq_del.
ENDLOOP.
*Delete table level lock entry for our table
CALL FUNCTION 'ENQUE_DELETE'
EXPORTING
check_upd_requests = 1
IMPORTING
subrc = lv_subrc
TABLES
enq = lt_enq_del.
6. Just one more change in table maintenance screen. Now open table maintenance function
group(ZTEST_SHUKS3) in SE80.We know for table maintenance SAP automatically creates code in
the function group. Now we will make some modification in that existing code to change the behavior.
Open the screen you created through table maintenance and add one module.
Open the screen 0001 and add one module in PBO of the screen as shown in figure below.
Check the code below to be added in the module m_change_locking.
7. Now we are ready for testing. Call the transaction once and make some entries in table. In below
screenshot I have entered some random values. Since we have not maintained any check tables etc,
so values may be invalid. That can be taken care in real scenario.
Save data.
Session 1
In first session we will call the transaction ZTEST_SHUKS3 and try to open some existing values for table
maintenance.
Now open a second session of the transaction and see. Now the same material and plant combination
can not be changed by any other user or session.
Session 2
View Cluster
A view cluster is the set of objects, such as views, reports or tables, which belong to one business
function. The data can be arranged either hierarchically or non-hierarchically in view cluster. A view-
cluster transaction edits the complex cross-table data in a view cluster. The transaction navigation box
shows the complex business object with its components or sub objects.
Example:
Let us create a View Cluster on Material Details. The view cluster would include three tables namely,
MARA, MARC and MARD. We need to create maintenance views for each of these tables.
To create maintenance view for the table MARA follow the procedure below. Go to transaction SE11.
Give a view name say ZMM_V_MARA and click on ‘Create’. Give a short description, enter the table
name as MARA and click on the tab View fields.
By default all the key fields would be added. We can add more fields by clicking on the button Table
fields.
Follow the same procedure as above. In the Tab View fields, give ‘S’ in the column ‘P’ for the fields
MANDT and MATNR as shown in the screen shot below:
This is because the fields MANDT and MATNR would be filled in the view for MARA and thus they act as
subsets and appear as header data when we create entries in view cluster.
Follow the same procedure as above. In the Tab View fields, give ‘S’ in the column ‘P’ for the fields
MANDT, MATNR and WERKS as shown in the screen shot below:
This is because the fields MANDT, MATNR and WERKS would be filled in the view for MARC and thus
they act as subsets and appear as header data when we create entries in view cluster.
Now, for each view we need to create a table maintenance generator, which has to be done as follows:
The table maintenance screen appears. Here give the details as in the screen shot below. This table
maintenance is for the view ZMM_V_ MARA.
Before creating a table maintenance generator, create a function group say ZFG_MATERIAL from the
transaction SE80. After the function group is successfully created, enter the function group name as
shown in the screen shot. Also select Maintenance type as ‘One Step’ and give the Maintenance Screen
no. as ‘1’ in the Overview screen and click on the button ‘Create’.
Similarly, create the Table maintenance Generators for the views ZMM_V_MARC and ZMM_V_MARD.
The screen shots for these views would be as follows:
The pre-requisites for creating the View Cluster are now ready. Go to transaction SE54 and select the
button ‘Edit View Cluster’. Enter the view cluster name as say ‘ZMM_VC_MATERIAL’ and click on
‘Create’.
An information message would pop up saying
Continue by pressing ‘Enter’. The following screen appears. Give a short description and click on ‘Object
Structure’ as shown in the screen shot below:
On Clicking the ‘Object Structure’ the following screen appears. Select the ‘New Entries’ button to enter
the maintenance views created to form a cluster.
The entries would be entered in a hierarchical manner. The short text is the description of the view. The
‘Predecess’ column specifies the predecessor of that view. So in this case, the predecessor of
ZMM_V_MARA is ZMM_V_MARA itself. The predecessor of ZMM_V_MARC is ZMM_V_MARA and the
predecessor of ZMM_V_MARD is ZMM_V_MARC. The ‘DEP’ column explains whether the entry is a
Header entry or a Dependent entry. It is ‘R’ for the view ZMM_V_MARA, because it is a header entry and
does not depend on any other view. Whereas, it is ‘S’ for ZMM_V_MARC and ZMM_V_MARD, because
ZMM_V_MARC is dependent on ZMM_V_MARA and ZMM_V_MARD is dependent on ZMM_V_MARC.
The column ‘POS’ specifies the sequence of the views. In the column ‘Start’ select the radio button
against the entry for ZMM_V_MARA as it comes first in the hierarchy.
After entering the above entries, press ‘Enter’. Three pop-ups for each view would appear as shown
below. Proceed further by clicking on ‘Enter’ key.
Now select each line and click on ‘Field-dependence’ button. A pop-up appears saying ‘Field
dependencies successfully generated’.
Generate the field dependence for the views ZMM_V_MARC and ZMM_V_MARD in the same way. Now,
save the entries and go back to ‘Header Entry’ folder. Activate the view cluster. A pop-up appears as
shown below. Click on ‘Yes’.
The view cluster is now created successfully.
Note:
1. The view cluster can be created on the tables whose data has to be stored in a hierarchical
manner.
2. One has to check whether proper foreign key relationships are maintained between the tables
appearing in the cluster. Sometimes while generating the Field-dependencies, errors may occur if
the foreign keys are not maintained properly.
From the initial screen of the transaction ‘SE54’ give the view cluster name and click on ‘Test’.
Since we have created the view cluster on standard tables MARA, MARC and MARD we observe that all
the existing entries would appear. The screen shot below shows all the existing entries of the table
MARA. In order to see the corresponding Plant details for the material, just select an entry and double
click on Plant details as shown below.
The plant details would appear. In the same way for the corresponding storage location details,
select an entry and double click on Storage details as shown below.
In the above screen shot the material selected in the Material details view would appear as a header
entry. The storage location details are as follows:
In the above screen shot the material selected in the Material details view and the plant selected in the
Plant details view would appear as header entry.
Creating Search Helps (Elementary and Secondary)
By Vikram Chellappa, Mouri Tech Solutions
Go To SE11 T-code.
Press enter.
Provide the Values
Then provide search help name, which is already define by the same fields.
2) Collective search helps combine several elementary search helps. Collective search help thus
can offer several alternative search paths.
4) A collective search help combines several elementary search helps. The user can thus choose
one of several alternative search paths with collective search help.
5) A collective search help comprises several elementary search helps. It combines all the search
paths that are meaningful for a field.
6) Both elementary search helps and other search helps can be included in a collective search
help. If other collective search helps are contained in collective search help, they are expanded to
the level of the elementary search helps when the input help is called.
There are two types of indexes: Primary index and secondary index. Primary index is
automatically created using the primary keys defined.
Secondary index could be created as per the user requirement. This article discusses about creating a
secondary index.
Go to transaction SE11.
For our demo purpose, we have considered the table ZAUTHOR.
To know if there are any secondary indexes available, click on Goto à Indexes
Fill in the details – Short description and the fields in the index.
Save and activate.
Now you can observe the index created above in the list now:
Maximum number of secondary indexes we can have are 9.
How to make SELECT statement to make use of any particular secondary index?
In the above example, 001 is the secondary index of the table SPFLI. It's a well-known fact that
the efficient way of retrieving data from the database tables is by using secondary indexes. Many
database vendors provide the optimizer hints for the same. From SAP® v4.5, optimizer hints can
be provided by the %_HINTS parameter. This is dependent on the database systems that support
optimizer hints. The point to be noted here is these optimizer hints are not standardized by the
SQL standards. Each database vendor is free to provide the optimizer hints.
Now to know which index to use for our table:
1. Go to SE11 and there specify the table name
2. Now from the menu, goto --> indexes
3. select the required index.
Now suppose that the identifier 001 represents a non-unique secondary index comprising of the
columns CITYFROM and CITYTO. The index name should be defined as:
<tablename>~<Index Identifier>
like SPFLI~001 in the above example.
The sequence of fields in the WHERE condition is of no relevance in using this optimizers
index. If you specify hints incorrectly, ABAP ignores them but doesn't return a syntax error or
TM
runtime error.
The code was written in R/3 4.6C.
Code
REPORT Suresh_test.
TABLES: spfli.
LOOP AT t_spfli.
WRITE :/ t_spfli.
ENDLOOP.