cancel
Showing results for 
Search instead for 
Did you mean: 

How to know if the user is in change or display mode

Former Member
0 Kudos

Hello!

I created a user exit macro for my planning book. if the user is in display mode, i don't want him to be able to run the macro. He should only run the macro in change mode.

How to determine in an user exit macro (i.e in an abap programm) if the user is in change or display mode?

There is the FM /SAPAPO/DATA_IS_LOCKED with this parameters but it doesn't work.

Thanks in advance,

Accepted Solutions (1)

Accepted Solutions (1)

somnath_manna
Active Contributor
0 Kudos

Hi Laurent,

Can you use FM /SAPAPO/MSDP_PB_READ_DVIEW to determine if user is in change mode or not in the planning book. I am not at all good in ABAP but saw this FM in OSS note 403619. Line 240 onwards has a check for determining the user authorization for the planning book.

Hope this helps.

Thanks,

Somnath

Answers (2)

Answers (2)

wilfried_k
Discoverer
0 Kudos

Hi

try to look in the changing parameter c_s_actview

  c_s_actview-agc_child1-readonly

0 = input    mode

1 = display mode


i think child1 and child2 will be set similar.


have fun 😉

Former Member
0 Kudos

The planning book based upon the Planning Area. There no such direct method to know the exact status of planning book.

Follow below logic ,

First try to find the planning area of that planning book .since any update to planning book will directly affect underline planning area . If planning book is in change mode then planning area too will be in change mode.

There is function /SAPAPO/TS_DM_LOCK which gives the status of planning book / area along with who has locked the planning book.

you need to pass planning area name and if possible pass selection parameter and group parameter. if you don't then it is fine too.

Paramater

EV_SUCCESS = X ...Means no Lock.

EV_USER = ...Blank indicate , no user has locked the planning area / book.

If EV_USER is blank means , no one has locked the planning book / area , if it has value then it means the planning book/ area is locked .....here EV_SUCCESS would have blank value.

You can test the this FM , by locking plannig book and passing planning area in FM ..and see the results

Regards,

Prashant

Reward points if it helps.

Reward pints if it helps

Message was edited by:

Prashant S

null

Former Member
0 Kudos

Hello and happy new year!

Thanks for your help.

I tried the FM by locking plannig book and passing planning area in FM and it works but it doesn't work in my default user exit macro. This macro is for dataview CTRL_OP1 from PAREA ZPA_GROUPE.

In the macro, i call the FM like this :

CALL FUNCTION '/SAPAPO/TS_DM_LOCK'

EXPORTING

IV_PAREAID = 'ZPA_GROUPE'

IT_SELECTION = WT_SEL "for 9AVERSION

IMPORTING

EV_SUCCESS = w_success

EV_USER = w_user

w_success is always equal to 'X' even if i lock the planning area before the default macro is running.

Former Member
0 Kudos

Hi Techies,

If any of you have got the solution to this problem, please share with me. As i Am also having exactly the same requirment.

Thanks in advance.

Surbhi