cancel
Showing results for 
Search instead for 
Did you mean: 

Time Dependency with RSNDI_MD_ATTRIBUTES_UPDATE

0 Kudos

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:

  1. I1 as KEY
  2. I2 as KEY
  3. 0DateTO as KEY
  4. Attribute AT1 (Time-Dependent)
  5. Attribute AT2 (Time-Dependent)
  6. Attribute A1

P-Table of InfoObject I:

  1. I1 as KEY
  2. I2 as KEY
  3. 0DateTO as KEY
  4. Attribute A1

Q-Table of InfoObject I

  1. I1 as KEY
  2. I2 as KEY
  3. 0DateTO as KEY
  4. Attribute AT1
  5. Attribute AT2

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

Accepted Solutions (0)

Answers (0)