2008 Jul 16 6:19 AM
Hello Abapers,
Can anybody explain with some examples. How to call a mainetenance view from a program.
Thanks
Ranjith.
Hello Abapers,
Can anybody explain with some examples. How to call a mainetenance view from a program.
Thanks
Ranjith.
2008 Jul 16 6:27 AM
Use FM 'VIEW_MAINTENANCE_CALL'.
REPORT zmaintaintest.
&----
VARIABLES / CONSTANTS
&----
CONSTANTS:
c_action(1) TYPE c VALUE 'U', "Update
c_viewname TYPE tabname value 'ZEMP_EXAMPLE', "View Name
c_field(6) TYPE c VALUE 'EMPNO'. "Field Name
&----
INTERNAL TABLES
&----
DATA: itab_rangetab TYPE STANDARD TABLE OF vimsellist,
v_empno TYPE zempno,
wa_rangetab TYPE vimsellist.
&----
SELECTION SCREEN
&----
PARAMETERS: p_empno TYPE zempno OBLIGATORY. "Emplyee ID
&----
AT SELECTION-SCREEN
&----
AT SELECTION-SCREEN.
Chcking the existence of the user in EMPLOYEE table
PERFORM validate_employee.
&----
START_OF_SELECTION
&----
START-OF-SELECTION.
This will restrict the user view so that user can only view/change
Table data corresponding to his/her Employee ID
PERFORM define_limited_data_area.
Displaying table maintenance view for a particular employee ID
PERFORM call_view_maintenance.
&----
*& Form validate_employee
&----
Validate plant entered in the selection screen
----
FORM validate_employee.
SELECT SINGLE empno u201CEmployee ID
FROM zemp_example u201CEmployee Table
INTO v_empno
WHERE empno = p_empno.
IF sy-subrc <> 0.
MESSAGE 'Not an Valid User' TYPE 'I'.
ENDIF.
ENDFORM. "validate_employee
&----
*& Form DEFINE_LIMITED_DATA_AREA
&----
To restrict the user view so that user can see/change table data
corresponding to his employee ID. Here one internal table is
getting populated with field name as u201CEMPNOu201D (Key field of the table)
And value as given by user in Selection Screen and this is passed as
Parameter in function module 'VIEW_MAINTENANCE_CALL'
&----
FORM define_limited_data_area.
CLEAR wa_rangetab.
wa_rangetab-viewfield = c_field.
wa_rangetab-operator = 'EQ'.
wa_rangetab-value = p_empno.
APPEND wa_rangetab TO itab_rangetab.
ENDFORM. "define_limited_data_area
&----
*& Form CALL_VIEW_MAINTENANCE.
&----
Displaying table maintenance view for a particular employee ID
&----
FORM call_view_maintenance.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = c_action
view_name = c_viewname
TABLES
dba_sellist = itab_rangetab.
ENDFORM. "call_view_maintenance
Regards,
Joy.
2008 Jul 16 6:29 AM
Hi Friend,
Use function module 'VIEW_MAINTENANCE_CALL' to call a maintainance view from program.
Regards
Krishnendu