cancel
Showing results for 
Search instead for 
Did you mean: 

Using attachment with RNIF

Former Member
0 Kudos

Hi,

I actually use B2B scenario based on RosettaNet/RNIF with SAP PI 7.0 SP12.

I need to use the attachment capability, but, according to discussion with SAP support there is no current documentation about how to perform this action.

Has anybody already do this setup ?

Is it like attachment with mail adapter ? Do I develop a custom adapter module to use this standard capability ?

Best Regards,

Laurent

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

The attachments in RNIF are mapped to an XI message attachment.

You can create this attachment in an adapter module or you can send or receive the attachment with an ABAP proxy.

What is the senders or receivers of the message in your scenario?

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

In my scenario sender are SAP ECC for the supply of IDOC Orders data, and Java Server Proxy for attached data, the receiver is partner EAI : Webmethods.

Regards,

Laurent

stefan_grube
Active Contributor
0 Kudos

So you send the data that way:

ECC -> Java proxy -> WebMethods?

I do not anything about RNIF attachments. I think you should create an RNIF message with attachment and send this to XI. Then you can see, how the XI message has to look like.

Regards

Stefan

Former Member
0 Kudos

No Stefan,

data are send by that way :

ECC |----


> Webmethods

+Java Proxy |

Data source | RNIF with attachment

From documentations that I read I suppose that I have to create XI message with 2 payload, and use PayloadSwapBean for the first payload.

And set the second payload as main message payload.

I don't know if this is possible.

Another alternative is to use custom MessageTransformBean to all requierd things.

Regards,

Laurent

stefan_grube
Active Contributor
0 Kudos

When you use Java Proxy as sender, then create the main payload as always and add the attachment with help of the messageSpecifier class:

http://help.sap.com/saphelp_nw04/helpdata/en/9a/945e3026760745a751a85499139c7c/frameset.htm

Regards

Stefan

Former Member
0 Kudos

Ok,

Thank's

Former Member
0 Kudos

Laurent - Were you successful?

We seem to have the same scenario. We need to send PO's and attachments to the B2B Hub. As we understand, it is the extraction from SAP (i.e. no problem from XI to the B2B Hub) that is the problem.

The PO will be sent using IDOC ORDERS5 but we have been advised that it would be a complex bespoke development (i.e. there is no standard solution) to send the attachments along with the PO.

Thanks in advance!

Former Member
0 Kudos

I currently use custom Java Module to manage the attachement.

These module provide theses features :

- XML SAX parsing of the RosettaNet PIP3A4 message for extracting identifier

- Read file

- Base64 encoding

- Attach the file to the PIP3A4 message as attachment.

I couldn't find faster solution (standard ?) to do that.

Regards,

Laurent

Former Member
0 Kudos

Hi Laurent,

Can you share the Java Module Code to manage the attachment? I currently have a solution need for an XML with attachment to be sent to TIBCO via an RNIF Adapter. The data will come from an IDOC extension and I need to send in one message ID both the XML and the attachment. Thanks.

Regards,

Madz

Former Member
0 Kudos

Hi Stefan,

Does this mean that an adapter module bean is necessary by default in order to create an attachment for an RNIF adapter? My scenario is SAP --> PI --> TIBCO. Tibco requires a PIDX (application/pdf format). Thanks.

Regards,

Madz

Former Member
0 Kudos

Where is the file you need to attach coming from? Is it coming from SAP back-end, etc or do you need to grab it from FTP?

Thanks

Asif

Former Member
0 Kudos

Hi Asif,

It's coming from SAP R/3 and not using any FTP. Thanks.

Regards,

Madz

Former Member
0 Kudos

In that case since R/3 is sending both the main payload and attachment together, create a UDF - Single Values , "Value" as String input Argument and use the code below.

AbstractTrace trace = container.getTrace();
if (!Value.equals("")) {
	try{
				GlobalContainer globalContainer = container.getGlobalContainer();
				OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
				Attachment attachments = outputAttachments.create("", "application/pdf",Value.getBytes()); 
				outputAttachments.setAttachment(attachments);
	} catch(Exception e) {
       trace.addWarning("Attachment failed: " + e);
	}	
}


