Creating Conditions in XML transformation for Bank Statements

I was having a problem in an XML bank statement where some of the banks were using a different tag for statement number (AZNUM) than others. The mapping of an XML bank statement into FEB* tables is normally done in the transformation FIEB_CAMT053_V2_TO_FEB. I could not find it explained in any of the threads how to work with this transformation. At the first glance you can see that there are conditions for some fields. I finally found out how to use a simple condition so I think someone might find this useful.

Consider this scenario:

Some of the banks are sending statement number in this field:

Other banks in this field:

Standard transformation provided by SAP is mapping the second case into FEBKO-AZNUM. Now I wanted to achieve that both fields can be used without any error in bank statement processing. The condition could look like as follows:

Tcode: STRANS

Now what it all means – if the tag ElctrncSeqNb is in the file the value in this tag will be populated. If it is not there, the value in the tag LglSeqNb will be populated instead. You also have to define ElctrncSeqNb as a variable.

It took me few hours to find out have a simple “when” condition works here so maybe it can save those hours to somebody else.