on 07-21-2020 4:08 PM
Hi Experts,
I am looking for the exact BAPI which will create/update a characteristics in the Functional location like IL02. I am using BAPI - BAPI_OBJCL_CREATE and BAPI_OBJCL_CHANGE but both of them does not work properly. Using the CREATE BAPI it infact delete records from the table EAML_D_AUSP_LFE and the CHANGE BAPI delete the records from AUSP table.
If anyone has implemented the same requirement then kindly help me.
Appreciate a quick response.
Regards,
Nitin
Hello,
Y have this test code with functions modules.
It is for caracteristic on mara.
Perhaps it can help you.
Best regards
Thierry
REPORT zztr_set_classif.
DATA w_num TYPE bapi1003_key-object_guid.
DATA wl_object TYPE bapi1003_key-object.
DATA : w_table LIKE bapi1003_key-objecttable,
w_classt LIKE bapi1003_key-classtype.
DATA wt_ret TYPE bapiret2 OCCURS 0.
DATA wa_ret TYPE bapiret2.
w_table = 'MARA'.
w_classt = '001'.
wl_object = '000000000000355881'.
*Permet d'affecter l'article à la classification
CALL FUNCTION 'BAPI_OBJCL_GET_KEY_OF_OBJECT'
EXPORTING
objectname = wl_object
objecttable = w_table
classtype = w_classt
create_missing_key = 'X'
IMPORTING
clobjectkeyout = w_num
TABLES
return = wt_ret.
COMMIT WORK AND WAIT.
CALL FUNCTION 'BAPI_OBJCL_CREATE_KEY'
EXPORTING
clobjectkey_new = w_num
classnum_new = 'M'
status = '1'
standardclass = ' '
TABLES
return = wt_ret.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
READ TABLE wt_ret INTO wa_ret INDEX 1.
*Cette erreur signifie que la classe est deja affectée à l'article
IF wa_ret-type = 'E' AND wa_ret-number <> '731'.
MESSAGE i112(zm) WITH wl_object 'err' wa_ret-number wa_ret-message.
ENDIF.
***CREATION DE LA CARACTERISTIQUE D'UNE CLASSE SUR UN OBJET MARA
DATA wt_val_char TYPE TABLE OF bapi1003_alloc_values_char WITH HEADER LINE.
DATA wt_val_new TYPE TABLE OF bapi1003_alloc_values_num WITH HEADER LINE.
DATA wt_val_cur TYPE TABLE OF bapi1003_alloc_values_curr WITH HEADER LINE.
DATA w_alloclist LIKE bapi1003_alloc_list OCCURS 0.
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
EXPORTING
objectkey_imp = '000000000000355881'
objecttable_imp = w_table
classtype_imp = w_classt
read_valuations = 'M'
* KEYDATE = SY-DATUM
* LANGUAGE = SY-LANGU
TABLES
alloclist = w_alloclist
allocvalueschar = wt_val_char
allocvaluescurr = wt_val_cur
allocvaluesnum = wt_val_new
return = wt_ret.
DATA vl_value(1).
vl_value = '_'.
IF vl_value = '_'.
READ TABLE wt_val_char WITH KEY charact = 'CRITIC_TECH'.
IF sy-subrc = 0.
DELETE wt_val_char INDEX sy-tabix.
ENDIF.
else.
wt_val_char-charact = 'CRITIC_TECH'.
wt_val_char-value_char = vl_value.
wt_val_char-value_neutral = ''.
wt_val_char-charact_descr = ''.
APPEND wt_val_char.
ENDIF.
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = '000000000000355881'
objecttable = w_table
classnum = 'M'
classtype = w_classt
status = '1'
keydate = sy-datum
TABLES
allocvaluesnumnew = wt_val_new
allocvaluescharnew = wt_val_char
allocvaluescurrnew = wt_val_cur
return = wt_ret.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
READ TABLE wt_ret INTO wa_ret INDEX 1.
IF wa_ret-type = 'E' AND wa_ret-number <> '731'.
* MESSAGE i123(zm) WITH w_matnr.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Nitin,
You can try the function modules:
EAML_AUSP_LFE_DATA_READ (Read linear data for characteristic values)
EAML_AUSP_LFE_DATA_CHANGE (Change/create linear data for characteristic values)
More details at: 2086362 - Function modules for linear data for characteristics
Best Regard from Brazil.
Arai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For technical objects (functional locations, equipments, etc.) it's usually required to use first BAPI_OBJCL_GETDETAIL and edit the resulting table before calling BAPI_OBJCL_CHANGE as any characteristic not passed to BAPI will be erased.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi nitin.mishra1,
Could you please, inform what was the solution.
Best regards
Alexander.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.