2007 May 14 1:41 PM
Hallo,
I've a methode with a string paramter like: code]methode(i_param TYPE string)[/code].
In the calling methode the parameter value
l_valuefor i_param is stored in a variable from type c.
In java I would like call:
methode((string) l_value)(For all java guys: I know that casting between basic types and objects are not possible, but I belive string isn't an object in ABAP)
Is there any simular way in ABAP or is this me way:
DATA: l_value_string TYPE string.
MOVE l_value TO l_value_string.
methode( l_value_string ).Torsten
2007 May 14 2:00 PM
Hello Torsten
If you are already working on SAP release 6.20 or higher then you can use static method <b>CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C</b>.
Regards
Uwe
Hallo,
I've a methode with a string paramter like: code]methode(i_param TYPE string)[/code].
In the calling methode the parameter value
l_valuefor i_param is stored in a variable from type c.
In java I would like call:
methode((string) l_value)(For all java guys: I know that casting between basic types and objects are not possible, but I belive string isn't an object in ABAP)
Is there any simular way in ABAP or is this me way:
DATA: l_value_string TYPE string.
MOVE l_value TO l_value_string.
methode( l_value_string ).Torsten
2007 May 14 1:55 PM
Hi Torsten,
There is no other way as far as I know...Might be in release 7.10, but I have no info about it.
Casting exist also in ABAP, but only for objects:
DATA: dref1 TYPE REF TO i,
dref2 TYPE REF TO data.
CREATE DATA dref1.
dref2 = dref1.
CREATE DATA dref2 TYPE string.
TRY.
dref1 ?= dref2.
CATCH cx_sy_move_cast_error.
...
ENDTRY.
I agree, that it would be quite useful.
Best regards,
Peter
2007 May 14 2:00 PM
Hello Torsten
If you are already working on SAP release 6.20 or higher then you can use static method <b>CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C</b>.
Regards
Uwe
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |