Skip to Content
0

How to change the sign of data while copying data using Copy data manager package?

Nov 20, 2017 at 01:54 PM

48

avatar image
Former Member

Hi all,

I have a strange requirement to flip the sign of the data while copying using COPY DM package.

An example is as follows: (pic attached)

We need a Copy reverse append functionality to be implemented :(

We thought about copying first and then use script logic to change the sign but that option takes away the append functionality required.

Tried to implement a custom logic but not able to successfully pass "Selection" and "ToSelection" advanced script parameters to Custom BAdI script logic.

Please help.

Regards,

Surya Tamada

capture.jpg (27.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Nov 20, 2017 at 02:48 PM
0

You can't change sign using copy package. Use script logic instead:

*XDIM_MEMBERSET ACCOUNT=SOURCE

*WHEN ACCOUNT

*IS *

*REC (EXPRESSION =-%VALUE%+[ACCOUNT].[DESTINATION], ACCOUNT = DESTINATION)

*ENDWHEN

"Tried to implement a custom logic but not able to successfully pass "Selection" and "ToSelection" advanced script parameters to Custom BAdI script logic." - strange statement! What do you mean by badi in this case? No badi required!

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 23, 2017 at 12:37 PM
0

Hi Vadim,

May be I did not articualte it good enough.

Client wants to select values from Source and copy it to destination but the sign to be flipped.

If I use your logic script code, how do I get the scoping for the destination or differentiate if from that of the source?

Now coming to my "Strange Statement" :)

I tried to achieve this by implementing Custom logic BAdI and struggling to pass "SELECTION" (source), "TOSELECTION" (destination) from advanced script to the BAdI using script logic.

Regards,

ST


source-dest.jpg (214.0 kB)
Show 5 Share
10 |10000 characters needed characters left characters exceeded

Sorry, but looks like you still unable to provide a clear requirements. You have to explain what dimensions are fixed, what dimensions has to be selected for source and what for target.

Badi is absolutely strange idea - not related to this case. May be you need some basic bpc training.

0
Former Member

Hi Vadim,

Thank you very much for your comments. Sure I need some basic training.

Let me make another attempt to explain. Hopefully, I will be successful this time:

1. The client wants a way to copy data from a source to a destination using an interface similar to COPY data manager package. The user should be able to select dimension members by clicking on "add" button as mentioned in the picture above (see previous message).

2. As the COPY DM package does not allow reversing the sign of SIGNEDDATA before saving, I am trying to replicate similar interface using Advance Script of another DM package.

3. "selection" and "toselection" are the items I am using in advanced script of DM package to create the interface.

Client does not want to fix any values. It must be dynamic.

*XDIM_MEMBERSET ACCOUNT=SOURCE

*WHEN ACCOUNT

*IS *

*REC (EXPRESSION =-%VALUE%+[ACCOUNT].[DESTINATION], ACCOUNT = DESTINATION)

*ENDWHEN

In the code above, you mentioned "source" and "destination", I would like to scope them DYNAMICALLY. Could you please help me understand how to read data from the interface and scope DYNAMICALLY?

Let me know if you need more information. Thank you very much for your time.

Kind Regards,

Surya Tamada

0

From my own experience copy from any to any is never used in the real business processes :) You have to talk again with your client!

In the real life the requirements are like:

Some dimension members are hard coded (fixed in script logic).

Some dimension members are equal for the source and destination, but selectable by user: ex.: TIME

Some dimensions require source member and target member selectable by user.

This scenario can be achieved using script logic and the statements in advanced script like:

For "same":

PROMPT(SELECTINPUT,%SELECTION%,,"Select DIM2, DIM3:","DIM2,DIM3")

and passed as:

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

and used in script as:

%DIM2_SET%, %DIM3_SET%

For different source and target (for each dimension):

PROMPT(COPYMOVEINPUT,%DIM1SOURCE%,%DIM1TARGET%,"Select the members of DIM1 to COPY and where to",DIM1,0)

and passed as:

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,MEMBERSELECTION,DIM1SOURCE%EQU%%DIM1SOURCE%%TAB%DIM1TARGET%EQU%%DIM1TARGET%)

and used in script as:

$DIM1SOURCE$, $DIM1TARGET$

1
Former Member

Fully agree with you, Vadim.

We have been trying to explain the same thing to the client over various conversations. Hopefully your comments will help them appreciate it further.

Regards,

ST

0

Using badi or custom chain with z class for this task is overkill (ABAP maintenance is not so simple)! Try to analyze business process first.

0