ABAP 在程序中CALL SM30视图维护,并根据选择屏幕仅维护选择屏幕内的数据

DATA:lt_dba_sellist TYPE STANDARD TABLE OF vimsellist,
       ls_dba_sellist TYPE vimsellist.
  DATA:lv_view   TYPE dd02v-tabname,
       lv_action TYPE c LENGTH 1.
  CLEAR: lv_view.
  CLEAR lt_dba_sellist.
  lv_action = 'S'.
  lv_view = 'ZMM_MRP_INFO'.

***当需要输入选择值范围时,则向表lt_dba_sellist中写入对应的条件。
  ls_dba_sellist-viewfield = 'WERKS'.
  ls_dba_sellist-operator  = 'EQ'.
  ls_dba_sellist-and_or    = 'AND'.
  ls_dba_sellist-value = p_werks.
  APPEND ls_dba_sellist TO lt_dba_sellist.

    IF s_lifnr[] IS NOT INITIAL.
      CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
        EXPORTING
          fieldname          = 'LIFNR'
          append_conjunction = 'AND'
        TABLES
          sellist            = lt_dba_sellist
          rangetab           = s_lifnr.
    ENDIF.
    IF s_matnr[] IS NOT INITIAL.
      CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'
        EXPORTING
          fieldname          = 'MATNR'
          append_conjunction = 'AND'
        TABLES
          sellist            = lt_dba_sellist
          rangetab           = s_matnr.
    ENDIF.


  CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
    EXPORTING
      action                       = lv_action
      view_name                    = lv_view
*     show_selection_popup         = 'X'
    TABLES
      dba_sellist                  = lt_dba_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.

上一篇:getApplicationContext()、getBasecontext()、getApplication() 、getParent()


下一篇:(EXIT)Copy PR header text to PO header when ME21N