cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Data Within a Model

Former Member
0 Kudos

Hi,

I need to copy data from ACTUAL to PLAN. For example, I need to transfer 2014 data to 2015 Plan.

I found the standard package COPY.

A few questions which i hope you can help with

- on the handling of records what is "Copy Records with Match Key" and "Copy by replacting in same data region of Entity, Category, Time and Audit ID"

- Is there a way to restrict the number of options on the dimension selection area. As I want to restrict the options that the user selections? E.g. only allow them to select CATEGORY and TIME?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Leo,

1. Replacing will first clear all data for the selected Entity, Category, Time and Audit ID.

2. You can edit advanced DM script to fix some values. Correct the COPYMOVEINPUT and add fixed values like here:

3. You can also copy data using script logic.

Vadim

Former Member
0 Kudos


Hi,

Thanks for your response.

Just to re-affirm your first point. I want to make sure all data with the selections I have made is cleared first. e.g. if was transfering ACTUAL year 2014 to PLAN year 2015. Then i want the plan data for year 2015 to be cleared first.

How does "Copy Records with Match Key" work - does that just copy the records over and not impact the existing records in the target? e.g. if 100 was already in the target and we transferred over 120. Then total would be 220?

"Copy by replacting in same data region of Entity, Category, Time and Audit ID" - this looks like it clears all data first based on the "Entity, Category, Time and Audit" selected? To be honest we will only be selecting Category and Time so this would clear that data first? Correct?

Reason I am asking is i need to understand if i need to set up a package first which clears the data and then do the copy?

Cheers

former_member186338
Active Contributor
0 Kudos

The disadvantage or "replace" is that it will clear for only Entity, Category, Time and Audit ID, not for ALL dimension! In our projects we use script logic copy with script logic clear before to work with user defined dimensions...

For "Copy Records with Match Key" please read the link provided by Ashish, only records that are copied will overwrite the destination, if source has no record - the destination will be intact.

Vadim

former_member210696
Active Contributor
0 Kudos

Leo,

Believe in your case none of the two options will work -

Copy Records with Match Key - If your source doesn't have any data, destination will be as is.

say 2014.Jan doesn't have any data and 2015.Jan has 100, then after copy 2015.Jan will continue to have 100.

Replace - As is clear from the example taken in the link provided, Entity, Category, Time and Audit combination would only be cleared.

So, it's better to write a script logic. Alternate could be to create a package link to have clear package and then copy package within it (not suggested though).

Regards,

Ashish

former_member186338
Active Contributor
0 Kudos

P.S. Script like:

*XDIM_MEMBERSET ENTITY=SOMEFIXEDENTITY

*XDIM_MEMBERSET AUDITID=SOMEFIXEDAUDITID

...

*FOR %T%=$SOURCE_TIME$

*XDIM_MEMBERSET CATEGORY=$TARGET_CATEGORY$

*XDIM_MEMBERSET TIME=TMVL(12,%T%)

*WHEN TIME

*IS *

*REC(EXPRESSION=0)

*ENDWHEN

*XDIM_MEMBERSET CATEGORY=$SOURCE_CATEGORY%

*XDIM_MEMBERSET TIME=%T%

*WHEN TIME

*IS *

*REC(EXPRESSION=%VALUE%,CATEGORY=$TARGET_CATEGORY$,TIME=TMVL(12,%T%))

*ENDWHEN

*NEXT

Assuming you want to copy data to next year

Vadim

former_member186338
Active Contributor
0 Kudos

P.S. The details (like user prompts etc...) depends on requirements: do you want to copy full year always? Do you always want to copy to next year?...

Vadim

Former Member
0 Kudos

Hi,

Just to clarify what you mean by the disadvantage - if the data was set as below.

Source

CostCenter     Entity     Category     Time         Audit     Signeddata

CC1               E1          Actual       2015.01     Input       250

Current Data in Destination

CostCenter     Entity     Category     Time         Audit     Signeddata

CC1               E1          Plan       2015.01     Input      250

CC2               E1          Plan       2015.01     Input      150

CC1               E2          Actual        2014.01     Input      200

I then selected "Copy by replacting in same data region of Entity, Category, Time and Audit ID." with paramters

Catgeory: ACTUAL -> Category: PLAN

TIME: 2015.01 ->  2015.01

