Skip to Content
0
Former Member
Mar 27, 2007 at 05:46 AM

Clear BPS variables values

26 Views

I wrote an ABAP program to clear BPS variables values defined for the user.

      DATA:
      lr_variable TYPE REF TO cl_sem_variable.

* Get variable instance
      CALL METHOD cl_sem_variable=>get_instance
        EXPORTING
          i_area       = I_AREA
          i_variable   = 'ZPVDEP' "z_v_var
        RECEIVING
          rr_variable  = lr_variable
        EXCEPTIONS
          not_existing = 1
          OTHERS     = 2.

      IF sy-subrc <> 0.
* do s.th., eg send a message
        EXIT.
      ENDIF.

* delete the restrictions
      CALL METHOD lr_variable->set_user_restriction
        EXPORTING
          i_user   = sy-uname
          i_delete = 'X'
        EXCEPTIONS
          failed   = 1
          OTHERS   = 2.

In BPS0:

1. i restrict the variable with some values

2. execute planning function to clear the variable values

But the restriction remains.

3. When i do /nBPS0 the variable restriction clears

As far as i understand the problem is in buffer. How can i clear buffered values of the variable in ABAP program?

i tried to call method CL_SEM_VARIABLE=>RESET_BUFFER.

but it doesn't work.

Thanks