‎2007 Oct 19 3:56 PM
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
‎2007 Oct 19 3:59 PM
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
‎2007 Oct 19 3:59 PM
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
‎2007 Oct 19 4:02 PM
‎2007 Oct 19 4:12 PM
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
‎2007 Oct 19 4:16 PM
I did the custom transaction for SM30 to modify ztable but it is asking workbench request for every new entries to the ztable.
Thanks
‎2007 Oct 19 4:21 PM
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
‎2007 Oct 19 4:23 PM
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
‎2007 Oct 19 4:26 PM
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
‎2007 Oct 19 4:29 PM
For Customizing table, it will always ask for a transport.
Which table do you want to maintain? Is it a Z table?
ashish
‎2007 Oct 19 4:32 PM
Yes. It is ZTABLE Create by me.
what should i give for Delivery Class and Data Browser/Table View Maint.
Thanks
‎2007 Oct 19 4:35 PM
Give delivery class is A
and use table maintaince allowed
Thanks
Seshu
‎2007 Oct 19 4:35 PM
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
‎2007 Oct 19 4:38 PM
Even i tried 'A - Application table (master and transaction data)' it is asking request.
Thanks
‎2007 Oct 19 4:41 PM
Did you change this property?
Data Browser / Table View Maint = Display / Maintenance allowed.
Delete table maintenance , check above property and create again.
ashish
‎2007 Oct 19 4:47 PM
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
‎2007 Oct 19 4:50 PM
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
‎2007 Oct 19 4:54 PM
When i try to delete table maintenance it is showing the following error
Function group Y_TABMAINT cannot be processed
‎2007 Oct 19 4:56 PM
Check if this function group exists. Also exit from transaction se11 and reenter and try again. It will work.
ashish
‎2007 Oct 19 5:03 PM
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
‎2007 Oct 19 5:05 PM
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
‎2007 Oct 19 5:21 PM
They need to edit/change only based on some selection condition from selection screen. How can i do this ??
Thanks
‎2007 Oct 19 5:23 PM
You will get selection screen on SM30. That should not be an issue.
‎2007 Oct 19 5:27 PM
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
‎2007 Oct 19 5:31 PM
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
‎2007 Oct 19 5:32 PM
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
‎2007 Oct 19 5:37 PM
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
‎2007 Oct 19 5:50 PM
Seshu
The FM is nice. But kindly let me know how to execute sm30 via custom transaction with restriction (Enter Condition in SM30)
Thanks
‎2007 Oct 19 6:11 PM
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
‎2007 Oct 19 6:29 PM
‎2007 Oct 19 7:40 PM
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
‎2007 Oct 19 8:01 PM
No other way Senthil .
You have to define data element level.
Thanks
Seshu
‎2007 Oct 19 8:02 PM
‎2007 Oct 19 8:03 PM
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
‎2007 Oct 19 8:12 PM
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
‎2007 Nov 07 7:39 PM
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
‎2007 Nov 07 8:03 PM
What is the message says Senthil ?
Check the transport request Status in SE10.
You have to transport ( Table maintaince then program)
Thanks
Seshu
‎2007 Nov 07 8:12 PM
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
‎2007 Nov 07 8:39 PM
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
‎2007 Oct 19 4:03 PM
Check the below links :
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac4435c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbac4435c111d1829f0000e829fbfe/frameset.htm
Thanks
Seshu
‎2007 Nov 07 7:46 PM
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