Добрый день.
Нужно создать пакетник по созданию заказа на услуги с nn-ым количеством позиций. У всех позиций разные контировки. Начитавшись в инете разной инфы, получилось создать заказ на услуги c одной позицией с помощью BAPI BAPI_PO_CREATE1 с типом позиции D и с контировкой куда копируется счёт, мвз и заказ. Пытаюсь создать с двумя позициями, программа создаёт вторую позицию, но контировку тянет из первой позиции. Кто - нибудь что то похожее делал? Ни как не могу понять в чём именно проблема? Вот код присвоения начиная с создания позиции.
*********************Первая позиция********************************
wa_item-po_item = '00010'.
wa_item-short_text = 'Alarm System Installation'.
wa_item-plant = '8000'.
wa_item-matl_group = '86'.
wa_item-quantity = '2'.
wa_item-net_price = '0'.
wa_item-price_unit = '0'.
wa_item-item_cat = '9'.
wa_item-acctasscat = '6'.
wa_item-gr_ind = 'X'.
wa_item-gr_non_val = 'X'.
wa_item-preq_no = '0020114422'.
wa_item-preq_item = '00010'.
wa_item-pckg_no = '0000000001'.
APPEND wa_item TO item.
CLEAR wa_item.
wa_itemx-po_item = '00010'.
wa_itemx-po_itemx = 'X'.
wa_itemx-short_text = 'X'.
wa_itemx-plant = 'X'.
wa_itemx-matl_group = 'X'.
wa_itemx-quantity = 'X'.
wa_itemx-net_price = 'X'.
wa_itemx-price_unit = 0.
wa_itemx-item_cat = 'X'.
wa_itemx-acctasscat = 'X'.
wa_itemx-gr_ind = 'X'.
wa_itemx-gr_non_val = 'X'.
wa_itemx-preq_no = 'X'.
wa_itemx-preq_item = 'X'.
wa_itemx-pckg_no = 'X'.
APPEND wa_itemx TO itemx.
CLEAR wa_itemx.
***********************Конец первой позиции****************************
***********************Вторая позиция**********************************
wa_item-po_item = '00020'.
wa_item-short_text = 'Alarm System Installation2'.
wa_item-plant = '8000'.
wa_item-matl_group = '86'.
wa_item-quantity = '2'.
wa_item-net_price = '0'.
wa_item-price_unit = '0'.
wa_item-item_cat = '9'.
wa_item-acctasscat = '6'.
wa_item-gr_ind = 'X'.
wa_item-gr_non_val = 'X'.
wa_item-preq_no = '0020114423'.
wa_item-preq_item = '00010'.
wa_item-pckg_no = '0000000001'.
append wa_item to item.
clear wa_item.
wa_itemx-po_item = '00020'.
wa_itemx-po_itemx = 'X'.
wa_itemx-short_text = 'X'.
wa_itemx-plant = 'X'.
wa_itemx-matl_group = 'X'.
wa_itemx-quantity = 'X'.
wa_itemx-net_price = 'X'.
wa_itemx-price_unit = 0.
wa_itemx-item_cat = 'X'.
wa_itemx-acctasscat = 'X'.
wa_itemx-gr_ind = 'X'.
wa_itemx-gr_non_val = 'X'.
wa_itemx-preq_no = 'X'.
wa_itemx-preq_item = 'X'.
wa_itemx-pckg_no = 'X'.
append wa_itemx to itemx.
clear wa_itemx.
********************Конец второй позиции**************************
********************Начало первой позиции*************************
wa_acct-po_item = '00010'.
wa_acct-serial_no = '01'.
wa_acct-quantity = '1'.
wa_acct-distr_perc = '0'.
wa_acct-net_value = '2000'.
wa_acct-gl_account = '8019.4885'.
wa_acct-co_area = '2000'.
wa_acct-costcenter = '80-102'.
wa_acct-orderid = '009010055021'.
wa_acct-activity = '0010'.
APPEND wa_acct TO acct.
CLEAR wa_acct.
wa_acctx-po_item = '00010'.
wa_acctx-serial_no = '01'.
wa_acctx-gl_account = 'X'.
wa_acctx-co_area = 'X'.
wa_acctx-costcenter = 'X'.
wa_acctx-orderid = 'X'.
wa_acctx-activity = 'X'.
APPEND wa_acctx TO acctx.
CLEAR wa_acctx.
********************Конец первой позиции**************************
********************Начало второй позиции*************************
wa_acct-po_item = '00020'.
wa_acct-serial_no = '02'.
wa_acct-quantity = '1'.
wa_acct-distr_perc = '0'.
wa_acct-net_value = '2000'.
wa_acct-gl_account = '8019.4885'.
wa_acct-co_area = '2000'.
wa_acct-costcenter = '80-101'.
wa_acct-orderid = '009010055042'.
wa_acct-activity = '0020'.
append wa_acct to acct.
clear wa_acct.
wa_acctx-po_item = '00020'.
wa_acctx-serial_no = '02'.
wa_acctx-gl_account = 'X'.
wa_acctx-co_area = 'X'.
wa_acctx-costcenter = 'X'.
wa_acctx-orderid = 'X'.
wa_acctx-activity = 'X'.
append wa_acctx to acctx.
clear wa_acctx.
*******************Конец второй позиции****************************
*******************Начало первой позиции***************************
wa_esllc-pckg_no = '0000000001'.
wa_esllc-line_no = '0000000001'.
wa_esllc-EXT_LINE = '0'.
wa_esllc-outl_level = '0'.
wa_esllc-outl_ind = 'X'.
wa_esllc-subpckg_no = wa_esllc-pckg_no + 1. "Child Package No
wa_esllc-price_unit = '0'.
wa_esllc-from_line = '1'.
wa_esllc-short_text = 'Alarm System Installation'.
APPEND wa_esllc TO esllc.
CLEAR wa_esllc.
wa_esllc-pckg_no = '0000000002'.
wa_esllc-line_no = '0000000002'.
wa_esllc-ext_line = '0000000010'.
wa_esllc-outl_level = '0'.
wa_esllc-quantity = '2'.
wa_esllc-price_unit = '1'.
wa_esllc-base_uom = 'WK'.
wa_esllc-gr_price = '2000'.
wa_esllc-short_text = 'Alarm System Installation'.
wa_esllc-pln_pckg = '0000692650'.
wa_esllc-pln_line = '0000000002'.
wa_esllc-service = '000000000001000022'.
wa_esllc-matl_group = '86'.
APPEND wa_esllc TO esllc.
CLEAR wa_esllc.
wa_esklc-pckg_no = '0000000002'.
wa_esklc-line_no = '0000000002'.
wa_esklc-serno_line = '01'.
wa_esklc-percentage = '100'.
wa_esklc-serial_no = '01'.
APPEND wa_esklc TO esklc.
CLEAR wa_esklc.
***********************Конец первой позиции***********************************
***********************Начало второй позиции**********************************
wa_esllc-pckg_no = '0000000001'.
wa_esllc-line_no = '0000000001'.
wa_esllc-EXT_LINE = '0'.
wa_esllc-outl_level = '0'.
wa_esllc-outl_ind = 'X'.
wa_esllc-subpckg_no = wa_esllc-pckg_no + 1. "Child Package No
wa_esllc-price_unit = '0'.
wa_esllc-from_line = '1'.
wa_esllc-short_text = 'Alarm System Installation'.
append wa_esllc to esllc.
clear wa_esllc.
wa_esllc-pckg_no = '0000000002'.
wa_esllc-line_no = '0000000002'.
wa_esllc-ext_line = '0000000010'.
wa_esllc-outl_level = '0'.
wa_esllc-quantity = '2'.
wa_esllc-price_unit = '1'.
wa_esllc-base_uom = 'WK'.
wa_esllc-gr_price = '2000'.
wa_esllc-short_text = 'Alarm System Installation'.
wa_esllc-pln_pckg = '0000692658'.
wa_esllc-pln_line = '0000000002'.
wa_esllc-service = '000000000001000022'.
wa_esllc-matl_group = '86'.
append wa_esllc to esllc.
clear wa_esllc.
wa_esklc-pckg_no = '0000000002'.
wa_esklc-line_no = '0000000002'.
wa_esklc-serno_line = '01'.
wa_esklc-percentage = '100'.
wa_esklc-serial_no = '01'.
append wa_esklc to esklc.
clear wa_esklc.
***********************Конец второй позиции*******************************