Application Development and Automation 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: 
Read only

Table Control Change / Delete

Former Member
0 Likes
3,241

I need to Delete or Change database table using screens. I want to view the selected records together and change or delete. Kindly provide me sample table control program or any other method to achieve this.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,068

Changing or modifying Standard table records is not a good practice.

If it is a custom table, please go ahead and create Table maintenance for the same using transaction sE11. This will help you to maintain data for a custom table.

ashish

40 REPLIES 40
Read only

Former Member
0 Likes
3,069

Changing or modifying Standard table records is not a good practice.

If it is a custom table, please go ahead and create Table maintenance for the same using transaction sE11. This will help you to maintain data for a custom table.

ashish

Read only

0 Likes
2,926

Ashish

Users are not authorized for se11.

Thanks

Read only

0 Likes
2,926

Senthil,

That is not required. Developer needs to have access to SE11 to create a table maintenance.

Users will maintain table using transaction SM30. If users don't have access to SM30 (which at most client places they don't), create a custom transaction code for SM30 for maintaining that specific table and give access of that transaction to users.

Are you clear with the concept?

ashish

Read only

0 Likes
2,926

I did the custom transaction for SM30 to modify ztable but it is asking workbench request for every new entries to the ztable.

Thanks

Read only

0 Likes
2,926

Check your table attributes - If it is 'C' for customizing, it will ask for the request, every time you make a change.

Also check Data Browser / Table maintenance property in "Delivery & Maint" tab. It should not be "Display Main allowed with restric".

ashish

Read only

0 Likes
2,926

Then issue would be at table maintaince or delivery classs ( if you use C)

Just goto SE11 -> enter table name -> display

Utilities -> table maintaince -> here check the radio buttons

Recording routine -> select no or user recording routine

delete old table maintaince,recreate it again

Thanks

Seshu

Read only

0 Likes
2,926

My settings are the following

Data Browser/Table View Maint: Display/Maintenance allowed

Delivery class is : Customizing table, maintenance only by cust., not SAP import

But it should not ask request every time when user changes. How to achieve this ?

Thanks

Read only

0 Likes
2,926

For Customizing table, it will always ask for a transport.

Which table do you want to maintain? Is it a Z table?

ashish

Read only

0 Likes
2,926

Yes. It is ZTABLE Create by me.

what should i give for Delivery Class and Data Browser/Table View Maint.

Thanks

Read only

0 Likes
2,926

Give delivery class is A

and use table maintaince allowed

Thanks

Seshu

Read only

0 Likes
2,926

Ok, Delivery class should be "A" if this contains Master / Transaction data. (Not customizing data).

Data Browser / Table View Maint = Display / Maintenance allowed.

Change this, activate table, recreate Table maintenance and check again. It should work.

ashish

Read only

0 Likes
2,926

Even i tried 'A - Application table (master and transaction data)' it is asking request.

Thanks

Read only

0 Likes
2,926

Did you change this property?

Data Browser / Table View Maint = Display / Maintenance allowed.

Delete table maintenance , check above property and create again.

ashish

Read only

0 Likes
2,926

I tried it is not working for 'A' and works when i changed to

'Table for storing temporary data, delivered Empty'

Kindly help me what should i give while creating the custom transaction for sm30 for default values (Name of the screen field and value).

Thanks

Read only

0 Likes
2,926

You can click on find screen numbers, it will generate screen numbers automatically. Make sure radio button for "Standard Recording routine" is set.

You should be able to change table attributes to "A". Please make sure that the attributes are changed before going for table maintenance.

ashish

Read only

0 Likes
2,926

When i try to delete table maintenance it is showing the following error

Function group Y_TABMAINT cannot be processed

Read only

0 Likes
2,926

Check if this function group exists. Also exit from transaction se11 and reenter and try again. It will work.

ashish

Read only

0 Likes
2,926

Asish

it working on following condition

Delivery Class for ztable: Table for storing temporary data, delivered empty

