Editable alv: add custom validation and display "errors" in protocol list

Hi,
What I want to do:
PAI validation of editable alv with displaying error's in the protocol list by adding custom entries to the existing protocol object.
What is my problem:
After registering "data_changed event", the protocol list don't appear.
My understanding is, that the object "er_data_changed" is passed by the event "data_changed"
an so I thought I can add some more entries to the protocol list.
After "de-registering" the "data_changed" event, the protocol appears with the standard errros messages (e.g. "input to numeric" by enter charachters)
One more hint:
By creating a new object "er_data_changed" in the handler method the protocol list works, but I would like to append entries to the object that was passed with the event.
Probably I've misunderstand something, please help !
My coding:
PAI:
trigger event "data_changed" -> calls handler method
  CALL METHOD r_myalv->check_changed_data
    IMPORTING
      e_valid = is_valid.
stop processing
  IF is_valid NE 'X'.
    MESSAGE 'invalid input' TYPE 'E' .
  ENDIF.
handler method:
handle_data_changed FOR EVENT data_changed  OF cl_gui_alv_grid  IMPORTING e_ucomm
                                                                                er_data_changed.
METHOD handle_data_changed.
    data: ls_mod_cell type lvc_s_modi.
     CALL METHOD er_data_changed->add_protocol_entry
                EXPORTING
                       i_msgid     = 'SU'
                       i_msgty     = 'E'
                       i_msgno     = '000'
                       i_msgv1     = 'This is a test !'
                       i_fieldname = ls_mod_cell-fieldname.
     er_data_changed->refresh_protocol( ).
     er_data_changed->DISPLAY_PROTOCOL( ).
ENDMETHOD.                    "handle_data_changed

Dear Olaf,
    If understood correctly, you want to Edit an ALV and do some data validations when some data is changed in an ALV.   To do this follow the following steps:
1.   Before displaying ALV, Register the edit event.
* Set cell modified to trigger data_changed
CALL METHOD go_alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
2.  Register the event DATA_CHANGED of class CL_GUI_ALV_GRID & handle the event.
SET HANDLER lo_event_receiver->handle_data_changed FOR go_alv_grid.
The event DATA_CHANGED of class CL_GUI_ALV_GRID has a parameter ER_DATA_CHANGED which is of type CL_ALV_CHANGED_DATA_PROTOCOL.
This er_data_changed has internal table MT_MOD_CELLS(contains index of records changed ) & MP_MOD_ROWS(contains the changed row), using these update your internal table accordingly.
DATA : wa_mod_cell TYPE lvc_s_modi.
FIELD-SYMBOLS: <fs> TYPE table.
LOOP AT er_data_changed->mt_mod_cells INTO wa_mod_cell.
ASSIGN er_data_changed->mp_mod_rows->* TO <fs>.
READ TABLE <fs> INTO wa_output INDEX wa_mod_cell-tabix.
MODIFY lt_output FROM wa_output INDEX wa_mod_cell-row_id.
ENDLOOP.
3.   Here it self you can do the required data validations(No need of any PAI modules) as below.
IF wa_orders-zfstfirmtyp = c_9.
MESSAGE s288(zcsp).
DELETE er_data_changed->mt_mod_cells.
EXIT.
ENDIF.
Regards
Kesava

