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: 

Customize Master Table

benlim
Contributor
0 Kudos
265

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?

ClientKeyXFELD
100A
100BX
100C
100D

Thanks.

Regards,

-Ben-

1 ACCEPTED SOLUTION

Former Member
0 Kudos
232

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.

6 REPLIES 6

Former Member
0 Kudos
233

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.

0 Kudos
232

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.

ClientKeyXFELD
100A
100BX
100C
100D

Scenario 2:

Prompt error and not allowed to save as only 1 xfeld field can be maintained.

ClientKeyXFELD
100AX
100BX
100C
100D

How do I achieve scenario 2 for customize table maintenance?

Thanks.

Regards,

-Ben-

0 Kudos
232

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.

0 Kudos
232

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.

0 Kudos
232

Hi @Angela Chong,

Thanks for such details explanation with sample code. This has help me achieve my requirements.

Thanks a lot!

Regards,

-Ben-

raymond_giuseppi
Active Contributor
0 Kudos
232

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