on 2019 Jul 26 2:56 PM
I want to change a local class to global class. So i need to create a field symbol in global, so please help me how can I achieve this.
Global field symbols are not possible in class pools. Only local field symbols are allowed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but this question hardly make any sense. Do you have a local class in a program and you want to convert it to a global class? Create a global class and simply copy-paste the code in source code view.
What does this have to do with field-symbols?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Convert local class in program to global class
create a field symbol
REPORT z_cl_test .
*---------------------------------------------------------------------*
* CLASS lcl_cl1 DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_cl1 DEFINITION.
PUBLIC SECTION.
DATA cref TYPE REF TO data.
METHODS : constructor IMPORTING i_type TYPE char20,
me1 IMPORTING value TYPE i.
ENDCLASS. "lcl_cl1 DEFINITION
*---------------------------------------------------------------------*
* CLASS lcl_cl1 IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_cl1 IMPLEMENTATION.
METHOD constructor.
CREATE DATA cref TYPE (i_type).
ENDMETHOD. "constructor
METHOD me1.
FIELD-SYMBOLS <fs> TYPE any.
ASSIGN cref->* TO <fs>.
WRITE: 'Value is ' ,value.
ASSIGN value TO <fs>.
WRITE: 'Field symbol is ', <fs>.
ENDMETHOD. "me1
ENDCLASS. "lcl_cl1 IMPLEMENTATION
START-OF-SELECTION.
DATA ref_class TYPE REF TO lcl_cl1.
CREATE OBJECT ref_class
EXPORTING
i_type = 'I'.
CALL METHOD ref_class->me1
EXPORTING
value = 3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.