return "";

This udf will take the input String and create it as attachment, use it while doing message mapping of the main payload. My PI version is 7.1 EHP1 and it worked during testing. Let me know if this solved your issue.

Thanks

Asif

Former Member
0 Kudos

Hi Asif,

Thanks for the help below. I will also try to propose this as part of the low-level design. I'm just thinking that the overall architecture makes it complicated. SAP will send IDOC with the fields to be converted to both XML and MIME attachment in PI. And these data should be both sent by PI to TIBCO. During the message mapping, will PI be able to convert this to the desired format?

The desired format is like the one below:

mime-version:1.0

content-id:"6acecec45db14b70bfad32298bc4134c"

x-rn-version:RosettaNet/V02.00

x-rn-response-type:async

content-type:multipart/related; type="multipart/related"; boundary="c95198da0eb5408ba23f0caee018a88b"

host: ...

content-length:35518

expect:100-continue

connection:Keep-Alive

--c95198da0eb5408ba23f0caee018a88b

-


=_Part_1418_1240817770.1288816246590

Content-Type: multipart/related;

boundary="----=_Part_1417_171409072.1288816246574";

type="application/xml"

-


=_Part_1417_171409072.1288816246574

Content-Type: application/xml

Content-Transfer-Encoding: binary

Content-Location: RN-Preamble

Content-ID: RN-Preamble.3d1534e0e78911dfbeda001b78be27c2

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Preamble SYSTEM "Preamble_MS_V02_00.dtd"><Preamble><standardName><GlobalAdministeringAuthorityCode>RosettaNet</GlobalAdministeringAuthorityCode></standardName><standardVersion><VersionIdentifier>V02.00</VersionIdentifier></standardVersion></Preamble>

-


=_Part_1417_171409072.1288816246574

Content-Type: application/xml

Content-Transfer-Encoding: binary

Content-Location: RN-Delivery-Header

Content-ID: RN-Delivery-Header.3d1534e1e78911df8070001b78be27c2

<XMLTag>insert XML here</XMLTag>

Thanks.

Regards,

Madz

Former Member
0 Kudos

PI will only do xml automatically. The main payload is in xml format and the RNIF adapter will take care of it. You can send any MIME type as an attachment as long as its acceptable to TIBCO and RNIF adapter. You will have to convert XML or text to other MIME types before attaching it. The above code accepts a string input and attach's it to the main payload. If you want to convert to pdf you have to do it in other udf then use the above udf to create attachment.You need to change "application/pdf" to your required MIME type in the above code.

In my scenario I was getting the IDOC as the main payload and a binary string in another proxy and BPM multi-mapping was used to put both of them together.

Below is the scenario

IDOC -> BPM -


main payload PIDX Invoice

PROXY- BPM -


attachment in base64 binary string

BPM -> (RNIF) Receiver

If you create attachment then

You should get another RNIF after

Content-ID: RN-Delivery-Header.3d1534e1e78911df8070001b78be27c2

&lt;XMLTag&gt;insert XML here&lt;/XMLTag&gt;

for attachment:

Content-Type: application/(Your MIME)

Content-Transfer-Encoding: binary

Content-ID: Attachment.xxxxxxxATsap.com

Thanks

Asif

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks, Asif for the help. Currently we are exploring the ABAP proxy solution with the customized module to send the attachment as well from SAP to PI.

Former Member
0 Kudos

Hi Madina,

I am facing the same issue ,I am also trying to get some ABAP Proxy solution.My senario is

Mainpayload willbe Invoic IDOC and attachements are also in SAP.

Is there any way i can send both main payload and attachments is XML message to XI?

Please help me if you have any answers for this type of senario.

Thanks,

Former Member
0 Kudos

Hi Venkata,

Sorry this answer came in 3 years late. 😉 I hope you were able to resolve your problem. The ABAP Consultant should be able to generate a spool of both the XML (proxy) message + the attachment.

Cheers.

Regards,

Madina