cancel
Showing results for 
Search instead for 
Did you mean: 

SEM-BPS Variable with exit function

Former Member
0 Kudos

Hi,

this is my problem. I use a variable for period and I increment the variable dinamically in a sequence of execution. When I try to read the variable with a exit function, the function is only called the first time and return ok the value, but the next time the function not called and the value is returned from the buffer (I think this, because always is the same value).

How can I change this? I need to my function return the variable value, because is changed.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Anand can you post an example of a custom ABAP solution to incrementate my variable? You are ok, and is possible that my problem occurs because I don't use a correct implementation to incrementate my variable.

Thanks for your help.

Former Member
0 Kudos

Hi,

The reason I had asked about the custom program behind all this as there's a method CL_SEM_VARIABLE=>RESET_BUFFER that can be called to reset buffer.

thanks

Former Member
0 Kudos

Hi Anand,

you are right. I solve my problem changing the code of the exit function to incrementate my variable. I use the methods of cl_sem_variable class and, when the variable is incremented the buffer refresh, and my sequence running ok.

Thanks to all for your help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

thanks for replys.

I think the problem occurs after update the patch level to level 15. This is the code of class_constructor in class cl_sem_variable:

method CLASS_CONSTRUCTOR.

*

  • data ls_dark type upc_dark2.

  • select single * from upc_dark2 into ls_dark

  • where param = c_param_dark_buffer.

  • if sy-subrc = 0 and ls_dark-value = 'X'.

m_buffer = 'X'.

  • endif.

*

endmethod.

The flag m_buffer is always X and for that reason my the value of the variable is read from the buffer and the exit function for read variable isn't called.

What do yo think about this?

Thanks.

Former Member
0 Kudos

Hi,

You are correct the variable value will be read from the buffer, can you please let us know the functionality beind incrementing the value, as if it's fox you can use one of the commands to do the same.

thanks

Former Member
0 Kudos

Thanks for your reply.

The value of the variable are incremented ok with an exit function, I sure about this. The problem is when I try to read the value with other exit, because this function is only called the first time.

This is my secuence:

Incrementate variable(OK)->Read variable(OK)

->...(other functions)........ ->Incrementate variable(OK)->Read variable(failed, return the same value as the first time).......

Thanks.

Former Member
0 Kudos

""""Incrementate variable(OK)->Read variable(OK)

->...(other functions)........ -><u><b><i>Incrementate variable(OK)</i></b></u>->Read variable(failed, return the same value as the first time).......""""

Where the highlighted code is written...

Is this a custom ABAP solution calling the API's for processing data ?

thanks

Former Member
0 Kudos

Hello Ivan,

Why dont you use the option to increment the variable value locally instead of updating the value globally?

In case you have the need to change the value globally, you would have to save the data generated and restart the process.

One option of achieving that is by using a planning sequence and repeating the steps for the number of iterations you desire.

Sunil