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: 

mandatory field in transaction

Former Member
0 Kudos

hi sap experts.

i added  a field "work center" to QM02  transaction , i want to mandatory this field .

actually i want that the user have to fill this field and cant exit the transaction untill fill and save this field, can any one help me.

thaks a lot.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

I suppose (hope) you used the generic (*) enhancement (SMOD) QQMA0001 and include CI_QMEL to add the field and create the Customer-exit subscreen ?

If yes, then use Enhancement QQMA0014, Exit EXIT_SAPMIWO0_020 to add some check before save, of course you should also check the data in the PAI of your subscreen. The previous exit will be effective when user doesn't display the customer subscreen, so its PAI may not be executed.

Regards,

Raymond

(*) effective with QM, PM and SM

16 REPLIES 16

nabheetscn
Active Contributor
0 Kudos

How did you add this field can you please provide the details

Nabheet

0 Kudos

i add this field in table and then add input/output object in screen.

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi,

Try with user exit IWOC0002.

Check - I_VIQMEL-ARBPL.

Arivazhagan S

raymond_giuseppi
Active Contributor
0 Kudos

I suppose (hope) you used the generic (*) enhancement (SMOD) QQMA0001 and include CI_QMEL to add the field and create the Customer-exit subscreen ?

If yes, then use Enhancement QQMA0014, Exit EXIT_SAPMIWO0_020 to add some check before save, of course you should also check the data in the PAI of your subscreen. The previous exit will be effective when user doesn't display the customer subscreen, so its PAI may not be executed.

Regards,

Raymond

(*) effective with QM, PM and SM

0 Kudos

thanks a lot reymond.

i add message to EXIT_SAPMIWO0_020 and check for initial field but when i want to exit the transaction i dont go to this function ! and so i can dont fill this field and exit!

0 Kudos

Did you

  • Activate the CMOD project
  • Raise the exception EXIT_FROM_SAVE  (MESSAGE E999(ZMSG) RAISING EXIT_FROM_SAVE.)
  • Notice thar the Exit will only be triggered by SAVE not by EXIT/CANCEL

Else there is also a BADI : NOTIF_EVENT_SAVE

Regards,

Raymond

0 Kudos

Yes Raymond, it happened to me once, I forgot to activate the CMOD project and at last I found that it is not activated. My exit worked after activating it.

Regards,

TP

0 Kudos

hi reymond and thanks for reply to me .

now i have another question ,if i want to do the same in qm01 , what to do i ? in the package of qm01 i dont have any EXIT_FROM_SAVE !

0 Kudos

QM01 and QM02 are executing the same program, did you check if same customer-exit was also triggered ?

Regards,
Raymond

0 Kudos

hi reymond.

in qm02 when i dont fill workcenter it dosnt alow me to save and show my messegae in FUNCTION EXIT_SAPMIWO0_020. but when i save in qm01 , it dosnt got to this.

0 Kudos

Can you

  • set a break-point in include, does QM01 trigger exit
  • In your include did you use any assign or similar statement to access data not provided by customer-exit signature

Regards,

Raymond

Former Member
0 Kudos

Hi Izadi,

If you added that field through screen exits by module pool program, then in properties of field make it as mandatory.

From above screen for attribute input there is a option as required

By this u can make it as mandatory.

0 Kudos

hi vineesh.

i do this but it occure when the user go to that tab, if not , user can exit transaction without save that.

0 Kudos

Then check the exit for QM02 Transaction

COOPA003 is the exit fot that  and in that include(PAI)  place the code as

if i_work_center is initial.

error message that field is particular tab is mandatory.

endif.

thanga_prakash
Active Contributor
0 Kudos

Hello Mahdieh,

I guess you can achieve it through the below adapt screen selection.

Click on the documentation and you will get to know in detail.

Regards,

Thanga

0 Kudos

i do this and make my field required but it doesnt work.!