cancel
Showing results for 
Search instead for 
Did you mean: 

KEYWORD runlogic in BADI: works in UJKT but not working in script logic

Former Member
0 Kudos
173

Hi, Gersh, Zane, and everyone,

I am implementing runlogic to improve performance of script logic.

I have something like

*START_BADI RUNLOGIC

QUERY = OFF

WRITE = ON

LOGIC = INIT_FCST_PROF.LGF

APPSET = 08092011_PBI

APP = PROFITABILITY

DIMENSION ENTITY = BAS(CO_1010)

DIMENSION RPTCURRENCY = USD, LC

DIMENSION ACCTDETAIL = F_CLO

DIMENSION TIME = 2011.SEP

CHANGED = ENTITY

DEBUG = OFF

*END_BADI

this works fine in UJKT simulation, validating and execution.

however when I insert this into script logic, it failed in log (the DM status shows successfully finished in 2-3 seconds)

checking the log,

LOG BEGIN TIME:2011-10-25 09:03:30

FILE:\ROOT\WEBFOLDERS\08092011_PBI\ADMINAPP\PROFITABILITY\TESTCALL_SCRIPT.LGF

USER:Z\GYCHEN

APPSET:08092011_PBI

APPLICATION:PROFITABILITY

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

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CUSTOMER 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:ENTITY WILL QUERY ON ALL BASE MEMBERS.

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

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

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

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

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

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

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

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

EXECUTION BADI:RUNLOGIC

QUERY: OFF

WRITE: ON

Error in RUNLOGIC call.

BADI EXECUTION TIME IN TOTAL :367.96 ms.

SCRIPT RUNNING TIME IN TOTAL:1.04 s.

LOG END TIME:2011-10-25 09:03:31

There are two errors here:

1. it was not able to read the dimension member I put in script logic.

2. it says error in RUNLOGIC call.

for connection from DM to process chain, I am just using default formula process chain. this in on BPC7.5 NW version.

George

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Gersh,

thanks for the clarification.

now I have two more questions,

1. it seems that I have to have *XDIM_MEMBERSET AAA in front of *START_BADI, i.e. in my calling script

*XDIM_MEMBERSET AAA

*START_BADI

*DIMENSION BBB

*END_BADI

if I do not put *XDIM in front, it will not recognize the scope from DIMENSION BBB and says "error in runlogic", however it did read the appset and application.

is this true? because when I read your PDF HOW TO GUIDE, It does not show the *XDIM in front of *START_BADI

see a typical log I got below:

******************************

LOG BEGIN TIME:2011-10-24 15:43:18

FILE:\ROOT\WEBFOLDERS\08092011_PBI\ADMINAPP\PROFITABILITY\TESTCALL_SCRIPT.LGF

USER:ZV\GYCHEN

APPSET:08092011_PBI

APPLICATION:PROFITABILITY

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

[WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CUSTOMER 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:ENTITY WILL QUERY ON ALL BASE MEMBERS.

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

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

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

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

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

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

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

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

EXECUTION BADI:RUNLOGIC

QUERY: OFF

WRITE: ON

Error in RUNLOGIC call.

BADI EXECUTION TIME IN TOTAL :984.08 ms.

SCRIPT RUNNING TIME IN TOTAL:1.55 s.

LOG END TIME:2011-10-24 15:43:19

*****************************************

I can definitely bypass this issue by adding *XDIM AAA in front. let me know if what you think.

2. variable declaration.

my question is

in calling_script.lgf

*select (%variable% ... )

*XDIM_MEMBERSET ...

*START BADI

...

*DIMENSION ... %variable%

*END_BADI

then in called_script.lgf, I CANNOT use %variable%, I have to either redeclare variable using *SELECT statement or *INCLUDES, right? like

called_script.lgf

*SELECT(%variable%...)

*XDIM ...

*WHEN

...

*ENDWHEN

is this correct?

George

former_member186338
Active Contributor
0 Kudos

Hi, George,

If we have scoped some dimension inside BAdI in the calling_script.lgf:

*START BADI

...

*DIMENSION AAA %variable%

*END_BADI

In the called_script.lgf you can use the following (assuming that %AAA_SET% will be equal to %variable%):

*XDIM_MEMBERSET AAA AS %VARIABLE% = %AAA_SET%

And later use %VARIABLE% in another BAdI inside called_script.lgf

B.R.

Vadim

Former Member
0 Kudos

thank you Vadim. Now I am clear on this issue. DIMENSION inside *START_BADI will pass the variable into the called script.

George

Former Member
0 Kudos

now I figured out.

before start_badi,

I need to do *XDIM_MEMBERSET xxxxxx to define the scope in calling script.

but here I have another question.

with the following structure

calling script:

*XDIM_MEMBERSET AAA

*START_BADI RUNLOGIC

...

LOGIC: SCRIPT1.LGF

...

DIMENSION ... = BBB

*END_BADI

SCRIPT1.LGF:

*XDIM_MEMBERSET CCC

...

Here what is the relationship among AAA, BBB, and CCC?

Do we need CCC?

can script1.LGF use some variables defined in calling script? sth. like customer defined %vyear% ... ?

I assume AAA > BBB > CCC in scoping and

BBB is not required,

CCC is not required.

please enlighten me.

George

former_member200327
Active Contributor
0 Kudos

Hi George,

RUNLOGIC should accept both definitions of scope - via XDIM_MEMBERSET as well as in DIMENSION.

If you define scope just in XDIM_MEMBERSET - it will be taken. You can re-define it in BAdI call using DIMENSION. In that case BAdI will work with scope defined in the call while the calling script will keep XDIM_MEMBERSET scope.

If you redefine that scope inside the called script then that script will run using that internally defined scope.

So, if all 3 definitions define same set than definitely just one definition should be enough. Which one to use depends on the goal you are trying to achieve.

You can pass %...% variable to the script you call via DIMENSION parameter of RUNLOGIC.

Hope this helps.

Regards,

Gersh

former_member186338
Active Contributor
0 Kudos

Dear Gersh!

Is it true, that if I define scope before calling RUNLOGIC, I do not need to mention the scoped dimensions inside *START_BADI RUNLOGIC - *END_BADI? Only <none> for dimensions, not existing in the RUNLOGIC application and some members for dimension that are absent in the script application and present in RUNLOGIC application?

By the way, if you use %SOMEDIMNAME_SET% variables in the DIMENSION parameter of BAdI - the script will not validate.

former_member200327
Active Contributor
0 Kudos

Hi Vadim,

Yes, that is true: you have to put DIMENSION in RUNLOGIC only if you want to change scope for Dimension that is in both Applications, or if Dimension doesn't exist in the target Application or doesn't exist in the source Application.

Issue with %DIMNAME_SET% and %DIMNAME_DIM% validation has nothing to do with RUNLOGIC. You'll have same error if you use those variables for any other BAdI. Problem is that validation doesn't resolve those variables and for BAdIs it check that there is some value to the right of the equal sign. Hence even though it doesn't validate it should work fine.

An issue can come up if in the called script you have call other BAdI with those variables because RUNLOGIC checks it in validate mode before calling.

Regards,

Gersh

Former Member
0 Kudos

Gersh,

thanks for your message.

now I think

1. in my previous example in terms of scope, AAA > BBB > CCC

meaning definition AAA before BADI should be bigger than DIMENSION BBB inside BADI, and DIMENSION BBB inside BADI should be bigger than the called script scope CCC.

we cannot make CCC bigger than AAA or BBB, is that right?

2. if I have defined variable in calling script, then I have to reclaim them in called script or

*includes calling script so that called script can understand these variables, correct? that's what I am doing now,but need your comment on this.

e.g.

calling_script.LGF

%variable%

*STATRT_BADI RUNLOGIC

LOGIC = TEST1.LGF

*END_BADI

TEST1.LGF:

*includes calling_script.lgf

when %variable%

xxx

endwhen.

former_member200327
Active Contributor
0 Kudos

Hi George,

No, each new scope definition is just a redefinition, i.e. it has nothing to do with the preceding definition: it could contain it, can define a subset, can overlap or can have nothing in common - no restrictions.

If you want to pass some set from the calling script to the called script the easiest way to do it is to put DIMENSION ABC= %VARIABLE% in RUNLOGIC and *XDIM_MEMBERSET ABC = %ABC_SET% in the called script.

Regards,

Gersh