Validating records into a maintenance view

Hi folks!
I have a simple Z table (say ZTABLE) and a Z view based on it with some related description (say ZVIEW).  The ZTABLE has a DEC field (called COEF) with 2 decimals and it should have only numbers between 0 and 1.
I set the valid interval from 0 to 1 but, as help says, it's only checked for CHAR, NUMC, DEC, INT1, INT2 and INT4 data types.  Not for DEC.
Then I use an event on ZVIEW.  On SE11 I went to "Table maintenance generator" - Environment - Modification - Events.  So there I put the 05 event (Creating a new entry) and I programed the check.  It works fine for new entries, but if you have a record on table and you want to change the COEF field you can put there any number, even outside the 0-1 range.
I tried with the 01 event (Before saving the data in the database) but it seams to be called only for last record.
Could anybody tell me what can I do?
Thanks!

Hi,
Since it is a Z TABLE..
You can directly modify the flow logic in SE51.
Go to SE51
Give the program name - SAPL + Function group name
Screen number
Press change..
In the flow logic..
Add a module after the FIELD ztable-number, in the PAI event..
Ex..
FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
And in the module validate the number..
MODULE NUMBER_CHECK INPUT.
  IF ZTABLE-NUMBER <> '0' OR
      ZTABLE-NUMBER <> '1'.
     MESSAGE E208(00) WITH 'Not a valid number'.
  ENDIF.
ENDMODULE.
Thanks,
Naren

