Part 6 - Using Extension Fields in Migration Objects - SAP Blogs
Part 6 - Using Extension Fields in Migration Objects - SAP Blogs
Community
Product Information
In this blog I explain how to extend migration objects and provide data to the extension structure of BAPIs.
Scenario
Some BAPIs support extension for customer added elds by table parameters EXTENSIONIN and
EXTENSIONOUT in their interface.
In my example I will extend the migration object EQUIPMENT and provide ETM data (Equipment and Tools
Management) for the append structures J_3GEQUIA and J_3GEQUZA via EXTERNSIONIN to the function
module BAPI_EQUI_CREATE.
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 1/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
So, you have to provide the name of a structure in eld STRUCTURE and the data of all elds of the
structure in the elds VALUEPART1, hence the structure must only contain character-like elds:
If you want to read more on the extension concept, you could read
https://blogs.sap.com/2014/06/24/bapi-extension-for-customer-added- elds/.
Prerequisites
This blog is based on S/4HANA 1709 FPS2 and should be valid for higher versions as well.
The creation of additional source structures was introduced in LTMOM with S/4HANA 1610 FPS2,
hence, this approach does not work in older versions.
(For versions between 1610 FPS2 to 1709 FPS1 I can’t tell if it works or not.)
I performed the necessary steps for a le upload project and a staging project. The screenshots are taken
from the le-based project.
The BAPI itself does not process the data in the extension elds but a BADI implementation is required. In
case of BAPI BAPI_EQUI_CREATE the BADI BADI_EAM_ITOB_BAPI_CUST_FIELDS must be implemented
which is not part of this blog.
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 2/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
Remark
I prefer the technical view which displays the names of elds and structures instead of the descriptions.
The view can be switched in the menu Settings à Technical Names On/O .
The target structure EXTENSIONIN of the BAPI is a table; hence we must add a new source structure below
the source structure S_EQUI. The structure EXTENSIONOUT is not required for my example.
Switch to change mode, then right-click on S_EQUI, select Append Structure to Lower Level:
Enter name and description of the additional structure and con rm. I name the structure S_EXTENSIONIN
and use description “Extension Fields”:
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 3/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
Remark
Field EQUNR is necessary for the migration cockpit to link the entries in this structure to the
equipments in the upper level structure.
The other elds are entered as they are de ned in structure EXTENSIONIN of the function module.
Now we need to link the structure to the parent structure S_EQUI by foreign key relationship:
Enter EQUNR in the rst line and leave the second line initial:
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 4/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
In Structure Mapping we need to map our new structure S_EXTENSIONIN to the structure EXTENSIONIN by
drag and drop:
In Field Mapping we need to map the elds of the source structure to the corresponding elds in the target
structure by drag and drop:
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 5/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
The eld EQUNR is only needed for the link to the structure S_EQUI, so we do not map it to the target
structure.
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 6/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
Now you can jump to Migration Cockpit (transaction LTMC) and test your extension:
After you downloaded the new xml template you see a new sheet Extension Fields; the screenshots show
some sample data:
Here you ll the equipment number and the name of the extension structure and its values.
Debugging the migration object according to note 2630183 shows that the values are correctly passed to
the BAPI:
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 7/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
Alert Moderator
Assigned tags
How to migrate materials with user elds using the Migration Cockpit
By Alexey Danshin , Oct 21, 2019
Content of EXTENSIONIN structure:
Related Questions
How to add DMS Document in Inspection Method Migration Cockpit Object - SIF_INSP_METHOD
By Pratik Ghosh , Apr 30, 2019
The processing of the data in the BAPI is not described in this blog, as mentioned above; if you need
information please look at note 2146575 Customer elds in BAPIs: Technical object.
3 Comments
Michelle Crapo
I’m glad this blog has been written now. I could have used it a few months ago. But I’m sure others will be
happy to use this guide. As always I appreciate the pictures. It takes a bit more work to include them.
Like(1)
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 8/9
02.12.2020 Using extension fields in migration objects | SAP Blogs
Luis Urbina
Hello Udo.
Now, about using staging tables. Say I added extended elds copying the objects to z versions. Then all I
have to do is create the project using these objects with the staging tables option and the tables created will
have the extended elds? Or do I need to go throug other steps?
Luis.
Like(0)
Hello Luis,
There aren’t any additional steps, you only need to copy the enhanced object to the staging project and then
the staging tables are created accordingly.
Regards,
Udo
Like(1)
Find us on
Newsletter Support
https://blogs.sap.com/2018/11/05/using-extension-fields-in-migration-objects/ 9/9