Skip to Content
author's profile photo Former Member
Former Member

SAP Inbound email related query (from Outlook to SAP)

Hi,

I am in a situation where I have to send email from MS Outlook to SAP with a PDF file as an attachment. The PDF file will be stripped into an XML file and processed further and a reply is sent to the user sending the email. The Outlook admins have set up the necessary config for the connectivity - I am able to send the PDF file from Outlook to SAP (everything has been configured using SICF, SCOT etc) for inbound processing. In SCOT - Settings->Inbound processing I have used a Class which implements interface IF_INBOUND_EXIT_BCS (as per one of the blogs by Jeff Gebo). I can see the trace file in SCOT ->Utilities->Trace->Internal trace. When I send the PDF file, I can see in the trace (I cannot debug as the SAPCONNECT user which gets called in the backgound triggers the user exit class). In the trace file I can see my class gets instantiated but the next step to read the PDF file fails. The code come the Jeff's blog which I use is as follows:

  • Set return code so that no other Inbound Exist class will be called

e_retcode = IF_INBOUND_EXIT_BCS=>gc_terminate.

try.

  • Get the email document that was sent.

data: document type ref to if_document_bcs.

document = io_sreq->get_document( ).

  • Get the sender's address to reply back

lv_sender = io_sreq->get_sender( ).

addr = lv_sender->address_string( ).

return_addr = addr.

  • Get the interactive form attachment.

data: pdf_table type BCSS_DBPC.

pdf_table = document->get_body_part_content( 2 ).

  • Convert the pdf table into an xstring.

data: pdf_xstring type xstring,

pdf_line type solix.

clear pdf_xstring.

loop at pdf_table-cont_hex into pdf_line.

concatenate pdf_xstring pdf_line-line into pdf_xstring in byte mode.

endloop.

  • Process the PDF form

data: formxml type string.

formxml = me->process_form( pdf = pdf_xstring ).

Here the contents of the pdf_table-cont_hex is blank (I used a table to populate the values). All I get in my Outlook inbox is a empty email with an empty subject from SAP (called by the instantiated class of the Interface)

The irony is that I setup the same procedure has been configured and setup in another totally different SAP system and everything works fine there - I did a comparision of both SAP systems and everything seems fine (config wise and user exit class wise) and everything is identical. I have no clue as to why it works in one system and not in the other system.

If anyone has any pointers wit will be greatly appreciated as I am on a tight deadline - I have checked OSS but with no help.

Thanks in advance,

Ryan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2007 at 03:18 AM

    You may be able to find more information by putting an infinite loop at the beginning of your user exit:

    x = ' '.

    while x = ' '.

    x = ' '.

    endwhile.

    and then go into debugging via SM50 and set the x variable to break out of the loop.

    This technique is useful debugging workflows and other code which you cannot get to directly by placing a break-point.

    Andrew

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.