- 입력받은 테이블로 1차 구성
DATA(ls_struct) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( pv_tabname ) ).
DATA(lr_tabletype) = cl_abap_tabledescr=>create( p_line_type = ls_struct ).
DATA(lt_comp) = ls_struct->get_components( ).
- top 선언부
TYPES : BEGIN OF t_s_styl.
TYPES : xxxxindex TYPE sy-tabix,
xxxxmode TYPE c,
xxxxcell TYPE lvc_t_styl.
TYPES : END OF t_s_styl.
DATA : gs_styl TYPE t_s_styl.
- 연결
" GS_STYLE 구조를 동적 테이블에 추가
ls_struct = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_data( gs_styl ) ).
lt_comp = VALUE #( BASE lt_comp FOR ls_comx IN ls_struct->get_components( ) ( ls_comx ) ).
ls_struct = cl_abap_structdescr=>create( lt_comp ).
" 핸들링용 Work Area
CREATE DATA lo_ref TYPE HANDLE ls_struct.
ASSIGN lo_ref->* TO <fs_data>.
FREE lo_ref.
" 핸들링용 ITAB
CREATE DATA lo_ref LIKE STANDARD TABLE OF <fs_data>.
ASSIGN lo_ref->* TO <ft_data>.
FREE lo_ref.