cancel
Showing results for 
Search instead for 
Did you mean: 

Clear BPS user-specific variable values

Former Member
0 Kudos

Hi,

Is there a way to quicly delete all the variable values (user ID and cost center) for a user-specific variable in BPS without access to the configuration (BPS0) or do I need to write a small piece of ABAP for that ?

Thanks

David

Accepted Solutions (1)

Accepted Solutions (1)

gerd_schoeffl
Advisor
Advisor
0 Kudos

Hello David,

You either have to access the BPS0 and delete each of the variable values or write a little ABAP program. You could include this ABAP in a planning function type Exit so the user can press a button in a web interface or planning folder to delete the settings. The coding using internal methods you need is:

DATA:

lr_variable TYPE REF TO cl_sem_variable.

  • Get variable instance

CALL METHOD cl_sem_variable=>get_instance

EXPORTING

i_area = 'name of area where the variable is defined'

i_variable = 'name of the variable'

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 = 'user name, e.g. sy-uname'

i_delete = 'X'

EXCEPTIONS

failed = 1

OTHERS = 2.

Best regards,

Gerd Schoeffl,

SAP NetWeaver RIG BI

Former Member
0 Kudos

Thanks very much.

I tried to reward you the points but I keep getting an error message:

ID-1 is not valid

Invalid mode

David

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

We are using transaction UPSPL in order to perfrom PBS folder .

We activated function exit for enhancing user defined variable .

We used method :

cl_sem_variables=>get_instance

then we used methode to get instance attribute (gr_var is the instace )

gr_var->get_attribute

then we change the user variables as requierd , and set them using method :

gr_var->set_attribute

as the user perfroming the function ( via ICON ) the values are displayed and set on the screen properly , but …..

when the user hit the SAVE icon in order to save the variable – the data is lost and not saved .

can you help me ?!?!?