cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BPC NW 10 - Passing variables from DM to logic script, then BADI

Former Member
0 Likes
618

Hi All,

I am working on a custom package, which allow user to enter a flag, then pass the flag to badi for calculation.

I have created a custom badi using UJ_CUSTOM_LOGIC and pass the flag using table REPLACEPARAM.

But it is fail to pass the flag to badi, below are the sample coding:

Coding in DM:

PROMPT(TEXT,%VAR1%,,,)

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(ZTEST,TAB,%TAB%)

TASK(ZTEST,EQU,%EQU%)

TASK(ZTEST,SUSER,%USER%)

TASK(ZTEST,SAPPSET,%APPSET%)

TASK(ZTEST,SAPP,%APP%)

TASK(ZTEST,SELECTION,%SELECTION%)

TASK(ZTEST,REPLACEPARAM,ZVAR1%EQU%%VAR1%%TAB%) TASK(ZTEST,LOGICFILENAME,ZLOGIC_SCRIPT.LGF)

Coding in logic script:

*START_BADI ZBADI

ZVAR1 = $VAR1$

*END_BADI

Coding in Badi:

data : wa_param type ujk_s_script_logic_hashentry.

data : it_test type STANDARD TABLE OF ZTABLE " temp table for checking
, wa_test like line of it_test
.

read table IT_PARAM with key HASHKEY = 'ZVAR1' into wa_param .
if sy-subrc = 0.

wa_test-ztest = wa_param-hashvalue.
append wa_test to it_test.
modify ZTABLE from table it_test.
endif.

And the ZTABLE gives the result as $VAR1$

Don't know why the name of the variable is passed to the temp table instead of variable value.

Thank you in advance for your help.

Regards,

Kelvin

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Vadim,

Thanks for your response.

We use ZTEST chain because of internal IT policy, a custom logic script need to call by a custom chain.

I have changed to use standard /CPMB/DEFAULT_FORMULAS and test if the parameter is passed to the script.

But I want to know if we can pass characters from DM to script instead passing number?

Our BW version are: SAP_BW 740 Patch:0021

EPM version : 10.0 SP33

CPMBPC 810 Patch:0015

former_member186338
Active Contributor
0 Likes

"internal IT policy, a custom logic script need to call by a custom chain." - sorry, but absolutely senseless! Always use standard chain - you custom chain can be incorrectly configured!

And what is the result with standard chain?

"But I want to know if we can pass characters from DM to script instead passing number?" - yes, we can! I do not see any issues!

former_member186338
Active Contributor
0 Likes

Why you are using ZTEST chain?

Use standard /CPMB/DEFAULT_FORMULAS

First ensure that parameter is passed to very simple script without badi...

Post your BPS & BW version and SP