2014 Nov 26 4:31 PM
Hi
I have a specific table for which I want to have mandatory fields filled in by my users.
The table have the following fields
Maintenance plant (data element IWERK)
Article (MATNR)
Plant (WERKS_D)
Stor loc (LGORT_D)
Maintenance plant and article are the table keys.
Transaction SM30 is used to fill in the data.
I put the following code for event 05 (new_entry).
form new_entry.
if zcs_div_mag_art-division is initial.
message e900(sv) with zcs_div_mag_art-article.
endif.
if zcs_div_mag_art-magasin is initial.
message e901(sv) with zcs_div_mag_art-article.
endif.
endform.
When filling the data I got the right error message, but the fields plant and storage location are grey so that I can't fill in and correct the entry.
I tried also to use the event 01 when saving but the issue is the same.
I tried with message type w, but a warning is not enough as the user can pass it.
Any idea?
Regards
Olivier
2014 Nov 27 4:42 AM
Hi Joseph,
Don't write Event code for this functionlity. You can directly make any field mandatory by screen painter . Just go to Screen painter of this TMG screen and make it mandatory.
Regards,
Sagar
Hi Joseph,
Don't write Event code for this functionlity. You can directly make any field mandatory by screen painter . Just go to Screen painter of this TMG screen and make it mandatory.
Regards,
Sagar
2014 Nov 27 12:18 AM
2014 Nov 27 4:38 PM
2014 Nov 27 1:38 AM
Hi Josheph,
Please try using below message type :
MESSAGE ID 'SV' TYPE 'S' NUMBER 900 DISPLAY LIKE 'E'.
or
MESSAGE ID lc_msv TYPE 'E'
number 900 DISPLAY LIKE 'S'.
Hope this helps.
Thanks
Sri
2014 Nov 27 3:41 AM
In the flow logic of your screen PAI event try to put the chan-endchain. Do the checks inside the module.
Something like this -
PROCESS AFTER INPUT.
chain.
field sflight-carrid.
field sflight-connid.
field sflight-fldate.
module check_flight.
endchain.
here any errors in module check_flight will ensure that after error is displayed all the three fields are still enabled.
Best regards,
Saurabh
2014 Nov 27 4:37 AM
Please display the message as:
MESSAGE s900(sv) WITH zcs_div_mag_art-article DISPLAY LIKE 'E'.
When the system encounters sy-msgty as 'E', it stops further processing of the program, not allowing us to modify existing screen. However, in order to ensure that after giving sy-msgty as 'S', our field is not left empty by the end-user, we can do so by programming as you have done.
2014 Nov 27 4:42 AM
Hi Joseph,
Don't write Event code for this functionlity. You can directly make any field mandatory by screen painter . Just go to Screen painter of this TMG screen and make it mandatory.
Regards,
Sagar
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |