2015 Mar 02 9:15 AM
Hi,
I am using BAPI_ALM_NOTIF_DATA_MODIFY BAPI to modify service order information such as equipment ,serial,material,work center , but no modifications occurred on notification.
could you help me why this message?
1 E IM 407 No changes made
______________________________
DATA : IT_NOTIFHEADER TYPE TABLE OF BAPI2080_NOTHDRI WITH HEADER LINE ,
WA_NOTIFHEADER TYPE BAPI2080_NOTHDRI,
IT_NOTIFHEADER_X TYPE TABLE OF BAPI2080_NOTHDRI_X WITH HEADER LINE ,
WA_NOTIFHEADER_X TYPE BAPI2080_NOTHDRI_X,
it_cause TYPE STANDARD TABLE OF BAPI2080_NOTCAUSI,
wa_cause type BAPI2080_NOTCAUSI,
it_causex type STANDARD TABLE OF BAPI2080_NOTCAUSI_X,
wa_causex type BAPI2080_NOTCAUSI_X,
IT_notifitem TYPE STANDARD TABLE OF BAPI2080_NOTITEMI WITH HEADER LINE,
WA_notifitem like BAPI2080_NOTITEMI occurs 0 with header line,
IT_notifitemX TYPE STANDARD TABLE OF BAPI2080_NOTITEMI_X WITH HEADER LINE,
WA_notifitemX like BAPI2080_NOTITEMI_X occurs 0 with header line,
IT_notifitem_x like BAPI2080_NOTITEMI_X occurs 0 with header line,
IT_RETURN TYPE STANDARD TABLE OF BAPIRET2,
IT_RETURN2 TYPE STANDARD TABLE OF BAPIRET2.
DATA : NOT TYPE QMNUM VALUE 300002696.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = NOT
IMPORTING
OUTPUT = NOT.
DATA wa_methods TYPE bapi_alm_order_method.
DATA itab_methods TYPE TABLE OF bapi_alm_order_method.
wa_methods-refnumber = 1.
wa_methods-objecttype = 'HEADER'.
wa_methods-method = 'CHANGE'.
wa_methods-objectkey = '%110000300002696' . "notification
APPEND wa_methods TO itAB_methods.
WA_NOTIFHEADER-REFOBJECTTYPE ='QMEL'.
WA_NOTIFHEADER-REFOBJECTKEY = 'QM000300002696'.
WA_NOTIFHEADER-EQUIPMENT = '000000000010008442'.
WA_NOTIFHEADER-PM_WKCTR = '101'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '31a191232821wdic'.
APPEND WA_NOTIFHEADER TO IT_NOTIFHEADER.
WA_NOTIFHEADER_X-REFOBJECTTYPE ='X'.
WA_NOTIFHEADER_X-REFOBJECTKEY = 'X'.
WA_NOTIFHEADER_X-EQUIPMENT = 'X'.
WA_NOTIFHEADER_X-PM_WKCTR = 'X'.
WA_NOTIFHEADER_X-MATERIAL = 'X'.
WA_NOTIFHEADER_X-SERIALNO = 'X'.
APPEND WA_NOTIFHEADER_X TO IT_NOTIFHEADER_X.
CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
EXPORTING
NUMBER = NOT
NOTIFHEADER = IT_NOTIFHEADER
NOTIFHEADER_X = IT_NOTIFHEADER_X
RETURN = IT_RETURN
IMPORTING
NOTIFHEADER_EXPORT =
TABLES
NOTIFITEM = IT_notifitem
NOTIFITEM_X = IT_notifitemX
NOTIFCAUS = IT_cause
NOTIFCAUS_X = IT_causex
* NOTIFACTV =
* NOTIFACTV_X =
* NOTIFTASK =
* NOTIFTASK_X =
* NOTIFPARTNR =
* NOTIFPARTNR_X =
RETURN = IT_RETURN
.
BREAK-POINT.
CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
EXPORTING
number = NOT "ß----
SN No.
TABLES
return = IT_RETURN2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
commit work and wait.
2015 Mar 02 11:49 AM
The parameters NOTIFHEADER and NOTIFHEADER_X are structures, not tables!
You are passing the empty header lines to the function module.
2015 Mar 02 11:49 AM
The parameters NOTIFHEADER and NOTIFHEADER_X are structures, not tables!
You are passing the empty header lines to the function module.
2015 Mar 02 1:16 PM
HI Karsten
could you explain more as i couldnt understand you.
i found that
IT_NOTIFHEADER and IT_NOTIFHEADER_X have data not empty.
tahanks.
2015 Mar 02 1:33 PM
Internal tables with header lines is a concept that is obsolete for quite a while now. If you define a table WITH HEADER LINE as you did, you define an internal table and at the same time a single structure.
The table is addressed with IT_NOTIFHEADER[ ], and the header line just with IT_NOTIFHEADER.
So you made two mistakes in the coding above: First of all, you tried to pass internal tables for parameters NOTIFHEADER and NOTIFHEADER_X, but these parameters are structures. And you ommited the [ ] to address the tables, that is the reason why the syntax check did not give you an error message.
Here is what the coding should look like:
WA_NOTIFHEADER-REFOBJECTTYPE ='QMEL'.
WA_NOTIFHEADER-REFOBJECTKEY = 'QM000300002696'.
WA_NOTIFHEADER-EQUIPMENT = '000000000010008442'.
WA_NOTIFHEADER-PM_WKCTR = '101'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '31a191232821wdic'.
WA_NOTIFHEADER_X-REFOBJECTTYPE ='X'.
WA_NOTIFHEADER_X-REFOBJECTKEY = 'X'.
WA_NOTIFHEADER_X-EQUIPMENT = 'X'.
WA_NOTIFHEADER_X-PM_WKCTR = 'X'.
WA_NOTIFHEADER_X-MATERIAL = 'X'.
WA_NOTIFHEADER_X-SERIALNO = 'X'.
CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
EXPORTING
NUMBER = NOT
NOTIFHEADER = WA_NOTIFHEADER
NOTIFHEADER_X = WA_NOTIFHEADER_X
TABLES
RETURN = IT_RETURN
The tables IT_NOTIFHEADER and IT_NOTIFHEADER_X are not needed.
2015 Mar 02 2:24 PM
thanks so much .YES, it works with me
but give error with work center
E CR 082 System error: Work center with ID 101 was not found
although i use this function to remove leading zero
************************
WA_NOTIFHEADER-PM_WKCTR = WC.
BREAK-POINT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = WA_NOTIFHEADER-PM_WKCTR
IMPORTING
OUTPUT = WA_NOTIFHEADER-PM_WKCTR.
*********************
where WC is import paramter
WC TYPE LGWID.
2015 Mar 02 3:06 PM
Do not remove leading zeroes. The function module needs the data in the internal SAP format, not in the external format seen on the screen. So try '00000101' instead.
2015 Mar 02 3:44 PM
2015 Mar 02 4:00 PM
I think that is something you have to figure out by yourself. It's hard to analyse the problem without seeing the data.
The work center with ID 00000101 probably does not exist, as the message suggests. Check table CRID for a corresponding entry.
The field is the id of the work center, not the work center itself. You can determine the id of a work center and a plant with function module CR_WORKSTATION_CHECK.