cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Master data Via ABAP

Former Member
0 Kudos

Hi,

My requirements is to load master data infoobject through ABAP. I searched in the forum and found RSDMD_WRITE_ATTRIBUTES_TEXTS function module .

data : itab like /BI0/PMATERIAL occurs 0 with header line.

itab-MATERIAL = 'Mat420'.

itab-OBJVERS = 'A'.

append itab.

CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'

EXPORTING

I_IOBJNM = '0MATERIAL'

I_TABCLASS = 'M'

TABLES

I_T_TABLE = ITAB

EXCEPTIONS

ATTRIBUTE_NAME_ERROR = 1

IOBJ_NOT_FOUND = 2

GENERATE_PROGRAM_ERROR = 3

OTHERS = 4.

However , it doesnt add an entry into infoobject...

We are using APO 3.0 version.

Does anyone has any idea on this ?.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I think you should use FM RSDMD_MD_ACTIVATE after RSDMD_WRITE_ATTRIBUTES_TEXTS in order to activate the master data.

I often use this to FM to add master data via abap like you and it works very well.

LB

Message was edited by:

Laurent BOUDART

Former Member
0 Kudos

Thank you all of you for your replys.

I believe there must be a version issue while using function module RSDMD_WRITE_ATTRIBUTES_TEXTS , it works well in BW system but not in APO version

However , my issue gets resolved by using Function Module RSNDI_MD_ATTRIBUTES_UPDATE.

Here is a sample code in APO 3.0 version. ( for other's reference )

Data : i_final Like RSNDI_S_CHAVL occurs 0 with header line,

i_final-RECORD_NO = 1.

i_final-IOBJNM = '0Material'.

i_final-VALUE = 'DTEST'.

Append i_final.

CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'

EXPORTING

I_IOBJNM = '0MATERIAL'

I_UPDATE_ALL_ATTRIBUTES = 'X'

TABLES

I_T_DATA = i_final

E_T_MESSAGES = i_message.

After execution , it did add records into infoobject.

Anyway thank you all for your replies and suggestions.

Regards,

Prashant

Message was edited by:

Prashant

Former Member
0 Kudos

Hello Prashant,

Please add the below after the execution of your function module.

data : L_T_RIOBJNM TYPE RANGE OF RSD_IOBJNM,

L_S_RIOBJNM LIKE LINE OF L_T_RIOBJNM.

CLEAR L_S_RIOBJNM .

REFRESH L_T_RIOBJNM.

  • Hierarchy change at the end

L_S_RIOBJNM-SIGN = 'I'.

L_S_RIOBJNM-OPTION = 'EQ'.

L_S_RIOBJNM-LOW = 'ZAA_CONTR'.

APPEND L_S_RIOBJNM TO L_T_RIOBJNM.

SUBMIT RSDDS_AGGREGATES_MAINTAIN

WITH I_T_IOBN IN L_T_RIOBJNM

AND RETURN.

Thanks,

Siva.

Former Member
0 Kudos

Hello Prashant,

You can simply access the master data table itself. Here are the naming conventions:

Text Tables:

/BIC/T<infoobject name> for customer built infoobjects

/BI0/T<infoobject name> for business content infoobjects

Attribute Tables:

/BIC/P<infoobject name> for customer built infoobjects (Time independent)

/BIC/Q<infoobject name> for customer built infoobjects (Time dependent)

So for example, you would like to add text entry for infobject ZCOUNTRY for the short text (field TXTSH), then you can simply insert a row in that table. Here's a sample abap code.


data: ls_txt_cnty type /bic/tzcountry.

ls_txt_cnty-/bic/zcountry = 'PH'.
ls_txt_cnty-langu = 'EN'.
ls_txt_cnty-txtsh = 'Philippines'.

modify /bic/tzcountry from ls_txt_cnty.

Hope this helps.

Former Member
0 Kudos

Thanks Emmanuel for your response,

However , the these tables are stored as per the Star Schema...I believe , we would need to build SID tables to have syn across diffrent table that may be referrencing this table.

Building SID table I guess would be complicated task and hence I am looking at some SAP std function module which does this.

I read in the forum that adding entries directly into table is not fesible.

Thanks

Prashant