cancel
Showing results for 
Search instead for 
Did you mean: 

User status check

Former Member
0 Kudos

Dear All,

I need to have an custom check in PM notification based on user status. I couldn't find any Badi fo the same and user exit is available for that. But if I use the userexit, then it will not check while updating and it will check once it got saved. Can anyone suggest Badi for PM notifications?

Thanks in advance.

Regards,

Nellaiappan N.P.

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Here is the code to be put in QQMA0014 (include ZXQQMU20).


DATA : I_USTAT LIKE ALM_ME_USER_STATUS_CHANGES OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'ALM_ME_READ_USER_STATUS'

   EXPORTING

     OBJECT_NO   = I_VIQMEL-OBJNR

   TABLES

     USER_STATUS = I_USTAT.

IF I_USTAT-USER_STATUS_CODE = 'CLSD'.

   IF I_VIQMEL-AUSBS IS INITIAL.

     MESSAGE: 'Fill ''Malfunct.end'' fields before setting ''CLSD'' status.'

     TYPE 'E' DISPLAY LIKE 'I'.

   ENDIF.

ENDIF.

This code does exactly that, what we discussed. Presently only one field is mentioned here. (You can extend the Ifs for other fields and hence the respective error messages). As per this syntax, if the user status is set to 'CLSD' the following error is thrown.

So it has been checked that user status is captured at runtime and used in user-exit. Hope it addresses your need.

KJogeswaraRao

Former Member
0 Kudos

Hi Sir,

Thank you so much for your quick reply with positive solution and i will implement the same with the help of our programmers.

Thanks & Regards,

Nellaiappan N.P.

Answers (1)

Answers (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Nellaiappan,

You need to explain your requirement in detail, so that members would share their expertise in terms of User-exit Or BADI. All my such requirements were addressed through 'Save' user-exits (when I am not particular about the error message to be exactly on spot.)

KJogeswaraRao

Former Member
0 Kudos

Hello Sir,

My requirement is,

My client wants to make some field as mandatory in PM Notifications where as that mandatory should be active only when particular user status is active. If I use User exit, then I can fetch the value form the table only so the user can save the notification without entering the fields at first time. At second time, if they go inside the same notification then only mandatory check will work.

But my client wants to activate the check at the time of choosing user status and save the notification at first time itself. Hence I search Badi but none will be suitable for my requirement.

Regards,

Nellaiappan N.P

jogeswararao_kavala
Active Contributor
0 Kudos

I understand this way. You have set a user status say INPR (in process). At this instance itself, few fields should become mandatory. This seems to be possible with User-exit also. You need to capture the runtime user status. Is this your requirement? If so which are the fields you want to make mandatory?

Former Member
0 Kudos

Exactly sir. It should be work in such a way only. If it is possible with the user exit, then please share the same too.

The following fields to be made mandatory, Malfunction end date (AUSBS) & time (AUZTB), Person responsible (I_PARNR) & Person attended (PARNR_VERA)