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: 

VIEW_MAINTENANCE_CALL

Former Member
0 Kudos

Hi,

Can any one please help me with the code to create entries in a view using the FM VIEW_MAINTENANCE_CALL

Also, i need to create entires as a part of background processing

Kind regards,

Sujith

5 REPLIES 5

Former Member
0 Kudos

Hello sujith,

I think now able to create entries.

Former Member
0 Kudos

Hello,

Try this sample code below and see if you could get some pointers to it


  IF g_viewname IS INITIAL.
    MESSAGE ID 'SV' TYPE 'E' NUMBER '062'.
  ELSE.
*     Check if the Table/View actually exists
    SELECT SINGLE * FROM dd02l
                    INTO dd02l
                   WHERE tabname    = g_viewname
                     AND as4local  = 'A'.        "Active
    IF sy-subrc NE 0.
      MESSAGE ID 'SV' TYPE 'E' NUMBER '306' WITH g_viewname.
    ENDIF.
  ENDIF.

* Get the class for the given table.
  SELECT SINGLE cclass FROM tddat INTO l_class
                      WHERE tabname = g_viewname.
* Check user's authority
  AUTHORITY-CHECK OBJECT 'Z_TABU_DIS'
            ID 'ACTVT'     FIELD p_activity
            ID 'DICBERCLS' FIELD l_class
            ID 'TABLENAME' FIELD g_viewname.

  IF sy-subrc NE 0.
* The user does not have the necessary authority
*   If the user is trying to Change:
    IF p_activity EQ '02'.
      MESSAGE ID 'MO' TYPE 'E' NUMBER '417'.
*   If the user is trying to Display
    ELSEIF p_activity EQ '03'.
      MESSAGE ID 'MO' TYPE 'E' NUMBER '419'.
    ENDIF.
  ENDIF.

* Set the action to be performed for Maintenance
  IF ok_code EQ 'SHOW'.
    l_action = 'S'.          "View/Display
  ELSEIF ok_code EQ 'UPD'.
    l_action = 'U'.          "Update
  ENDIF.

*Start of CRQ58509
data: l_subrc like sy-subrc.
*Disable Change button for display activity
  IF p_activity EQ '03'.
    REFRESH :lt_excl_cua_funct[].
    lt_excl_cua_funct-function = 'AEND'.
    APPEND lt_excl_cua_funct.
    lt_excl_cua_funct-function = 'TOGGLE'.
    APPEND lt_excl_cua_funct.
        lt_excl_cua_funct-function = 'SINGLE'.
    APPEND lt_excl_cua_funct.
    CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
      EXPORTING
        action                       = l_action
        view_name                    = g_viewname
      TABLES
        excl_cua_funct               = lt_excl_cua_funct
      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.

Regards,

Mansi.

0 Kudos

HI,

I have to pass the entres in the in the internal table and these values have to be created in the view that part of the logic is not given in ur code, please provide me that.

Kind regards,

Sujith

0 Kudos

Hi Sujith,

VIEW_MAINTENANCE_CALL is used to call the maitenance screen i.e., you could just see the entries and u can update or delete,copy etc.. manually...u cannot directly create entries into it thru this FM..

regards,

Dinesh.

matt
Active Contributor
0 Kudos

If you're wanting to add data into a table in background, just use the normal commands - INSERT etc.

VIEW_MAINTENANCE_CALL isn't for background.