Skip to Content

send email if fm executes more than one minute

Hi Experts,

we have z function module, have created rest api for the same. this rest api used by the non sap systems, it is working as expected.

now the requirement, if the FM is executing more than 30 seconds then we have to send fm output as email & after 31st-second need to return the flag to api saying that data is sending through email.

let me know your thoughts how can we handle this.

thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Oct 21, 2019 at 06:45 PM

    You can get the current time stamp in the first line of the FM using GET RUN TIME field. Below is the link for the same.

    https://wiki.scn.sap.com/wiki/display/Community/GET+RUN+TIME+FIELD

    After each statement you can get the RUN TIME field again and can do the subtraction. If the value is more than "30" sec, you can proceed for the sending email and exit the FM.

    Thanks,

    Gourab

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2019 at 07:14 AM

    Hi Gourab,

    my requirement, if the fm is executing more than 30 seconds then I have to interrupt the fm execution send some flag to api then after run the fm again send the output as email.

    Thanks,

    Vishwa

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2019 at 01:33 PM

    You can use the timer class - CL_GUI_TIMER to trigger the email after 30 secs, check the program SAP_TIMER_DEMO

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 02, 2019 at 06:17 AM

    Hi Nalluri,

    SAP_TIMER_DEMO which is more similar to WAIT statement. It does not suites my requirement.

    1. I am creating a fm with wsdl, inside fm calling one child fm

    2. if child fm executes more than 30 seconds then we have to stop child fm execution forcefully.

    3. send a message to wsdl saying that "output will send through email"

    4. send the fm output data through email.

    I hope requirement is clear now.

    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.