Need to validate a existing field in the table maitainence Generator events

Hi EXPERTS,
There is one Z-table and for that TMG also there. There is custom transaction for sm30. Now I need to validate one field BNAME for new entries I have created event -05(creating new entry) it is validating correctly. But now another requirement is if user also wants to change the existing values for the field BNAME it should also be validated needs to populate error mesg and does not allow to save it. I used event 01(before saving data) 07 ( before correcting the contents of selected field) 18 ( after checking whether data has changed)but not working any of these events. Please suggest me which event is  suitable for my requirement. Orelse I need to put the code in the  flow logic of the screen under PAI module I think this is not a good practice.
Code:
FORM data_changed.
  DATA     : l_bname TYPE xubname.
  CONSTANTS: c_mesg      TYPE char16   VALUE 'Invalid SAP User',
             c_error     TYPE char1    VALUE 'E'.
* Validation on BNAME field
  IF zps_capex_appr-bname IS NOT INITIAL.
    SELECT SINGLE bname FROM usr01 INTO l_bname
           WHERE  bname = zps_capex_appr-bname.
    IF sy-subrc NE 0.
      MESSAGE c_mesg TYPE c_error.
    ENDIF.
  ENDIF.
ENDFORM.                              "DATA_CHANGED
Please suggest me how to proceed.
<Added code tags>
<< Priority normalized >>
Awaiting for your replyu2026
Thanks in Advance.. 
Edited by: Rob Burbank on Mar 2, 2012 9:23 AM

Hello Sreekanth,
How are you populateing the field zps_capex_appr-bname ? I'm pretty much sure that this is not getting populated at runtime.(put a break-point & check)
In order to access the data in the TMG [Event01|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm], we have to use the TMG system tables - TOTAL & EXTRACT.
If your validation of BNAME fails, remember to:
1. Set SY-SUBRC to a non-zero value,
2. Set the flag VIM_ABORT_SAVING to 'X'.
BR,
Suhas

