Skip to Content
0

BEx Variables Problem

Sep 13, 2017 at 02:19 PM

160

avatar image
Former Member

Hello,

I want to process a customer exit variable wherein I can call both I_step =1 and I_step2 .

In istep1,i will set default values for the variable and in istep2 I will derive the value from another variables input.

Problem is when I run the Query,it only takes the default value set by istep 1. Istep2 is not being executed at all.

I have tried writing both isteps in different cases in CMOD but no change.

My Variables is Not ready for input and Customer exit.

Any Suggestions on this. Need a workaround urgently.

Regards,

Aditya

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

2 Answers

Best Answer
Torsten Kessler
Sep 17, 2017 at 04:54 AM
0

Hi,
I'm not sure it's been a long time since I've been using queries.
But I would say i_step 1 is not necessary for a not Input ready variable. A Default value is not needed because the variable is nevere be shown to the user.
So you can do everthing in the i_step 2.
May be the variable handling skip i_step 2 if the variable already been handeld in i_step 1?
But I'm not 100% sure. Try to handle the variable only in i_step 2.
If you sure the variable is set to not-Input-ready and part of the query and would not be handled in i_step 2 it's sounds like an error.
In that case I would open an incident.
Torsten

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks for the reply torsten.

The variable is not ready for Input but we want both i.e a default value when query selections appear and then a dynamic value when a query runs.

So to achieve this, we wrote istep1 for default value and istep2 for dynamic value.

The problem is we are using this variable for currency translation in Planning Function in Integrated planning. So unless we give a default value to this Variable, it throws an error saying Variable has to be restricted to Single Value.

But our code in cmod,executes istep1 only.

Is it that only one istep is executed for a variable?

0
Loed Despuig Sep 18, 2017 at 12:24 AM
0

Hi,

Can you please post here your code so we can check if there is any code issue?

Regards,

Loed

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,

Heres the code

Case i_vnam.

When = 'YGC'.

If i_step =1.

L_s_range-low = 'INR'.

L_s_range-Sign = 'I'.

L_s_range-opt ='EQ'.

append l_s_range to e_t_range

Endif.

If istep =2.

Read table i_t_var_range into loc_var_range with key v_nam = 'ZCCode'.

Select single ZCurr from Ztab into ZGC where

ZCCode = loc_var_range-low .

Loc_var_range-low = ZGC.

L_s_range-Sign = 'I'.

L_s_range-opt ='EQ'.

append l_s_range to e_t_range

Endif.

Endcase.

Problem is its not going to Istep 2 at all. We have tried different cases as well but no results

0

Hi,

As you have said, the variable is NOT READY FOR INPUT therefore it will not go to I_STEP = 2.

Can you explain what do you really wanted to achieve? How come you wanted to use I_STEP = 2 but variable you are using is not input ready?

Regards,

Loed

0
Former Member

Because I don't want this variable in the selection screen.

Even if I make this variable ready for input then also the variable executes the Query with the default value in istep1 only,it doesn't get the istep2 value.

My Scenario is ,for a variable, I want a default value and then based on comp code fetch a dynamic value.

0

I'm not sure if it a copy and paste error but in case the coding you're posted is the original one please check you IF statement

If istep =2.

You must use I_STEP not ISTEP.

Torsten

0
Former Member

Code is fine. Just pasted wrongly.

0

Hi,

try to add the bold marked line and try again.

Torsten

Case i_vnam.

When = 'YGC'.

If i_step =1.

L_s_range-low = 'INR'.

L_s_range-Sign = 'I'.

L_s_range-opt ='EQ'.

append l_s_range to e_t_range

c_check_again = 'X'.

Endif.

If istep =2.

Read table i_t_var_range into loc_var_range with key v_nam = 'ZCCode'.

Select single ZCurr from Ztab into ZGC where

ZCCode = loc_var_range-low .

Loc_var_range-low = ZGC.

L_s_range-Sign = 'I'.

L_s_range-opt ='EQ'.

append l_s_range to e_t_range

Endif.

Endcase.

2
Former Member

This Worked.

Instead of c_check_again = 'X' it is E_check_again = 'X'.

Query is now going to istep2. I just had to add Comp Code default value to make it work.

Thank you so much everyone and Tornsten :)


0

Hi,

I'd tested it in the BAdI implementation and here the parameter is changed to c_check_again.

You can read more about that in my blog

https://blogs.sap.com/2014/08/04/coexistence-of-badi-rsroavariablesexitbadi-and-exit-exitsaplrrs0001/

Torsten

1