PARAMETERS: p_vbeln TYPE vbeln.
START-OF-SELECTION.
* Welche Daten sollen gelesen werden?
DATA(lv_bapi_view) = VALUE order_view( header = abap_true
item = abap_true
sdschedule = abap_false
business = abap_false
partner = abap_false
address = abap_false
status_h = abap_false
status_i = abap_false
sdcond = abap_true
sdcond_add = abap_true
contract = abap_false
text = abap_false
flow = abap_false
billplan = abap_false
configure = abap_false
credcard = abap_false
incomp_log = abap_false
).
* Belegnummern (VBELN) die selektiert werden sollen
DATA: it_sales_documents TYPE STANDARD TABLE OF sales_key WITH DEFAULT KEY.
APPEND p_vbeln TO it_sales_documents.
* Ausgabetabellen
* VBAK (Kopf)
DATA: it_order_headers_out TYPE STANDARD TABLE OF bapisdhd WITH DEFAULT KEY.
* VBAP (Positionen)
DATA: it_order_items_out TYPE STANDARD TABLE OF bapisdit WITH DEFAULT KEY.
* KOMV (Konditionen)
DATA: it_order_conditions_out TYPE STANDARD TABLE OF bapisdcond WITH DEFAULT KEY.
* Kundenauftrag: Liste aller Auftragsdaten (analog VA03)
* Werte für I_MEMORY_READ:
* SPACE = zuerst Pufferzugriff, dann DB-Zugriff
* 'A' = nur Datenbankzugriff
* 'B' = nur Pufferzugriff
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
i_bapi_view = lv_bapi_view
i_memory_read = space
i_with_header_conditions = abap_true
TABLES
sales_documents = it_sales_documents
order_headers_out = it_order_headers_out
order_items_out = it_order_items_out
order_conditions_out = it_order_conditions_out.
* Datenausgabe
cl_demo_output=>write_data( it_order_headers_out ).
cl_demo_output=>write_data( it_order_items_out ).
cl_demo_output=>write_data( it_order_conditions_out ).
* 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.