Skip to Content
0

Default logic to copy changed or new records from source model to destination model

Aug 03 at 04:54 PM

116

avatar image

Hello all, I have a requirement to copy data to target model when users enter/change any data in input sheets in the source model.

That should trigger my script logic calculation every time a record is saved in source Model, and only update the new values, incase if any changed record that should clear old record in target model and copy only changed record, we imported RUNLOGIC_PH BAdi, can I use this for my requirement? do I need to create a default logic in source model?

I created a script logic to work with by executing DM package with category selections, can I copy that logic and change the syntax to work with default logic? always user selects a category in the input sheets.

Thank you

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Vadim Kalinin Aug 03 at 05:10 PM
0

First please close your previous question accepting the correct answer.

Share
10 |10000 characters needed characters left characters exceeded
Naveen Moravaneni Aug 03 at 07:01 PM
0

Hi Vadim-I just closed my previous question accepting the correct answer.

Thank you.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Second question discussion is not finished!

0
Naveen Moravaneni Aug 11 at 09:53 PM
0

Found the solution, hence closing this thread.

Created DEFAULT.LGF in source model,included runlogic badi to clear the record in target model.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Unfortunately this approach will not work correctly.

0

Hi Vadim, could you please let me know in which scenario this approach will not work?

I am clearing only changed record in the target using variables in scoping, like below.

*START_BADI RUNLOGIC_PH
QUERY=OFF
WRITE=ON
APP=PROJECTREPORTING
LOGIC=CLEAR.LGF
DIMENSION COSTELEMENT=%COSTELEMENT_SET%
DIMENSION DATASRC=%DATASRC_SET%
DIMENSION PO=%PO_SET%
DIMENSION PROJECT=%PROJECT_SET%
DIMENSION TIME=%TIME_SET%
DIMENSION CATEGORY=%CATEGORY_SET%
*END_BADI

this is clear in target model.
*WHEN CATEGORY
*IS *
*REC(EXPRESSION=0)
*ENDWHEN




0
Naveen Moravaneni

"Clearing only changed record" is not required, changed record will overwrite!

0

Yes, in my scenario I am loading properties data from source as dimensions in the target model, so if any changes in property value in the source it will not overwrite in target model because it will not find the unique key, so I am clearing that and loading new data.

Ex:- in source model

Dimension Property

Project Comm area Signdata

1 ABC $100

Target model

Dimension1 Dimension2

Project Comm area Signdata

1 ABC $100

Now the property Comm area is changed from ABC to XYZ in source model and user changed the sign data from $100 to $200, if I have not cleared this in target it will not overwrite and my records in target as

Dimension1 Dimension2

Project Comm area Signdata

1 ABC $100

1 XYZ $200

for this reason, I am clearing, apart from this is there any other scenarios which my approach is not going to work?

0