cancel
Showing results for 
Search instead for 
Did you mean: 

Inbound proxy with attachments.

matt
Active Contributor
0 Kudos

We've created an inbound proxy. The inbound message has an attachment. How do I get access to it, within the inbound proxy method?

I've got this from the various helps and blogs:

  DATA: lt_attach    TYPE prx_attach,
        l_name       TYPE string,
        l_xstring    TYPE xstring,
        l_string     TYPE string,
        l_type       TYPE string,

        l_attachment TYPE REF TO if_ai_attachment,

DATA: lr_controller TYPE REF TO if_wsprotocol_attachments.

* Get attachments
  lr_controller = cl_wsprotocol_attachments=>get_protocol( ).
  lt_attach = lr_controller->get_attachments( ).

  LOOP AT lt_attach INTO l_attachment.
...

But lt_attach is always empty.

Any ideas?

Thanks

matt

Edited by: Matt on Mar 23, 2009 4:15 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

r u sure that the message that come into ABAP inbound proxy has attachements?

matt
Active Contributor
0 Kudos

>

> r u sure that the message that come into ABAP inbound proxy has attachements?

Yes.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Matt,

Sorry to come in so late on this one, but I've got what appears to be a similar requirement. I want to receive a pdf attachment via mail into an inbound proxy (in ECC) and post the attachment to document management. Using your work and others, I now have access to the attachments in the proxy method, except that the table of attachments only ever has 1 'attachment' - not the pdf, but the text of the mail. In the monitor at ECC, I can see both the mail-text and the attachment that I'm after.

I guess my question is whether you used mail as the sender and if so, how did you arrange to pass the real attachment (and if not - the same question).

Thanks for any tips,

Guy

MichalKrawczyk
Active Contributor
0 Kudos

hi Matt,

I only used that in outbound but can you compare with my code:

?

Regards,

Michal Krawczyk

matt
Active Contributor
0 Kudos

>

> hi Matt,

>

> I only used that in outbound but can you compare with my code:

>

>

> ?

>

> Regards,

> Michal Krawczyk

I've already looked at that, thanks!

matt
Active Contributor
0 Kudos

OK, I got it. I needed the server context in order to get the attachments

New code:

  DATA: lr_attachments TYPE REF TO if_wsprotocol_attachments.

  DATA:  lr_server_context   TYPE REF TO if_ws_server_context.

  lr_server_context = cl_proxy_access=>get_server_context( ).
  lr_attachments ?=
       lr_server_context->get_protocol( if_wsprotocol=>attachments ).
  lt_attach = lr_attachments->get_attachments( ).

* instantiate Attachment
  LOOP AT lt_attach INTO l_attachment.

The final clue came from [here|http://help.sap.com/saphelp_nw70/helpdata/en/51/d5cd16235e4643ae8ec92395c4ad97/frameset.htm]

Thanks for you help though

matt.