I have also created custom transaction for SM30.

But i don't know when i transport to Production the user should have authorization for SM30 because the custom transaction again calls SM30 right?

Thanks

Read only

0 Likes
2,926

Once user get access to custom transaction, it will take care of that. But check once your table attributes, it should be of Type "A".

ashish

Read only

0 Likes
2,926

They need to edit/change only based on some selection condition from selection screen. How can i do this ??

Thanks

Read only

0 Likes
2,926

You will get selection screen on SM30. That should not be an issue.

Read only

0 Likes
2,926

When i use custom transaction to call SM30 it directly goes to table ie. without any restriction. how to call sm30 transaction from custom transaction with selection screen.

Thanks

Read only

0 Likes
2,926

Check these steps to create custom tcode for SM30 -

Goto SE93.

Create a Tcode :

Name : ZTCODE1

Type : Parameter Transaction

In the Attributes of Parameter Transaction

Enter The Transaction SM30

Select the Checkbox : Skip first Screen

Enter the Following Fields below in the Table provide.

FieldName FieldValue

VIEWNAME <YOUR ZTABLE>

UPDATE X

Hope this helps.

ashish

Read only

0 Likes
2,926

Check the example program :

      • Table diclaration

tables: tvdir.

      • Selection screento table View

selection-screen skip 2.

parameter p_tabnm(30) as listbox visible length 30 obligatory.

selection-screen skip 1.

selection-screen begin of block s1 with frame title text-001.

parameter: p_radio1 radiobutton group g1,

p_radio radiobutton group g1.

selection-screen end of block s1.

      • Add values to list box

at selection-screen output.

type-pools: vrm.

data: name type vrm_id,

list type vrm_values,

value like line of list.

name = 'P_TABNM'.

refresh list.

value-key = 'Enter table name'.

value-text = text-002. " Table description.

append value to list.

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

start-of-selection.

      • Get flag of corresponding table view

select single tabname flag from tvdir into tvdir

where tabname = p_tabnm.

      • Set flag of corresponding table view

if p_radio1 eq 'X'.

if tvdir-flag ne 'X'.

update tvdir set: flag = 'X'

where tabname = p_tabnm.

endif.

endif.

if p_radio eq 'X'.

if tvdir-flag eq 'X'.

update tvdir set: flag = ''

where tabname = p_tabnm.

endif.

endif.

      • Execute View/Table

call function 'VIEW_MAINTENANCE_CALL'

exporting

action = 'U'

view_name = p_tabnm

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.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

      • Reset flag of corresponding table view

update tvdir set: flag = tvdir-flag

where tabname = p_tabnm.

Thanks

Seshu

Read only

0 Likes
2,926

Yes I did already while creating custom transaction but it is directly going to SM30 Maintenance without any restriction (No Restrction Option in SM30). But i need to execute sm30 via custom transaction with restriction (Enter Condition Option in SM30)

Thanks

Read only

0 Likes
2,926

Seshu

The FM is nice. But kindly let me know how to execute sm30 via custom transaction with restriction (Enter Condition in SM30)

Thanks

Read only

0 Likes
2,926

See the bold one :

REPORT Ztest_ytt.

      • Table diclaration

tables: tvdir.

      • Selection screento table View

selection-screen skip 2.

parameter p_tabnm(30) as listbox visible length 30 obligatory.

selection-screen skip 1.

selection-screen begin of block s1 with frame title text-001.

parameter: p_radio1 radiobutton group g1,

p_radio radiobutton group g1.

selection-screen end of block s1.

      • Add values to list box

at selection-screen output.

type-pools: vrm.

data: name type vrm_id,

list type vrm_values,

value like line of list.

name = 'P_TABNM'.

refresh list.

value-key = 'ZWM_TRK_LOC'.

value-text = 'Truck Location'. " Table description.

append value to list.

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

start-of-selection.

      • Get flag of corresponding table view

select single tabname flag from tvdir into tvdir

where tabname = p_tabnm.

      • Set flag of corresponding table view

