vielen dank für den tipp....
allerdings hab ich jetzt das problem, dass er mir die daten nicht einliest (bzw. nichts zurückgibt) weiß zufällig jemand woran das liegen könnte??? vielen Dank!!
Hier noch mal der code
&---------------------------------------------------------------------*
*& Report ZERP06_SELEKTIONSBILD *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZERP06_SELEKTIONSBILD.
tables: vbak, kuagv, kna1, vbkd, vbap, rv45a.
Data: ok_code type sy-ucomm.
start-of-selection.
selection-screen: begin of tabbed block mytab for 30 lines,
TAB (20) Auftrdat user-command push1 default screen
0100,
TAB (20) Matdat user-command push2 default screen 0200
,
TAB (20) Bestdat user-command push3 default screen
0300,
end of block mytab.
Initialization.
Auftrdat ='Auftragsdaten'.
Matdat ='Materialdaten'.
Bestdat ='Bestelldaten'.
mytab-prog = sy-repid.
mytab-dynnr = 0100.
At selection-screen.
case sy-ucomm.
when 'push1'.
call screen 0100.
mytab-activetab = 'Auftrdat'.
when 'push2'.
call screen 0200.
mytab-activetab = 'Matdat'.
when 'push3'.
call screen 0300.
mytab-activetab = 'Bestdat'.
endcase.
DATA: l_order_header_in TYPE bapisdhd1.
DATA: l_salesdoc TYPE BAPIVBELN-vbeln.
DAtA: l_return TYPE TABLE OF BAPIRET2.
DATA: l_ord_item_in TYPE TABLE OF BAPISDITM.
DATA: l_ord_item_in-material type bapisditm-material.
DATA: l_ord_item_in-itm_number type bapisditm-itm_number.
DATA: l_ord_item_in-TARGET_QTY type bapisditm-TARGET_QTY.
DATA: it_ord_partners type table of BAPIPARNR.
DATA: it_ord_partners-partn_numb type bapiparnr-partn_numb.
DATA: it_ord_partners-partn_role type bapiparnr-partn_role.
move vbak-auart to l_order_header_in-doc_type.
move vbak-vkorg to l_order_header_in-sales_org.
move vbak-vtweg to l_order_header_in-distr_chan.
move vbak-spart to l_order_header_in-division.
move KUAGV-KUNNR to it_ord_partners-partn_numb.
it_ord_partners-partn_role = 'AG'.
move VBKD-BSTKD to l_order_header_in-PURCH_DATE.
move VBAP-MATNR to l_ord_item_in-material.
move VBAP-POSNR to l_ord_item_in-ITM_NUMBER.
move RV45A-KWMENG to l_ord_item_in-TARGET_QTY.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
* SALESDOCUMENTIN =
ORDER_HEADER_IN = l_order_header_in
* ORDER_HEADER_INX =
* SENDER =
* BINARY_RELATIONSHIPTYPE =
* INT_NUMBER_ASSIGNMENT =
* BEHAVE_WHEN_ERROR =
* LOGIC_SWITCH =
* TESTRUN =
* CONVERT = ' '
IMPORTING
SALESDOCUMENT = l_salesdoc
TABLES
RETURN = l_return
ORDER_ITEMS_IN = l_ord_item_in
* ORDER_ITEMS_INX =
ORDER_PARTNERS = it_ord_partners
* ORDER_SCHEDULES_IN =
* ORDER_SCHEDULES_INX =
* ORDER_CONDITIONS_IN =
* ORDER_CONDITIONS_INX =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* ORDER_CCARD =
* ORDER_TEXT =
* ORDER_KEYS =
* EXTENSIONIN =
* PARTNERADDRESSES =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN = l_salesdoc
.
write: / 'Auftragsart: ', vbak-auart.
end-of-selection.