Similar Messages

  • How to delete records from standard maintenance view

    Dear Sir/Madam,
            i want to delete records from standard view " v_mmim_rep_cust "
    This is a standard maintenance view , used in MBLB report.
    here i found the records with different report name but same fields as shown below...
    REPORT             TABLE NAME     FIELD NAME 
    RM07DOCS         MKPF                 BKTXT
    RM07DOCS         MKPF                 BLDAT
    RM07DOCS         MKPF                 BUDAT
    RM07DOCS         MSEG                 ANLN1
    RM07DOCS         MSEG                 ANLN2
    RM07DOCS         MSEG                 APLZL
    YRM07DOCS         MKPF                 BKTXT
    YRM07DOCS         MKPF                 BLDAT
    YRM07DOCS         MKPF                 BUDAT
    YRM07DOCS         MSEG                 ANLN1
    YRM07DOCS         MSEG                 ANLN2
    YRM07DOCS         MSEG                 APLZL
    I WANT TO DELETE THE RECORDS FROM THE VIEW WITH REPORT = YRM07DOCS.
    PLEASE HELP ME.
    Thanks in Advance,
    Dastagiri.

    Dear Sir,
          when i did so , it displays a message that  " entry mseg zeile  must not be deleted ".
    hense i went through writing a program to delete the records from table mmim_rep_cust
    but it says that record not found.
    program logic : 
    delete from mmim_rep_cust
        where report in report
          and TABNAME in TABNAME.
    if sy-subrc = 0.
    write ' RECORDS DELETED SUCCESSFULLY'.
    else.
    write ' RECORD NOT FOUND'.
    endif.
    please guide me to delete the records from the view.
    Thanks in advance,
    Dastagiri.

  • Maintenance View Validations

    I have a custom table for which I am maintaining a Maintenance View.
    I want to provide some validations and checks on the fields entered by the user in that maintenance view.
    For example, if the user enters a value greater than 1000 in quantity field, I want to display a message saying that " enter only values below 1000". This is part of customer requirement.
    Can I provide validations on fields in Maintenance view and if yes, then how ?
    Thanks,
    Urmila

    Hi this may help u.
    Maintenance views offer easy ways to maintain complex application objects.
    Data distributed on several tables often forms a logical unit, for example an application object, for the user. You want to be able to display, modify and create the data of such an application object together. Normally the user is not interested in the technical implementation of the application object, that is in the distribution of the data on several tables.
    A maintenance view permits you to maintain the data of an application object together. The data is automatically distributed in the underlying database tables. The maintenance status determines which accesses to the data of the underlying tables are possible with the maintenance view.
    All the tables in a maintenance view must be linked with foreign keys, that is the join conditions for maintenance views are always derived from the foreign key (see Foreign Key Relationship and Join Condition). You cannot directly enter the join conditions as for database views.
    There are some restrictions for the attributes of the foreign keys with which the tables in a maintenance view can be linked (see Restrictions for Maintenance and Help Views).
    A standardized table maintenance transaction is provided (SM30), permitting you to maintain the data from the base tables of a maintenance view together.
    Maintenance mechanisms, like screens and processing programs, must be created from the view definition with the transaction Generate Table View (SE54). This makes it possible to create easy-to-use maintenance interfaces in a simple manner.
    You can find out how to create such maintenance mechanisms in the documentation BC - Generate Table Maintenance Dialog.
    Creating Maintenance Views
    Procedure
    Enter an explanatory short text in the field Short text.
    You can for example find the view at a later time using this short text.
    Enter the primary table of the view under Tables in the Tables/Join conditions tab page.
    Only those tables that are linked with the primary table (indirectly) with a foreign key can be included in the maintenance view.
    If required, include more tables in the view. In a maintenance view you can only insert tables that are linked to one another with foreign keys.
    Place the cursor on the primary table and choose Relationships. All existing foreign key relationships of the primary table are displayed. Select the required foreign key and choose Copy. The secondary table used in such a foreign key is included in the view. The join conditions derived from the foreign keys (see Foreign Key Relationship and Join Condition) are displayed.
    You can also insert tables that are linked by foreign key with one of the secondary tables that was already inserted. To do this, place the cursor on the secondary table and choose Relationships. Then proceed as described above.
    For maintenance and help views, there are certain restrictions on the foreign keys with which the tables can be included in the view (see Restrictions for Maintenance and Help Views). The foreign keys violating these conditions are displayed at the end of the list under the header Relationships with unsuitable cardinality.
    On the View fields tab page, select the fields that you want to copy to the view.
    Choose Table fields. All the tables contained in the view are displayed in a dialog box. Select a table. The fields of the table are now displayed in a dialog box. You can copy fields by selecting them in the first column and choosing Copy.
    All key fields of the primary table must be included in a maintenance view. In addition, all key fields of secondary tables that are not involved in the foreign key (that is, which are not linked via a join condition to a key field already included in the view) must be included in the view.
    This ensures that the records inserted with a maintenance view can be written correctly in the tables contained in the view.
    On the Selection conditions tab page, you can (optionally) formulate restrictions for the data records that can be displayed with the view (see Maintaining Selection Conditions for Views).
    The selection conditions define the data records that can be selected with the view.
    In the Maintenance status tab page, define the maintenance status of the view.
    The maintenance status defines how you can access the view data with the standard maintenance transaction (SM30).
    Choose .
    At activation, a log is written; it can be displayed with Utilities ® Activation log. If errors or warnings occurring when the view was activated, the activation log is automatically displayed.
    Go to Transaction SE54 with Environment ® Tab.maint.generator.
    From the view definition you can generate maintenance modules and maintenance interfaces that distribute the data entered with the view to the base tables of the view. You can find more information in Creating a Maintenance Dialog.
    Other Options
    Recording documentation: You can create information about using the view with Goto ® Documentation. This documentation is output for example when you print the view.
    Changing the data element of a view field: Select column Mod (modification) for the view field. The Data element field is now ready for input. You can enter a data element that refers to the same domain as the data element of the assigned table field here. Cancel the Mod flag if you want to use the data element of the assigned table field again.
    Enter the delivery class of the view: In the Maintenance status tab page, select the delivery class of the maintenance view. If you assign the delivery class G or E to the view, you must also maintain a customer namespace (key block) for the view entries. To navigate to the appropriate maintenance transaction, choose Define Customer Namespace.
    Entering the maintenance attributes of the view field: In the View fields tab page you can define the Maintenance Attributes of the view field in column F.
    Check functions: With Extras ® Runtime object ® Check you can determine whether the definition of the view in the ABAP Dictionary maintenance screen is identical to the definitions in the runtime object of the view. With Extras ® Runtime object ® Display you can display the runtime object of the view.
    table maintai9nenece generator
    The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator.
    Table maintenance allows you to create entries for that table
    Follow these steps to generate table maintenance
    1) Go to SE11 and check table maintanance check box under attributes tab.
    2) Go to menu Utilities -> Table Maintanance Generator ->
    Create function group and assign it under function group input box. You can enter same as table name for function group. Also assign authorization group default &NC& .
    3) Select standard recording routine radio in table table mainitainence generator to move table contents to quality and production by assigning it to request.
    4) Select maintenance type as single step.
    5) Maintainence screen as system generated numbers this dialog box appears when you click on create button.
    6) Save and activate table.
    useful links
    http://www.saptechies.com/how-to-create-table-maintenance-generator/
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ecdf446011d189700000e8322d00/content.htm
    http://www.saptechies.com/table-maintainance-generator/
    with regards,
    Hema Sundara.
    pls reward if u find it helpful.

  • Maintenance view field check.

    Hi,
    I want to insert new record into maintenance view and check some field that must be inserted.
    If i make them required so when i press "New Entries" all the redcord are ready for new entries and all the fields in each record are required so if the user insert only one record so he get msg that there are still required  fields to enter.
    Other problem is that i can save blank record in the maintenance view.
    Hope there is any good solution for those problem.
    I've tried coding abap in the flow logic of the screen but still it run on all the records.
    Thanks in advance.

    HI it very simple.
    Generate table maintanance generator screen for you maintanance view and wirte your validation in table maintance generator event.  create event new entry(05).
    *first create 05 event and give suroutine name as new_entry.
    form new_entry.
    *----here you have to put your validtion
    if ztable-f1 is not initial and
    ztable-f2 is initial and
    ztable-f3 is initial.
    message 'Enter value in all the fields' type 'E".
    endif.
    endform.
    for creating events in TMG refer below link
    To change top of page in Block ALV list display
    Regards,
    Peranandam
    Edited by: peranandam chinnathambi on Apr 2, 2009 11:18 AM
    Edited by: peranandam chinnathambi on Apr 2, 2009 11:19 AM

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • How to capture the data that the user modified in SM30(Maintenance view)

    Hello experts,
    I have a new requirement wherein when the user modifies a particular record in SM30(maintenance view)
    it would also update that certain records in another table. For example, I modified the address
    of record 1 in table1 so I need to automatically update that same record in table2. Help would be greatly appreciated.
    Again, thank you guys and have a nice day!

    Hi again,
    1. But how can I capture the data that was modified
    Yes, u are right.
    We will have to use the event,
    'BEFORE SAVING'.
    2. In that,
      u must fire a select query,
       from the same table,
       for the same record.
    3. In this, u will get the OLD DATA (which was already saved),
    4. Using this,u can compare,
       (either thru LOOP, or field by field)
      to know, which field value has been changed.
    regards,
    amit m.

  • How Can I Include a Transaction in Maintenance View

    Hi All,
    Can anybody help me on how can I release transactions to be available to the end user by putting it in maintenance view? There is a request to include the transaction S_ALR_87001487 into the maintenance view put I need to know how can I achieve this.
    Thanks,

    Hi Ahmad,
    Can you please explain clearly.
    Are you asking us on how to create a maintenance view for transaction S_ALR_87001487 . You can create a Z transaction of similar attributes as that of standard one and give authorizations for the ztransactions for which user will be allowed to edit.
    Regards,
    Gautham Paspala

  • How to Access Maintenance View from a program

    Hi Experts,
    I have created a maintenance view for a table. i want to insert data's into the table through the maintenance view. I don't know how to access the view, how to insert data into the Maintenance view. Please suggest me how to access the view from the program.
    with regards,
    James...
    Valuable answers will be rewarded...

    Hi,
    What is the need to search for a program.
    Use transaction SM30 or SE16 to create or maintain entries in the table.
    e.g. if the Maintenance view is created on table A, then Goto transaction SM30 or SE16 and give the table name as A and proceed. This will automatically take u to the maintenance view on tha table A.
    Regards,
    Himanshu

  • Maintenance view event for validation when changing data

    Hi All,
    I have a maintenance view on a table that should validate some fields during user input.
    I am using event 05 'Creating a new entry' to validate fields when user creates new entry in the table. That works fine.
    I would like to have the same validations happening when the user changes fields of records already existing in the database. I tried to use event 01 'Before saving the data in the database' but the problem with this is that user can change many fields of many records before clicking 'Save'. I would like to have the error raised for incorrect entry already after the change.
    So far I could not find an event to do this but only by changing the code itself. The problem with that is whenever the code is regenerated the custom part is lost.
    Is there an event I can use that would help me achieve this?
    Thanks in advance.

    Hi Abhishek,
    I tried event 21, I`m playing around with that since that`s the only one triggered when I press Enter.
    The problem with this is that
    - the check runs when you press enter, so you can still change many fields of many records (one step maintenance) before the validation runs
    - you can`t raise an error message, because only the key fields will be input ready, the non-key fields will be readonly
    The way I currently handle is I undo the changes in 21 (get previous field values from TOTAL) and raise an information message i/o an error informing user to check the entry.
    What I`m looking for is an event that will raise a message and set focus on the incorrect field (if there`s one such).

  • Getting Data from Maintenance view V001N into ABAP program

    Hello Experts,
    I have to fetch data from the maintenance view V001N in my ABAP program.  I have used select statement in my program but I am getting a syntax error  'V001N is not defined in the ABAP Dictionary as a table, projection view or database view. '.  V001N is a Maintenance view.
    Can anybody help me out how to get the data from that maintenance view into the internal table of my ABAP program.
    Regards.

    Sunil,
    check these threads
    https://forums.sdn.sap.com/click.jspa?searchID=18906946&messageID=6074746
    https://forums.sdn.sap.com/click.jspa?searchID=18906946&messageID=6088233
    so query on the tables which are used in the view
    Thanks
    Bala Duvvuri

  • Problem to add ADCP-DEPARTMENT into maintenance view

    Hi All,
    I need help urgently on creating a maintenance view of a customized table.
    The Customized Table name is ZTSUBCON, it contains fields below:-
    MANDT     - Client
    BNAME     - User Name in User Master Record
    ... (and other fields)
    I would like to create a maintenance view called ZVSUBCON and this view must be able to show the department of the User Name automatically when user maintain the data.
    Customized View Name : ZVSUBCON, contains fields below:-
    BNAME          - SAP Account that will be input by user thru transaction SM30
    DEPARTMENT     - This should be the information from ADCP table (field : DEPARTMENT), which must automatically display after user key in the SAP account
    ... (and other fields)
    I tried to create a foreign key BNAME with check table USR21, and try to add the table ADCP in "Table/Join Conditions" in SE11, but, it failed.
    Please help me if you know the solution.
    Thanks & Regards,
    Heng Lye

    Hello Heng
    Define your maintenance view with the following tables:
    ZTSUBCON (primary table)
    USR21
    ADRC
    ADRP
    These tables will give the following JOIN conditions:
    USR21     MANDT     =     ZTSUBCON     MANDT
    USR21     BNAME     =     ZTSUBCON     BNAME
    ADRC     ADDRNUMBER     =     USR21     ADDRNUMBER
    ADRP     PERSNUMBER     =     USR21     PERSNUMBER
    To receive the department from table ADCP use the key fields from ADRC and ADRP and fill the maintenance view field using <a href="http://help.sap.com/saphelp_nw04/helpdata/en/91/ca9f4aa9d111d1a5690000e82deaaa/content.htm">Event 21 fill hidden fields</a>
    Regards
      Uwe

  • Using user-defined transport recording routine with table maintenance view?

    Hi,
    I have  a table that is maintained through a maintenance view. I need to record the changes to a dedicated transport object (not TABU) with my own recording routine instead of teh standard recording routine.Could someone tell me which/how the events can be used to achieve this?
    Regards
    Rachana

    Hi Rajeev,
    I have changed TMG to choose the option - User defined routine. And I have created a new transport object in SOBJ for the table. Is this enough to record the object to the transport as the object i defined instead of TABU? Do I need to write some subroutine for any view event to achieve this? Do you mean to use the menu option to include the object to a request?
    I have a bigger problem where this view is actually part of a view cluster. Even in that case is teh above steps enough?
    Regards
    Rachana

  • Data validation in maintenance view

    I have a maintenance view which is just simply a projection of a database table.
    I'm trying to add a validation before user save the data, what I have done is add a standard event by using 'Table Maintenance Generator', there is an event 'Before saving the data in the database' which I think is proper place to do the validation.
    Now the problem is if the user input is invalid, after validation and message displayed on the screen, the entry user is editing will be locked, and cannot be back to editable even you click 'Change<->Display' button, user have to back to SM30 screen and re-enter again.
    The idea behavior is the screen stays and the entry is editable, user can correct his input immediately.
    So someone can provide any advice regard this problem?
    Thanks in advance.
    Ben

    Hi
    You can set the flag VIM_ABORT_SAVING in order to abort the saving process and back to maintenance screen without to go out from SM30
    I've found a my old code:
    * Check entries with same sorting key
       loop at t_sort_key_count.
         check t_sort_key_count-tot > 1.
         message i398(00) with <...............>
         vim_abort_saving = 'X'.
         exit.
       endloop.
    I use e message tyoe I instead of E, in order not to lock the process and back to imain screen
    Max

  • Ztables ,maintenance view , delete record , consistency

    hello , i create a few ztables one with code and other with descriptions
    let called it ztable01 -header , ztable02-descriptions
    make ztable01 foreignkey of ztable02 , and i create 2 maintenance view for they ( one per table )
    i create a record ( a new code ) in the ztable01 then i go to the ztable01 and create a new record using the code in create ztable01 ( search help show the new record ) now i go back to the ztable01 and delete that record of code used in the ztable02 and it allow me to delete it!!!! the abap dictionary don't do this kind of check ? i need config something special ? some info about ?
    Thanks

    >
    Lavanya K wrote:
    > HI
    >
    > For ur requirement, create a custom table and a text table for description following below steps.
    >
    > 1. Create custom table . Eg- MANDT, COUNTRY are key fields
    > 2. Create text table with field SPRAS (language), Country (this should have a foreign key field relationship with table from step 1. check radiobutton for -Key Fields of a text table) & Country Name.
    > 3. Maintain Table maintain generator for table in step1.
    > 4. If first table is maintained in step1 then description can also be maintained there. In background the text table will be automatically filled with the same entry in the logon language in which first table is maintained
    > 5. If entry from first table is deleted , in turn it is deleted from text table too
    thanks for that but i already known how do that , my question was if sap don't do that integrity check for itself i mean in the abap dictionary , example that let me delete data that have relationship with other ( foreign keys relationship ).
    the step 5 only happen with you do a maintained view with the second table how dependency ( maintained both table with the same view ) if that is you try to say i already known that , i was try maintained it with different maintenance view.

  • Splitting the single record into multiple records based on validity

    Hi Guru's,
    basically i am an BI consultant with less knowledge on ABAP, can i request your help on the ABAP task.
    I am working on HR module which is integrated with SAP BI,  the reports will be executed based on calendar month the requirement is i should split the single record into a multiple records based on validity of the record.  basically the HR data would be in data from and date to. 
    below is the logic
    Check whether the start and end date of the record are in the same month and year.
    If yes  nothing changes
    If no  create multiple records
    1st record  original start date of the record u2018till end of that month
    Following record  1st of the next month  u2018till last day of the month
    u2026
    Last record  1st of the month u2018till original end date.
    All fields will have the same values, only the datefrom and dateto fields change.
    Can any one please provide me the same code to proceed on my task.
    Thanks and Regards,
    Venkat

    Hi,
    Using Rule group we can split it.
    Using Rule Group in SAP-BI  Part - 1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/using%20rule%20group%20in%20sap-bi%20%20part%20-%201.pdf
    Thanks
    Reddy

Maybe you are looking for

  • Error:express document "Update was terminated" received from author

    Hi All, I m creating shipment frm the transaction VL01. While creating the shimpment i am assigning one Z output type and clicking on the planning phase on the shipment. After that i am saving my shipment. At this point of time my shimpmnet is create

  • Connecting shuffle to an existing itunes library

    i have a regular 20GB pod, but i also have a used shuffle that was given to me. ive never tried loading anything into the shuffle, what do i need to do in order to load songs into my shuffle as the shuffle obviously doesnt have the memory to load all

  • How to find list and cost price in MM module

    Hi Can any one help me in how to find List and cost price in MM module for pricing. thank you. David

  • Updated to DM 6 cannot connect my Bold 9700 anymore

    Hi there. I'm new to the blackberry community. I got a Bold 9700 three days ago. I was using DM 5, provided with the phone. It was working great. Yesterday I've updated to DM 6. At first it worked  perfectly, but today it just won't work. It asks for

  • Theme music plays, but no video

    I just watched a tutorial on iDVD, and wanted to get started, but I open the program, and a new project is ready for me, but when I click on the theme, the video won't show up. When I hit the moton button, the music plays, but no picture. I clicked o