cancel
Showing results for 
Search instead for 
Did you mean: 

Map File name in BPM to email response

Former Member
0 Kudos

I have a scenario I am working:

File FTP -> FTP -> RFC

The file is deleted off initial server and pulled into our landscape to Processing server, then processed into SAP via RFC. I wish for an email response to send on pass/fail of interface.

This is all done and executing as expected with pass/fail message in body of email, received in inbox - no problem.

However, one thing is missing....

When the file is first processed, the File name is deleted and renamed with a time and date stamp (not ideal, but I got this working) is added when the file is created on receiving server. I am using a BPM to do the file send mapping and email response.

I wish to map the initial file name to the new file name, and then process then add time/date stamp when placed into Archive folder. I would like the email to have the original name oif the file in the Subject line of the email, if possible....

Has anyone done something similar? Can you point me in the right direction?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can do this using Adapter specific identifiers in receiver CC. You can get the same filename as your source file.

Blog: /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Go thro this thread as well for more details:

Then in BPM, add one more send step for a file receiver CC and place the file in the archive directory with timestamp.

Regards,

P.Venkat.

Message was edited by:

Venkataramanan

Former Member
0 Kudos

That was very handy, and I now have the file name mapped across.

The last bit to do...

How do I get this file name into the subject line of my email response???

Former Member
0 Kudos

Hi,

You can get the file name in mapping.

<b>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

return ourSourceFileName;</b>

Can you try this...

Regards,

Jai Shankar

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

once you get the filename as shown in my blog:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

you can use the same method in the other direction

(you can set the subject in your mapping)

Mail header 'subject' field <b>THeaderSUBJECT</b>

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

So near...

I now get the email, with the file name, but only part of the the error message.

The success message is only one line, but errors are two lines....

I currently get "Error in document: BKPFF $ BEC040",

however there is a second line: "Account 8485 1000 is blocked for posting"

The response and the content are both 0:1 (in mail mapping), but it only ever populates one line...

Any thoughts??

Sorry, I am using bapi_acc_document_post....

Former Member
0 Kudos

A user defined function has sorted this out!

public void concatContext(String[] input,ResultList result,Container container){

String temp = "";

for (int i=0; i<input.length; i++) {
	temp += input<i> + "n";
}

result.addValue(temp);

}

Not pretty but it works!

Thanks for all your help!!!!