Code: Alles auswählen.
LS_QUOTATION_HEADER_IN-DOC_TYPE = 'YAG'.
LS_QUOTATION_HEADER_IN-SALES_ORG = 'ET01'.
LS_QUOTATION_HEADER_IN-DISTR_CHAN = 'GV'.
LS_QUOTATION_HEADER_IN-DIVISION = 'TD'.
LS_QUOTATION_HEADER_IN-SALES_OFF = 'VBZW'.
APPEND INITIAL LINE TO LT_QUOTATION_PARTNERS ASSIGNING <QUOTATION_PARTNERS_LINE>.
<QUOTATION_PARTNERS_LINE>-PARTN_ROLE = 'AG'.
* <QUOTATION_PARTNERS_LINE>-PARTN_NUMB = '1019'.
<QUOTATION_PARTNERS_LINE>-PARTN_NUMB = '882723'.
APPEND INITIAL LINE TO LT_QUOTATION_ITEMS_IN ASSIGNING <QUOTATION_ITEMS_IN_LINE>.
<QUOTATION_ITEMS_IN_LINE>-PO_ITM_NO = '5'.
<QUOTATION_ITEMS_IN_LINE>-MATERIAL = 'A36'.
<QUOTATION_ITEMS_IN_LINE>-PLANT = '0010'.
<QUOTATION_ITEMS_IN_LINE>-ITEM_CATEG = 'AGC'.
<QUOTATION_ITEMS_IN_LINE>-TARGET_QTY = '1'.
<QUOTATION_ITEMS_IN_LINE>-TARGET_QU = 'ST'.
CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2'
EXPORTING
* SALESDOCUMENTIN =
QUOTATION_HEADER_IN = LS_QUOTATION_HEADER_IN
* QUOTATION_HEADER_INX =
* SENDER =
* BINARY_RELATIONSHIPTYPE = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* BEHAVE_WHEN_ERROR = ' '
* LOGIC_SWITCH =
* TESTRUN =
* CONVERT = ' '
IMPORTING
SALESDOCUMENT = LV_RETURN_SD_NUMBER
TABLES
RETURN = LT_MEASSAGE
QUOTATION_ITEMS_IN = LT_QUOTATION_ITEMS_IN
* QUOTATION_ITEMS_INX =
QUOTATION_PARTNERS = LT_QUOTATION_PARTNERS
* QUOTATION_SCHEDULES_IN =
* QUOTATION_SCHEDULES_INX =
* QUOTATION_CONDITIONS_IN =
* QUOTATION_CONDITIONS_INX =
* QUOTATION_CFGS_REF = LT_QUOTATION_CFGS_REF
* QUOTATION_CFGS_INST = LT_ORDER_CFGS_INST
* QUOTATION_CFGS_PART_OF = LT_ORDER_CFGS_PART_OF
* QUOTATION_CFGS_VALUE = LT_ORDER_CFGS_VALUE
* QUOTATION_CFGS_BLOB =
* QUOTATION_CFGS_VK =
* QUOTATION_CFGS_REFINST =
* QUOTATION_KEYS =
* QUOTATION_TEXT =
* EXTENSIONIN =
* PARTNERADDRESSES =
.
IF SY-SUBRC EQ '0'.
SET UPDATE TASK LOCAL.
* COMMIT WORK AND WAIT.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'x'
IMPORTING
RETURN = LS_MASSAGE_COMMIT
.
SET UPDATE TASK LOCAL.
ENDIF.