[ABAP] Auslieferung und Splitfluss (Liefersplit) lesen

* Belegnummer Auslieferung
PARAMETERS: p_vbeln TYPE vbeln_vl DEFAULT '100000000'.

DATA: it_ledspd_flow_tree TYPE ledspd_flow_tree_t.
DATA: it_ledspd_flow TYPE ledspd_flow_t.
DATA: if_reference_delivery TYPE vbeln_vl.
DATA: if_root_delivery TYPE vbeln_vl.
DATA: if_items_belong_to TYPE ledspd_items_belong_to.
DATA: if_split_profile TYPE ledspd_pmode.

* Lesen des Splitflusses (in Baumdarstellung)
CALL FUNCTION 'LE_DSP_READ_FLOW'
  EXPORTING
    if_vbeln              = p_vbeln
*   IF_CHECK_GOODS_ISSUE  = ' '
  IMPORTING
    et_ledspd_flow_tree   = it_ledspd_flow_tree
    et_ledspd_flow        = it_ledspd_flow
    ef_reference_delivery = if_reference_delivery
    ef_root_delivery      = if_root_delivery
    ef_items_belong_to    = if_items_belong_to
    ef_split_profile      = if_split_profile
  EXCEPTIONS
    internal_error        = 1
    OTHERS                = 2.

IF sy-subrc = 0.
  cl_demo_output=>write_data( it_ledspd_flow_tree ).
  cl_demo_output=>write_data( it_ledspd_flow ).
  cl_demo_output=>write_data( if_reference_delivery ).
  cl_demo_output=>write_data( if_root_delivery ).
  cl_demo_output=>write_data( if_items_belong_to ).
  cl_demo_output=>write_data( if_split_profile ).
  cl_demo_output=>display( ).
ENDIF.