Similar Messages

  • Include a field in the table maintenance generator

    Hi All,
    There is a Z table with MATNR and another numeric field and the table maintenance generator exists for the table. The requirement is to include another field for MAKTX ( Material description) in the table maintenance generator with input disabled. Is it possible to do the same in the table maintenance generator else please suggest me the best solution.
    Thanks in Advance.

    Hi Srinivasa,
    This is quite simple, first add the field MAKTX into the Table and activate it .
    Now again generate the Table maintainence for the table.
    from Table maintainence generator go to the main program
    there click the screen maintained for Table maintainence generator .
    in the Pbo of the screen write the following code.
    assume table name is table1.
    Loop at screen.
    if screen-name = table1-maktx.
    screen-input = '0'.
    modify screen.
    endif.
    endloop.
    this will automatically disable the material description field in the Table Maintainence Generator.
    This is will solve your problem
    Regards,
    Madhavi

  • How to disable a field in the table maintenance generator of a table

    dear experts,
    i have created a table with  2 fields A ,B . i had created table maintenance generator  for the table. i am entering the values for the table through table maintenance generator . for filed A i had given dropdown list which contains  only 2
    entries YES & NO. my requirement is if i select YES in field A , field B should be in enable mode(it must take some input), if i select NO in field A, field B should be in disable mode ( it should not take any input).
    kindly help me....
    thanks & regards
    krishna

    Hi Krishna,
    A further to the above, you can go to SE11 and in the table maintenance generator click on
    Fn.Gr.Text button, then go to Main program.
    Here you will see "User-defined Include-files (if necessary). "
    Just uncomment the PAI include and put your code..to make the field editable or un-editable.
    To do that you might have to go to the screen painter and change that screen, to include those fields in a group or something, so that you can control them better.
    Regards,
    Sameer

  • All fields are not found in Table Maitainence Generator

    Hi all,
    I have create a table with ZPFT_TRAY with 6 fields and created table maitainence generator for the table.
    But when i check in SM30 i can see only 5 fields in Table maitainence generator.
    will anybody let me know why it is showing only five fields.
    Regards,
    Madhavi

    Hi madhavi,
    do one thing delete your old table maintenance generator and again create a new TMG , generate it properly and save it and then check in sm30. and if u have defined your own data element then fill the field label of that data element and activate ur table. because when ever you do any modification in your Ztable then you have to create again table maintenance generator othervise your modification will not reflect in sm30.
    hope this will help you.
    Regards
    Saurabh

  • Need help in Populating a Z-field in the table "MARD"

    Hi Group,
    I have a requirement like as under:
    1)
    Need to add a field in the transaction MM01/02/03 screen in the view u2018Plant data / stor. 1u2019. And this field should go into the table u2018MARDu2019 table, by appending the structure and adding this field details in it.
    2)
    Once I post a value into this field thru the transactions (MM01/MM02/MM03) , I need the value in the screen to be populated into the table u2018MARDu2019 in the Appended Structure field.
    Could you please help me out by getting a proper User Exit or BADI which fulfills the requirement?
    in Summary, please let me know a User Exit or BADI which will update the Z-field of the table 'MARD'.
    Thanks for the help in advance.
    Regards,
    Vishnu.

    please  check , it might help you.
    How to add fields to MM01 Transaction
    How to add a new field in MM01 with CONCEPT as a field?
    How to add a new field in MM01, with say contaminent  as a field?
    HI ALL, How can i add new field in mm01 basicdata1 screen
    Add button in MM01 Transaction
    i want to add the one field in mm01 application how can i add the field?
    If you dont get the answer still , please search the forum you will get many links for your requirement
    Regards
    Satish Boguda

  • I have reached full memory capacity on my 500GB Time Capsule. I am considering purchasing a 2TB Time Capsule. Do I need to resave all existing data on the new hard drive or can I start afresh? Or can I link both time capsules to operate independantly?

    Hi,
    I  have reached full memory capacity on my 500GB Time Capsule. I am considering purchasing a 2TB Time Capsule.
    a) Do I need to resave all existing data on the new hard drive or can I start afresh?
    b) Or can I link both time capsules to operate independantly?
    Thanks,
    Paul

    You may not need to buy a new Time Capsule. 
    You can connect a USB drive to the Time Capsule, and use it in addition to the TC's internal HD.  You may need a powered USB hub as well.
    Exactly what is on your TC?  If it's only Time Machine backups, you may not need to do anything -- Time Machine will delete the oldest backup(s) automatically when it needs room for new ones.  But if you have more than about 250 GB on your internal HD, that 500 GB may not be large enough to keep backups long enough.
    If you have other data on the TC's internal HD, besides your backups, you could back up to the external HD and use the internal for the other data, or vice-versa.  But TM backups cannot "span" two drives, and you shouldn't mix backups and other data on the TC's internal HD.

  • Changing the attibutes of a field in the table will affect existing data

    Hi Experts,
    If I want to changne the field attribute of particular field in the table, this table whoes field is changed is used in 15 more tables.Will that affect the data in production after changing the field attributes in all the 15 tables.
    Thanks in Advance.
    Regards,
    IFF

    Hi,
    Definitely data will effect in all tables and also you have to modify all the programs which are used modified tables.
    Regards,
    Peranandam

  • Add a custom-field in the table MARC and manage it in MM01/MM02/MM03

    Good day to all of you!
    I have this task: To add a custom-field to the table MARC. This custom-field will be managed through the MM01/MM02/MM03 transaction as follows:
    In the Basic Data 1 or Basic Data 2 the custom-field data will be added. Let's say the field is MATNR OBSOLETE.
    I have searched and implemented the things in customizing: Made a copy of function group MGD1, added the field on the screen.
    MY PROBLEM! How to manage it??? When the user enters MM01/MM02/MM03 and update this field, the field should be updated in MARC.
    1. I am not sure that this custom-field should be on Basic Data1 or Basic Data2.They want it at plant level.
    2. How to manage the data transfer from SAP Standard Program and my Custom Function Group.
    PLs: Do not paste me link to sap technical site with that example, because there takes the custom fields and UPDATE a CUSTOM TABLE. I need to update MARC!
    All the documentations i have read until now tell you how to add the field, ONLY the first part of the SOLUTION.
    Any help, pls?
    Good day and thank you!

    Hi Alex,
    In which way you are trying to update that custom filed. Have you written any logic in EXITS/BADIS?
    http://pavelgk.pbworks.com/f/6729224-Implement-Screen-Exit-for-MM01-Adding-New-Fields-in-Screen.pdf
    and
    Just read the OSS note mentioned earlier.
    Symptom
    You want to integrate customer-specific fields in material master maintenance.
    Other terms
    SAPLMGMM, RMDATIND, ALE, CI_MMH1, EXIT_SAPLMGMU_001 
    Solution
    To add customer-specific fields to an existing material master table (such as MARA or MARC) , you can proceed as follows as of Release 3.0C:
          1. Use an append structure to add the fields to the required table in the Dictionary (this is not a modification; for details, see the SAP document "ABAP/4 Dictionary"). In Release 3.x, the length of the field names must be the same as  the standard five character fields. This is necessary because of dynamic assignments. As of Release 4.0A, the lengths of the field names can be longer than five characters. If the changes of the fields should be recorded in the change document and taken into account during ALE distribution, set the 'Change document-relevant' indicator for the corresponding data elements. For table MARA in Release 3.x, you must also enhance the database view MARU because the database changes are carried out using this view. This small modification is no longer necessary as of Release 4.0A because the database view MARU is enhanced automatically when you enhance table MARA or the include EMARA (which is the data part of table MARA).
          2. Enhancing online maintenance in customized material master maintenance:
          Define a subscreen with your customer-specific fields in a customer-specific function group created as a copy of the standard function group MGD1.
          In Customizing, assign this subscreen to a maintenance screen using the "Copy customized material master" function. For details, see the Implementation Guide (IMG). As of Release 4.0A, program COPYMGD1 is available. You can use this program to create customer-specific function groups as required. This program is also incorporated in the Customizing function 'Configure customized material master'. Ensure that each field of the subscreen has a field statement in the flow logic, otherwise the data is not transported correctly. You can use subscreen SAPLMGD1 2002 as an example.
          If you want these fields to be subject to standard field selection, you must add new entries for them to the central field table for material master maintenance (T130F): 
          Application examples for standard field selection:
          The field is mandatory and is to be flagged with a "?".
          The field belongs exclusively to the purchasing user department. Purchasing data and MRP data are both contained on one screen. However, the MRP controller is not to see the purchasing data.
          The following data is required for each field:
                a) Field name        (T130F-FNAME)
                b) Field selection group (T130F-FGRUP)
                Here, you should use a standard field group if the customer field is subject to the same field selection as the standard fields of the standard field group. If it is not, use a customer-specific field group.
                You must then check and, if necessary, modify the attribute of the field group using the function "Maintain field selection for data screens" in Customizing under "Logistics Basic Data -> Material Master".
                Field groups 111 through 120 that are not used in the standard system are reserved as customer-specific field groups. As of Release 3.0F, additional customer field groups are available. (For details, see the IMG).
                c) Maintenance status (T130F-PSTAT)
                List of the user departments that may maintain the field. You can display possible values by using the input help for the maintenance status field in the Customizing activity "Configure Material Master" when maintaining logical screens.
                d) Reference        (T130F-KZREF)
                This indicator must be set if the field from the reference material should be proposed during creation with reference.
    Note: You cannot yet use Customizing to enhance table T130F; you can use only transaction SE16 (Data Browser) or transaction SM31. Future releases will include a separate Customizing function for maintaining customer-specific fields. See Note 306966. By implementing this note you can add entries to table T130F within Customizing. This type of maintenance is possible as of Release 4.5B.
    You may change the entries for standard fields only with regard to the reference data and field selection group. Changing other data for standard fields constitutes a modification. Therefore, you cannot use the Customizing function "Assign Fields to Field Groups" to change this data.
    In addition, you must not add new standard fields to table T130F.
          3. If you want to maintain customer-specific fields using data transfer by direct input or via ALE distribution, proceed as follows:
          Add the fields to central field table T130F (see above).
          Add the customer-specific fields to the data structures for the data transfer (for example, BMMH1 for the main data).
          Also, add the customer-specific fields to the tables in which the incorrect data is stored during direct input. These tables have the same name as the corresponding master data table and also have the suffix _TMP.
          For example: If you add customer-specific fields to table MARA, you should add the same fields to table MARA_TMP.
          If you use ALE, you must also add fields to the IDoc. To process enhanced IDocs, you can use enhancement MGV00001 with customer exit EXIT_SAPLMV01_002 for creating the IDocs and customer exit EXIT_SAPLMV02_002 for posting the IDocs.
          Prior to Release 3.0E, enhancing structure BMMH1 constitutes a modification. In this case, you must add the new fields tot the end of the structure before the last field (SENDE = record end indicator).
          As of Release 3.0F, structure BMMH1 contains the customer include CI_MMH1, which is part of the enhancement MGA0001. Here, you must proceed as follows:
                a) Add the customer-specific fields to include CI_MMH1.
                The names of the fields in CI_MMH1 must be identical to those of the corresponding fields in material master tables MARA, MARC and so on.
                Important: The fields must be CHAR type fields. Therefore, create CHAR type data elements whose lengths are identical to the output length of your fields in  table MARA and so on. Use these data elements in include CI_MMH1, but use the field names from table MARA and so on.
                b) Activate include CI_MMH1.
                c) If you have not used customer structure ZMMH1 before, create it as a copy of structure BMMH1 and delete the standard fields that you do not require. You are not permitted to delete field STYPE and include CI_MMH1 when doing this. If you have already used structure ZMMH1, add include CI_MMH1 to it.
                d) Activate structure ZMMH1. This also adds the customer-specific fields to ZMMH1.
    Run program RMDATING. This program generates routines which are supplied to your customer-specific fields from the input file. As of Release 4.5A, you also need to activate the routines/function modules generated by program RMDATING (especially, the MAT_MOVE_BMMH1_XXXX modules). Details about this subject (especially the procedure when using customer structure ZMMH1) are described in the IMG for transferring the material data under item 'Maintain Transfer Structure'. Also, check the declaration of structure WA in program RMMMBIMC to see whether it is declared with sufficient length. If necessary, enhance the declaration (for the time being, this still constitutes a minor modification).
    In addition, lengthen domain DI_DATA with CHAR 5000. As of Release 3.1H, this has already been done.
    Important: When using customer-specific fields, you can use only structure ZMMH1 to transfer the data. Otherwise, after the next SAP upgrade which contains new standard fields in structure BMMH1, the input files no longer match. If you want these new standard fields to be transferred, add them after your customer-specific fields (the order of the fields in structure ZMMH1 does not need to be the same as the order of the fields in BMMH1).
    If you want foreign key dependencies or fixed domain values to be checked, or another check for a customer field, this is possible up to and including Release 3.0D only by modifying the corresponding check function modules. As of Release 3.0E, you can use function exit EXIT_SAPLMGMU_001 (SAP enhancement MGA00001) for these purposes.
    If you want to use engineering change management to schedule future changes for your customer-specific fields or you want to use the 'Display at Key Date' function, execute program GENERATE in addition. This program generates the necessary assignments for interpreting the change documents. With regard to engineering change management, you must read Notes 60281, 60973, and 48962.
    To date, it is not possible to integrate customer-specific tables in material master maintenance without making a modification. However, you can create customer-specific development objects containing the essential additional logic. You can then integrate these development objects in your system as part of only a minor modification.
    check this link. It may helps you to solve your issue.
    Thanks
    Sravan

  • Field in the table but not in the datasource

    I have a datasource 0co_pc_act_05 based on mbew table . I need a field from that table , which is not present in the datasource , what should i do .?
    How can i get the field from the table into the datasource?
    Thanks

    hi Mike,
    try following steps
    - in r/3 transaction rsa6 choose the datasource, click enhance strucutre, then append structure, system will propose z..., confirm it, in the next screen, type in the field name e.g abcd
    - activate the append structure
    - back to rsa6 choose the datasource, click edit, remove mark in column 'hidden' field for that field, save the datasource.
    - in this case you no need to do user exit since that field exist in the origin table where the data extracted.
    - recheck with rsa3
    later in bw side
    - create new infoobject, then right click the datasource and 'replicate datasource', change transfer rules, move the new field from right side to left (to be included in transfer structure), then assign the field by type in the new created infoobject name, activate the transfer rules. include also this new object in infocube etc.
    hope this helps.

  • Fields missing in SM30 after adding new fields to the table

    Hi ABAPers,
    I added a new field & marked another field as primary key in the table. Then I generated the table maintenance view for the table in SE55 and adjusted Database utility SE14.
    When i saw the table in SM30. The number of fields in the overview screen of SM30 shows less field then existing in table. i.e in my table i have 10 fields(3 primary). in SM30 it shows only 5 fields(3 primary + 2 normal fields)
    In SE51, the overview screen of the table show less fields in the field list..
    I want all the fields in the Table maintenance overview screen. Please suggest me a way forward friends..
    Note: the system is 4.0B.
    Thanks...Suresh Kumar

    Hi
    You have to re-generate your dialog for SM30 by table maitenance generator.
    - From Se11 go to table maitenance generator
    - Choose update icon
    - Set flags for NEW FIELD
    - Go to expert
    - Set flag to re-generate dynpro
    Message was edited by: max bianchi

  • Adding a new field to the table

    Hello friends,
    I have a custom table and is in  use from a long time now.
    Now i need to add a new field to that table.
    1 - can i go directly to the change mode and then add it or is their any other way that needs to be followed.
    2 - once added do i need to go to SE14 and do something thr for the changes done to the table.
    This table also has a table Maintenence generator. Do I need to do something thr.
    Thanks,
    Bob.

    Hi,
    Check whether the change in ur custom table is going to impact any Custom program or not.
    If its so then adjust ur ABAP code so as to fit with the new table.
    Decide whether this field is going to be aprt of primary key or simple field.
    Is there any data present in ur custom table already?
    Regards,
    Lakshman.

  • Search Help on Table Control - Fill more than one field in the table?

    Hey everyone,
    I have built a screen with a Table Control on it... the fields of the table control are linked to an internal table...  The internal table has the line type of a structure I've defined in the data dictionary.  Within that structure in the data dictionary, I've linked some fields to search helps (For example, a MATNR and CUSTOMER search help)...  I've defined in the structure definition which fields from the search help are to be returned to which fields in the structure.
    The problem is, even though I have the search help set to export both the customer number and location when using the search help on the customer field, it still does not fill the location field within the table.  Is this a limitation of using search helps within table controls?
    I'm also finding that by defining the search help through the structure, instead of directly within the screen, the search help round button does not show up on the field, yet I can still press F4 to bring up the search help.  Is there a reason why it's not showing the search help clickable button even though it works fine using F4?
    For doing search helps in Table Controls, is it better to just build the search help, attach it directly to the field in the table, and then after the user picks the single field, use the PAI to run a select and fill the rest of the fields required?
    Thanks,
    Dallas

    Hi Dallas,
    (1)
    What  i understood is that you added a search help by defining it in the internal table type for a field customer number..in the search help you have 2 fields customer number and location...user press the search help ..then you need to fill 2 different fields or 1 field?
    if you need to fill the customer location or location (only one) then you need to set the "import" in the search help for whichever is required.....
    if you need to fill 2 or more different fields..then you can use the technique you have mentioned last , to do a select in PAI and fill the fields....but this you can use if the combination for the fields is unique...eg: u have customer number and location..if customer X can be mapped to location X and location Y..when a select statement is done there are 2 options..so in such cases it is better to leave the option to the user otherwise if there is a clear mapping like customer X can be mapped only to location X then you can use the select..
    (2)
    usually when you define it as a type in the internal table the icon doesn't show up..but you can do alternative like mentioned..go to the table,find the search help for the required field if present or create a new one if required and place the search help mentioned in the screen itself..so as to see the icon...sometimes users are adamant that they need the search help icon to be seen..so it depends on if your user
    (3)
    as in the example of customer number and location mentioned we can provide them different search helps and do the needful processing in PAI to fill the fields
    Table controls may be used for different purposes and requirements....even a checkbox,push button can be placed as a field in table control and used,but yes most of the time requirements are like what is mentioned in your case...
    Regards
    Byju

  • I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    Hi Arun ,
    Can you explain little bit more ??
    what is account doc no? 
    what are the transactions should be displayed in your output??
    -Rajesh N

  • What is needed for sorting on two fields in a table control

    Hi Everybody
    I am going to certification in a couple of days. I need some help and was hopeing that you  guys could help.
    What is needed for sorting on two fields in a table control?
         One sorted table and two processing blocks
         Two standard tables and one processing blocks
         Two standard tables and two processing
    Which one is corret??
    //Script

    Hi Kimallan
    I am not sure what is meant by a "processing block". However, it seems the question wants the original table order to be preserved. If so; as far as I understood the problem we need:
    itab_proxy[] = itab_main[] .
    "two standard tables"
    SORT itab_proxy BY field1 field2 .
    If we have a sorted table, then it is always sorted by its keys. So, the question seems to become obsolete for that option.
    Hope I've understood correct...
    Regards
    *--Serdar
    [email protected]

  • In the Dreamweaver brim Bindings, the recordset and all of the fields of the table are not EXHIBITED

    In the Dreamweaver brim Bindings, the recordset and all of the fields of the table are not EXHIBITED. I don't know if an option of configuration adjustment exists in Dreamweaver that corrects the problem. It is Dreamweaver CS4 - Version 10.0 build 4117.

    I have traced the problem to a corrupted profile.  When I captured the images in question, I also used Color Cherckr to create a profile for processing.  When I apply that profile to the adjustments I make, I can no longer "Edit In".  If I use another profile, even one that I created using Color Checkr at a different point in time, I don't have the issue.  Something seems to have corrupted the new profile.  I will re-create the profile and see if the issue is resolved.

Maybe you are looking for

  • Upgrade Oracle 9Upgrade Oracle 9.2.0.6 to 9.2.0.8

    Hi, I want to upgrade Oracle Database from Upgrade Oracle 9.2.0.6 to 9.2.0.8. And Application is 11.5.10.2 Can some one pls guide me Which Patch should I donload from Metalink. Thanks,

  • One calendar all of a sudden doesn't display

    One of my calendars won't show any of it's appointments. It clicks between a checkmark and a horizontal line and in neither case does it show appointments. It doesn't click to blank in the box. The same calendar on mobile me retained it data but I'm

  • Unable to kill a session in SM50 or SM66

    One of our developer was working on a program and there was a network failure.  When we got the network back the system shows the process is till running since 3 days. Tried to kill it from SM50 and SM66.  While logging in it is giving 3 options and

  • Main display removed - desktop

    With the main LCD display removed, will the OS automatically make an external display the default? or will it still try and display the tool bar on the non existent LCD?

  • ITunes without a computer

    How do I set up iTunes with a computer? I have an iPad 3 with an external drive that contains around 50 ripped CD's.