人法地,地法天,天法道,道法自然
分类:
2010-10-07 23:05:46
*&---------------------------------------------------------------------*
*& Report ZDYG_0004
*&
*&---------------------------------------------------------------------*
*&物料分類特性維護
*&
*&---------------------------------------------------------------------*
REPORT ZDYG_0004.
DATA: GT_VALUES_NUM TYPE TABLE OF BAPI1003_ALLOC_VALUES_NUM,
GT_VALUES_CHAR TYPE TABLE OF BAPI1003_ALLOC_VALUES_CHAR,
GT_VALUES_CURR TYPE TABLE OF BAPI1003_ALLOC_VALUES_CURR,
GT_BAPIRET2 TYPE TABLE OF BAPIRET2,
LS_BAPIRET2 TYPE BAPIRET2.
DATA: GS_VALUES_NUM TYPE BAPI1003_ALLOC_VALUES_NUM,
GS_VALUES_CHAR TYPE BAPI1003_ALLOC_VALUES_CHAR,
GS_VALUES_CURR TYPE BAPI1003_ALLOC_VALUES_CHAR,
GC_FLAG_X(1) TYPE C VALUE 'X'.
START-OF-SELECTION.
GS_VALUES_CHAR-CHARACT = 'ZMAT_PRJ' .
GS_VALUES_CHAR-VALUE_CHAR = 'ZHUHAI'.
APPEND GS_VALUES_CHAR TO GT_VALUES_CHAR.
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
OBJECTKEY = '590-A0900100--0000' "Customer
OBJECTTABLE = 'MARA'
CLASSNUM = 'ZMAT' "Class Number
CLASSTYPE = '001' "Class Type
* STATUS = '1'
* STANDARDCLASS =
* CHANGENUMBER =
* KEYDATE = SY-DATUM
* NO_DEFAULT_VALUES = ' '
* IMPORTING
* CLASSIF_STATUS =
TABLES
ALLOCVALUESNUMNEW = GT_VALUES_NUM
ALLOCVALUESCHARNEW = GT_VALUES_CHAR
ALLOCVALUESCURRNEW = GT_VALUES_CURR
RETURN = GT_BAPIRET2 .
IF SY-SUBRC <> 0.
ENDIF.
* IF GT_BAPIRET2[] IS INITIAL .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = LS_BAPIRET2.
* ELSE.
* CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
* ENDIF.
* LOOP AT LS_BAPIRET2 .
WRITE:'消息類型',LS_BAPIRET2-TYPE .
LOOP AT GT_BAPIRET2 INTO LS_BAPIRET2.
WRITE:'消息類型',LS_BAPIRET2-TYPE ,LS_BAPIRET2-MESSAGE.
ENDLOOP.
* ENDLOOP.