cancel
Showing results for 
Search instead for 
Did you mean: 

SNP Macros: How to know if planning book is in change or display mode ?

thomas_schulze2
Active Participant
0 Kudos

Hello experts,

I have a simple macro in an SNP planning book assigned to a button. The user can press this button any time to run the macro. I want to avoid that the macro is executed if the planning book is in "Display" mode, meaning the macro should only run if the planning book is in "Change" mode". I couldn't find a respective macro function in SAP's SCM library ... any idea here ?

Regards

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

Hi,

There is no direct macro function to check planning book is change or display mode.

But you can try with macro function DATA_IS_LOCKED()

DATA_IS_LOCKED returns the value 1, if the data is locked for the current user, meaning they can edit the data. It returns the value 0, if the data is locked by another user, meaning the current user cannot edit the data.

.

Regards,

Sunitha

thomas_schulze2
Active Participant
0 Kudos

Hello Sunitha,

DATA_IS_LOCKED works perfects for this purpose. Thanks !

Regards

Thomas

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi !

This answer was also very useful  to me in correcting the macro to behave the way we wanted and generate a message.

I have one more requirement.

Is it possible to  select all the objects by the macro when it is run by the user.

Thank you in anticipation.

Tarak Shah

Former Member
0 Kudos

Hi Thomas,

I checked, unfortunately we donot have a function to verify cell is editable or not.

However, pls try below function.

CALC_ERROR

CALC_ERROR returns the value X if an error has occurred during execution of the macro.

-


Check if macro returs 'X' in case of execution in display mode.

Best Regards,

Deepthi

Former Member
0 Kudos

Hi,

I'm just thinking if a macro really executes it's code in Display mode.

Regards,

Deepthi

Former Member
0 Kudos

HI,

If no macro function is available, may be you can try option of giving a message(Ex:This function is only possible in change mode) by checking whether planning book cells are editable or grayed out.

Best Regrads,

Deepthi

thomas_schulze2
Active Participant
0 Kudos

Hello Deepthi,

how would you do this ? Functions like CELL_INPUT() and ROW_INPUT() are used to set the changeablity but they do not return if a cell or row is currently "editable".

Regards

Thomas

Edited by: Thomas Schulze on Aug 6, 2010 9:16 AM

Edited by: Thomas Schulze on Aug 6, 2010 9:16 AM