Skip to Content

PM Module: How to make a field Mandatory in Standard Screen based on a Validation

Hi Experts,

My requirement is to make a field Mandatory in standard screen based on validation.

Whenever notification is been Rejected, Subject Long Text should be Mandatory before Saving the Notification.

Kindly let me know the solution with steps to acheive this scenario.

Note: I've tried with different Enhancements, but in those I'm getting the Rejection SY-UCOMM, but not the long text field.

Find the below attachment picture.

With Regards,

Sudhir.

notif_reje1.JPG (129.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Sep 24, 2015 at 10:44 AM

    Hello Sudhir,

    I think a I have arrived at a working solution.

    User-exit : QQMA0014

    Include: ZXQQMU20

    Put this code in the above include:

    IF i_viqmel-qmart = 'M2'.

    DATA:i_stat LIKE jstat OCCURS 0 WITH HEADER LINE.

    CALL FUNCTION 'STATUS_READ'
    EXPORTING
    objnr = i_viqmel-objnr
    only_active = 'X'
    TABLES
    status = i_stat.

    LOOP AT i_stat.
    IF i_stat-stat = 'E0004' AND i_viqmel-indtx IS INITIAL.
    MESSAGE: 'Long text can not be empty for Rejected notifications'
    TYPE 'E' DISPLAY LIKE 'I'.
    ENDIF.
    ENDLOOP.

    ENDIF.

    User will get the following error when trying to Save notification (M2 type) with REJE user status and Blank Longtext

    Notes:

    1. Lines 01 and 19 are to confine your code to a particular Notification type (Here it is M2).

    2. In line 34 the value 'E0002', you will replace with yours. This is the code for your user-status REJE. This code you will get from table TJ02T by passing the Status profile value in STSMA field and REJE in TXT04 field.

    3. I have tested this and working fine.

    4. fm STATUS_TEXT_EDIT will not work here, so we have to use fm STATUS_READ only

    5. You must be knowing that the user-exit must be assigned to a project created through CMOD.

    Good luck

    KJogeswaraRao


    Capture.JPG (13.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 24, 2015 at 10:11 AM

    Hello Sudhir,

    Prima facie this looks very much possible through user-exit QQMA0014, by using fm STATUS_READ or STATUS_TEXT_EDIT to check the user status. Things would have been very easy if it is filed. In your case it is the Long text. But I feel this too can be managed. Let me find sometime to post the solution in detail, if possible with the code.

    Regards

    KJogeswaraRao

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 24, 2015 at 09:54 AM

    Hi.

    Did you try NOTIF_EVENT_SAVE badi?

    Hope to help.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.