cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with offline form - IF_INBOUND_EXIT_BCS

former_member194198
Active Participant
0 Kudos

I am trying to set-up the email processing class. The SAP system seems configured correctly because I can send an email to it and it is received by my user in SAP. I can see the email in the Business workplace.

i have configured SCOT / SO50 to add in my class ZCL_EMAIL_RECEIVE which has the interface of IF_INBOUND_EXIT_BCS. The config entry in SO50 is "Internet Mail", email address, document type "ICS", class "ZCL_EMAIL_RECEIVE, Call ID 1.

I have coded the following simple methods in the class as per instructions on SDN.

In the create instance method, I create an instance if required.

METHOD if_inbound_exit_bcs~create_instance.

IF instance IS INITIAL.

CREATE OBJECT instance.

ENDIF.

ro_ref = instance.

ENDMETHOD.

In the PROCESS_INBOUND method i've put a simple check to see if it running - an update on a table

method IF_INBOUND_EXIT_BCS~PROCESS_INBOUND.

data : st_test type ze03.

select single * into st_test from ze03 where kunnr = 2.

if sy-subrc eq 0.

st_test-stras = sy-uzeit.

update ze03 from st_test.

else.

st_test-kunnr = 2.

st_test-stras = sy-uzeit.

insert ze03 from st_test.

endif.

e_retcode = if_inbound_exit_bcs=>gc_terminate.

endmethod.

I've tried it with or without a commit. The table never gets updated but the email gets received into SAP by my user. Any ideas why the class doesn't seem to be being run?

Cheers

Richard

Accepted Solutions (1)

Accepted Solutions (1)

NoJo
Active Participant
0 Kudos

hi, try with an asterix (*) instead of ICS in the SO50 and try again....commit is not necessary (causes failures, if you do one)

br

norbert

former_member194198
Active Participant
0 Kudos

I've tried replacing the ICS with a * and removing the Commit work but the code still doesn't seem to be being run.

Former Member
0 Kudos

Hi richard,

If you receive the mail in your workplace that means that the incoming mail process is not executed .

Check the e-mail adress you define .

Regards

former_member194198
Active Participant
0 Kudos

I've checked the email address and it is correct. I've pasted the email out of the config and have sent an email but the ABAP doesn't appear to be triggering.

Any other thoughts?

Former Member
0 Kudos

Does the service SMTP is activate on your host ( use transaction SICF for this )

Look at oss note 455140 here there is all step for configuring

Regards

former_member194198
Active Participant
0 Kudos

I believe i have the email correctly configured in SICF as I do receive the emails. The problem is that the class does not run. The trace log saysit does, but the code doesn't get executed - I have coded a short dump ( divide by zero ), a table update or a 50 second wait statement but nothing ever happens. The trace below was from an email that seems to have run the ZCL_TEST class via SO50. At that time, there was a 50 second wait statement in the code and nothing appeared in the system process list for the email user.

17.11.2008 13:57:29 if_smtp_extension~handle_request SAPconnect Inbound Processing Started

17.11.2008 13:57:29 if_smtp_extension~handle_request Message Successfully Analyzed According to SMTP/ESMTP

17.11.2008 13:57:29 if_smtp_extension~handle_request Messages ID:

17.11.2008 13:57:29 if_smtp_extension~handle_request Return Coverage for Status Messages: H

17.11.2008 13:57:29 if_smtp_extension~handle_request Length of E-Mail Data Received: 5632

17.11.2008 13:57:29 if_smtp_extension~handle_request Sender First 50 Characters: <richard.tucker at emailremoved.com>

17.11.2008 13:57:29 if_smtp_extension~handle_request Recipient of First 60 Chars Plus Status Request (SAPconnect -> BCS)

17.11.2008 13:57:29 if_smtp_extension~handle_request <vendormaint at emailremoved> (->N)

17.11.2008 13:57:29 if_smtp_extension~handle_request BCS Inbound Processing Will Now Be Called

17.11.2008 13:57:29 INBOUND_PROC_ENTRY INBOUND_PROC_ENTRY: Mime-Parser starten

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE MIME Parser Started

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Instance of Type CL_BCOM_MIME_MESSAGE_SMTP Generated

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: RECEIVED

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: RECEIVED

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: RECEIVED

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: RECEIVED

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-MIMEOLE

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: CONTENT-CLASS

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: MIME-VERSION

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: CONTENT-TYPE

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: SUBJECT

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Subject: test

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: DATE

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Date: Mon, 17 Nov 2008 14:06:51 -0000

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME UTC Time Stamp: 17.11.2008 14:06:51

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: MESSAGE-ID

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Message-ID: D6BF1597D4358F44B24855AAA11C38BA036C4D4D@UKCWRX003

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Message-ID: .uk.int.atosorigin.com

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-MS-HAS-ATTACH

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-MS-TNEF-CORRELATOR

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: THREAD-TOPIC

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: THREAD-INDEX

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: FROM

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME From: Header Addresses

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Structure: MIME_ADR

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: TO

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME To: Header Addresses

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Structure: MIME_ADR

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-ORIGINALARRIVALTIME

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-UKAO-MAILSCANNER-INFORMATION

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: X-MAILSCANNER-FROM

17.11.2008 13:57:29 CL.MIME_MESSAGE_SMTP->SET_MIME Header field name: RETURN-PATH

17.11.2008 13:57:29 INBOUND_PROC_ENTRY INBOUND_PROC_ENTRY: Mime-Parser succeeded

