Do.

ABAP 동적 구조생성 본문

SAP/ABAP

ABAP 동적 구조생성

성공보다는 가치를.. 2022. 7. 26. 15:58
728x90

※ DDIC 에 구조가 존재하는 경우 

DATA l_struc TYPE REF TO cl_abap_structdescr.
l_struc ?=  cl_abap_typedescr=>describe_by_name( 'SFLIGHT' ).
"-- Include포함
DATA(lt_comp) = l_struc->get_ddic_field_list( p_including_substructres = abap_true ).

 

※ Internal Table을 임의로 생성한 경우 필드값 가져오기 

SELECT carrid, connid, fldate
  INTO TABLE @DATA(lt_sflight)
  FROM sflight
  UP TO 3 ROWS.
  
  DATA:
    ls_struc LIKE LINE OF lt_sflight.

  DATA(l_struc) = CAST cl_abap_structdescr( cl_abap_structdescr=>describe_by_data( p_data = ls_struc ) ).
  DATA(lt_comp) = l_struc->get_components( ).​




 

728x90

'SAP > ABAP' 카테고리의 다른 글

ABAP CTE( Common Table Expressions)  (0) 2022.09.14
HTML 본문 메일 전송  (0) 2022.07.28
ABAP Debugging에 대한 설명  (0) 2022.07.22
SUBMIT Standard 프로그램 수정 안하고 호출  (0) 2022.07.20
ABAP 7.4 New Future PDF 버전  (0) 2022.07.18