Application Development and Automation 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: 
Read only

View Table with Restriction

Former Member
0 Likes
9,451

Hi All,

How can I achieve a view table with restrictions with something like below that would only allow user to select field/s to be maintained or display?

Thanks,

Trixa

16 REPLIES 16
Read only

Former Member
0 Likes
8,529

Hi Trixa, when you create a view table, each field has a attribute called "Maintenance Attribute", you have to choose the value S for the fields that you wanna appear as condition, see the image below

I hope this help you

Regards

David Carballido

Read only

0 Likes
8,529

Hi David,

I can't find the part you highlighted above. My table looks like below:

Read only

0 Likes
8,529

Hi,

David Carballido talking about maintenance View.

There you find the Options.

Regrads,

Ravi Pratap Singh

Read only

0 Likes
8,529

Hi Trixa, you have to create a view based on your table, go to SE11 and choose View, then put a name of your view to create, follow the next steps

1. My table is ZTABLE

2. You have to create a view based on your table ZTABLE

3. Then select Maintenance View

4. Then select your table like that and press ENTER to refresh and select all your fields

5. Then save and activate, then go to "table maintenance generator" to create a function group

6. Then go to SM30 and put your view and you'll see your fields marked as condition

I hope this help you

DCC

Read only

0 Likes
8,529

i think this is not what author want.

Read only

Former Member
0 Likes
8,529

Hi Trixa,

Do you want to restrict the fields visibility while maintaing the table through SM30. Is this is your requirement.

Thanks and Regards,

Vinay Mutt

Read only

0 Likes
8,529

Yes that's what I want.

Read only

0 Likes
8,529

Hi Trixa,

I have posted the code below to make the fields not visible in SM30. If you want to do some validations on the fields you have to create events or write the code in PAI .

Regards,

Vinay Mutt

Read only

Former Member
0 Likes
8,529

Hi Trixa,

Actually we had impleneted  PBO module and had written the code as shown below in oder to hide the fields when trying to maintain/display through SM30. David s approach is easy and it is good.

Approcah we followed.

Below code is  written in the PBO MOdule.

 

MODULE hide_fields OUTPUT.

 

*-- To Hide CHANGEDDATE CHANGEDTIME and CHANGEDBY Fields On the Screen

 

PERFORM sub_hide_fields USING c_changeddate.

PERFORM sub_hide_fields USING c_changedtime.

PERFORM sub_hide_fields USING c_changedby.

 

FORM sub_hide_fields USING p_field.

DATA: x_cols LIKE LINE OF tctrl_ztest-cols,

l_index TYPE i.

READ TABLE tctrl_ztest-cols INTO x_cols

WITH KEY screen-name = p_field.

IF sy-subrc EQ 0.

 

*-- To Modify the Correct Entry in the Internal Table

 

l_index = sy-tabix.

 

*-- To Make the field invisible on the screen

 

x_cols-invisible = c_x.

MODIFY tctrl_ztest-cols FROM x_cols INDEX l_index

TRANSPORTING invisible.

ENDIF.

ENDFORM. " SUB_HIDE_FIELDS

Read only

Aiolos
Active Participant
0 Likes
8,529

do u mean u want to control the fields in the maintain view?

e.g total 10 fields, u only want to display 5?

Read only

Former Member
0 Likes
8,529

Yes based on the screenshot I provided above.

Read only

Former Member
0 Likes
8,529

Trixa,

You want to modify the modification view i.e., SM30 dynamically?

If you select two fields only those two should be visible like that?

Regards,

Vinay Mutt

Read only

Former Member
0 Likes
8,529

The new table would be assigned to a  new transaction code. Once transaction code is executed, the below window should display wherein a user will only select either of the four fields.

Read only

Aiolos
Active Participant
0 Likes
8,529

please Write ur own z program to achieve this

Read only

Former Member
0 Likes
8,529

Based on our requirement:

In order to restrict the number of records display the table should be created to be maintained with restrictions, forcing users to select at least one of the fields to restrict entries.Users will select Plant, Material, Resource, Recipe Group, Recipe Number and they will get the list of records matching values provided.

Thanks,

Trixa

Read only

Former Member
0 Likes
8,529

Hi All,

I was able to display the required window by creating a custom program calling the FM below:

DATA gt_sellist TYPE STANDARD TABLE OF vimsellist.


CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
  EXPORTING
   action                                     = 'U'
   show_selection_popup          = 'X'               " this enables the pop-up window
   view_name                            = 'ZTABLE'
TABLES
   DBA_SELLIST                       = gt_sellist
EXCEPTIONS
   client_reference                     = 1
   foreign_lock                           = 2
   invalid_action                         = 3
   no_clientindependent_auth    = 4
   no_database_function            = 5
   no_editor_function                  = 6
   no_show_auth                        = 7
   no_tvdir_entry                        = 8
   no_upd_auth                          = 9
   only_show_allowed                = 10
   system_failure                        = 11
   unknown_field_in_dba_sellist = 12
   view_not_found                      = 13
   maintenance_prohibited         = 14
   OTHERS                                = 15 .

IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

However, all fields are showing when all I really need are the first five fields only. Does anyone knows how to eliminate the last two fields?

Thanks,

Trixa