Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal264
Active Participant


In this article we are explaining How to use Base_UserDefined transform step by step with an example of  Replacing Special characters from the

input field(Salary).

 

Base_UserDefined Transform

This transform provides an interface to do anything that you can write Python code to do. You can use the User-Defined transform to create new records and data sets, or populate a field with a specific value, just to name a few possibilities.

  1. Create Input File and place a Base_UserDefined transform of Data Services and link the transform with the file .


         

  1. Open Base_UserDefined  in the Input tab of the transform, drag and drop Input column of the input schema to the Input Schema Column Name so as to map with the Transform Input Field Name .




3.  Check the Options tab and Click on Edit Options Button to customize the transform.



  1. Check Per record , then select Python Expression Editor and Click on Launch Python Editor Button to open the Python Editor .


       (Option :- Per Record:- To deal all record independently ,Per collection:- Build a group of records on basis of  Break group conditions like Base_match transform in this example we will go with Per record option and in next Topic we will proceed with Per collection option )


         




  1. Python Editor:- a.) I/O Field :- Insert the Input/Output fields according to requirement by  Right clicking on particular option Input Fields / Output Fields then click on Insert give the field name and length of field .  b.) Python API :- Python functions GetField to get the input field value and SetField to set output field value.  c.) Editor :- Write your Python code  here .


(For more details about code refer any Python Book)



  1. On the Output tab select the fields of interest.



7.  Result :-

Please find the input and the output dataset generated as screenshots below:



In Part-2 I will explain used Python code in detail

24 Comments
Labels in this area