if p_radio1 eq 'X'.

if tvdir-flag ne 'X'.

update tvdir set: flag = 'X'

where tabname = p_tabnm.

endif.

endif.

if p_radio eq 'X'.

if tvdir-flag eq 'X'.

update tvdir set: flag = ''

where tabname = p_tabnm.

endif.

endif.

      • Execute View/Table

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

ACTION = 'U'

  • CORR_NUMBER = ' '

  • GENERATE_MAINT_TOOL_IF_MISSING = ' '

<b> SHOW_SELECTION_POPUP = 'X'</b> VIEW_NAME = p_tabnm

  • NO_WARNING_FOR_CLIENTINDEP = ' '

  • RFC_DESTINATION_FOR_UPGRADE = ' '

  • CLIENT_FOR_UPGRADE = ' '

  • VARIANT_FOR_SELECTION = ' '

  • COMPLEX_SELCONDS_USED = ' '

  • TABLES

  • DBA_SELLIST =

  • 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

OTHERS = 14

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*call function 'VIEW_MAINTENANCE_CALL'

*exporting

*action = 'U'

*view_name = p_tabnm

*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.

*if sy-subrc <> 0.

*message id sy-msgid type sy-msgty number sy-msgno

*with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

*endif.

      • Reset flag of corresponding table view

update tvdir set: flag = tvdir-flag

where tabname = p_tabnm.

Thanks

Seshu

Read only

0 Likes
2,926

Excellent Seshu.

Thanks

Read only

0 Likes
2,926

Seshu

Do you have any idea for the following issues?

I created a 'ZTable' and used Predefined Data types. I am able to give only short text. When see in SM30 view using your FM there is no Label displayed only it gets displayed if I use data element type. There are some 60 fields already created with predefined type and it is difficult to change everything. Is there way to display labels in SM30 view with existing predefined type.

Thanks

Read only

0 Likes
2,926

No other way Senthil .

You have to define data element level.

Thanks

Seshu

Read only

0 Likes
2,926

Ok Seshu. I will do that

Thanks

Read only

0 Likes
2,926

You can modify screen of SM30, As you just need to add labels to the field columns, you can do this from SE11 --> Table maintenance generator --> Envorinment --> Modification --> Maintenance screen.

Hope this will help you.

ashish

Read only

0 Likes
2,926

Ashish

That is really great!!!. I am able to change the layout from Maintenance screen and there i am able to assign the field label.

Thanks

Read only

0 Likes
2,926

Hi Seshu

FM ''VIEW_MAINTENANCE_CALL' was working fine in DEV and now it is showing the following pop up error when it got transported to QAS. Do you have any idea ?

ZVEN - My ZTABLE

ZVEN - Function Group

stop

Check maintenance object ZVEN or update

function group ZVEN

Thanks

Read only

0 Likes
2,926

What is the message says Senthil ?

Check the transport request Status in SE10.

You have to transport ( Table maintaince then program)

Thanks

Seshu

Read only

0 Likes
2,926

Seshu

When i execute the program it asks for selection paramter from my ztable after that when i click it end up with following error

The pop up Message was

-


stop symbol with the following message

Check maintenance object ZVEN or update

function group ZVEN

-


My ZTABLE NAME = ZVEN

My Function Group = ZVEN

Even in SM30 if I give my table I am getting the same error

but it works good in DEV

Thanks

Read only

0 Likes
2,926

Senthil,

I have no idea since i am testing in my system.

it works perfect ,may be transport request issue.

anyhow post new thread and some one will give you best answers.

Thanks

Seshu

Read only

Former Member
0 Likes
2,926

FM ''VIEW_MAINTENANCE_CALL' was working fine in DEV and now it is showing the following pop up error when it got transported to QAS. Do any one have idea ? and even SM30 i am getting the same error.

ZVEN - My ZTABLE

ZVEN - Function Group

stop

Check maintenance object ZVEN or update

function group ZVEN

Thanks