07-18-2007 12:13 AM
Hi All,
how to get the value from a returning pararmeter when we call a method from the main program.
call method obj1->withdraw exporting amount = 100
regards
Siddhartha
07-18-2007 12:25 AM
07-18-2007 12:24 AM
Hi Siddhartha,
If that method has the return parameter then only you can get it.Check if this method has return parameters.
Regards,
Atish
07-18-2007 12:25 AM
07-18-2007 12:43 AM
Hi RIch,
NEW_BALANCE = obj1->deposit.
New balance is my returning parameter of the method, but at the same time i have to export some values too to that method.
its not working for me.
regards
Siddhartha
07-18-2007 1:06 AM
07-18-2007 10:25 AM
HI,
In addition to the code
new_balance = obj1->deposit( 'some value' ).
You can use the following syntax also.
CALL METHOD obj1->deposit
EXPORTING
iv_value = 'some value'
RECEIVING
iv_balance = new_balance.
Regards
Geogy
07-19-2007 1:13 AM
Hi Geogy,
thanks for the reply, but you know none of the things are working for me, i dont know why.
CALL METHOD obj1->deposit
EXPORTING
iv_value = 'some value'
RECEIVING
iv_balance (main program parameter) = new_balance(returning parameter).
when i am using this one, its saying the reverse is accepted, its throwing a syntax error.
e.g.
CALL METHOD obj1->deposit
EXPORTING
iv_value = 'some value'
RECEIVING
new_balance(returning parameter) = iv_balance (main program parameter).
and the output is coming as zero. as the program parameter value is Zero.
Please help.
Regards
Siddhartha
07-19-2007 2:19 AM
If the returning parameter is defined as NEW_BALANCE within the method, then the following should work fine. But you must be move some result to this parameter inside the method itself.
CALL METHOD obj1->deposit
EXPORTING
iv_value = 'some value'
RECEIVING
new_balance = iv_balance .
So for example, inside this method, you should be filling it.
method deposit.
new_balance = 100. "or whatever your logic is
endmethod.
Regards,
RIch Heilman
07-19-2007 8:31 PM
Hi RIch,
Thanks a lot for the help, actually i was missing on that part where some operation has to be carried out for the parameter which i am returning, now the problem is solved. Once again Thanks a lot.
regards
Siddhartha Sengupta
07-18-2007 6:30 PM
Hi,
You can use the other form also.
<data> = obj1->withdraw ( exporting amount = 100 ).
or.
call method obj1->withdraw
exporting amount = 100
receiving <parameter> = <data>.
Regards.
Marcelo Ramos