cancel
Showing results for 
Search instead for 
Did you mean: 

problem in update rules

former_member671571
Participant
0 Kudos

Hi,

I have created update rules for Master Data Objects. If one of the attributes value is null it should not overwrite the previous value in the Master data attribues. I have written code for one filed:

IF COMM_STRUCTURE-/BIC/Z_NAME <> ' '.

RESULT = COMM_STRUCTURE-/BIC/Z_NAME.

RETURNCODE = 0.

ELSE.

  • if the returncode is not equal zero, the result will not be updated

RETURNCODE = 1.

ENDIF.

But its giving error. Even I tried without ELSE code. but it is overwriting the previous values with blanks.

Any ideas how to do this.

Thanks,

Ram

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member93896
Active Contributor
0 Kudos

Hello Ram,

in the start routine, read the complete master data table into memory (using RSAU_READ_MASTER_DATA for example) and merge it with the data package using your logic. Then you don't need the routine for the attribute any more.

Regards,

Marc Bernard

SAP NetWeaver RIG, US BI

former_member671571
Participant
0 Kudos

Hi Marc,

Thanks for your suggestion. Each time null value comes I need to get Master data table(Previous) values and update the same value., which reduces the performance. Is there anyway that we can restrict the single field value in update or transfer rules.

Thanks in Advance,

Ram

Former Member
0 Kudos

As Marc has said earlier, in the start routine delete all records with blank values for the attribute. Then only those with valid attribute values will be uploaded!

former_member671571
Participant
0 Kudos

But in my senario I have about several attributes which is updating master data table. If I delete the records in start routine, which is blank, I am unable to update other field(attribute) values. I just want to restrict only one field value in update rules, but not the record.

Thanks in advance.

former_member93896
Active Contributor
0 Kudos

Don't delete the complete record in the start routine, just set the one attribute to blank and leave the others as they are.

Performance should not be an issue if you read the master data table only once (select * into table) and then use the internal table (read table...).

Regards,

Marc

SAP NetWeaver RIG, US BI