Wednesday, October 28, 2009

Call Default Table/View Maintenance Screen (SM30)

The example below shows calling maintenance screen (SM30) using a function module. Especially if you'd like to fix a value like company code , simply add values to dba_sellist and that's it. Maintenance just works for the fixed values. First col. value is fixed at the screenshot.






data : rangetab type table of vimsellist with header line.

rangetab-viewfield = 'BUKRS'.
rangetab-operator = 'EQ'.
rangetab-value = p_value.
rangetab-tabix = 2.
rangetab-converted = 'X'.
append rangetab.

call function 'VIEW_MAINTENANCE_CALL'
exporting
action = 'U' " Update 'S' Show
view_name = 'TABLE_OR_VIEW_NAME'
check_ddic_mainflag = 'X'
tables
dba_sellist = rangetab[]
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 NE 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

No comments:

Post a Comment