cancel
Showing results for 
Search instead for 
Did you mean: 

When running from DMP can't read parameters from Badi

lauraquinterosa
Participant
0 Kudos

Dear experts,

I'm new to BPC. I'm using BPC 10 NW. I've implemented a new Badi for UJ_CUSTOM_LOGIC. This Badi is executed from Data Manager in a package.

I have an issue when reading parameters from IT_PARAM internal table within the Badi.

Script that runs from a package in Data Manager:

Abap code that read the parameters table it_param (it comes through the interface in method execute):

As you can see is a simple read table.

Issue:

If I run it from DM this above read fails (sy-subrc=4) and can't read my parameters.

But if I run it from UJKT it executes fine (sy-subrc=0) and reads my parameters ok.

UJKT run:

DM run:

I can't figure out why it behaves differently?

It's not to do with the read statement as it works fine from UJKT.

Am I missing something from DM side? May be some permissions?

Anybody experienced this ever? Any clues?

Thanks and regards,

Laura

Accepted Solutions (1)

Accepted Solutions (1)

former_member185511
Active Participant
0 Kudos

why you use extra move statement ?

what is the content of LWA_PARAM here ? (on your DM debugging screen)

why you are not directly checking

if lwa_param-hashvalue <> 'OFF' ?

lauraquinterosa
Participant
0 Kudos

Hi Bilen,

I could remove the MOVE stmt and just check the value but the issue would still persist:

not being able to read the value itself when running from DM.

Thanks,

Laura

former_member185511
Active Participant
0 Kudos

ok dont worry we will resolve it

try the extra safest metod.

put your "while" code above the "read table" statement.

and here

check IT_PARAM again and be sure QUERY=OFF is there

after READ statement please double click on la_param and check the QUERY parameter.

one possibility is, maybe there are spaces and DM is sending with to many space to IT_PARAM but in UJKT it maybe deleted already so lets be sure about it.

if still you get sy-subrc = 4 or 8 (please check also after read statement )

start a loop and check the lwa_param-hashvalue.

>>>please check here al the values and parameters

loop at it_param into lwa_param.

endloop.

lauraquinterosa
Participant
0 Kudos

Hi Bilen

I did try the loop..endloop with the same results although I didn't look for extra spaces.

I will try it and let you know. I didn't think of DM putting extra spaces in it.

Thanks!

former_member185511
Active Participant
0 Kudos

dm doesn't put space normally maybe the consultant who wrote the SL wrongly put extra spaces or any other problem.

Because, the UJKT script logic is given by BPC consultant i think, and you don't have access to BPC Web Admin i assume ? is it like that ?

So best way is, just do a loop-endloop and check all the parameters one by one with HASHVALUE and HASHKEY in LWA_PARAM .

Or give me remote access i check coz i also get crazy it is not possible.

lauraquinterosa
Participant
0 Kudos

I do have access to BPC Web Admin as I needed to check the script provided by the consultant to rule out an error there.

I have posted previously the script logic file in use. Do you see any errors in it?

Thanks!

former_member185511
Active Participant
0 Kudos

no it is correct

but loop endloop will give you answer.

comment all your code.

use this.

while sy-subrc = 0.

endwhile.

* when you go in debug, set subrc=4 here and let while to finish.

loop at IT_PARAM into LWA_PARAM.

break-point.  <<<<here please check what you have in LWA_PARAM-HASHVALUE and LWA_PARAM-HASHKEY in all loop cycles and see what you have in QUERY. Because as i see from your screenshot QUERY=OFF is there.

endloop.

lauraquinterosa
Participant
0 Kudos

Hi Bilen,

The issue was caused by the spaces before and after the equal sign in the logic script file.

You were right!!

I removed them from the script in BPC Web Admin tool and re run the package from DM and it worked.

Somehow, when running a package that it's not the default logic it adds spaces randomly to the parameters or betted said it just doesn't remove them.

Strange! as this is not the case for the scripts running in default logic or from UJKT where I'm using the very same script provided by the consultant with the spaces before and after the equal sign and they work.

May be it's like you said before: it remove the spaces automatically in those cases?

But for sure it's not removing the spaces from the script running from a package.

Thank you very much!

lauraquinterosa
Participant
0 Kudos

Hi Bilen,

Do you want to hear something odd?

I tried to reproduce the issue again adding the spaces before and after the equal sign on every parameter and it worked ok anyway (???)

But previously didn't work at all, the images I posted at the beginning of my post proves it.

Do you know of some known issue in regards to the refresh with BPC 10 NW? and is it possible that this occurred because I'm working inside a Citrix box?

Just wondering to prevent this from happening in the future..

Thanks a lot for your advice!! it did work although now I can't reproduce the issue again.

former_member185511
Active Participant
0 Kudos

that is strange, i am thinking how it is possible but maybe there was tab ? becase tab also seen as space on textedit but maybe in the backend causing some problems . It is hard to reproduce the problem.

If you check standard CL_UJK_RUN_LOGIC, they are using some regular expressions, wild cards to catch the parameters entered to the script logic. Maybe one of the space which wasn't a space originally caused this error.

