Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using ASSIGN COMPONENT

Former Member
0 Likes
339

Hi,

I am using <i>ASSIGN COMPONENT name OF STRUCTURE struc TO <fs></i> to move a value from a dynamic structure to a field. Ex:

<b>DATA: my_structuture TYPE REF TO data.

FIELD-SYMBOLS: <my_struct> TYPE ANY,

<input> TYPE ANY.

ASSIGN COMPONENT i_zmapparam-zinfield OF STRUCTURE

<my_struct> TO <input>.</b>

what I would like to know is how I can map the field <input> to a field and add it to a new dynamic table.

I would appreciate any suggestions - thank you.

Kind regards,

Michael Nielsen

Message was edited by:

Miroslav Holecy

1 REPLY 1
Read only

Former Member
0 Likes
301
try this..

lets say new_table is ur dynamic table , then

FIELD-SYMBOLS : <it_final> TYPE STANDARD TABLE,
                <wa_final> TYPE ANY,
                <w_field> TYPE ANY.

CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog           = it_fieldcatalog
    IMPORTING
      ep_table                  = new_table
    EXCEPTIONS
      generate_subpool_dir_full = 1
      OTHERS                    = 2.

ASSIGN new_table->* TO <it_final>.
*********CREATE WORK AREA****************************

CREATE DATA new_line LIKE LINE OF <it_final>.
  ASSIGN new_line->* TO <wa_final>.

<wa_final>-field1 = <input>.