You are not using a modern browser version. As a result, the website may not be displayed correctly. You can find more information here.

Creating a Field List in AMDP Routines from BW Transformations – Right in Eclipse


1      Introduction

Very often when programming AMDP routines in BW transformations it is necessary to create a complete list of the existing fields in the source/target.

Frequently Excel templates are used to enable some degree of automation in creating these field lists.

In this blog we will show you another way that works without Excel and can be used right in the Eclipse Editor. For this the “Find and Replace” functionality in combination with regular expressions is used.

2      Procedure

  1. In the AMDP routine, scroll up to the type definition of the desired structure. In the example it is the output table of the end routine.

Copy all the fields there along with the type definitions:

2. Insert the copied lines in the Select for the outTab and, as shown on the screen, mark all lines between SELECT and FROM:

3. Open the search with CTRL + F, enter both regular expressions for “Find” and “Replace with”, select both settings and then click on “Replace All”:
Find([^ ]*)( type).*
Replace with:“$1”,

4. Result:

Now all you have to do is remove the final comma and the field list is ready.

3      Explanation of the regular expression:

Explanation of the search:

([^ ]*)First group, consisting of everything that’s not an empty space.
Only this part should remain for the field list
( type).*Second group consisting of everything that comes after ” type”
This part is not needed in the field list

Explanation of the replace:

The character – ” -, which should go at the beginning
$1References the first group, i.e. whatever is not an empty space and comes before ” type”
“,The characters – “, -, which should go at the end

Nehmen Sie Kontakt zu uns auf!

    I hereby consent to my personal data being collected, processed, and used for the purpose of processing my inquiry. I may revoke my consent anytime without stating my reasons for doing so. More information can be found in our privacy statement.