CALLING SM30 FROM A PROGRAM ABAP VIEW_MAINTENANCE_CALL (SAMPLE CODE)

   

Kode transaksi (TCODE) SM30 dapat digunakan untuk menampilkan dan memperbarui data tabel. Pada artikel kali ini kita akan membuat sebuah program abap yang akan mengeksekusi langsung table seperti tampilan SM30.

Berikut contoh script sub rutin untuk menampilkan table maintain seperti pada tcode SM30:

FORM call_sm30 USING inc_act TYPE c
                     inc_tablename TYPE dd02v-tabname.
  CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
    EXPORTING
      action                       = inc_act
      view_name                    = inc_tablename
    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
      OTHERS                       = 14.
ENDFORM.

Subrutin tersebut dapat dipanggil menggunakan script berikut ini:

DATA: ld_tablename TYPE dd02v-tabname.
ld_tablename = 'ZTABLEMAINTAIN '.
PERFORM call_sm30 USING 'S' ld_tablename.

Sehingga kode script full nya adalah sebagai berikut:

DATA: ld_tablename TYPE dd02v-tabname.
ld_tablename = 'ZTABLEMAINTAIN '.
PERFORM call_sm30 USING 'S' ld_tablename.
FORM call_sm30 USING inc_act TYPE c
                     inc_tablename TYPE dd02v-tabname.
  CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
    EXPORTING
      action                       = inc_act
      view_name                    = inc_tablename
    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
      OTHERS                       = 14.
ENDFORM.

Wahyu Amaldi, M.Kom has written 87 articles

Hi Reader, thank you for read this article, i hope this article can be useful.
If you will share knowladge to me, dont forget contact to me.

Email 1 : wahyu.amaldi@outlook.com
Email 2 : wahyu.amaldi@ilmuprogram.com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>