[ABAP] BAPI zum Lesen von Infos zur Bestellanforderung (BANF)

PARAMETERS: p_banfn TYPE eban-banfn.

START-OF-SELECTION.
  DATA: lv_bapimereqheader TYPE bapimereqheader.
  DATA: it_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH DEFAULT KEY.
  DATA: it_bapimereqitem TYPE STANDARD TABLE OF bapimereqitem WITH DEFAULT KEY.
  DATA: it_bapimereqaccount TYPE STANDARD TABLE OF bapimereqaccount WITH DEFAULT KEY.
  DATA: it_bapimerqaddrdelivery TYPE STANDARD TABLE OF bapimerqaddrdelivery WITH DEFAULT KEY.
  DATA: it_bapimereqitemtext TYPE STANDARD TABLE OF bapimereqitemtext WITH DEFAULT KEY.
  DATA: it_bapimereqheadtext TYPE STANDARD TABLE OF bapimereqheadtext WITH DEFAULT KEY.
  DATA: it_bapiparex TYPE STANDARD TABLE OF bapiparex WITH DEFAULT KEY.
  DATA: it_bapimedcm_allversions TYPE STANDARD TABLE OF bapimedcm_allversions WITH DEFAULT KEY.
  DATA: it_bapimereqcomponent TYPE STANDARD TABLE OF bapimereqcomponent WITH DEFAULT KEY.
  DATA: it_bapimereqserialno TYPE STANDARD TABLE OF bapimereqserialno WITH DEFAULT KEY.
  DATA: it_bapi_srv_outline TYPE STANDARD TABLE OF bapi_srv_outline WITH DEFAULT KEY.
  DATA: it_bapi_srv_service_line TYPE STANDARD TABLE OF bapi_srv_service_line WITH DEFAULT KEY.
  DATA: it_bapi_srv_limit_data TYPE STANDARD TABLE OF bapi_srv_limit_data WITH DEFAULT KEY.
  DATA: it_bapi_srv_contract_limits TYPE STANDARD TABLE OF bapi_srv_contract_limits WITH DEFAULT KEY.
  DATA: it_bapi_srv_acc_data TYPE STANDARD TABLE OF bapi_srv_acc_data WITH DEFAULT KEY.
  DATA: it_bapi_srv_longtexts TYPE STANDARD TABLE OF bapi_srv_longtexts WITH DEFAULT KEY.

  CALL FUNCTION 'BAPI_PR_GETDETAIL'
    EXPORTING
      number                = p_banfn
      account_assignment    = abap_true
      item_text             = abap_true
      header_text           = abap_true
      delivery_address      = abap_true
*     VERSION               = ' '
      sc_components         = abap_true
      serial_numbers        = abap_true
      services              = abap_true
    IMPORTING
      prheader              = lv_bapimereqheader
    TABLES
      return                = it_bapiret2
      pritem                = it_bapimereqitem
      praccount             = it_bapimereqaccount
      praddrdelivery        = it_bapimerqaddrdelivery
      pritemtext            = it_bapimereqitemtext
      prheadertext          = it_bapimereqheadtext
      extensionout          = it_bapiparex
      allversions           = it_bapimedcm_allversions
      prcomponents          = it_bapimereqcomponent
      serialnumbers         = it_bapimereqserialno
      serviceoutline        = it_bapi_srv_outline
      servicelines          = it_bapi_srv_service_line
      servicelimit          = it_bapi_srv_limit_data
      servicecontractlimits = it_bapi_srv_contract_limits
      serviceaccount        = it_bapi_srv_acc_data
      servicelongtexts      = it_bapi_srv_longtexts.

  cl_demo_output=>write_data( lv_bapimereqheader ).
  cl_demo_output=>write_data( it_bapiret2 ).
  cl_demo_output=>write_data( it_bapimereqitem ).
  cl_demo_output=>write_data( it_bapimereqaccount ).
  cl_demo_output=>write_data( it_bapimerqaddrdelivery ).
  cl_demo_output=>write_data( it_bapimereqitemtext ).
  cl_demo_output=>write_data( it_bapimereqheadtext ).
  cl_demo_output=>write_data( it_bapiparex ).
  cl_demo_output=>write_data( it_bapimedcm_allversions ).
  cl_demo_output=>write_data( it_bapimereqcomponent ).
  cl_demo_output=>write_data( it_bapimereqserialno ).
  cl_demo_output=>write_data( it_bapi_srv_outline ).
  cl_demo_output=>write_data( it_bapi_srv_service_line ).
  cl_demo_output=>write_data( it_bapi_srv_limit_data ).
  cl_demo_output=>write_data( it_bapi_srv_contract_limits ).
  cl_demo_output=>write_data( it_bapi_srv_acc_data ).
  cl_demo_output=>write_data( it_bapi_srv_longtexts ).

* HTML-Code vom Demo-Output holen
  DATA(lv_html) = cl_demo_output=>get( ).

* Daten im Inline-Browser im SAP-Fenster anzeigen
  cl_abap_browser=>show_html( EXPORTING
                                title        = 'BANF-Daten'
                                html_string  = lv_html
                                container    = cl_gui_container=>default_screen ).

* cl_gui_container=>default_screen erzwingen
  WRITE: space.