Skip to Content
0

Script Logic - Unable to clear data

Dec 27, 2017 at 11:06 AM

91

avatar image

Hello Experts,

I'm trying to execute a logic file to clear the data based on some properties(on Account & Entity) but in the end it is not deleting the data. I've tried hard coding Entities but still I'm unable to see any change in output executed via UJKT/Package Run.

1. Version BPC10.1 SP8 , BW740 SP13


2. List of Dimensions for Finance Model: ACCOUNT, CATEGORY,GROUP, COSTCENTER,CURRENCY,DATASRC,ENTITY,FLOW,INTERCP,PROFITCENTER,
SCENARIO, TIME


3. RECLASS.LGF - Re classification is done on the basis of Account Property. [DISCOPS TO ACCT]= (other than blank) , Entity Property. [DISCOPS_HFS] =D , DATASRC(AUDIT) Property.[DISCOPS_DS]=Y. Now whenever the script run based on the above properties , reclassification is done.

This scenario is whenever the Entity Property.[DISCOPS_HFS] = other than blank was used , now the business has removed this property. So, in order to automatically clear the data from the DATASRC = DISCOPS and ACCOUNT Property. [DISCOPS TO ACCT]= (other than blank) . This logic should be added in the script.

Thus, to delete the data always whenever the Entity Property = DISCOPS_HFS is blank. DATSRC should always be DISCOPS. Accounts should always be Property = DISCOPS TO ACCT (other than blank).


4. DM Script (Not a Default logic)

PROMPT(SELECT,,,,"ENTITY,CATEGORY,TIME")

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,SELECTION,%SELECTION%)

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


5. UJKT
DATA REGION -

CATEGORY=ACTUAL

ENTITY=AE10

TIME=2017.JAN


CODE - Provided Below


LGX:

*XDIM_SKIPNULLCHECK CURRENT

*XDIM_MEMBERSET CATEGORY = %GAAPONLY%

*XDIM_FILTER ENTITY = [ENTITY].PROPERTIES("CALC") = N

*START_BADI RUNLOGIC_PH

QUERY = OFF

WRITE = ON

LOGIC = RECLASS.LGF

APPSET = FPR

APP = Finance

DIMENSION ACCOUNT = <ALL>

DIMENSION CATEGORY = ACTUAL

DIMENSION GROUP = G_NONE

DIMENSION COSTCENTER = <ALL>

DIMENSION CURRENCY = <ALL>

DIMENSION DATASRC = <ALL>

DIMENSION ENTITY = AE10

DIMENSION FLOW = FOPE,FACT,FCLO

DIMENSION INTERCO = <ALL>

DIMENSION PROFITCENTER = <ALL>

DIMENSION SCENARIO = <ALL>

DIMENSION TIME = 2017.JAN

CHANGED = ENTITY.PARALLEL

DEBUG = OFF

*END_BADI

*COMMIT



LOG-

APPSET:FPR

APPLICATION: Finance

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:ACCOUNT WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:GROUP WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:COSTCENTER WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:DATASRC WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:FLOW WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:INTERCO WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:PROFITCENTER WILL QUERY ON ALL BASE MEMBERS.

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:SCENARIO WILL QUERY ON ALL BASE MEMBERS.

EXECUTION BADI:RUNLOGIC_PH

QUERY: OFF

WRITE: ON

Logic script RECLASS.LGF is processed.

1 Data Regions will be generated.

30 parallel processes will be used.

Dimension ENTITY property P02 1 members used for a new Data Region

Process Task 1 Started at 05:41:24 .

Process Task 1 Ended at 05:41:25 successfully.

BADI EXECUTION TIME IN TOTAL :2.00 ms.

SCRIPT RUNNING TIME IN TOTAL:2.00 s.

LOG END TIME:2017-12-28 05:41:25

6. Code:-

*XDIM_SKIPNULLCHECK CURRENT

*XDIM_MEMBERSET CATEGORY = %GAAPONLY%

