Skip to Content
0
Former Member
Nov 18, 2008 at 06:49 PM

Service order confirmation

22 Views

Hello

I am using the following code to confirm service order but when I run this code I always get the message

Order 4000000039 not found, check entry

When I use se37 it confirms the service order

I guess its problem with 'BAPI_TRANSACTION_COMMIT'

any ideas?

thx

Shai

method ZII_CONFIRM_SERVICE_ORDER_IB~CONFIRM_SERVICE_ORDER_IB.

  • Convert Input Parameters

DATA: TIMETICKETS TYPE TABLE OF BAPI_ALM_TIMECONFIRMATION.

DATA: DETAIL_RETURN TYPE TABLE OF BAPI_ALM_RETURN.

DATA: WA_TIMETICKETS TYPE BAPI_ALM_TIMECONFIRMATION.

DATA : WA_DETAIL_RETURN TYPE BAPI_ALM_RETURN.

DATA : WA_RESP TYPE ZCONFIRM_SERVICE_ORDER_RES_DT1.

WA_TIMETICKETS-ORDERID = INPUT-CONFIRM_SERVICE_ORDER_REQ_MT-ORDERID.

WA_TIMETICKETS-OPERATION = INPUT-CONFIRM_SERVICE_ORDER_REQ_MT-OPERATION.

APPEND WA_TIMETICKETS TO TIMETICKETS.

CALL FUNCTION 'BAPI_ALM_CONF_CREATE'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

  • TESTRUN =

  • IMPORTING

  • RETURN = RETURN

TABLES

TIMETICKETS = TIMETICKETS

DETAIL_RETURN = DETAIL_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

COMMIT WORK.

LOOP AT DETAIL_RETURN INTO WA_DETAIL_RETURN.

MOVE-CORRESPONDING WA_DETAIL_RETURN TO WA_RESP.

APPEND WA_RESP TO OUTPUT-CONFIRM_SERVICE_ORDER_RES_MT-ITEM.

ENDLOOP.

endmethod.