Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8808

Re: to change variable defaulted values dynamically using field symbol

$
0
0

Hi Chaudhury, you can try this

 

DATA: var_a TYPE c,

       var_b TYPE i VALUE '102',

       go_ref     TYPE REF TO cx_root,

      gt_ztable TYPE TABLE OF ztable,

      g_text     TYPE string.

 

FIELD-SYMBOLS: <fs_ztable> TYPE ztable.

                            <fs>            TYPE any.

 

START-OF-SELECTION.

* Assuming your table is called ZTABLE

SELECT *

  INTO TABLE gt_ztable

    FROM ztable.

 

LOOP AT gt_ztable ASSIGNING <fs_ztable>.

   ASSIGN (<fs_ztable>-parameter) TO <fs>.

 

  IF sy-subrc = 0.

     TRY.

       <fs> = <fs_ztable>-value.

    CATCH cx_root INTO go_ref.

      g_text = go_ref->get_text( ).

      WRITE g_text.

    ENDTRY.

  ENDIF.

ENDLOOP.

 

I hope this help you

 

Regard

David Carballido


Viewing all articles
Browse latest Browse all 8808

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>