This code demonstrates how to call function module VIEW_MAINTENANCE_CALL to call a table maintenance view from any program.
The Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
REPORT z_test_program. DATA: i_sellist TYPE STANDARD TABLE OF vimsellist INITIAL SIZE 0, i_header TYPE STANDARD TABLE OF vimdesc INITIAL SIZE 0, i_namtab TYPE STANDARD TABLE OF vimnamtab INITIAL SIZE 0. PARAMETERS: p_view TYPE viewname MATCHCODE OBJECT viewmaint OBLIGATORY. AT SELECTION-SCREEN. CALL FUNCTION 'VIEW_GET_DDIC_INFO' EXPORTING viewname = p_view
TABLES sellist = i_sellist x_header = i_header x_namtab = i_namtab EXCEPTIONS no_tvdir_entry = 1 table_not_found = 2 OTHERS = 3 . IF sy-subrc <> 0. data: l_message type NATXT. CONCATENATE 'Table/View' p_view INTO l_message SEPARATED BY space. MESSAGE e001(00) WITH l_message ' not in the Dictonary'. ENDIF. START-OF-SELECTION. CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING action = 'S' view_name = p_view 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. MESSAGE i001(00) WITH 'Error while calling the view'. LEAVE LIST-PROCESSING. ENDIF.
|
Hi Sourav, Thanks for you comment on my blog.
ReplyDeleteYou might like to see this blog: which can get the changed contents after the FM VIEW_MAINTENANCE_CALL
http://help-abap.blogspot.com/2008/09/capture-changed-content-after-fm.html
HOW shud i go about if instead of parameter, selecct-option is used ?
ReplyDeletethanks
URL was moved to:
ReplyDeletehttp://zevolving.com/2008/09/capture-changed-content-after-the-fm-view_maintenance_call/