cancel
Showing results for 
Search instead for 
Did you mean: 

How to get service interface name dynamically in the file to mail scenario

0 Kudos

Hello Everyone,

Currently I am working on file to proxy scenario/mail scenario. Based on the condition in the receiver determination, I am triggering ABAP proxy or creating a xml file for file to mail scenario. My question is how to get the service interface name in the xml file dynamically, so that I can provide the service interface name in the mail content.

Please let me know if there is any workaround possible.

Waiting for your responses.


Accepted Solutions (1)

Accepted Solutions (1)

azharshaikh
Active Contributor
0 Kudos

Hi Vaibhav,

I believe you can write the XML file name with Service Interface (using Variable Substitution approach) and later read this File Name in 2nd step of your mapping to do the required.

Regards,

Azhar

0 Kudos

Hi Azhar,

Thanks for the quick response.

Currently I am using SFTP adapter, so in that case I suppose I can't use variable substitution.

My simple requirement is I need to send the interface name in the content part of the mail. There are around 15 interfaces, for all interfaces I am creating just 1 file to mail scenario,but the content of the file should change dynamically based on the interface triggered.
Suppose for interface A condition fails in receiver determination then a mail should be triggered with content containing interface name A.

Thanks in advance.

azharshaikh
Active Contributor
0 Kudos

Hi Vaibhav,

SFTP also supports Variable Substitution, pls chk the following:

You can read the FileName and pass it in the Mail Content in your 2nd step.

Suppose for interface A condition fails in receiver determination then a mail should be triggered with content containing interface name A

>>> Is the msg failing in this step?  I believe you can catch the error using Alert configuration


Regards,

Azhar

RaghuVamseedhar
Active Contributor
0 Kudos

Azhar,

Service interface can be accessed using below UDF code. Link.


public String getInterfaceName(Container container) throws StreamTransformationException {

        String senderInterface = container.getInputHeader().getSenderInterface();

        //String senderInterface = transformationInput.getInputHeader().getSenderInterface(); //Use this in Java Mapping

        return senderInterface;

    }

Answers (0)