Skip to Content
0
Former Member
Sep 07, 2014 at 10:22 PM

How to update info object attributes using Abap

1734 Views

Hi All,

I have a reqirement to update master data info object's attributes using Abap program. Currently we are in BW 7.3 version. I have tried the following options with no success.

[a] Using internal table.

I have declared an internal table with the exact fields of the info object's P table /BIC/PZ* & then poplated the vales in the internal table.

I have used the regular Abap statement. While updating the internal table I have tried OBJVERS = 'A', OBJVERS = 'M', and OBJVERS =''. as well. But no luck.

update /BIC/PZ* from table it_table.

While debggin the Abap program, post execution of the update statement, I am getting the sy-subrc = 4.

[b] Using the Function Module RSDMD_WRITE_ATTRIBUTES_TEXTS

I have created the internal table to similar to the table /BIC/PZ* & passed the internal table while calling the function module RSDMD_WRITE_ATTRIBUTES_TEXTS with no luck.

CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
EXPORTING
I_IOBJNM = '<info object name Z*>'
I_TABCLASS = 'M'
* I_T_ATTR =
* I_S_MINFO =
* I_REQUNR =
* I_DATAPAKID =
* I_MONITORING =
* I_CREATE_STATISTICS = RS_C_TRUE
* IMPORTING
* E_T_IDOCSTATE =
* E_SUBRC =
TABLES
I_T_TABLE = it_table
EXCEPTIONS
ATTRIBUTE_NAME_ERROR = 1
IOBJ_NOT_FOUND = 2
GENERATE_PROGRAM_ERROR = 3
OTHERS = 4

After executing this function module the master data table is not getting updated.

[c] I have used the function module RSNDI_MD_ATTRIBUTES_UPDATE as mentioned below with no luck

CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
I_IOBJNM = '<info object name z*>'
I_UPDATE_ALL_ATTRIBUTES = 'X'
* I_CLEAR_UNMAPPED_ATTRIBUTES = RS_C_FALSE
* I_CHAVL_ENQUEUE = RS_C_TRUE
* I_DB_COMMIT = RS_C_FALSE
* I_COMMIT_WORK = RS_C_FALSE
* I_PROTOCOL = RS_C_FALSE
* I_NO_APPL_LOGGING = RS_C_FALSE
* I_ACTIVATE_MD = RS_C_FALSE
* IMPORTING
* E_SUBRC =
TABLES
* I_T_ATTRIBUTES =
I_T_DATA = it_table
E_T_MESSAGES = .

In all the three options I have mentioned above, I am not sure what is missing.

Can any one check and let me know in the above three options what I did wrong ?. Also, if there is any other funtion module, provide me the sample code.

Thanks in Advance,

Spring