Would I be correct the result will be (the CC2 entry will be zero'ed out):

Final Data in Destination

CostCenter     Entity     Category     Time         Audit     Signeddata

CC1               E1          Plan       2015.01     Input      250

CC1               E2          Actual        2014.01     Input      200

Thanks,

Former Member
0 Kudos

Hi,

I have just found out that the requirements will be to copy to same year i.e.

ACTUAL year 2014 to PLAN year 2014.

However, for other combinations it may be that we want to copy for example ACTUAL year 2014 to BUDGET 2016.

I always need to make sure the data has been fully cleared in the destination i.e. BUDGET 2016 data should be cleared and then we do the copy of the data.

Prompts wise then it will be

source category and target category

source Time (full year) and target Time (full year)

Cheers,

former_member186338
Active Contributor
0 Kudos

Yes, in this particular case - because CostCenter is user defined dimension the data will be cleared. You will not be able to copy the single CostCenter without clearing all.

Vadim

Former Member
0 Kudos

Hi,

When selecting time and i want to copy over a year and if I select

Source -> 2014.01, 2014.02...2014.12

Target-> 2015.01, 2015.02...2015.12

Will the 2014.01 data go to 2015.01? How does the selection of multiple items work?


Cheers,

former_member186338
Active Contributor
0 Kudos

For the same year the script will be very simple (without FOR/NEXT)

For: source Time (full year) and target Time (full year) it will be more complex:

*SELECT(%SM%,"[ID]",TIME,"[YEAR]=$SOURCE_YEAR$ AND [CALC]=N")

*SELECT(%TM%,"[ID]",TIME,"[YEAR]=$TARGET_YEAR$ AND [CALC]=N")

*XDIM_MEMBERSET TIME=%TM%

*XDIM_MEMBERSET CATEGORY=$TARGET_CATEGORY$

*WHEN TIME

*IS *

*REC(EXPRESSION=0)

*ENDWHEN

*XDIM_MEMBERSET CATEGORY=$SOURCE_CATEGORY$

*FOR %S%=%SM% AND %T%=%TM%

*XDIM_MEMBERSET TIME=$S$

*WHEN TIME

*IS *

*REC(EXPRESSION=%VALUE%,TIME=%T%,CATEGORY=$TARGET_CATEGORY$)

*ENDWHEN

*NEXT

former_member186338
Active Contributor
0 Kudos

With standard copy package it will work  like 2014.01 data go to 2015.01.

For script - look on my last sample with *FOR %S%=%SM% AND %T%=%TM%

Vadim

Former Member
0 Kudos

Hi,

Thanks for the script and i am going to try both options script and the standard package.

I was wondering how the mapping of months work for source and target in the standard COPY package as you can select multiple source/target time?

Cheers

former_member186338
Active Contributor
0 Kudos

Standard package requires same number of members in source and target. Both member lists are passed as comma separated strings. The first element of source string will be copied to the first element of the second string etc...

Just test!

The issue of the standard package is that for some strange reason the developers decided to limit clear only to fixed dimensions list.

Vadim

Former Member
0 Kudos

Hi,

I want to modify the standard COPY Package so it only requests the CATEGORY and TIME dimensions. The script is below...any chance you can point me in the right direction on what needs changing. I have read the document you posted but I am finding it difficult to get my head around. 

PROMPT(RADIOBUTTON,%TARGETMODE%,"Handling of records",0,{"Copy records with match key","Copy by replacing data in same data region of Entity, Category, Time and Audit ID"},{"0","2"})

PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after copying",0,{"Yes","No"},{"1","0"})

PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})

PROMPT(COPYMOVEINPUT,%SELECTION%,%TOSELECTION%,"Select the members to COPY and where to",%DIMS%,0)

INFO(%TEMPNO1%,%INCREASENO%)

INFO(%ACTNO%,%INCREASENO%)

INFO(%SELECTION_KEYDATE%,)

TASK(/CPMB/CM_CONVERT,OUTPUTNO,%TEMPNO1%)

TASK(/CPMB/CM_CONVERT,ACT_FILE_NO,%ACTNO%)

TASK(/CPMB/CM_CONVERT,SAPPSET,%APPSET%)

TASK(/CPMB/CM_CONVERT,SAPP,%APP%)

TASK(/CPMB/CM_CONVERT,SELECTION,%SELECTION%)

TASK(/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%)

