* Tabelle EDBAS
PARAMETERS: p_btype TYPE edbas-idoctyp DEFAULT 'ORDERS05'.
START-OF-SELECTION.
DATA: lv_pe_header TYPE edi_iapi10.
DATA: it_pt_segments TYPE STANDARD TABLE OF edi_iapi11 WITH DEFAULT KEY.
DATA: it_pt_fields TYPE STANDARD TABLE OF edi_iapi12 WITH DEFAULT KEY.
DATA: it_pt_fvalues TYPE STANDARD TABLE OF edi_iapi14 WITH DEFAULT KEY.
DATA: it_pt_messages TYPE STANDARD TABLE OF edi_iapi17 WITH DEFAULT KEY.
* IDoctyp mit Segmenten lesen (RFC-fähig)
CALL FUNCTION 'IDOCTYPE_READ_COMPLETE'
EXPORTING
pi_idoctyp = p_btype
IMPORTING
pe_header = lv_pe_header
TABLES
pt_segments = it_pt_segments
pt_fields = it_pt_fields
pt_fvalues = it_pt_fvalues
pt_messages = it_pt_messages
EXCEPTIONS
object_unknown = 1
segment_unknown = 2
relation_not_found = 3.
IF sy-subrc = 0.
cl_demo_output=>write_data( lv_pe_header ).
cl_demo_output=>write_data( it_pt_segments ).
cl_demo_output=>write_data( it_pt_fields ).
cl_demo_output=>write_data( it_pt_fvalues ).
cl_demo_output=>write_data( it_pt_messages ).
cl_demo_output=>display( ).
ENDIF.