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: 

Help needed in table maintenance

Former Member
0 Kudos

Hello everyone,

I have to create a screen for all the table maintained tables.

SAY i HAVE TABLE ZTEST

I HAVE TO CREATE A SCREENWITH PUSH BUTTON TEST WHEN I CLICK THAT IT SHOULD TAKE ME TABLE MAINTENACE SCREEN i.e SM30 and when we click maintain .

It should take to that screen.

Please let me how to proceed regarding this..

Thanks

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, this is pretty easy, I assume that you know how to handle putting pushbutton on your screen and handling the function code, you can then use function module to fire the table maintenance, just as if you where going to SM30.




  call function 'VIEW_MAINTENANCE_CALL'
       exporting
            action                       = 'U'
            view_name                    = 'ZTEST'
       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.

Regards,

Rich Heilman

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, this is pretty easy, I assume that you know how to handle putting pushbutton on your screen and handling the function code, you can then use function module to fire the table maintenance, just as if you where going to SM30.




  call function 'VIEW_MAINTENANCE_CALL'
       exporting
            action                       = 'U'
            view_name                    = 'ZTEST'
       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.

Regards,

Rich Heilman

0 Kudos

Here is a sample report program for your solution.




report zrich_0001 .


selection-screen pushbutton 1(40) tabmaint user-command tabmain.


at selection-screen output.

  tabmaint = 'ZTEST Table Maintenance'.

at selection-screen.

  case sy-ucomm.
    when 'TABMAIN'.


      call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                       = 'U'
                view_name                    = 'ZTEST'
           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.



  endcase.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Otherwise ..Create a parameter transaction and call the transaction from your program using the CALL TRANSACTION syntax..

Check this link for creating a parameter transaction..

http://www.sap-basis-abap.com/sapbs011.htm

Thanks,

Naren

0 Kudos

Hi Rich,

I solved my problem and i am rewarding full points to you.

I have one more question when i press the button on my screen it gives me a pop up windoe saying table is cross client -


can we avoid this.

Thanks

Former Member
0 Kudos

Hi,

I think you have created the Z TABLE without the MANDT field..

TO avoid this error..

Add the field MANDT as one of the primary key..

Thanks,

Naren

0 Kudos

Naraen, is correct here, you will recieve the same messages as you would if you were to maintain via SM30. This includes the message that you are getting as well as the message that you get when trying to change repository objects in a closed system, if you table is of delivery class "Customizing Table"..

Regards,

Rich Heilman