Skip to Content
0

CCAP_ECN_MAINTAIN use

May 04, 2017 at 09:11 AM

83

avatar image
Former Member

Hi.
I have a program that will automatically change or create material BOM using BAPI. But when you create or change there is no possibility to convey the description (AEOI-OITXT) in the room changes (AEOI-AENNR), it Changes Master. This description is very important and is used in other reports.
Batch input using transaction CC02 is not possible.
Looking for FM or BAPI and found CCAP_ECN_MAINTAIN.
Before you start cause CCAP_ECN_HEADER_READ to get the output of HEADER and submit it to the entrance CCAP_ECN_MAINTAIN, as well in the HEADER add two fields INDATE_RULE = OUTDATE_RULE and VALID_FROM = VALID_FROM.

CALL FUNCTION 'CCAP_ECN_HEADER_READ' 
EXPORTING
CHANGE_NO = '40000_240317'
IMPORTING CHANGE_HEADER = Z_AENR_API02

MOVE-CORRESPONDING Z_AENR_API02 TO Z_CHANGE_HEADER.
Z_CHANGE_HEADER-INDATE_RULE = Z_CHANGE_HEADER-VALID_FROM.
Z_CHANGE_HEADER-OUTDATE_RULE = Z_CHANGE_HEADER-VALID_FROM.

Also, the input is OBJECT-BOM, with the fields ACTIVE = X and OBJ_REQU = X.

DATA OBJETCT_BOM TYPE AENV_API01. 
OBJETCT_BOM-ACTIVE = 'X'.
OBJETCT_BOM-OBJ_REQU = 'X'.


After choosing data changes from the table AEOI, and to transfer to CCAP_ECN_MAINTAIN.

SELECT * FROM AEOI INTO CORRESPONDING FIELDS OF TABLE LT_AEOI 
WHERE AENNR EQ '40000_240317' AND AETYP EQ '02'.

IF SY-SUBRC IS INITIAL.
LOOP AT LT_AEOI ASSIGNING <AEOI>.
APPEND INITIAL LINE TO Z_OBJMGREC ASSIGNING <MGREC>.
<MGREC>-CHG_OBJTYP = 4.
<MGREC>-BOM_CAT = '1'.
<MGREC>-BOM_STD_OBJECT = '251654321040000000'.
<MGREC>-BOM_USAGE = '1'.
<MGREC>-DESCR_OBJ = 'Text 111'.
<MGREC>-PLANT = '1000'.
ENDLOOP.
ENDIF.

And actually cause CCAP_ECN_MAINTAIN.

CALL FUNCTION 'CCAP_ECN_MAINTAIN' 
EXPORTING
CHANGE_HEADER = Z_CHANGE_HEADER
OBJECT_BOM = OBJETCT_BOM
TABLES
OBJMGREC = Z_OBJMGREC

The result is an error:

" processing of Change Number XXXXX cancelled ".

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers