Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

IW21 Check At SAVE

mrahhaoui
Participant
0 Kudos

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?

1 ACCEPTED SOLUTION

jogeswararao_kavala
Active Contributor
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

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?

0 Kudos

Hello rahhaoui,

in this user-exit you have VIQMEL structure with fields you've commented:

BEBER - Business Area

KOSTL - Cost Center

PROID - WBS Element

jogeswararao_kavala
Active Contributor
0 Kudos

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