17.11.2008 13:57:29 INBOUND_PROC_ENTRY Message ID: D6BF1597D4358F44B24855AAA11C38BA036C4D4D@UKCWRX003

17.11.2008 13:57:29 INBOUND_PROC_ENTRY Message ID: .uk.int.atosorigin.com

17.11.2008 13:57:29 INBOUND_PROC_ENTRY SMTP Envelope RCPT TO: vendormaintat emailremoved

17.11.2008 13:57:29 INBOUND_PROC_ENTRY DSN Request: H

17.11.2008 13:57:29 INBOUND_PROC_ENTRY store_mime: success

17.11.2008 13:57:29 INBOUND_PROC_ENTRY SMTP Envelope MAIL FROM: <richard.tucker at emailremoved>

17.11.2008 13:57:29 INBOUND_PROC_ENTRY From: Richard.Tuckerat emailremoved

17.11.2008 13:57:29 INBOUND_PROC_ENTRY To: vendormaint at emailremoved

17.11.2008 13:57:29 INBOUND_PROC_ENTRY Disposition notification: Not requested

17.11.2008 13:57:29 INBOUND_PROC_ENTRY GET_CONTENT_AS_MIME: Successfull

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE MIME Parser Started

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Content Type Found: multipart/alternative

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Instance of Type CL_BCOM_MIME_MULTI_ALTERNATIVE Generated

17.11.2008 13:57:29 CL_DOCUMENT_BCS->BUILD_DOC_TREE Step: Tree building

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE MIME Parser Started

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Content Type Found: text/plain

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Instance of Type CL_BCOM_MIME_SINGLE_TEXT Generated

17.11.2008 13:57:29 CL_BCOM_MIME_SINGLEPART->SET_MIM CONTENT-TYPE:text/plain

17.11.2008 13:57:29 CL_BCOM_MIME_SINGLEPART->SET_MIM CONTENT-TRANSFER-ENCODING:quoted-printable

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE MIME Parser Started

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Content Type Found: text/html

17.11.2008 13:57:29 CL_BCOM_MIME->AS_REFERENCE Instance of Type CL_BCOM_MIME_SINGLE_TEXT Generated

17.11.2008 13:57:29 CL_BCOM_MIME_SINGLEPART->SET_MIM CONTENT-TYPE:text/html

17.11.2008 13:57:29 CL_BCOM_MIME_SINGLEPART->SET_MIM CONTENT-TRANSFER-ENCODING:quoted-printable

17.11.2008 13:57:29 CL_DOCUMENT_BCS->BUILD_DOC_TREE Step: Tree building

17.11.2008 13:57:29 CL_DOCUMENT_BCS->MAKE_TEXT_NODE Content type: Text plain

17.11.2008 13:57:29 CL_DOCUMENT_BCS->MAKE_TEXT_NODE Content information:

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES EXIT_PROCESSING: Exitprocessing was started

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES Exit-Call succeeded: ZCL_TEST

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES Recipients

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES vendormaint at emailremoved

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES Document types

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->EXIT_PROCES txt

17.11.2008 13:57:29 IBND_PROC_POST_DECR Internal delivery: DELIVER_TO_RECIPIENTS

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->DELIVER_TO_ RECIPIENT

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->DELIVER_TO_ Structure: BCSS_RETE

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->DELIVER_TO_ TRANSF SREQ: N

17.11.2008 13:57:29 CL_SEND_REQUEST_BCS->DELIVER_TO_ SUBMIT: TO ALL

17.11.2008 13:57:29 if_smtp_extension~handle_request BCS Inbound Processing Was Successful. Status Will Now Be Returned

17.11.2008 13:57:29 if_smtp_extensionhandle_request if_smtp_extensionhandle_request Will Now Be Exited

Former Member
0 Kudos

Hi,

In the log the class ZCL_TEST is launch by the exit . Now perhaps you got a problem inside

Try to add entry in the log also to see what happens.

here is the sample code for adding entries in the current log


************* Add those line at the begining of the process

data w_mes type string .

* Check if Trace for inbound process is activated. 
  CALL FUNCTION 'SX_TRACE_GET_STATE' 
    IMPORTING 
      trace_state_inb = bool_trace_inb 
      trace_state_glob = bool_trace_glob. 

  IF bool_trace_glob = abap_true OR 
     bool_trace_inb = abap_true. 
       trace_bcs = cl_trace_bcs=>get_trace( ). 
       IF trace_bcs IS INITIAL. 
           trace_bcs = cl_trace_bcs=>create_new_trace( 
            i_function = 'My log' 
            i_direction = cl_trace_bcs=>c_inbound ). 
       ENDIF. 
  ENDIF.

w_mes = 'Start processing of my local class' .
if not trace_bcs is initial.
   trace_bcs->success_string( string = w_mes ).
endif.

...........
...........

*********add thoses lines at the end.
w_mes = 'End processing of my local class'.
if not trace_bcs is initial.
   trace_bcs->success_string( string = w_mes ).
endif.

Hope this help you

Regards

former_member194198
Active Participant
0 Kudos

Thanks for your help.

The trace messages didn't actually fix the problem, but it did make me look at the code in the CREATE_INSTANCE method one more time. I found that the problem was to do with the instance creation. I had copied the class from another and had not changed the OO reference.

Once I changed

data: ref type ref to CL_APPOINTMENT.

to

data: ref type ref to zcl_test.

it works!.

The trace messages now appear.

Former Member
0 Kudos

Great if it's work now.

Regards

Answers (0)