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

Insert a line in an generic hashed table

Hello experts,

i have an generic hashed table an wants to insert a new row but I dont know how to generate a structure to fill with my local data an how to insert this new row to the hashed table. Does anybody has an answer?

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 08, 2010 at 12:22 PM
    FORM do_stuff CHANGING xth_data TYPE HASHED TABLE.
    
      DATA: lp_data TYPE REF TO DATA.
    
      FIELD-SYMBOLS: <ls_data>  TYPE ANY,
                     <l_field1> TYPE ANY,
                     <l_field2> TYPE ANY.
    
      CREATE DATA lp_data LIKE LINE OF xth_data.
      ASSIGN lp_data->* TO <ls_data>.
    
      ASSIGN COMPONENT 1 OF STRUCTURE <ls_data> TO <l_field1>.
      ASSIGN COMPONENT 'FIELD_NAME' OF STRUCTURE <ls_data> TO <l_field2>.
    
      <l_field1> = 'Some value'.
      <l_field2> = 'Another value'.
    
      INSERT <ls_data> INTO TABLE xth_data.
    
    ENDFORM.
    Add a comment
    10|10000 characters needed characters exceeded

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.