cancel
Showing results for 
Search instead for 
Did you mean: 

Help on DM Selection

Former Member
0 Kudos

Hi ,

Now I am with  BPC 10 , sp 12 .

I created below DM package and script for copy one sales office to many sales office .

But below code is working only for copy one to one , but i want copy one sales office to many sales offices .

I searched all posts  and unable to found answer for my requirement .

DM :

PROMPT(COPYMOVEINPUT,%S_SO%,%T_SO%,"Select the members to COPY and where to","SOFFICE")

INFO(%EQU%,=)

INFO(%TAB%,;)

INFO(%PREFIX%,@@@SAVE@@@@@@EXPAND@@@|X|)

INFO(%SUFFIX%,|)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,MEMBERSELECTION,S_SO%EQU%%S_SO%%TAB%T_SO%EQU%%T_SO%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,COPY_ADJ_GP.LGF)

Script :

*XDIM_MEMBERSET SOFFICE = $S_SO$,$T_SO$

*WHEN SOFFICE

*IS $S_SO$

*REC(FACTOR=1,SOFFICE=$T_SO$)

*ENDWHEN

*COMMIT

Please let me know any help on to copy many sales office at a time .

Thanks.

PSR.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

PROMPT(SELECTINPUT,%S_SO%,,"Select the member to COPY:","SOFFICE")

PROMPT(SELECTINPUT,%T_SO%,,"Select the members to COPY to","SOFFICE")

INFO(%EQU%,=)

INFO(%TAB%,;)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,MEMBERSELECTION,S_SO%EQU%%S_SO%%TAB%T_SO%EQU%%T_SO%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,COPY_ADJ_GP.LGF)

Script:

*XDIM_MEMBERSET SOFFICE=$S_SO$

*FOR %TSO%=$T_SO$

*WHEN SOFFICE

*IS *

*REC(FACTOR=1,SOFFICE=%TSO%)

*ENDWHEN

*NEXT

B.R. Vadim

Former Member
0 Kudos

Hi Vadim ,

Many thanks for your reply .

Now It is working from one to many .

But I have some condition inside code like

