cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BPC : Complex copy via script logic

0 Kudos
312

Hi Experts,

I'm facing a business issue and I'd like to know if it's possible to make it through script logic :

Below the requirement :

I'd like to copy one contract from one category to multiple category and same contract, for example :

L1500054, CAT1 copy to CAT_MATIS1_L1500054,L1500054 - 500

L1500054, CAT1 copy to CAT_MATIS4_L1500054,L1500054 - 500

I tried to create in CATEGORY dimension a property that I called Contract and wrote the script like that :

*SELECT(%CON%, ID, CONTRACT, ID = %CONTRACT_SET%)

*SELECT(%CAT_DEST%, ID, CATEGORY, CONTRACT = %CON% AND STATUS = IN_PROGRESSION)

*XDIM_MEMBERSET CATEGORY = CAT1

*XDIM_MEMBERSET CONTRACT = %CONTRACT_SET%

*XDIM_MEMBERSET TIME = %TIME_SET%

*FOR %CAT_DESTINATION% = %CAT_DEST%

*WHEN CONTRACT

*IS *

*REC(FACTOR = 1, CAT = %CAT_DESTINATION% )

*ENDWHEN

*NEXT

When I execute the script via a package, I select the TIME and let the CONTRACT dimension on <ALL>

The script seems to work correctly but it writes on all the others category that have a Contract property different from the source, for example :

L1500054,CAT1 copy to CAT_MATIS1_L1500054,L1500054

L1500054,CAT1 copy to CAT_MATIS2_L1500013,L1500013

... and so on

According to you, do you think we can achieve this requirement via a script logic ?

Kindly regards.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

You have to create properties like CATEGORY1, CATEGORY2 ... in CONTRACT dimension and fill it with appropriate category ID.

Then in WHEN/ENDWHEN:

*REC(FACTOR = 1, CATEGORY=CONTRACT.CATEGORY1
*REC(FACTOR = 1, CATEGORY=CONTRACT.CATEGORY2
...

Actually you can have multiple when/endwhen and before each you can select only contracts with non-empty property CATEGORYx

0 Kudos

Thanks Vadim

Answers (0)