We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] BAPI For PM Order TECO

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from avikg on Dec 19 at 8:50 AM
Hi All,

Thanks for your reply, I found the issue and corrected it.

w_methods-refnumber = 1.
w_methods-objecttype = 'HEADER'.
w_methods-method = 'TECHNICALCOMPLETE '.
w_methods-objectkey = g_aufnr.
APPEND w_methods TO it_methods.
CLEAR w_methods.

w_methods-refnumber = 1.
w_methods-objecttype = ''.
w_methods-method = 'SAVE'.
APPEND w_methods TO it_methods.
CLEAR w_methods.

SELECT SINGLE aufnr
auart
werks
prctr
func_area FROM aufk INTO w_aufk WHERE
aufnr EQ g_aufnr.
IF sy-subrc = 0.
w_header-orderid = w_aufk-aufnr.
w_header-order_type = w_aufk-auart.
w_header-plant = w_aufk-werks.
w_header-profit_ctr = w_aufk-prctr.
w_header-func_area = w_aufk-func_area.
w_header-teco_ref_date = sy-datum.
w_header-teco_ref_time = sy-uzeit.
APPEND w_header TO it_header.
CLEAR w_header.
ENDIF.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
it_header = it_header
return = i_return
et_numbers = et_numbers.

Regards,

Avik

---------------Original Message---------------
From: Avik Ghosh
Sent: Thursday, December 19, 2013 1:41 AM
Subject: BAPI For PM Order TECO

I am using BAPI_ALM_ORDER_MAINTAIN to do TECO for plant maintenance order. However its ending with error. My code is below:

DATA: it_methods TYPE STANDARD TABLE OF bapi_alm_order_method,
w_methods TYPE bapi_alm_order_method,
et_numbers TYPE STANDARD TABLE OF bapi_alm_numbers.

w_methods-refnumber = 1.
w_methods-objecttype = 'HEADER'.
w_methods-method = 'TECHNICALCOMPLETE '.
w_methods-objectkey = g_aufnr. " '000007092118'.
APPEND w_methods to it_methods.

*IT_METHODS-REFNUMBER = 1.
w_methods-objecttype = ''.
w_methods-method = 'SAVE'.
APPEND w_methods to it_methods.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = it_methods
return = i_return
et_numbers = et_numbers.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.

Regards,
Avik

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2013 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
avikg  

achievement
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language