SAP Bilgi Merkezi
Ana Sayfa  ABAP   FI   CO   MM   SD   PP   QM   HR   BW 
ABAP Destek
Sipariş Oluştur

Sistemde sipariş oluşturmak için BAPI_ALM_ORDER_MAINTAIN fonksiyonu çağırılabilir.

Örnek Program:

*&---------------------------------------------------------------------
*& Created Date : 11.3.2005                                            *
*& Created By   : Yavuz KOMUT                                          *
*&---------------------------------------------------------------------*
DATA: return LIKE bapiret2 OCCURS 1 WITH HEADER LINE, it_methods LIKE bapi_alm_order_method OCCURS 1 WITH HEADER LINE, it_header LIKE bapi_alm_order_headers_i OCCURS 1 WITH HEADER LINE, it_header_up LIKE bapi_alm_order_headers_up OCCURS 1 WITH HEADER LINE, it_operation LIKE bapi_alm_order_operation OCCURS 1 WITH HEADER LINE, et_numbers LIKE bapi_alm_numbers OCCURS 1 WITH HEADER LINE. CLEAR: it_methods. it_methods-refnumber = '000001' . it_methods-objecttype = '' . it_methods-method = 'SAVE' . it_methods-objectkey = i_aufnr . APPEND it_methods. CLEAR: it_methods. it_methods-refnumber = '000001' . it_methods-objecttype = 'HEADER' . it_methods-method = 'CHANGE' . it_methods-objectkey = i_aufnr . APPEND it_methods. CLEAR: it_methods. CLEAR: it_header. it_header-orderid = i_aufnr . it_header-systcond = 1 . it_header-finish_date = i_finish_date. it_header-basic_fin = i_basic_fin . APPEND it_header. CLEAR: it_header_up. it_header_up-orderid = i_aufnr . it_header_up-systcond = 'X' . it_header_up-finish_date = 'X' . it_header_up-basic_fin = 'X' . APPEND it_header_up. CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN' TABLES it_methods = it_methods it_header = it_header it_header_up = it_header_up return = return et_numbers = et_numbers. READ TABLE return WITH KEY type = 'E'. IF sy-subrc IS INITIAL. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. e_return[] = return[]. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. READ TABLE et_numbers INDEX 1. e_aufnr = et_numbers-aufnr_new. e_return[] = return[]. ENDIF.
ABAP Programlar
SAP Chain
SAP NetWeaver
ticket sistemimize katılın ve ücretsiz
10 adam gün kazanın >>
 Ana Sayfa  |  ABAP  |  FI  |  CO  |  MM  |  SD  |  PP  |  QM  |  HR  |  BW 
ykomut@gmail.com