08-29-2007 3:15 PM
Hello,
I want to use fm view_maintenance_call to update a table. But I want to pass one of the key fields from the parameters of the selection screen of my program. Is it possible to display this field with the value from program's selection screen and to lock it against changes. ie. the table has 3 fields to be updated, value of one of the fields will be read from the selection screen and it will be display only in SM31/SM30.
Is it possible?
Thx in advance,
Ali
08-29-2007 3:21 PM
Hi,
First you need to create the LOCK object for that table, then a function mdoule (EQUEUE and DEQUEUE)will be generated,
in your program before updating the table, call this function module with the selection screen parameter then lock it then update then unlock the table
Regards
Sudheer
08-29-2007 3:25 PM
Hi Sudheer,
how do i create a lock object? i think with enque and dequeue the whole record is locked. i want one field to be display only. for the rest of the fields in the record the user must have the chance to make entries.
thx for the concern
Ali
08-29-2007 3:38 PM
<b>I want one field to be display only. for the rest of the fields in the record the user must have the chance to make entries.</b>
This is not possible :
Check the below code :
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 = 'V_024'.
value-text = text-002. "'V_024-Purchasing Groups'.
append value to list.
value-key = 'V_T024D'.
value-text = text-003. "'V_T024D-MRP Controllers'.
append value to list.
value-key = 'ZT604'.
value-text = text-004. "'T604-Commodity Codes'.
append value to list.
value-key = 'T179'.
value-text = text-005. "'T179-Product Hierarchies'.
append value to list.
value-key = 'TVM1T'.
value-text = text-006. "'TVM1T-Business Manager'.
append value to list.
value-key = 'TVM2T'.
value-text = text-007. "'TVM2T-Division manager'.
append value to list.
value-key = 'TVM3T'.
value-text = text-008. "'TVM3T-Director'.
append value to list.
value-key = 'V_TVV2'.
value-text = text-009. "'V_TVV2-Customer Group 2'.
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.
Depend upon Radio button ,you get pop up window for transport request.
Thanks
Seshu
08-29-2007 3:39 PM
When u r using VIEW_MAINTENANCE_CALL , during the new record creation , u wont be having any control over the Input screen.So making one field - invisible/uneditable/unavilable is not possible.
You can rather try with VIEW_MAINTENACE, there u have the provision for making one field absolutely uneditable or unavilable. but inthat case you will have to update the field programatically from ur own prog.
08-29-2007 4:00 PM
Hi SKC,
any samples for fm VIEW_MAINTENANCE? How do I lock fields in this fm against update?
Thx a lot,
Ali
08-29-2007 4:26 PM
Hi,
VIEW_MAINTENANCE is called inside VIEW_MAINTENANCE_CALL.
During debugging you can put a break-point at this FM. You need to change the parameters of the X_NAMTAB. You can set READONLY = 'R' for you selected fieled - result Uneditable column or you simple remove the field from here . In that case that particular Column will not appear at all.
hope it helps.
06-19-2015 1:55 PM
Hi,
Function module VIEW_MAINTENANCE_CALL
Call for VIEW mode.
Call for EDIT mode.
Regards,
Alfonso.