HOLA AMIGOS,
CAMBIANDO VISTA DE CLASIFICACIÓN PARA MATERIAL USANDO BAPI
->CREAR CARACTERÍSTICA USANDO TCODE CT04
->CREAR CLASE USANDO TCODE CL01 .
-> EJECUTAR ESTE PROGRAMA PARA CAMBIAR LA VISTA DE CLASIFICACIÓN
PARÁMETROS: P_MATNR TYPE MARA-MATNR. "MATERIAL
DATA: OBJECTKEY TYPE BAPI1003_KEY-OBJECT,
OBJECTTABLE TYPE BAPI1003_KEY-OBJECTTABLE,
CLASSNUM TYPE BAPI1003_KEY-CLASSNUM,
CLASSTYPE TYPE BAPI1003_KEY-CLASSTYPE,
ALLOCVALUESNUMNEW TYPE TABLE OF BAPI1003_ALLOC_VALUES_NUM WITH HEADER LINE,
ALLOCVALUESCHARNEW TYPE TABLE OF BAPI1003_ALLOC_VALUES_CHAR WITH HEADER LINE,
ALLOCVALUESCURRNEW TYPE TABLE OF BAPI1003_ALLOC_VALUES_CURR WITH HEADER LINE,
RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE.
OBJECTKEY = P_MATNR.
OBJECTTABLE = 'MARA'.
CLASSNUM = 'MTS_CABLE_BIN1'. "CLASE (CREADA USANDO CL01)
CLASSTYPE = '023'. "TIPO DE CLASE (023 PARA LOTE)
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
OBJECTKEY = OBJECTKEY
OBJECTTABLE = OBJECTTABLE
CLASSNUM = CLASSNUM
CLASSTYPE = CLASSTYPE
-
STATUS = '1'
-
STANDARDCLASS =
-
CHANGENUMBER =
-
KEYDATE = SY-DATUM
-
NO_DEFAULT_VALUES = ' '
-
IMPORTING
-
CLASSIF_STATUS =
TABLES
ALLOCVALUESNUMNEW = ALLOCVALUESNUMNEW
ALLOCVALUESCHARNEW = ALLOCVALUESCHARNEW
ALLOCVALUESCURRNEW = ALLOCVALUESCURRNEW
RETURN = RETURN
.
LOOP AT RETURN.
WRITE: / RETURN-TYPE ,RETURN-MESSAGE.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
-
EXPORTING
-
WAIT =
-
IMPORTING
-
RETURN =
.