cancel
Showing results for 
Search instead for 
Did you mean: 

xstring to PDF file which is to be posted to a webserver

ramu_g4
Participant
0 Kudos

Hi Experts,

We are working on SAP PI 7.30 dual stack , our requirement is to convert xstring which is triggered as proxy(xml) from SAP ECC and which needs to be posted to webservice as an PDF file[as attachment file]. Here I guess that I need to decode a particular field in xml file from proxy whose data will be passed as an xstring to PI & PI needs to decode the xstring data and PDF file should be generated with that data and should be posted as an PDF file to webserver. Please let me know the feasibility of requirement in SAP PI?

Rgds,

Ramu.

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Ramu,

Much better would be:

1. Create the pdf and drop it in an AL11 directory

2. Attach it in Abap Proxy

3. Send to PI

Regards,

Mark

ramu_g4
Participant
0 Kudos

Hi Mark,

Thanks for your time! you mean create PDF file in SAP ECC itself & then drop it AL11 and then send the file as attachment to PI as Proxy right?

(or) Can I use pass through scenario to drag and drop the file from AL11 and post it as SOAP message as attachment.

Thanks!

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Ramu,

Yes that is correct. If you attach the file from the proxy, there would be little manipulation left to do e.g convert abap proxy message to the webservice message. Just check read attachments and keep attachments.

A pass-through scenario would be possible if the message sent by the abap proxy matches the one expected by the webservice.

Regards,

Mark

manoj_khavatkopp
Active Contributor
0 Kudos

Mark,

I guess pass through wont be possible if PI is picking file from AL11 because the PDF has to be sent to web-service as an attachment .

So my guess would be instead of ECC placing file in the AL11 they can send the same file as an attachment to the proxy and in PI we can make it pass through.

Br,

Manoj

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Manoj,

Yes, the Abap proxy code has to attach it.

Regards,

Mark

ramu_g4
Participant
0 Kudos

Hi Mark,Manoj,

Thanks for your time, so it will be a Proxy to SOAP async interface in PI perspective right? or can I go with NFS to SOAP [NFS for picking up file from AL11] which would need to send PDF file as an attachment to webservice i.e., I mean to ask whether NFS to SOAP is possible here or not? Also pls guide on NFS to SOAP interface to handle attachments.

If NFS to SOAP is not possible then say Proxy to SOAP & also client confirmed that ECC & Proxy structures would be same so I believe I can build pass-through scenario here. Also pls guide me on channel configuration in case of Proxy to SOAP scenario to handle PDF attachments since I am bit new to PI.

Thanks,

Ramu.

manoj_khavatkopp
Active Contributor
0 Kudos

Ramu,

Proxy to SOAP Async :

You need to create sender and receiver service interface with the WSDL which is provided by third party webservice (or you can create a structure and share with third party the same).

Later ECC will generate proxy with the structure which you created and also they will attach the pdf file for the proxy  and send and in PI you dont need to create mapping , just make sure you have 'Keep Attachment' in your soap channel.

NFS to SOAP Async :

Pick the file from NFS then write a java code to make this incoming payload(i.e pdf file) as an attachment to the output soap payload.

In both the case ID part configuration remains same with respective of SOAP receiver channel.

Br,

Manoj

ramu_g4
Participant
0 Kudos

Hi Manoj,

Thanks for ur time! Coming to NFS to Proxy scenario, ABAP program would generate the file in AL11 & PI should pick up and transfer to the webservice as an attachment. So I would like to go for pass-through & do you mean java mapping is required for this interface? If so kindly help on java code?

Thanks,

Ramu G.

manoj_khavatkopp
Active Contributor
0 Kudos

Ramu,

You may use the code from this FTP to Proxy With Attachment | SCN thread with few minor changes with respective to your payload.

Br,

Manoj

ramu_g4
Participant
0 Kudos

Hi Manoj,

Thanks for your time!

Sorry it is NFS to SOAP scenario where the ECC will be sender & where the input file format would a PDF file which should be sent as an attachment to webservice. Do I need java mapping for File to SOAP scenario where the PDF would be an attachment to SOAP. Is it possible like this?

Thanks,

Ramu G.

manoj_khavatkopp
Active Contributor
0 Kudos

Ramu,

The code provided in link works with your scenarios too.

try this and let us know in case if any issues

Br,

Manoj