TASK(/CPMB/CM_CONVERT,KEYDATE,%SELECTION_KEYDATE%)

TASK(/CPMB/CLEAR_SOURCE_CUBE,CHECKLCK,%CHECKLCK%)

TASK(/CPMB/CLEAR_SOURCE_CUBE,SELECTION,%TOSELECTION%)

TASK(/CPMB/CLEAR_SOURCE_CUBE,KEYDATE,%SELECTION_KEYDATE%)

TASK(/CPMB/CLEAR_SOURCE_CUBE,DUMPLOADMODE,3)

TASK(/CPMB/APPEND_LOAD,PREPROCESSMODE,0)

TASK(/CPMB/APPEND_LOAD,TARGETMODE,%TARGETMODE%)

TASK(/CPMB/APPEND_LOAD,INPUTNO,%TEMPNO1%)

TASK(/CPMB/APPEND_LOAD,ACT_FILE_NO,%ACTNO%)

TASK(/CPMB/APPEND_LOAD,RUNLOGIC,%RUNLOGIC%)

TASK(/CPMB/APPEND_LOAD,CHECKLCK,%CHECKLCK%)

TASK(/CPMB/APPEND_LOAD,KEYDATE,%SELECTION_KEYDATE%)

former_member186338
Active Contributor
0 Kudos

Hi Leo,

You have to train your mind The idea of this document is here:

You have (in the default package for all dimensions):

PROMPT(COPYMOVEINPUT,%SELECTION%,%TOSELECTION%,"Select the members to COPY and where to",%DIMS%,0)

Replace it with only 2 dimensions

PROMPT(COPYMOVEINPUT,%SELECTION%,%TOSELECTION%,"Select the members to COPY and where to","%CATEGORY_DIM%,%TIME_DIM%",0)

Then create INFO for fixed members (use your real dims and members):

INFO(%SUFFIX1%,DIMENSION:SOMEDIM1|SOMEVALUE1|)

INFO(%SUFFIX2%,DIMENSION:SOMEDIM2|SOMEVALUE2,SOMEVALUE3|)

Then correct each line where you have %SELECTION% and %TOSELECTION% variables like:

Change:

TASK(/CPMB/CM_CONVERT,SELECTION,%SELECTION%)

TASK(/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%)

To:

TASK(/CPMB/CM_CONVERT,SELECTION,%SELECTION%%SUFFIX1%%SUFFIX2%)

TASK(/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%%SUFFIX1%%SUFFIX2%)

Vadim

Former Member
0 Kudos

Hi,

Thanks.

Is it possible do a range in the source e.g. 2014.01 to 2014.06 and force the target to be the same values? Also, is it possible to force the system to not allow certain selections for the targert category? I am assuming "TASK - (/CPMB/CM_CONVERT,TOSELECTION,%TOSELECTION%)" sets the to selection but it looks like this is generic for all dimensions?

or are these requirements something that i would need to do via script logic?

I just want to say thank you for your help it is appreciated.

thanks,

Former Member
0 Kudos

Hi,

I found this, which is useful...just working through it now as it explains each of the functions. But cant find a v10 BPC version one?

https://help.sap.com/saphelp_bpc75_nw/helpdata/en/9b/b06738491048a1b6d78792d78d51c0/content.htm?fram...

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/cf/1988ba92144fad92abb87df37bcd97/frameset.htm

former_member186338
Active Contributor
0 Kudos

"Is it possible do a range in the source e.g. 2014.01 to 2014.06 and force the target to be the same values"

With standard copy package you can use SELECTINPUT instead of COPYMOVEINPUT to select the TIME members and use the result instead of %SELECTION% and %TOSELECTION%. But in this case you will not be able to use COPYMOVEINPUT for category selection, you will have to select CATEGORY with 2 COMBOBOX prompts with fixed value list.

With script it's also possible and the script will be very simple - no FOR/NEXT, just TIME scope.

But please, if we try to discuss all possible options this discussion will be endless

Vadim

P.S. To "restrict" something for target use COMBOBOX prompt!

former_member186338
Active Contributor
0 Kudos

Just look in EPMofc_10_user_en.pdf, the same info is here!

Former Member
0 Kudos

Thanks - I will look into this further. I will start a new discussion if i have another question.

Answers (1)

Answers (1)

former_member210696
Active Contributor
0 Kudos

Leo,

You can also look at the thread -