on 10-06-2017 4:03 PM
Hi everybody,
I want to update a MasterData Line (only attributes) via Function Module RSNDI_MD_ATTRIBUTES_UPDATE.
The InfoObject I want to update has time-dependent attributes in it.
My question is, is it enough to only update a line with the 0DateTO-attribute as it is in the Key of the P-Table. Or do I need to use the functionmodule with all time-dependent-attributes are in the Q-Table?
Example:
I only want to update attribut A1 of InfoObject I.
M-Table of InfoObject I:
P-Table of InfoObject I:
Q-Table of InfoObject I
Coding for the attributes and functionmodule call:
DATA:
lv_attributes TYPE rsd_s_iobjnm,
lv_chavl TYPE rsndi_s_chavl,
lt_chavl TYPE TABLE OF rsndi_s_chavl,
lt_attributes TYPE TABLE OF rsd_s_iobjnm,
lt_messages TYPE TABLE OF rsndi_s_message.
*Define updateable attributes
lv_attributes-iobjnm = '0DATETO'.
APPEND lv_attributes TO lt_attributes.
lv_attributes-iobjnm = 'A1'.
APPEND lv_attributes TO lt_attributes.
*Define masterdata-definition of updateable line
lv_chavl-record_no = 1.
lv_chavl-iobjnm = 'I1'.
lv_chavl-value = 'VALUE I1'.
APPEND lv_chavl TO lt_chavl.
lv_chavl-record_no = 1.
lv_chavl-iobjnm = 'I2'.
lv_chavl-value = 'VALUE I2'.
APPEND lv_chavl TO lt_chavl.
lv_chavl-record_no = 1.
lv_chavl-iobjnm = '0DATETO'.
lv_chavl-value = '99991231'.
APPEND lv_chavl TO lt_chavl.
lv_chavl-record_no = 1.
lv_chavl-iobjnm = 'A1'.
lv_chavl-value = 'VALUE A1'.
APPEND lv_chavl TO lt_chavl.
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = 'I'
I_UPDATE_ALL_ATTRIBUTES = rs_c_false
I_CLEAR_UNMAPPED_ATTRIBUTES = RS_C_FALSE
I_DB_COMMIT = RS_C_TRUE
I_COMMIT_WORK = rs_c_true
I_ACTIVATE_MD = rs_c_true
IMPORTING
E_SUBRC = lv_subrc
TABLES
I_T_ATTRIBUTES = lt_attributes
i_t_data = lt_chavl
e_t_messages = lt_messages
.
In generell, the coding works, the line will be updated. But if I have a combination with multiple time-dependencies all of them an not only the one to 99993112 are updated with the attribute value.
Thanks for your help and best regards,
Christian Kreipl
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.