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

ABAP Objects - getting a value of 'h'!!?! - what's going on!!??!?!?

Howdy,

I've got an objects question and its driving me crazy.

Basically I have two methods in a class.

Method 1 passes values to method 2.

Method 2 does some calculations and then passes the values to method 1.

Well, that's how things are supposed to work. instead the exporting value in method 2 gets populated witha 'h', which is then not passed to method 1 ?

Anyone got any idea what is going on????

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 03:50 PM

    Sorry folks,

    I must be doing somethign darn silly:

    I've written the following code to call the method 2 when we are in method 1:

    <b>call method assign_object( imp_http = imp_http ).</b>

    method two has two attributes:

    imp_http - importing parameter.

    edurl - exporting parameter.

    What would I have to add to my statement to get edurl from method 2 (assign_object)???

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Steve,

      are we using same language? I'm using little bit different syntax:

        CALL METHOD assign_object->method_2
          EXPORTING
            imp_http = imp_http
          IMPORTING
            edurl    = l_var_edurl.
      

      Look's pretty much like function module calls. 'assign_object' would have been created in beforehand by CREATE OBJECT, inside same class you can use

        CALL METHOD me->method_2...
      

      Regards,

      Christian

  • author's profile photo Former Member
    Former Member
    Posted on Feb 15, 2005 at 04:22 PM

    You describe a two-step reccursive algorithm here, Steve.

    Are you sure you wrote properly the conditions from getting out of the infinite "loop" ? (when method 1 will finish calling the other method 2 and when method 2 will finish calling the method 1 ?)

    Impredictable results may originate in a stack overflow or something related to the memory allocation.

    Bye,

    Bogdan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 15, 2005 at 06:52 PM

    Hi Steve,

    your example sounds pretty forward (assuming you a <i>returning</i> from method 2 to 1).

    Do you use SE24 or SE38 for class definition / implementation (use SE24!)?

    Do you use pattern generator for 'call method'-statement (use pattern generator!)?

    I guess, your method call has somewhere misspelled parameters. When you define in SE24 method's parameter as input / output, nonsense shouldn't appear any longer.

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 04:19 PM

    Thanks.

    I was being so stupid - getting confused with constructors and stuff.

    Didn't realise that the same code that calls the method from my program could also be used within the method.

    Don't suppose you know what <b>me-></b> does do you?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 16, 2005 at 04:27 PM

    Hi,

    you can have static and instance methods. In case of static (valid independent of 'create object') methods, you just can call them.

    In case of instance methods, you have to use a link to an object. If you are calling methods from outside of this class, you refer to your variable which was used with create object. If you are inside this class (meaning one method) and like to call some additional (private) functions, then you can refer to 'ME' -> actual instance, which is defined by external call.

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 04:41 PM

    Thanks Guys,

    I used:

    <b>CALL METHOD ME->ASSIGN_OBJECT

    EXPORTING imp_http = imp_http

    IMPORTING edurl = edurl.</b>

    and its working fine.

    Thanking you kindly!

    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.