‎2016 Aug 19 9:28 AM
Hi Expert,
I have created a customize master table and allowed user maintenance.
How can I do to make sure only 1 xfeld field(X) is allowed to maintain?
| Client | Key | XFELD |
| 100 | A | |
| 100 | B | X |
| 100 | C | |
| 100 | D |
Thanks.
Regards,
-Ben-
‎2016 Aug 25 7:42 AM
Hi Ben,
You can go to your customized table, then Utilities -> Table Maintenance Generator. Go to the Overview screen and check/tick whichever field you do not want to user to maintain in the 'Output only' column. This will disable the field for edit in SM30. Hope it solves your issue.
‎2016 Aug 25 7:42 AM
Hi Ben,
You can go to your customized table, then Utilities -> Table Maintenance Generator. Go to the Overview screen and check/tick whichever field you do not want to user to maintain in the 'Output only' column. This will disable the field for edit in SM30. Hope it solves your issue.
‎2016 Aug 25 7:54 AM
Hi @Angela Chong,
Thanks for your suggestion. But my requirement is allowed the user to maintain but only 1 field is allowed among the key.
Scenario 1:
Key B is allowed to maintain and save.
| Client | Key | XFELD |
| 100 | A | |
| 100 | B | X |
| 100 | C | |
| 100 | D |
Scenario 2:
Prompt error and not allowed to save as only 1 xfeld field can be maintained.
| Client | Key | XFELD |
| 100 | A | X |
| 100 | B | X |
| 100 | C | |
| 100 | D |
How do I achieve scenario 2 for customize table maintenance?
Thanks.
Regards,
-Ben-
‎2016 Aug 25 9:00 AM
You can go to the 'Generate Table Maintenance Dialog', Environment -> Modification -> Events, where you create a subroutine to manipulate the data or perform a checking/validation.
‎2016 Aug 25 11:10 AM
I tried with your given example and managed to perform the required validation. Here's the source code for your reference.
FORM validate_xfeld.
DATA: lw_struc TYPE ztt_tab,
lv_message TYPE string.
LOOP AT total.
IF= 'N'.
MOVE-CORRESPONDINGTO lw_struc.
IF lw_struc-zkey <> 'B' AND lw_struc-xfeld = 'X'.
CONCATENATE 'Field XFELD cannot be maintained by key' lw_struc-zkey
INTO lv_message SEPARATED BY space.
MESSAGE lv_message TYPE 'I'.
vim_abort_saving = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
‎2016 Aug 26 9:03 AM
Hi @Angela Chong,
Thanks for such details explanation with sample code. This has help me achieve my requirements.
Thanks a lot!
Regards,
-Ben-
‎2016 Aug 25 8:12 AM
Which event(s) of dialog maintenance did you already try? (did you find some save event where you could loop at table TOTAL and count records with the box checked)
Ref: in online help of BC - Generate Table Maintenance Dialog, look for Extended Table Maintenance Events.
Regards,
Raymond