Skip to Content
avatar image
Former Member

VIEW_MAINTENANCE_CALL

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 22, 2009 at 04:29 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 22, 2009 at 04:28 AM

    Hello sujith,

    I think now able to create entries.

    Add comment
    10|10000 characters needed characters exceeded