WHEN SOURCE  SOFFICE IS SELECTED , I NEED TO GET CORRESPONDING  PC ( IN PC DIMENSION SOFFICE IS PROPERTY , FOR THIS I USED SELECT STATEMENT AND SAME FOR TARGET SOFFICE ALSO

BUT MY CODE NOT WORKING SAYING INVALID SELECT STATEMENT .

PLEASE ADVISE ...

CODE :

*SELECT(%PCS%,"ID","PC","SOFFICE" = $S_SO%")

*SELECT(%PCT%,"ID","PC","SOFFICE" = $T_SO$")

*XDIM_MEMBERSET SOFFICE=$S_SO$

*XDIM_MEMBERSET PC=%PCS%

*FOR %TSO%=$T_SO$

*WHEN SOFFICE

*IS *

*REC(FACTOR=1,SOFFICE=%TSO%,PC=%PCT%)

*ENDWHEN

*COMMIT

*NEXT

THANKS.

former_member186338
Active Contributor
0 Kudos

Hi,

Please, read help about SELECT - you are using incorrect syntax and also some typo mistakes.

But anyway, you can't use SELECT inside FOR...

Please, describe, what you want to achieve?

You have SOURCE office and you have members of PC dimension with SOFFICE property filled with SOFFICE member. It looks like you want to copy PC's to the new office? But what will be the ID of PC in the new office? What is the link between the PC ID in the source office and the PC ID in the new office?

Vadim

P.S. Was my prev answer helpful?

former_member186338
Active Contributor
0 Kudos

P.P.S. Your comment wasn't very helpful for me to understand your requirements

Former Member
0 Kudos

Hi Vadam ,

Thanks for reply .

My requirement :

DM selection : source  and target sales

Scope of script : Sales office is property of PC dimension so , based on source sales office , source profit center will come using select statement.

same  like above , based on target sales offices , target profit centers will come using select statement.

I prepared below script but , while validating select statement is showing error .

Please advise .

DM :

PROMPT(SELECTINPUT,%S_SO%,,"Select the member to COPY:","SOFFICE")

PROMPT(SELECTINPUT,%T_SO%,,"Select the members to COPY to","SOFFICE")

INFO(%EQU%,=)

INFO(%TAB%,;)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,MEMBERSELECTION,S_SO%EQU%%S_SO%%TAB%T_SO%EQU%%T_SO%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,COPY_ADJ_GP.LGF)

SCRIPT :

*SELECT(%PCS%,"ID","PC","SOFFICE" = $S_SO$")

*SELECT(%PCT%,"ID","PC","SOFFICE" = $T_SO$")

//( "SOFFICE IS THE PROPERTY IN PC DIMENSION AND RELATION IS 1-1 )

*XDIM_MEMBERSET SOFFICE=$S_SO$

*XDIM_MEMBERSET PC=%PCT%

*FOR %TSO%=$T_SO$

*WHEN SOFFICE

*IS *

*REC(FACTOR=1,SOFFICE=%TSO%,PC=%PCT%)

*ENDWHEN

*COMMIT

*NEXT

THANKS.

former_member186338
Active Contributor
0 Kudos

Hi,

You are still using incorrect *SELECT syntax, pleeese... read the help!

Anyway even with correct syntax and the current version of BPC 10 you will have multiple members in %PCT%!

How do you want to write to multiple members in this REC:

*REC(FACTOR=1,SOFFICE=%TSO%,PC=%PCT%) ???

The issue is that using FOR it's possible to enumerate multiple sales offices and use SOFFICE=%TSO%, but it's not possible to get the property SOFFICE of the current %TSO% and use it in REC.

It's easy if you have some special naming for members of SOFFICE and PC like:

SOFFICE: 1234

PC: PC1234

Then PC=PC%TSO% in REC

Vadim

former_member186338
Active Contributor
0 Kudos

P.S. And FORGET about using *COMMIT - useless and will reset the scope!!!

former_member186338
Active Contributor
0 Kudos

Another option will be to implement RUNLOGIC_PH badi (look How-to section - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/903c14d2-6741-3010-34b2-9ae9822c2...).

Then you will have 2 script, one - main:

*FOR %TSO%=$T_SO$

START_BAdI RUNLOGIC_PH

QUERY = OFF

WRITE = ON

LOGIC = CALLED_LOGIC.LGF

DIMENSION SOFFICE = %TSO%

DIMENSION PC=<ALL>

// all other dimensions of the cube

DEBUG = OFF

END_BAdI

*NEXT

Second script CALLED_LOGIC.LGF

*SELECT(%PCS%,"[ID]",PC,"[SOFFICE]='$S_SO$'") //$S_SO$ - will be passed

*SELECT(%PCT%,"[ID]",PC,"[SOFFICE]='%SOFFICE_SET%'") //single SOFFICE - target!

*XDIM_MEMBERSET SOFFICE=$S_SO$ // source SOFFICE

*XDIM_MEMBERSET PC=%PCS% // source PC

*WHEN SOFFICE

*IS *

*REC(FACTOR=1,SOFFICE=%SOFFICE_SET%,PC=%PCT%)

*ENDWHEN

B.R. Vadim

Former Member
0 Kudos

Hi Vadim ,

Thanks for your all inputs .

Now my script working with all conditions ( source and target PC's will come based select statements ) but 1 to many copy  is not supporting still .

DM selection : one sales office to one sales office only , but I want copy one sales office to many sales office for related profit centers .

I am unable to use your Badi because I don't know abap .

DM :

PROMPT(SELECTINPUT,%S_SO%,,"Select the member to COPY:","SOFFICE")

PROMPT(SELECTINPUT,%T_SO%,,"Select the members to COPY to","SOFFICE")

INFO(%EQU%,=)

INFO(%TAB%,;)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

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

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

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,MEMBERSELECTION,S_SO%EQU%%S_SO%%TAB%T_SO%EQU%%T_SO%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,TEST2.LGF)

Script :

*SELECT(%PCS%,"[ID]",PC,"[SOFFICE]='$S_SO$'") //$S_SO$ - will be passed

*SELECT(%PCT%,"[ID]",PC,"[SOFFICE]='$T_SO$'") //single SOFFICE - target!

*XDIM_MEMBERSET SOFFICE=$S_SO$ // source SOFFICE

*XDIM_MEMBERSET PC=%PCS% // source PC

  

*FOR %TSO%=$T_SO$

*WHEN SOFFICE

*IS *

//*REC(FACTOR=1,SOFFICE=$T_SO$)

*REC(FACTOR=1,SOFFICE=$T_SO$,PC=%PCT%)

*ENDWHEN

*COMMIT

*NEXT

=====================

Above code is perfectly working for 1 to 1 copy , but i want copy 1 to many .

Please advise .

Thanks.

former_member186338
Active Contributor
0 Kudos

Hi,

You have 2 options only:

1. "It's easy if you have some special naming for members of SOFFICE and PC like:

SOFFICE: 1234

PC: PC1234"

If you are unable to rename members - then this is not an option...

2. Implement RUNLOGIC_PH badi. You don't need to know ABAP, just ask basis to import transport files attached to the mentioned How-To guide.

Vadim

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Hi,

First of all don't use code from this forum without understanding what is it for!

In the advanced script you mentioned the following lines:

INFO(%PREFIX%,@@@SAVE@@@@@@EXPAND@@@|X|)

INFO(%SUFFIX%,|)

Are useless!

Also, if you read help, for this line:

PROMPT(COPYMOVEINPUT,%S_SO%,%T_SO%,"Select the members to COPY and where to","SOFFICE")

you will see:

"This command prompts the user for two noncalculated data ranges (for copying data, for example). The number of members in FROM and TO should be the same."

B.R. Vadim

former_member190501
Active Contributor
0 Kudos

Hi,

Is there any reason for not using Standard COPY package?

Thanks,

Raju

Former Member
0 Kudos

Hi Raju ,

Thanks for fast reply .

my above code is sample only .

In my actual code , so many conditions are there at scope level before copy to target .

My code is working if one to one copy .

But i want copy one sales office to multiple sales office by user  selected target sales offices .

Please let me know any approach for achieve above .

Thanks.