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

Field symbols ?

I would like to pass the DREF variable as parameter to the class method. How should I define the parameter ?

Would the TYPING METHOD be 'DREF' and Associated type 'DATA'?

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Aug 03, 2006 at 11:22 PM

    Not sure what you are trying to do yet, but I think you want to do something like this.

    data: dref type ref to data.

    REgards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

    • For example, when creating a dynamic internal table.

      
      report  zrich_0002.
      
      field-symbols: <dyn_table> type standard table,
                     <dyn_wa>.
      
      data: new_table type ref to data.
      
      data: it_fldcat type lvc_t_fcat,
            wa_it_fldcat type lvc_s_fcat.
      data: index(2) type c.
      
      
      do 10 times.
        index = sy-index.
        clear wa_it_fldcat.
        concatenate 'Field' index into
                 wa_it_fldcat-fieldname .
        condense  wa_it_fldcat-fieldname no-gaps.
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 5.
        append wa_it_fldcat to it_fldcat .
      enddo.
      
      
      * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = it_fldcat
        importing
          ep_table        = new_table.
      
      assign new_table->* to <dyn_table>.
      
      check sy-subrc = 0.
      
      

      Regards,

      Rich Heilman