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

Object's lifetime in a program

Hi all,

What is the Object's lifetime in a program? How long does an object exists in a program?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Sep 19, 2007 at 04:09 AM

    Lifetime of an object is limited only till the execution of the program.

    <b>Local objects</b> - Scope & lifetime limited within the subroutine.

    <b>Global Objects</b> - Scope limited within the program or across programs, if imported/exported. Lifetime is till program termination.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 04:19 AM

    uSE FREE MEMORY TO INITIALIZE THE OBJECT, OR CLEAR, REFRESH, DELETE.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 04:12 AM

    Is there any way avilable to initialize an object before the termination of a program?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2007 at 04:18 AM

    You can initialize object at any point in the program.

    Depending on the location of decalration... Say Subroutine, FM, Top Include, the scope & lifetime would be decided.

    But eventually the object wont be available after program termination.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2007 at 04:19 AM

    If you IMPORT or EXPORT the variable from the program, the lifetime of that object will be till SAP Session is terminated.

    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.