Similar Messages

  • Custom Validations and Error Handling

    Hi
    I have a requirement that I have to use the custom validation and the errors and/or exceptions should display in the page. All the errors needs to be displayed in the page at the same time.
    Suppose If i have two fields like...1)First Name and 2) BirthDate ...both are required fields. If user does not enter any values for both the fields, the errors should display in the page like 'First Name is required! Save Failed' /n
    'Float the mouse cursr over the red arrows to see the filed serror mesg'. So all the errors in JSF page should be recorded and displayed when user mouse over taht particular component.
    I am new to JSF. Can you please anybody tell me what is best way to implement this in JSF?

    We should not use the JSF built-in validation framework and desiging the custom validation. For that we are writing the validate() method in BackingBean.
    My Requirement is as follows...
    Capture all the errors in JSF page and display the same JSF page with all the errors.
    For example: If I have 5 fields in form, and 3 fields out of it fails in validation ...we need to show the page with all the fields and some kind of Red border and arrow on the fileds that are failed in validation.
    Also in the bottom of the page we need to display the first field error mesg .....
    -- Suppose say First Name, Last Name, DOB, Gender, Field5 are the fields and only Last Name, DOB and field5 are failed in validation...
    Then we have to display in the botton of the page **{color:#ff0000}'Last Name is required! Save Failed{color}**' along with this,
    We need to display the mesg *{color:#ff0000}''Float the mouse cursor over the red arrows to see the filed error mesg'{color}*. -> This means we are dislaying the page with red arrows on the fileds that are failed in validation.
    So when user mouse over in the arrow...we should display the error message for that particular field.

  • How to validate VO result and display error message?

    Hi,
    I have created 2 pages:
    Page 1: User to enter employee number and click 'Go' button to search (redirect to Page 2)
    Page 2: To display employee details
    In situation where employee is suspended, employee detail will be display as blank in Page 2.
    At the same time, we would like to display error message which inform user to refer to HR Department for this scenario.
    Need guidance on how to perform the validation and display error message.
    Thanks and Regards,
    Shiau Chin

    Hi Shiau,
    In this case instead of redirecting to next page, throw an exception on the same page.
    If you want redirect it to next page then while redirecting it to next page pass some info that can indicate that employee is suspended, get this value in Process request if it has value then throw exception else query details.
    Regards,
    Reetesh Sharma

  • How to enhance DEBMDM06 to add custom segments and do mass message transf

    Hi Team,
    I have a requirement to transfer multiple IDocs(Customers) as a single IDoc to PI (Earlier XI) system. As I know this could be done by doing necessary config in ALE and execute the transaction MDM_CLNT_EXTR(MDMC specific to customer master day) by creating a variant with proper Extraction Object details. This works perfect with only standard idoc type DEBMDM05/06.
    1. I have extended the IDoc type DEBMDM06 to ZEUDEBMDM06
    2. Created a new message type ZDEBMDM (using WE81)
    3. Assigned the message type to IDoc type(using WE82).
    4. Created a new extraction object ZCUSTOMER_EXTRCT from CUSTOMER_EXTRACT by executing
        program 'MDM_METADATA_MAINTAIN'.
    5. Maintained the view 'VMDMMETA' using SM30 to add custom segments and altered the positions according to new IDoc type.
    6. Found a user exit to fill custom segments.
    7. Executed the transaction MDMC, in the debug managed the hord coded extraction object from 'CUSTOMER_EXTRACT'
        to 'ZCUSTOMER_EXTRCT'.
    This has generated a single IDOC for 2 customers but ulike one segment for one customer, it has addes somany segments at same level.
    Can we enhance the mass message transfer concept so that we can use it for extended IDOC type so that I can have custom segment types added ?
    Thanks in advance...
    Arun
    Edited by: Arunkumar Ponnoju on Sep 8, 2009 11:31 AM

    hi Caíque  ;
    Firstly thanks for your answer.But your badi is at CRM side, I want to fill BDOC with custom fields from ECC to CRM when I changed them in IE02 of ECC.
    Do you know there is any badi after BDOC is filled in ECC.
    Regards.

  • I have been using CS6 for two years without incident.  Suddenly the Media Encoder stops working, showing APPCRASH and displaying error message about WatchFolder.dll - I tried uninstalling and re-installing to no avail - can anyone help

    I have been using CS6 for two years without incident.  Suddenly the Media Encoder stops working, showing APPCRASH and displaying error message about WatchFolder.dll - I tried uninstalling and re-installing to no avail - can anyone help?

    Hi Mylenium,
    Thanks for your response.
    Here is the error information showing up:
    Problem signature:
      Problem Event Name: APPCRASH
      Application Name: Adobe Media Encoder.exe
      Application Version: 6.0.0.382
      Application Timestamp: 4f62fcf1
      Fault Module Name: WatchFolder.dll
      Fault Module Version: 6.0.0.382
      Fault Module Timestamp: 4f62f37f
      Exception Code: c0000005
      Exception Offset: 0000000000007899
      OS Version: 6.1.7601.2.1.0.768.3
      Locale ID: 4105
      Additional Information 1: 9a62
      Additional Information 2: 9a620826d8ae4a2fa8b984b39290a503
      Additional Information 3: 1fb3
      Additional Information 4: 1fb304eee594288faeefbf1271b70d37
    I am using a PC Windows 7

  • How do I display line numbers? I am using the International Digital Publishing Forum EPUB Validator and the error messages refer to line numbers. Thanks, Earl

    The validator gives me error messages messages that refer to line numbers and positions - very unhelpful. I need to be able to display the line numbers in the reader to find the places where the errors are. Can anybody point me in the right direction? MUch appreciated. Earl

    Adobe Reader can't display epub files. Adobe Reader can't display line numbers.

  • Urgent : Problem with Editable  ALV Grid  for Quantity and Currency Fields

    Hi All,
    I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
    When user changes these values these values are not changing properly .
    For the quantity field the domain is MENG13 with 3 deciamal places and here  if we enter 500 it takes it as 0.500   .
    The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
    Here also it takes last 2 digits after decimal places by default.
    Please advice how to get proper values in this case from ALV editable fields.
    Thanks and Regards
    Harshad
    Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AM

    for all the currency field , it will display like that only.
    u have to manipulate uin program before displaying.
    if they are giving 500, in program multiply with 100 and move it to table.
    when u are getting from table, divinde and display.
    this is what I am doing.
    Reward if helpfull.

  • Validation and displaying as log file

    hi i need to do some validation! actually in my program the delivering country and the import code works as the key. so i need to check that the delivering country and the import code is present in a table t604.(i am updating data from presentation server to an internal table)
    and also i need to check that whether the country of origin is in the table t005 or not.
    if the validations are success then put those into a log file and dsiplay otherwise put the error record in a log file and display and also the total; no of error records and the no of records!!
    can u people plss help me!!

    Dear Sonia,
    u can try this.
    1. Make the dropdown fields mandatory( by changing 'State' property.)
    2. Use the "Check_mandatory_attr_on_view " method...
    Just follow the code........
    data:
    lo_view_controller        TYPE REF TO if_wd_view_controller,
    msg_tab                     TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.
      lo_view_controller = wd_this->wd_get_api( ).
        cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
        EXPORTING
        view_controller = lo_view_controller
        IMPORTING
        messages = msg_tab ).
    Hope this will solve ur purpose. Let me know...
    Regards,
    Aditya.

  • New to web design. how to add feedback form and display comments in page?

    I have created a site using muse. Cient wants me to add a feedback page that has form and displays comments on page. She only wants to pay for web basics bc plan. I know I can export html and can edit using DW but I have never done this nor do I know much about coding.
    Does anyone know how to do this and could walk me thru it please?
    Thank you in advance

    Hello,
    There are ample learning resources that will teach you how to achieve this. Please see if the following help you:
    http://www.adobe.com/inspire/2012/12/configuring-forms-muse.html
    http://tv.adobe.com/watch/adobe-inspire-magazine/configuring-forms-in-adobe-muse/
    http://www.adobe.com/in/products/muse/html-contact-forms.html
    Regards,
    Suhas Yogin

  • Customizing 400 and 500 error pages

    Hello,
    We are using default 404 and 500 error pages, how can I customize these error pages?
    I have changed the default error page under global settings, however it is still not showing the error page which I have changed?
    Could someone help in this regard.
    Thanks in advance
    Message was edited by:
    419365

    Normally those are page not found errors.
    I got the steps from metalink. See below.
    Subject: Changing the default error pages
    Hi,
    Steps mentioned below are used to have customize error message page for http 404 error,you can find out error no. for 'internal server error' and apply same steps.
    1.Create an HTML file (Say test.html) as per your requirement and place it in
    application_home\Apache\Apache\htdocs folder.
    2.Edit the HTTPD.conf file and Uncomment the Local redirects as follows
    # 2) local redirects
    ErrorDocument 404 /test.html
    Save it.
    3. Restart the HTTP server.
    ********

  • How to upload images in to custom table and display them in normal ABAP report?

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

  • Reading text file and display in the selectOnechoice list item In ADF.

    Hi,
    I have a requirement to read the text field which have list of strings and that string display in the SelectOneChoice List item component on page load.
    I am using Jdeveloper 11.1.2.3 version.
    Any suggestion will highly appreciated..
    Thanks in advance.
    Regards

    Hi,
    Google will produce you with hints on how to read content of a file from Java (ideally the file uses some delimiter). Then in a managed bean, you read the file and save its content in a list of SelectItem. So your managed bean should have the following property and setter/getter pairs
    ArrayList<SelectItem> listFromFile = new ArrayList<SelectItem>();
    public void setListFromFile(ArrayList l){ //you don't need this }
    public ArrayList<SelectItem> getListFromFile(){
       //read file content and iterate over the file list entries
      for(i=0, i < fileContent.length, ++i){
         SelectItem si = new SelectItem();
         si.setValue(... the value to update the list of value with ...);
         si.setLabel("... the label to show in the list ...");
         listFromFile.add(si);
      return listFromFile;
    }The af:selectOneChoice component should look as follows
    <af:selectOneChoice id=".." value="...attribute to update with selection ..." ...>
       <f:selectItems value="#{managedBean.listFromFile}"/>
    </af:selectOneChoice>Frank

  • Using edit text control for storing and displaying text of 1000 characters

    Hi all,
    I have a requirement to provide a field for remark in one of dialog screens, for saving remarks of up to 1000 characters. I made container and edit control and add a field LCHR in database table with preceding INT4 field. Then I use this code to save/read data in/from database table:
    CALL METHOD editor->get_textstream
         EXPORTING
           only_when_modified = 0
         IMPORTING
           text               = mytext
         EXCEPTIONS
           OTHERS             = 1.
    in user command and:
    CALL METHOD editor->set_textstream
         EXPORTING
           text = mytext.
    in status.
    Then in read I tried to select single LCHR field from that row and put it in mytext TYPE string. In save I save mytext as LCHR field in database table. There is no error anywhere but it doesn't work. Is it even possible to save STRING text in LCHR field of database table?
    What is alternative? Text objects from SE75?

    Having a string in a database table is absolutely independent on having some trouble in the program. If you got an error saying you need only flat structure, that means you can't use a deep structure in the context.
    I suppose you are using the structure on the screen or ALV. You can only use a flat structure there (no strings, no sub-tables...) as you would not be able to render a deep-structured data on the screen. Of course, ABAP could handle that e.g. by ignoring those deep fields, but we would want too much.

  • Editable ALV with New Row and Save

    Hi Experts,
      I created an ALV report which is editable, add a New Row with SAVE options.
    Problem is: when i try to save the changes using SAVE button in the application tool bar for the coloumn in the specific row, the event is not triggered and the changes were not available. However if i press Enter and then the SAVE the changes were available and i am able to update it.
    I do not want to press ENTER after doing the changes, All i want is to press SAVE to save my changes.(one click)
    How can I do that? Thanks.

    Thanks satish,
    From the thread,
    We have to either press return key (enter) or switch between cells. But the problem here is with the user, they do not want to do it either way. All they want is to press the save button in the application tool bar after the data is changed in the cell.
    Any inputs will be greatly appreicated.
    Thank you.

  • Trying to look Contents for a new custom InfoCube and giving ERRORS ?????

    Hi all,
        I have created a custom InfoCube (ZTEST_PS) in similar to 0PS_C04. When I try to look the Contents of this InfoCube through Manage --> Contents or Listcube Tcode option, it is giving the following warnings/errors for every attempt:
    1. Your user master record is not sufficiently maintained for object Company Code Hierarchy
    Diagnosis
    When checking your authorizations for object 'Company Code Hierarchy' (technical name: ZCOMPHIER) it was established that you do not have authorization in your user master record for this object (return code 12).
    Procedure
    How you continue depends on the return code. See the online documentation for ABAP language element "AUTHORITY-CHECK". Please note:
    With a return code of 12, the object 'Company Code Hierarchy' has not been maintained in the user master, meaning there is no profile in the user master record in which this authorization object has been entered. This is, however, absolutely necessary, as all of the authorization objects created in the development class RSR are validated in the 'and' link. If the authorization is missing for only one object, the request is rejected as unauthorized.
    Get the person responsible for your authorization to create you a profile containing authorization for object Company Code Hierarchy.
    2. System error: RSDRC / FORM AUTHORITY_CHECK USER NOT AUTHORIZED ZTEST_PS ZTEST_PS
    3. System error: RSDRC / FUNC RSDRC_BASIC_CUBE_DATA_GET ERROR IN RSDRC_BASIC_QUERY_DATA_GET ZTEST_PS 64
    Message no. DBMAN100
    4. System error: RSDRC / FORM DATA_GET ERROR IN RSDRC_BASIC_CUBE_DATA_GET ZTEST_PS 64
    When I try to run a query against this custom InfoCube, I am getting the same First Warning.
    How can I fix theses warnings/errors, PLEASE ?
    Thanks.

    Venkat,
    You dont have authorizations for the 'Company Code Hierarchy'ZCOMPHIER , you dont have authorizations.
    What you will have to do is ask the basis person to give you authorization for the Hierarchy , Or if you can ..switcg off authorization checks for the Cube in T-Code RSSM.
    Regards,

Maybe you are looking for

  • Driver for ATI Radeon 9000 Pro 64MB

    Greetings, I'm buying the abovementioned card from a friend and need the driver for 9.2.1. This was a stock OEM card for PM G4 FW800 and perhaps others. Will the driver be embedded in the 9.2.1 install or do I need to source it elsewhere? Where on th

  • 0% idle time of cpu states from top command in oracle 8i /solaris 5.9

    Hi, for long time idle time is 0% in top command : database version:oracle 8.1.7.4.0 operating system : sun solaris 5.9 load averages: 9.32, 5.78, 6.13 15:22:13 404 processes: 387 sleeping, 13 running, 4 on cpu CPU states: 0.0% idle, 78.2% user, 21.8

  • No SOAPAction in dynamic proxy client

    I am trying to consume a .NET Web service from a J2EE client. I am using a dynamic proxy client from http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC5.html#wp79973 However, I am have a problem with the SOAPAction HTTP header. .NET require

  • My Apps are not updating on my iPad just showing "waiting" why?

    My apps are not updating and just showing "waiting" why? Anything I can do?

  • Cross Column Calculation

    Deal All, Assalam-o-Alikum, I have following table MY_TABLE (c1 number(5), c2 number(5)); and the data inserted in this format C1 C2 20 10 30 12 81 80 35 now I want to write the query that give the following result C1 C2 --- ---- ------comments for u