*XDIM_FILTER ENTITY = [ENTITY].PROPERTIES("CALC") = N

*START_BADI RUNLOGIC_PH

	QUERY = OFF

	WRITE = ON

	LOGIC = RECLASS.LGF

	APPSET = FPR

	APP = Finance

	DIMENSION ACCOUNT = <ALL>

	DIMENSION CATEGORY = %CATEGORY_SET%

	DIMENSION GROUP = <ALL>

	DIMENSION COSTCENTER = <ALL>

	DIMENSION CURRENCY = <ALL>

	DIMENSION DATASRC = <ALL>

	DIMENSION ENTITY = %ENTITY_SET%

	DIMENSION FLOW = FACT,FCLO,FOPE

	DIMENSION INTERCO = <ALL>

	DIMENSION PROFITCENTER = <ALL>

	DIMENSION SCENARIO = <ALL>

	DIMENSION TIME = %TIME_SET%

	CHANGED = ENTITY.PARALLEL

	DEBUG = OFF

*END_BADI

*COMMIT


RECLASS.LGF:-

*SELECT(%DA%, "[ID]","ACCOUNT", "[DISCOPS_TO_ACCT] <>  ''")
*SELECT(%DE%, "[ID]","ENTITY", "[DISCOPS_HFS] = 'D' AND ID = %ENTITY_SET%")
*SELECT(%DD%, "[ID]","DATASRC", "[DISCOPS_DS] = 'Y'")
*SELECT(%ED%, "[ID]", "ENTITY","[DISCOPS_HFS] = ''")

*XDIM_SKIPNULLCHECK CURRENT 
*XDIM_MEMBERSET ENTITY = %DE%
*XDIM_MEMBERSET ACCOUNT AS %CFDR% = 123212,A310005,312110
*XDIM_MEMBERSET ACCOUNT = <ALL>
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET DATASRC = DISCOPS
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>

*WHEN ACCOUNT
*IS <> %CFDR%
*REC(EXPRESSION = 0)
*ENDWHEN

*XDIM_MEMBERSET ACCOUNT = %DA%
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET DATASRC = %DD%
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>
*WHEN ENTITY.DISCOPS_HFS
*IS D
*WHEN CURRENCY
*IS FC,USD
*REC(FACTOR = -1,DATASRC = "DISCOPS")
*REC(FACTOR = 1,ACCOUNT = ACCOUNT.DISCOPS_TO_ACCT,DATASRC = "DISCOPS")
*ENDWHEN
*ENDWHEN

//ADDITIONAL CODE IN THE SCRIPT SHOWN BELOW TO CLEAR DATA (BUT NOT CLEARING ANY DATA) :-
*XDIM_MEMBERSET ENTITY = %ED%
*XDIM_MEMBERSET DATASRC = DISCOPS
*XDIM_MEMBERSET ACCOUNT = %DA%
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>
*WHEN ENTITY
*IS %ED%
*REC(EXPRESSION = 0)
*ENDWHEN

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

2 Answers

Best Answer
monu b Dec 28, 2017 at 08:00 AM
0

Issue is resolved now, correct script to delete the data:-

*XDIM_SKIPNULLCHECK CURRENT

*XDIM_MEMBERSET ENTITY = %ED%

*XDIM_MEMBERSET ACCOUNT = %DA%

*XDIM_MEMBERSET GROUP = <ALL>

*XDIM_MEMBERSET COSTCENTER = <ALL>

*XDIM_MEMBERSET CURRENCY = FC,USD

*XDIM_MEMBERSET DATASRC = DISCOPS

*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO

*XDIM_MEMBERSET INTERCO = <ALL>

*XDIM_MEMBERSET PROFITCENTER = <ALL>

*XDIM_MEMBERSET SCENARIO = <ALL>

*WHEN ACCOUNT

*IS %DA%

*REC(EXPRESSION = 0)

*ENDWHEN

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

Yes, skipnullcheck will help to avoid error with empty scope of some dimension.

But in you script the variable %ed% is assigned a fixed list of members with empty property DISCOPS_HFS

