cancel
Showing results for 
Search instead for 
Did you mean: 

Pass through Non-Dimension variable parameters from Data Manager Package to BADI

former_member201314
Participant
0 Kudos

Hi guys,

Question:

is it possible to pass through a parameter of a freely defined variable (that is not referring to a dimension) from a Data Manager Package to a BADI?

Idea:

The idea is to set a tick box as part of the Data Manager Parameters and pass this ON / OFF parameter to the BADI in order to control the execution of the program code.

Example:

The DMP includes the variables STEP_1 and STEP_2. Both variables can be activated (via tick box) - in our case only STEP_1 gets the tick, STEP_2 remains initial (unticked).

Upon release of the DMP, both parameters (STEP_1 = ON, STEP_2 = OFF) get passed through via the process chain and script logic to the BADI, which consists of two processing steps. Program-Step 1 and Program-Step 2.

Upon runtime,

- the BADI checks the parameter for the variable STEP_1 and processes Program-Step 1 since the parameter is set to ON,

- whilst process Program-Step 2 won't get processed since the parameter for variable STEP_2 is OFF.

Thanks for your input

Cheers

Claus

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Claus,

Question: - Answer - Yes!


No issues


Vadim

former_member186338
Active Contributor
0 Kudos

For example:

You have variables $STEP_1$=ON and $STEP_2$=OFF (filled by DM prompts). Then:

*START_BADI SOMEBADIFILTERNAME

   QUERY=ON

   WRITE=ON

   STEP_1=$STEP_1$

   STEP_2=$STEP_2$

*END_BADI

Vadim

former_member201314
Participant
0 Kudos

Thanks heaps, Vadim!

Just allow two more questions:

(1) Apparently, it is not possible to combine multiple CHECKBOX prompts in one DM page. Is that correct from your point of view or am I missing something?

(2) When introducing the DM Prompts and hence %variables%, is there anything to declare in the DEFAULT_FORMULA - process chain, or is ist just sufficient to reference these variables in the script logic as outline in your answer?

Cheers

Claus

former_member186338
Active Contributor
0 Kudos

1. Just test... RADIOBUTTON also can be used!

2. If you use PROMPT to store some user selected text in %VAR1%, %VAR2% then you have to use something like:

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,VAR1%EQU%%VAR1%%TAB%VAR2%EQU%%VAR2%)

Then in script you will be able to use $VAR1$, $VAR2$

Vadim

former_member201314
Participant
0 Kudos

Hi Vadim,

sorry - I need to come back to you once more.

Unfortunately, I cannot get this Checkbox Parameter passed through to the BADI.

--------------------------------------------------

What have I done? (Variable name = %GUESS_A%)

DMP:

PROMPT(CHECKBOX,%GUESS_A%,Guess A)


Process Chain /CPMB/DEFAULT_FORMULAS_LOGIC Step Run Logic :

no change


Script Logic:

*START_BADI XYZ

...

QUERY = ON

WRITE = ON

GUESS_A = (%GUESS_A%)

...

*END_BADI


----------------------------------------------------

I don't know what's missing, however could imagine that some declaration in the Process Chain Step might be missing. (DMP calls Process Chain, Process Chain calls Script Logic, Script Logic calls BADI)

Could it be that the variable %GUESS_A% needs to be declared in the Run_Logic parameters?

And / or is there a task missing in the DMP?

Thanks for your time, Vadim!

Cheers

Claus

former_member186338
Active Contributor
0 Kudos

Sorry, but looks like you have incorrect DM advanced script and incorrect script logic!

Please provide full DM advanced script!

Look on CHECKBOX syntax - the variable will contain only 0 or 1:

CHECKBOX Prompt() Command - SAP BusinessObjects Planning and Consolidation - SAP Library

Script Logic:

*START_BADI XYZ

...

QUERY = ON

WRITE = ON

GUESS_A = $GUESS_A$

...

*END_BADI

Variable in $$!!

Vadim

former_member201314
Participant
0 Kudos

Hi Vadim,

same result, still can't get it to work:

What's been passed trhough to the BADI's  IT_PARAM is

based on selections ACT für Category_KD and 2014.01 for TIME_KD.

The thing is that the parameter for GUESS_A reads $GUESS_A$ and not '1' as assumed based on the Tick Box selection parameter:


DMP "EXECUTE_SPLIT_GUESS_KD":

(SELECTINPUT,,,,"%CATEGORY_DIM%,%TIME_DIM%")

(CHECKBOX,%GUESS_A%,Guess A,1)

(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)

(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)

(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%)

(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,EXEC_SPLIT_GUESS.LGF)


Process Chain /CPMB/DEFAULT_FORMULAS_LOGIC Step Run Logic :

Script Logic "EXEC_SPLIT_GUESS.LGF":

//The first step is the scope setting
*XDIM_MEMBERSET CATEGORY_KD = %CATEGORY_KD_SET%
*XDIM_MEMBERSET DATEN_TYP_KD = INPUT_KEY, BASIS_VALUE              
*XDIM_MEMBERSET TIME_KD = %TIME_KD_SET%

*START_BADI KD_SPLIT
CATEGORY_KD = (%CATEGORY_KD_SET%)
TIME_KD = (%TIME_KD_SET%)
QUERY = ON
WRITE = ON
GUESS_A = $GUESS_A$

*END_BADI

Thanks again for your valueable ideas and help!

Really appretiate it!

Claus

former_member186338
Active Contributor
0 Kudos

Hi Claus,

"Please provide full DM advanced script!"

Without TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM in my prev answer it will not work!

Vadim

former_member201314
Participant
0 Kudos

Thanks Vadim - I thought that was applicable just for Text Variables.

I'll give that a go asap and keep you updated with the outcome.

Have a good weekend.

Claus

former_member186338
Active Contributor
0 Kudos

Something like:

PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%,%TIME_DIM%")

PROMPT(RADIOBUTTON,%GUESS_A%,"Select whether to perform step A",1,{"Yes","No"},{"ON","OFF"})

PROMPT(RADIOBUTTON,%GUESS_B%,"Select whether to perform step B",1,{"Yes","No"},{"ON","OFF"})

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%)

TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,GUESS_A%EQU%%GUESS_A%%TAB%GUESS_B%EQU%%GUESS_B%)

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,EXEC_SPLIT_GUESS.LGF)

Vadim

former_member201314
Participant
0 Kudos

Thanks heaps, Vadim!

Answers (0)