07-23-2014 7:52 PM
Hi Guru's ,
In transaction IW21 I have to check before saving if a cost object is enterred.
I spent a lot of hour to find if there is an user-exit to do this but nothing.
On of those fields in the printscreen should be filled in if not I should display an error.
I tried to play with the PAI and STATUS SAVE (BUCH) but the structure VIQMEL is filled in in PAI.
I assume that an user-exist do this.
Anyone have an idea please?
07-24-2014 1:52 AM
Hello rahhaoui mohamed,
On of those fields in the printscreen should be filled in if not I should display an error.
Solution (Tested)
User Exit : QQMA0014 Function Exit: EXIT_SAPMIWO0_020 Include : ZXQQMU20
Code to be used
IF I_VIQMEL-QMART = 'M4'.
IF I_VIQMEL-GSBER IS INITIAL AND I_VIQMEL-PROID IS INITIAL AND I_VIQMEL-KOSTL IS INITIAL.
MESSAGE 'One of the fields of BusArea, CostCtr or WBS Element in the Location tab is mandatory' TYPE 'I'.
RAISE EXIT_FROM_SAVE.
ENDIF.
ENDIF.
You'll get this pop-up, when you try to save with all these fields empty.
The first and last lines of the code makes this code confined to Notification type M4 only. (You may change as per your need)
Jogeswara Rao K
07-23-2014 10:02 PM
Hello rahhaoui,
Use the following enhancement: QQMA0014 for checks before saving in Tx CMOD
You can check any field, display message and failure to save notification.
This is the code example.
I hope you help.
07-23-2014 11:40 PM
Hello Pau,
Thank you for your reply, it almost works with your user exist but I don't have the value fields from Location Data tab where the table is ILOA. I should check if my specific field is added in Reference Object tab in Viqmel Table and other standard field in Location Data tab in ILOA table.
Any idea please?
07-23-2014 11:57 PM
Hello rahhaoui,
in this user-exit you have VIQMEL structure with fields you've commented:
BEBER - Business Area
KOSTL - Cost Center
PROID - WBS Element
07-24-2014 1:52 AM
Hello rahhaoui mohamed,
On of those fields in the printscreen should be filled in if not I should display an error.
Solution (Tested)
User Exit : QQMA0014 Function Exit: EXIT_SAPMIWO0_020 Include : ZXQQMU20
Code to be used
IF I_VIQMEL-QMART = 'M4'.
IF I_VIQMEL-GSBER IS INITIAL AND I_VIQMEL-PROID IS INITIAL AND I_VIQMEL-KOSTL IS INITIAL.
MESSAGE 'One of the fields of BusArea, CostCtr or WBS Element in the Location tab is mandatory' TYPE 'I'.
RAISE EXIT_FROM_SAVE.
ENDIF.
ENDIF.
You'll get this pop-up, when you try to save with all these fields empty.
The first and last lines of the code makes this code confined to Notification type M4 only. (You may change as per your need)
Jogeswara Rao K