Skip to Content

Field-symbols with structure

Hello,

i try to use dynamic programming with oo and i have a problem to use a field of one structure containing a reference to a specific class.

I have :

FIELD-SYMBOLS <l_talv> TYPE STANDARD TABLE.

ASSIGN my_talv->* TO <l_talv>.

data s_struct type ref to data.

field-symbols: <l_salv> type any.

create data s_struct like line of <l_talv>.

assign s_struct->* to <l_salv>.

read table <l_talv> into <l_salv> index e_row_id-index.

if sy-subrc is initial.

if e_column_id-fieldname = 'POSID' or e_column_id-fieldname = 'AUFNR'.

<l_salv>-my_navi->select_navi( e_column_id-fieldname ).

endif.

endif.

I want to use the 'my_navi' column of the dynamic structure and i don't know how to do that. Is it possible ?

Thank's

Thierry

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 03, 2007 at 02:23 PM

    You need to assign this field to some other field symbol and than have to use that field symbol in processing.

    Like

    FIELD-SYMBOLS: <FS_FILD> TYPE ANY.  " <<
    
    if sy-subrc is initial.
    if e_column_id-fieldname = 'POSID' or e_column_id-fieldname = 'AUFNR'.
    ASSIGN  COMPONENT 'MY_NAVI' OF STRUCTURE <L_SALV> TO <FS_FILD>. " <<
    <FS_FILD>->SELECT_NAVI( E_COLUMN_ID-FIELDNAME ). " <<
    * <l_salv>-my_navi->select_navi( e_column_id-fieldname ).
    endif.
    endif.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

    • I find one solution to do what I want :

      DATA l_class TYPE REF TO ZCL_NAVI.

      ...

      if sy-subrc is initial.

      if e_column_id-fieldname = 'POSID' or e_column_id-fieldname = 'AUFNR'.

      ASSIGN COMPONENT 'MY_NAVI' OF STRUCTURE <l_salv> TO <l_field>.

      l_class = <l_field>.

      l_method = 'SELECT_NAVI'.

      CALL METHOD l_class->(l_method)

      EXPORTING

      I_FIELD = e_column_id-fieldname.

      endif.

      endif.

      Thank's for your help and best regards.

      Thierry

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.