How it’s related to the issue?

0

It was related to issue. I was not able to clear the data for the Entities that has property.DISCOPS_HFS=""
if I'm using Variable %ED% for entity then the ACCOUNTS with %DA% will get cleared for those %ED% Entities only. Maybe my wordings didn't had the correct choice of words.

0

Sorry, but incorrect!

Skipnullcheck will skip your code if there are no entities with empty property. Looks absolutely strange for me!

Also this strange code will run for each parallel process - what for???

0

if I'm going to execute this script via DM , then I'll select the Top Node of Entity(that has 3041 base members), for that case we are using entity parallel process.

0

And in each parallel process you are trying to clear the same entities with empty property??

Looks absolutely strange.

0

Strange but true .
Step -1 Clear Accounts

*SELECT(%DA%, "[ID]","ACCOUNT", "[DISCOPS_TO_ACCT] <>  ''")
*SELECT(%DE%, "[ID]","ENTITY", "[DISCOPS_HFS] = 'D' AND ID = %ENTITY_SET%")
*SELECT(%DD%, "[ID]","DATASRC", "[DISCOPS_DS] = 'Y'")
*SELECT(%ED%, "[ID]", "ENTITY","[DISCOPS_HFS] = ''")

*XDIM_SKIPNULLCHECK CURRENT 
*XDIM_MEMBERSET ENTITY = %DE%
*XDIM_MEMBERSET ACCOUNT AS %CFDR% = 123212,A310005,312110
*XDIM_MEMBERSET ACCOUNT = <ALL>
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET DATASRC = DISCOPS
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>
*WHEN ACCOUNT
*IS <> %CFDR%
*REC(EXPRESSION = 0)
*ENDWHEN

Step - 2 Copy data from one DATASRC to another DATASRC based on properties.

*XDIM_MEMBERSET ACCOUNT = %DA%
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET DATASRC = %DD%
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>
*WHEN ENTITY.DISCOPS_HFS
*IS D
*WHEN CURRENCY
*IS FC,USD
*REC(FACTOR = -1,DATASRC = "DISCOPS")
*REC(FACTOR = 1,ACCOUNT = ACCOUNT.DISCOPS_TO_ACCT,DATASRC = "DISCOPS")
*ENDWHEN
*ENDWHEN


Step -3 New --> Clear Account Data based on the Entity Property that has blank value.

*XDIM_MEMBERSET ENTITY = %ED%
*XDIM_MEMBERSET ACCOUNT = %DA%
*XDIM_MEMBERSET GROUP = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET CURRENCY = FC,USD
*XDIM_MEMBERSET DATASRC = DISCOPS
*XDIM_MEMBERSET FLOW = FOPE,FACT,FCLO
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET PROFITCENTER = <ALL>
*XDIM_MEMBERSET SCENARIO = <ALL>
*WHEN ACCOUNT
*IS %DA%
*REC(EXPRESSION = 0)
*ENDWHEN
0
Show more comments
Vadim Kalinin Dec 27, 2017 at 11:14 AM
0

Please read: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

Your question is like: My script is not working, but I don't want to provide full info!

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

full script added.

0

Not full script only, BUT FULL INFO in line with:

https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues

Please read this blog again!

0

More details added in the question.

0

Read my blog again. The required info is still missing! I do not want to spend my time to ask the same questions again and again.

0

added all the info.

0

Still, something is not clear:

Which model is used to launch the main script? Dimensions of this model?

Not clear: “Entity Property.[DISCOPS_HFS] = other than blank was used , now the business has removed this property“

What do you need by remove?

0

Model = Finance , Dimension list already shared in point 2. Sorry it was not clear. Initially property was DSICOPS_HFS="A", now if we remove this property it will become DISOPS_HFS="" .

0

“Remove property” means removing property at all, looks like you are talking about removing particular property value. Please use correct wording.

0

Yes, you are right. Next time, I'll keep this in mind.

0

Read my comment about skipnullcheck

0