Skip to Content
0
Former Member
Dec 22, 2009 at 02:19 AM

FUNCTION 'BAPI_PRODORDCONF_CREATE_HDR' 101mvt and 261 mvt split tow matdoc

525 Views

Hi:

when use FUNCTION 'BAPI_PRODORDCONF_CREATE_HDR' to confirm a po,the 101mvt and 261 mvt components can't gather in one material document,system creat tow material docment,one include all 101 component,another include all 261 componet.

but when I use tcode co15 to confirm po,the 101 and 261mvt can gather in one material document.

Help me!

Thanks!

&----


*& Report ZTEST_L1

*&

&----


*&

*&

&----


REPORT ZTEST_L1.

DATA: PO LIKE BAPI_PP_HDRLEVEL OCCURS 0 WITH HEADER LINE,

RETURN LIKE BAPI_CORU_RETURN OCCURS 0 WITH HEADER LINE,

ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,

ZINDEX LIKE BAPI_LINK_CONF_GOODSMOV OCCURS 0 WITH HEADER LINE,

RETURN1 LIKE BAPIRET1.

PO-ORDERID = '000100471798'.

PO-FIN_CONF = ''.

PO-CONF_TEXT = '测试'.

po-YIELD = 10.

po-CONF_QUAN_UNIT = 'ST'.

PO-EXEC_START_DATE = SY-DATUM.

PO-EXEC_FIN_DATE = SY-DATUM.

PO-POSTG_DATE = SY-DATUM.

APPEND PO.

ITEM-MATERIAL = 'AAAAA'.

ITEM-PLANT = 'SY00'.

ITEM-STGE_LOC = 'SL01' .

ITEM-BATCH = '123456'.

ITEM-MOVE_TYPE = '101'.

ITEM-MVT_IND = 'F'.

ITEM-ENTRY_QNT = 1.

ITEM-ENTRY_UOM = 'ST' .

ITEM-LINE_ID = '1'.

ITEM-orderid = '000100471798'.

ITEM-ORDER_ITNO = '1'.

APPEND ITEM.

CLEAR ITEM.

ITEM-MATERIAL = 'BBBBBB'.

ITEM-PLANT = 'SY00'.

ITEM-STGE_LOC = 'SL01' .

ITEM-BATCH = '123456'.

ITEM-MOVE_TYPE = '101'.

ITEM-MVT_IND = 'F'.

ITEM-ENTRY_QNT = 1.

ITEM-ENTRY_UOM = 'ST' .

ITEM-LINE_ID = '2'.

ITEM-orderid = '000100471798'.

ITEM-ORDER_ITNO = '1'.

APPEND ITEM.

CLEAR ITEM.

ITEM-MATERIAL = 'CCCCCCC'.

ITEM-PLANT = 'SY00'.

ITEM-STGE_LOC = 'PL01' .

ITEM-BATCH = '0803130040'.

ITEM-MOVE_TYPE = '261'.

ITEM-ENTRY_QNT = 1.

ITEM-ENTRY_UOM = 'M' .

ITEM-LINE_ID = '3'.

ITEM-orderid = '000100471798'.

ITEM-ORDER_ITNO = '1'.

APPEND ITEM.

ITEM-MATERIAL = 'DDDDDDD'.

ITEM-PLANT = 'SY00'.

ITEM-STGE_LOC = 'PL01' .

ITEM-BATCH = '0803130040'.

ITEM-MOVE_TYPE = '261'.

ITEM-ENTRY_QNT = 2.

ITEM-ENTRY_UOM = 'M' .

ITEM-LINE_ID = '4'.

ITEM-orderid = '000100471798'.

ITEM-ORDER_ITNO = '1'.

APPEND ITEM.

ZINDEX-INDEX_CONFIRM = 1.

ZINDEX-INDEX_GOODSMOV = 1.

APPEND ZINDEX.

ZINDEX-INDEX_CONFIRM = 1.

ZINDEX-INDEX_GOODSMOV = 2.

APPEND ZINDEX.

ZINDEX-INDEX_CONFIRM = 1.

ZINDEX-INDEX_GOODSMOV = 3.

APPEND ZINDEX.

ZINDEX-INDEX_CONFIRM = 1.

ZINDEX-INDEX_GOODSMOV = 4.

APPEND ZINDEX.

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_HDR'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

*TESTRUN = 'X'

IMPORTING

RETURN = RETURN1

TABLES

athdrlevels = PO

GOODSMOVEMENTS = ITEM

LINK_CONF_GOODSMOV = ZINDEX

DETAIL_RETURN = RETURN

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

  • IMPORTING

  • RETURN =

.