I didn't have this problem in my BPC projects but i had a one spacing problem for one of the master data member.

ID was 'PRODUCT1' but actually it was stored as ' PRODUCT1' or 'PRODUCT1 ' . There was space in the beginning or end something like that . I was throwing my computer from the window because read table was not working.
anyway i don't think you will have problems like that, really hard to face.

good luck.(you need a bit )

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Laura,

Why do you want to check if QUERY is OFF?

those are hardcoded into the logic script, you just need to make sure they are OFF in the LGF file.

try use READ TABLE it_param WITH KEY hashkey = 'QUERY'

don't use TABLE KEY.

Andy

lauraquinterosa
Participant
0 Kudos

Hi Andy,

Why do you ask why do I check for QUERY = OFF? I was told that in order to read from the cube instead of using the data that comes in CT_DATA I need to set this parameter to OFF. Is that correct? I'm barely new to BPC and the way it works.

Regarding the READ TABLE stmt now I'm using WITH KEY in my last version of the code.

However, I've tried WITH KEY and WITH TABLE KEY as well and didn't worked.

Somehow, running from DM was adding some spaces from the script although this seems to be some random behaviour?? when I removed the spaces before and after the equal sign in every parameter in the script it worked.

I tried putting back the space to make it fail again and it didn't fail!

Is there any know issue related to the refresh in BPC front-end or is it needed to log off/on from BPC Web Admin and BW system (Abap) as well with every change and I'm not aware of?

Thanks!

Former Member
0 Kudos

Hi Laura,

Yes, query=off means that you need to read the BPC model yourself, you usually hardcode in the LGF file, so I don't know why you need to check in your code again. all you need to do is to make sure in your LGF file that QUERY=OFF.

That is very strange, I think maybe its because you copy and paste it from somewhere initially, and space is not really a space, in future maybe try to delete spaces and retype again.

Andy

former_member185511
Active Participant
0 Kudos

"all you need to do is to make sure in your LGF file that QUERY=OFF."

yes she is trying to proof/check it on the code

Former Member
0 Kudos

I know that, I just think that is a wasted step.

If QUERY = ON in the LGF, then by the time you get to the BADI it already load all the data from the Model, so if you check in BADI or not, the data already been read, thus time wasted!

QUERY = on is already executed before you do a check in the BADI.

Andy

former_member185511
Active Participant
0 Kudos

calm down champion i understand you.

Former Member
0 Kudos

I'm very calm, I know you understand me, but you need to understand BPC , not me.

former_member185511
Active Participant
0 Kudos

lol no worry. we are a perfect couple with BPC. we understand each other.

let me know if you need help in cape town

Former Member
0 Kudos

ah, we would of been working together if I took the job in Malaysia.

former_member185511
Active Participant
0 Kudos

ah good good

you can contact me gmail : bilencekic @

lauraquinterosa
Participant
0 Kudos

Alright guys

Happy Monday! (at least in this part of the world)

I understand what you mean with double checking the value of query.

To be honest, here they check query and write like this so I copied it from previous badis because as I mentioned before I'm still learning BPC as I'm new to BI/BW world. I will not check its value from now on if it's a waste of time

Thanks for sharing your knowledge!

Today the consultant showed me how she copied the script. She copied from the comment block from my code to Excel, from there she edit it and then copy it to the logic script file. That's how we've got the extra random spaces in it! although you don't get to see them in the script.

Lesson learnt: don't copy and paste it, write it yourself in the logic script file.

Thanks a lot for your recommendations/suggestions Andy and Bilen!

Cheers!

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Maria,

You can try

QUERY = ON

WRITE = ON

Go through the following link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f4252d-98ca-2b10-e689-f85085ae2...

Shrikant

lauraquinterosa
Participant
0 Kudos

Hi Shrikant,


Thanks for your input however the requirement is to implement a custom logic badi not a process chain and I'm passing my parameters in a proper manner as they work on UJKT.

The badi works fine when triggered from UJKT or an input schedule but it doesn't read its parameters when executing from Data Manager.

Even more, it happens only for this badi as I've tested other badis with the same reading logic and they work from DM. I have deleted and re created this badi and the result is the same; the reading statement fails and as you can see is a really simple read statement therefore there is some else either around the package or around the badi that I'm not seeing.

Thanks

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Maria,

Kindly share the Advance data manager script of this DM

Shrikant

lauraquinterosa
Participant
0 Kudos

Hi Shrikant,

Would you guide me in how to acquire it? as I'm a developer not a BPC consultant.


I can access the script logic file (.LGF) for this process:

*START_BADI ZBC_5000_PLAN_01_006

TIME = %TIME_SET%

ACCOUNT = 100000,100100,100200,100300,100400,100500,100600,100700

READ_DS = FILE

WRITE_DS = AUTOPOST

QUERY = OFF

WRITE = OFF

*END_BADI

Thank you very much.

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Maria,

Data manager tab - organize - organize package list - select your DMP - right click - modify package -modify script - advanced .

Also share the data manager log

Shrikant

Former Member
0 Kudos

don't waste your time with advanced script.

Its your ABAP code not working.