Start Routine / End Routine / Expert Routine - which one to use?
I have a flat file datasource which I need to add an additional column to as it doesnt contain certain data. This will be based on the file name. for example, if the file name contains USA and then column should contain USA.
The options I have is to
1. Amend the file in the process chain via ABAP to add the column
2. add a start routine to the transformation - i dont think this is an option as the column does not exist in source so cant do a start routine.
3. add a end routine to the transformation to update the value OR use a routine on the actual mapping in the transformation (if no source mapping included it still lets me add a routine. Which option would be best - would the end routine only be called once? if I did the routine in the actual transformation would it go an check the file name for each record which would be an unnecessary overhead?
I don't think that there would be any significant difference in performance between these two approaches.
But yes technical difference is there:
1) End Routine: all code is there at one place, but you will need to write few more lines of code as compared to other approach as you need to do additional looping in code in result package.
2) Start routine + Field Routine: Though code is at different places, fewer lines of code is required. You need not do additional looping manually, as Field routine executes record by record (which is loop only).
I would recommend Start-Routine + Field Routine due to one less Loop.