Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Resend email after smtp error

devagreen
Explorer
0 Kudos
1,121

Hello,

when we got a communication error with our SMTP relay, a lot of EMail's will get on error (Transaction SOST, message number 816).
We are looking for a way to resend these EMail's (like F7 in SOST) via a job/report every couple of hours so that their status will be changed automatically to "waiting" and they will be send out when the send process will run again and the SMTP relay will be up again.

Thanks

Deva

1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor
0 Kudos
992

Hi

Ignore my previous comment

You can use the following FM to resend the error SOST records. Call the following FM in a program and schedule that program as job in SM37 at your defined interval.

DATA:
it_send_process	 TYPE STANDARD TABLE OF SOSC1,"TABLES PARAM
wa_send_process	 LIKE LINE OF it_send_process .

Select * from sost table where msgty = 'E 
and append records into it_send_process internal table

'
CALL FUNCTION 'SO_SEND_PROCESS_REQUEUE'
  TABLES
    send_process =               it_send_process
  EXCEPTIONS
    NO_ENTRY =                   1
    X_ERROR =                    2
    .  "  SO_SEND_PROCESS_REQUEUE

IF SY-SUBRC EQ 0.
  "All OK
ELSEIF SY-SUBRC EQ 1. "Exception
  "Add code for exception here
ELSEIF SY-SUBRC EQ 2. "Exception
  "Add code for exception here
ENDIF.
9 REPLIES 9

devagreen
Explorer
0 Kudos
992

SOST tcode

venkateswaran_k
Active Contributor
0 Kudos
992

Hi

Write the following statement in a Program and put it in a job that runs at your convenient frequency.

SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
This will send all the pending sost mails.Regards,Venkat

venkateswaran_k
Active Contributor
0 Kudos
993

Hi

Ignore my previous comment

You can use the following FM to resend the error SOST records. Call the following FM in a program and schedule that program as job in SM37 at your defined interval.

DATA:
it_send_process	 TYPE STANDARD TABLE OF SOSC1,"TABLES PARAM
wa_send_process	 LIKE LINE OF it_send_process .

Select * from sost table where msgty = 'E 
and append records into it_send_process internal table

'
CALL FUNCTION 'SO_SEND_PROCESS_REQUEUE'
  TABLES
    send_process =               it_send_process
  EXCEPTIONS
    NO_ENTRY =                   1
    X_ERROR =                    2
    .  "  SO_SEND_PROCESS_REQUEUE

IF SY-SUBRC EQ 0.
  "All OK
ELSEIF SY-SUBRC EQ 1. "Exception
  "Add code for exception here
ELSEIF SY-SUBRC EQ 2. "Exception
  "Add code for exception here
ENDIF.

0 Kudos
992

Hi Venkat,

Thanks for the quick response.

Tried fm SO_SEND_PROCESS_REQUEUE by passing one record from SOST table as attached screenshot.

After executing the fm, unable to find the record in SOST tcode (even with waiting, error status) and

data not getting updated with current date, time and status in SOST table.

Thanks

Deva

0 Kudos
992

FM screenshot

0 Kudos
992

devagreen By debug, compare with what is done by SOST when you resend.

raymond_giuseppi
Active Contributor
0 Kudos
992

Exercise for the weekend

  • Launch an Abap trace on the SOST transaction via ST12
  • Select some records on SOST and select repeat send
    (tip: you can disable the trace with /roff and re-enable it with /ron to select what you want to trace)
  • Analyze the trace
  • Build you own tool

venkateswaran_k
Active Contributor
0 Kudos
992

Hi

Are your emails not at all going in first attempt also ?

Need to check the items - in SCOT

1. Whether you have Node In Use - Check box is checked or not?

2. Any recipient address is filled in ?

3. Any sender group is filled in ?

Because the Error 816 and 826 are related to that only.

Please share your detail - Can you please share your SCOT configuration detail.

0 Kudos
992

devagreen Any Update - are you still facing the issue? Kindly update on my above points.