* Bestellung
PARAMETERS: p_po TYPE bapimepoheader-po_number DEFAULT '0001234567'.
* Bestellung Kopfdaten
DATA: lv_bapimepoheader TYPE bapimepoheader.
* Returnparameter
DATA: it_return TYPE STANDARD TABLE OF bapiret2 WITH DEFAULT KEY.
* Bestellposition
DATA: it_poitem TYPE STANDARD TABLE OF bapimepoitem WITH DEFAULT KEY.
* Felder für Einteilungen der Bestellung
DATA: it_poschedule TYPE STANDARD TABLE OF bapimeposchedule WITH DEFAULT KEY.
* Kontierungsfelder der Bestellung
DATA: it_poaccount TYPE STANDARD TABLE OF bapimepoaccount WITH DEFAULT KEY.
* Kommunikationsstruktur Anlegen Leistungszeile
DATA: it_poservices TYPE STANDARD TABLE OF bapiesllc WITH DEFAULT KEY.
* Komm.struktur Anlege Kontierungsverteilung Leistungszeile
DATA: it_posrvaccessvalues TYPE STANDARD TABLE OF bapiesklc WITH DEFAULT KEY.
* Detailinformationen für eine Bestellung
CALL FUNCTION 'BAPI_PO_GETDETAIL1'
EXPORTING
purchaseorder = p_po
account_assignment = abap_true
item_text = abap_true
header_text = abap_true
services = abap_true
IMPORTING
poheader = lv_bapimepoheader
* POEXPIMPHEADER =
TABLES
return = it_return
poitem = it_poitem
poschedule = it_poschedule
poaccount = it_poaccount
poservices = it_poservices
posrvaccessvalues = it_posrvaccessvalues.
cl_demo_output=>write_data( it_return ).
cl_demo_output=>write_data( lv_bapimepoheader ).
cl_demo_output=>write_data( it_poitem ).
cl_demo_output=>write_data( it_poschedule ).
cl_demo_output=>write_data( it_poaccount ).
cl_demo_output=>write_data( it_poservices ).
cl_demo_output=>write_data( it_posrvaccessvalues ).
* HTML-Code holen
DATA(lv_html) = cl_demo_output=>get( ).
* Daten im Inline-Browser im SAP-Fenster anzeigen
cl_abap_browser=>show_html( EXPORTING
title = 'Daten zur Bestellung'
html_string = lv_html
container = cl_gui_container=>default_screen ).
* cl_gui_container=>default_screen erzwingen
WRITE: space.