Data type enhancements are generally used to add extra
fields (enhancing the structure) in existing or standard data types.
The cases where we may need to enhance the DATATYPES using
Datatype Enhancements are:
- Where we got standard Datatypes which we can’t
edit or modify. - In the existing datatype where we are not
supposed to change the structure of already created datatype as it might be
used in some other interface and changing the structure might cause
inconsistency in other existing scenarios.
- Note - Sometimes we get a requirement where
client want to use standard components created by SAP itself like E-Sourcing or
sometimes if want to use the standard ones for our purpose like SAP BASIS SWC. - Suppose the standard ones are not solving the
entire requirement and we need to enhance the existing structure by adding few
more fields. Now the first problem we face while enhancing the objects is that
the STANDARD ones are not editable or modifiable so you need to create a custom
SWCV to create your own datatype enhancements and then create the dependency of
standard SWCV and custom SWCV.
Let’s discuss it technically:
DATA TYPE
ENHANCEMENT WITHIN THE SAME SOFTWARE COMPONENT:-
There are ACTUALLY 2 cases for this:
CASE1:- WITHIN the
same namespace:-
- Sometimes we get a requirement from client where
we have to modify a data type for a particular scenario but the same data type
is being used in multiple scenarios, in this case we go for data type enhancements:-
Suppose we have to modify the data type DT_ASHU as shown
below:-
The requirement is to add an additional field PO NUM under
the address field as shown in the above screenshot, so here we will go for data
type enhancement:-
Click on data type enhancement under the Interface Objects
tab and create a data type enhancement as shown below:-
After the DT_ASHUN gets created add the extra field PONUM in
the data type enhancement. Save and activate the same as shown below:-
After the change gets activated that extra field added
(PONUM) will be visible in the message type as shown below:-
With this case you will not facing the issues in mapping as
each object (Datatype, Datatype Enhancment and Mapping) fall under same
namespace.
CASE2:- In the different
namespace:-
In this case we will be enhancing the data type in different
namespace but within the same software component. The steps are as follows:-
We will enhance a
datatype “DT_ASHU” present in the namespace http://Shubham
with a Data Type Enhancement DTE_ASHU
created into http://POCofPI
Now create a DATA TYPE ENHANCEMENT in http://POCofPI
Note-
In below screenshot, please check the highlighted text, there we need to play
with the namespaces. The first one is having the default information which will
automatically come when you create the Datatype Enhancements
If you follow the default way, you will definitely face
problem in mapping.
The enhanced field may look as a part of structure in the
tree view but in XML source view different namespaces shows the real issue.
In tree view it looks fine but check below screenshot, the
XML has problem.
The
trick to handle that is simple, GO to your created data type enhancement object
and remove the XML namespace and activate it
Check below screenshot, the problem is resolved the
structure seems fine to us now.
NOW we talk about SLD binding. We need to do SLD binding in
order to create dependency between SAP standard SWCV and custom SWCV. Below are
the details for the SLD binding.
SLD Binding:-
Sometimes there is a requirement from client in which we
have to modify a standard data type provided by SAP.
Ideally it is not possible as the edit button is disabled
and we cannot modify it.
Creating
Dependencies Between SWCV and EnSWCV in SLD
After this click on Software components as shown in the
above screenshot:-
After this click on Software components as shown in the
above screenshot:-
Now suppose we want to modify the data type in standard
software component named as “SAP Basis”, then in this case we will enhance it
after copying in into another software component named as XCITEC in this case.
Please find the same below:-
After selecting SAP_BASIS , click on “Define Prerequisite
Software Components” tab as shown in the above screenshot. After clicking we
see a screen as shown below:-
Doing this a dependency is created between XCITEC and
SAP_BASIS so now SAP_BASIS(software component in which data type we have to
enhance) will be visible under XCITEC .
Now to see the imported object log on to integration
repository as shown below:-
After
we login in integration repository, go to Tools and then click on Import
Software component versions as shown in the below screenshot:-
After clicking on Import Software component versions, we get
a screen as below:-
After this we select the software component XCITEC in the
import list in the above screenshot and once the import is successful we get
the message as below:-
After the import is successful, the objects to be
enhanced(in this case SAP_BASIS 7.0) will be visible under the software
component XCITEC as shown in the below screenshot:-
Thus in this way the objects gets imported.