REUSE_ALV_GRID_DISPLAY standard data validation routine

I am using REUSE_ALV_GRID_DISPLAY to display data from a custom table and allowing users to edit some fields. When the save button is clicked SAP automatically validates some data fields (for example MATNR) and alerts the user if there is an error. This is great!! But I need to execute some custom code when the user clicks the SAVE button. If SAP has detected an error and is going to pop up the Error Log screen for the user, I do not want to execute my custom code.
Does anyone know how to determine if SAP has detected problems with the data so I can skip my code and let the normal process flow continue?
I thought about trying to check if the all field values were valid using my own coding, but when I use the method CHECK_CHANGED_DATA  only valid field values are transfered to my internal table. So invalid fields AND fields that the user did not enter values into are all coming back as blank.
Here is a small portion of my code.
FORM user_command  USING    r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
  DATA ref1 TYPE REF TO cl_gui_alv_grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = ref1.
  CALL METHOD ref1->check_changed_data .
  CASE r_ucomm.
     WHEN 'SAVE'.
          "Do some custom coding here if SAP did not detect any errors with data validation
  ENDCASE.
Thanks for your help,
David

Hi,
In your user_command form
    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        it_fieldcat                 = i_fieldcat[]
        is_layout                   = pt_grplayout2
        i_callback_program          = 'YATTU0007'
        i_callback_html_top_of_page = p_header
        i_callback_user_command     = 'USER_COMMAND'
        it_events                   = i_events[]
      tables
        t_outtab                    = i_yatthdr.
In user_command form
* Form  user_command                                                   *
* This form will handle the user command from fm REUSE                 *
form user_command using p_ucomm type sy-ucomm
                     rs_selfield type  slis_selfield.
  data p_ref1 type ref to cl_gui_alv_grid.
  call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    importing
      e_grid = p_ref1.
  call method p_ref1->check_changed_data.
  case p_ucomm.
    when '&DATA_SAVE'.
   " WRITE YOUR CODE FOR SAVE
  endcase.
  rs_selfield-refresh = c_x.             " Grid refresh
endform.                                 " User_command

Similar Messages

  • How to make custom data validation on standard form.

    Hi,
    I have some little OAF experience. I have extended VO so far but I am still newbie.
    I need to make custom data validation on standard form.
    I Oracle Credit Management module on "Create Credit Application: Applicant" form I need
    to validate chosen currency against customer setup (whether there is customer profile amount for the currency).
    The page is /oracle/apps/ar/creditmgt/application/webui/ARCMCREDITAPPPAGE
    There are controllers on the page:
    oracle.apps.ar.creditmgt.application.webui.creditAppContentFooterCO 115.14.15104.2
    oracle.apps.ar.creditmgt.application.webui.creditApplicationPageCO 115.6
    oracle.apps.ar.creditmgt.application.webui.creditAppRegion2CO 115.13.15104.2
    oracle.apps.ar.creditmgt.application.webui.creditApplicationCO 115.8.15104.3
    oracle.apps.ar.creditmgt.application.webui.creditAppRegion1CO 115.28.15104.4
    oracle.apps.ar.creditmgt.application.webui.creditAppBusBackCO 115.6
    oracle.apps.ar.creditmgt.application.webui.OCMApplicantInfoRNCO 115.4
    creditApplicationPageCO is pageLayout controller.
    Please direct me how to achieve it.
    Which controller should I extend (if any)?
    How to get values from the page (customer site id, currency) and how to run custom sql in my CO class ?
    Regards,
    Marcin

    Hi Marcin,
    You have to find your GO button is handled in which standard controller, (if you click on the about this page, you should be able to identify the controller,
    or you can download all the controller .class files and decompile and check the logic).
    Then extend that controller(which has the Go button logic, you can see how it has been handled.),
    The usual way to check is
    if(pageContext.getParameter('<Go button name>') !=null)
    Since you want to validate first your custom validation, in the extended controller ProcessFormRequest
    dont call the super.processFormRequest unless your validation is success.
    Call the super at the end.
    Inside your extended controller you have to find your AM and then your required ViewObject to get the user entered values.
    Thanks,
    With regards,
    Kali.
    OSSi.

  • Excise Invoice Cancellation on Date validation only

    Hi Experts,
    i am having critical requirement from Business, which is not available in SAP Standard, So i need help from you guys...
    Excise invoice can be cancelled on the same day of system/posting date. but when the system date and posting dates are not matching it should through error..
    Example  : i created Excise invoice on 17th june,2011 this is posting date of excise invoice, if i try to cancell on 17th june , it should allow.
                        but when i try to cancell the excise invoice on 18th june (system date) , it should not allow to cancell and it say Error !!!
    i heard there will be possible through User Exit  OR Function Module OR Routins ... Please help me
    Thanks and Regards
    Madhu

    Dear Madhusudhanan,
    Following are the list of User Exits available for J1IIN
    J_1I7_USEREXIT_EXCISE_BEF_SAVE User exit after the excise header and details are written and they can changed in J1IS  , J1IIN and Automatic creation of Excise Invoice.
    J_1I7_USEREXIT_EXINV_ADDL_DATA User exit for Excise Invoice Additional Data    in J1IS and J1IG                 
    J_1I7_USEREXIT_J1I5_MATFORM    User exit for J1I5 material form changes                           
    J_1I7_USEREXIT_J1I5_VALIDATE   User exit for subsequent J1I5 data validation                      
    J_1I7_USEREXIT_J1IEX_BEF_SAVE User exit for J1IEX before the data is saved                    
    J_1I7_USEREXIT_J1IEX_CHANGE    User exit for changing data before display             
    J_1I7_USEREXIT_J1IS_BASE_VALUE User exit to Change base value in J1IS                
    I strongly believe that the first exit will serve the purpose.
    Now if you are cancelling it using J1IH, Check the following thread.
    J1IH-User Exit
    Thanks & Regards,
    Hegal K Charles

  • Date validation in ALV Grid output

    Hi Experts,
    I have created an OOP ALV output. There are a couple of date fields on the report output which are editable. I have referred the standard DATS type and hence I ma getting F4 help for date on the report output.
    Now, If the user enters an invalid date manually (without F4), the CHECK_CHANGED_DATA method of the CL_GUI_ALV_GRID does not read this invalid value and hence I am not able to validate the date.
    I do not want to create a custom search help for date.
    Please suggest how to validate the date in this case.
    Thanks.
    Regards,
    Rudresh

    Hi Rudresh,
    In PBO module, set handler for event 'DATA_CAHNGED'
    In PAI module always call 'check_changed_data( )' after a custom button click like below.
    Inside handler method of event 'DATA_CAHNGED' do validation for date.
    *PBO
    module status_0100 output.
    *Setting handler for event data_changed
            set handler g_o_main->data_changed for g_o_grid.
    endmodule.  
    *PAI
    module user_command_0100 input.
      clear: ok_code.
      ok_code = sy-ucomm.
      case ok_code.
        when 'SAVE'.  " Function code of ur custom button
          g_o_grid->check_changed_data( ).  " Raises event 'DATA_CAHNGED'
    endmodule. 
    *Class method
    method data_changed. " Handler method
    " Use table        er_data_changed->mt_good_cells[]  or er_data_changed->mt_mod_cells to get entered date
      endmethod.
    Thanks
    Edited by: Sap Fan on Sep 29, 2009 8:51 AM
    Edited by: Sap Fan on Sep 29, 2009 9:46 AM

  • Differences between Oracle's and ArcSDE's validation routines

    I am having a small number of problems with valid Oracle geometries not displaying through ArcSDE.
    I have read the following on ESRI's website.
    Features stored in Oracle's SDO_GEOMETRY can be validated after storage using Oracle's validation subprograms, such as VALIDATE_GEOEMTRY_WITH_CONTEXT. The validation rules are similar to, but not the same as, ArcSDE shape validation rules.
    Does anyone know what these differences are?

    I found an example which shows a difference of ESRI's and Oracle's validation routines:
    A polygon with two holes where the holes share one point.
    Here is the Oracle version:
    SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 33, 2003, 1, 43,2003, 1),
    SDO_ORDINATE_ARRAY(128212.114, 395486.529, 128176.43, 395481.085, 128177.792, 395471.529,
    128178.503, 395466.629, 128178.886, 395464.634, 128179.276,395463.348, 128180.136, 395461.264,
    128180.967, 395459.722, 128183.295, 395460.172, 128184.51, 395458.984, 128186.224, 395458.298,
    128188.128, 395458.374, 128204.149, 395461.887, 128212.15, 395463.629, 128215.611, 395464.395,
    128212.114, 395486.529, 128193.512, 395475.783, 128192.739, 395480.726, 128202.224, 395482.209,
    128203.003, 395477.267, 128193.512, 395475.783, 128193.814, 395473.856, 128194.085, 395473.898,
    128194.57, 395470.854, 128195.977, 395471.074, 128196.503, 395467.712, 128195.108, 395467.493,
    128195.515, 395464.937, 128187.326, 395463.655, 128185.922, 395472.622, 128187.078, 395472.803,
    128186.778, 395474.73, 128193.512, 395475.783, 128193.814, 395473.856))
    ESRI ArcCatalog (ArcMap) 9.0 stops drawing with an error message when this geometry is in the data set.
    The 9.1.version shows the geometry and continues drawing but draws a line from the common point to the origin point (0,0)
    which looks a bit strange in a map.
    Validating by SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT gives the result: TRUE
    ESRI validation-tools show an error. After a correction by ESRI tools we
    get the following geometry:
    SDO_GEOMETRY(2007, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 33, 2003, 1),
    SDO_ORDINATE_ARRAY(128176.43, 395481.085, 128177.792, 395471.529, 128178.503, 395466.629,
    128178.886, 395464.634, 128179.276, 395463.348, 128180.136, 395461.264, 128180.967, 395459.722,
    128183.295, 395460.172, 128184.51, 395458.984, 128186.224, 395458.298, 128188.128, 395458.374,
    128204.149, 395461.887, 128212.15, 395463.629, 128215.611, 395464.395, 128212.114, 395486.529,
    128176.43, 395481.085, 128192.739, 395480.726, 128202.224, 395482.209, 128203.003, 395477.267,
    128193.512,395475.783, 128193.814, 395473.856, 128194.085, 395473.898, 128194.57, 395470.854,
    128195.977, 395471.074, 128196.503, 395467.712, 128195.108, 395467.493, 128195.515, 395464.937,
    128187.326, 395463.655, 128185.922, 395472.622, 128187.078, 395472.803, 128186.778, 395474.73,
    128193.512, 395475.783, 128192.739, 395480.726))
    This is a polygon with one hole.
    Now Oracle shows an error:
    The Oracle validation function gives the result:
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(SHAPE,DIMINFO)
    13349 [Element <1>] [Ring <2>][Edge <15>][Edge <4>]
    This is a self intersecting polygon.
    The two holes are now a self intersecting polygon.
    I didn't find any way to get a geometry that is accepted by Oracle and ESRI
    without modifications of coordinates.

  • How to call routine and pass data to routine in vofm

    Hi Experts,
    I need to update KBETR and KWERT values present in 'Conditions Tab' in Purchase Order (ME21N/ME22N).
    I have created a new customer tab in which we enter amount field and  percentage filed. When user enters some value in this and clicks on 'Conditions Tab', calculation has to be done and the calculated value has to be appeared across a specific condition type.as i am new to abap  i dont know how to create routine and pass data to routine in vofm from customised tab in me21n .
                                                                                                                                                                          Thank's in advance

    Hello Rajendra,
    You can get plenty of forums in SCN related to it. Follow below steps to create VOFM routine.
    Go to VOFM Transaction Code
    1. On the Menu Select required Application i.e Pricing
    2. Enter any Number in between 600 to 999 for Custom Developments.
    3. On entering Pop Screen appears ask for Access Key(We have to remember that Every New Routine needs an Access Key)
    4. Once the Access Key is received we can do modification.
    5. Enter the Routine Number ,description and insert the Access Key
    6. Now the ABAP Editor will open and required code can be copied from Standard SAP Routine and Custom Code Can be developed.
    7. Once the coding is completed we have to Activate the Routine
    8. Select the Routine and Go to Edit – Activate
    9. Ensure that Active check box is ticked upon Activation of the Routine.
    10. Double click on the routine will enter into ABAP Editor, we have to generate the Routine
    11. Go to Program and select Generate
    12.A screen pops up with the related Main Programs  and select all required main programs wherever the Routine is being called.
    13. Once the Routine is Generated and Activated, We need to configure the Routine in the config.
    ** Important SAP note: 156230.
    Check the below document too.
    http://www.scribd.com/doc/35056841/How-to-create-Requirement-Routines
    Regards,
    Thanga

  • Data validation query change

    hi experts
    I got request to change one data validation query.
    In the existing query,I see three parts...in top(first part) part,we have one query view from One cube.....when we come to middle part(second)..it has one query view from second cube.....finally,the third and bottom part contains some excel formulas which substract middle part(second) total from top part(first) total and shows the result....
    so when I run the query it automatically populates top part(first) from one cube and second part(middle) from other cube and shows result in third and bottom part...
    my change request is:
    I donot need to change the top part(first)...I need to change middle part(second view from top)....but I donot know how to change this one....if I search on technical name of this whole Datavalidation query ...it just shows query corresponding the top part of this data validation query....
    Please advise how to do this  if any of you have idea
    Regards,
    SChand
    Edited by: SChandx200 on Aug 10, 2010 8:10 AM

    Hi,
    There can be one of the two erason,
    Either source data got corrupt. In your case the data in fltfile was not appropriate yesterday,, May be..
    Or someone has change the Info package/Process chain for load the data and change that again today. (Check if is there any Info Package routine is written and got changed recently.
    I hope it will help.
    Thanks,
    S

  • PO Confirmation with Delivery Date Validation Check

    Dear Experts,
    We have requirement in SNC to restrict PO confirmation within a agreed Delivery Date tolerance. This Delivery date validation should work similar to the Quantity validation we have in SAP standard through the PO_ITMUNDERDELIVERY/ PO_ITMOVERDELIVERY validation profiles.
    So the business wants that the Suppliers can only Confirm a PO when the Delivery date in the confirmation is within agreed tolerance (-5 / +1 day ) of the requested delivery date.
    Can you please let us know if there is some standard way through configurations to achieve this. I looked for validation profiles available for delivery date, but could see only for Quantity validations.
    Another option we looked for was to have a Z Table to store this Delivery date tolerance (-5/+1 days), and implement the BAdi /SCMB/BOL_VALFRMWRK to achieve through custom developments.
    Please let me know what solution options we can have for this requirement, as it is urgent.
    Thanks & Regards.
    Shiv.

    Hi Shiv,
    I think there is no need for Z-customization and you can achieve this standard way only thing you have maintained OWN validation:
    After below setting whenever Supplier try to give confirmation which is out side tolerance then system won't allow him to save the confirmation and if supplier is EDI which sends ROC_IN confirmation XML will fail in SNC (You can see that XML in SXI_MONITOR tcode in SNC).
    SPRO>Supply Network Collaboration>Basic Settings> Validation>Own Settings-->Maintain Settings in Validation Profiles
    And maintain below setting
    Profile:POC3
    Val.Check:PO_ACCEPTED_CONF_PUBLISH     
    Status:Active 
    Msg.Type:E(Error )
    Save Mode:DO Not Save message
    Continuation mode:Discontinue checks
    Checked
    Checked
    1-Error
    Profile:POC8
    Val.Check:PO_ACCEPTED_CONF_PUBLISH     
    Status:Active 
    Msg.Type:E(Error )
    Save Mode:DO Not Save message
    Continuation mode:Discontinue checks
    Checked
    Checked
    1-Error
    If you want alert whenever PO confirmation is not within tolerance activate the alert type 7035
    Path:SPRO>Supply Network Collaboration>Exceptions>Alert Type Activation>Activate Alert Types
    Alert type=7035
    History=<Blank>leave this entry blank.
    save this entry.
    If you want receive alert as email then maintain email alert notification:
    See the below link:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8009bba5-7806-2d10-0b80-fa26d8bcb07c?QuickLink=index&overridelayout=true
    In the above link you need to change alert type from 7051 to 7035.
    Regards,
    Nikhil

  • Data Validation . How to do

    Hi All,
    I need to do data vaildation like Soure xml structure has field A that should have only 4 characters.
    If character is more than 4 it should give error or some other thing.
    How to do these types of data validations.
    Regards

    Hi,
    Yes, standard function will return the length of string.
    Just write an small UDF and do the mapping.
    MappingTrace trace = container.getTrace();
              if(a.length() > 4 )
                   trace.addWarning("The length is not proper.");
                   throw new RuntimeException("The length is not proper.");       
    return a;
    Source ---> Length -> UDF--> Target.
    Change the code & mapping as per your need.
    Regards,
    Sarvesh

  • Where to put data validation & DB access in MVC designed app ?

    Hi,
    I write a stand alone app, because the user interface might required lots of changes in the future, I want to apply the MVC paradigm in the user interface design to improve maintainability.
    Where should I put the routine to perform data validation and read/write database ?
    Any advice would be greatly appreciated.
    Setya

    Like the tutorial says, you mustn't perform blocking or non-running operations in the GUI event thread.

  • Where to put data processing routine when acquiring data using DAQmx

    I have a program that is aquiring data using the DAQmx Acquire N Samples mechanism with automatic reset and a data handler callback routine. DAQmx acquires N samples (usually 1024) from the board, calls the handler to do something with it, and then resets to get the next batch of data. The program acquires a number of lines of data, say 512 lines of N points each, with one callback call per line. Triggering is done by a hardware trigger at the start of each line of data. So far so good.
    The issue is that the time that it can spend in the callback is limited, or else the callback is not finished when the next batch of data is ready to be transferd from the DAQmx buffers and processed. There is a substantial amount of analysis to be done after the entire frame has been acquired, and it ends up taking far longer than the time between lines; so where to put the processing? The data acquisition is started from a control callback callback that exits back to the idle loop after it starts the data acquisition process, so there is no code waiting to execute, to return to, when the data acquisition is finished.
    I could try to put the data analysis routine into an idle-time routine and trigger it with a semaphore, or I could put it into a timer control callback with, say, a 10 millisecond repetition rate and poll a flag, setting the flag when all of the data has been acquired. Any suggestions would be appreciated.

    I would recommend using Thread Safe Queues. Your acquisition callback can place items in the TSQ and then you can process the data in a separate thread. TSQs are nice because they allow you to install a callback function to run for certain events. Most importantly, you can install a callback for the Items in Queue or Queue Size Changed event which will run the callback if a certain number of items are in the queue. This lets you take advantage of multithreading in a simple and safe way using a standard Producer/Consumer architecture. However, you may still run into problems with this architecture if your acquisition thread is running much faster than the consumer thread. You could eventually overflow the queue. In that case, your only options are to either get a faster system, slow down the acquisition or do the data handling post process.
    National Instruments
    Product Support Engineer

  • The timesheet creation failed, because of problems with the project I server or with data validation

    Hi,
    One of my user is facing issue in creating new time sheet,
    "The time sheet creation failed, because of problems with the project server or with data validations".
    This issue is coming to only few members out of 10000 members.
    Note: For the same user, can able to do in other machines. only the problem in his machine. Have ran the office diagnostics, but still the problem persists.
    Is any add-on's/any settings need to update in IE. Could any one please help me on how to fix this issue?
    Many thanks in advance.

    I would check the compatibility settings in IE etc, or try another browser (chrome, safari etc.)
    Ben Howard [MVP] | web |
    blog | book

  • Standard Data Source for FMGLFLEXT Table

    Hello Friends,
    The standard data source for the Financials New Legder is 0FI_GL_10 General Ledger: Leading Ledger Balances, which fetches the data from the FAGLFLEXT Table using the Extract Structure FAGL_EXTSTRUCT_LEAD. However there has been a migration of the FAGL table to FMGL table. And now the FAGLFLEXT is no longer populated with any FI postings data. And the new table which is getting the update is the FMGLFLEXT Table. GL Migration from FAGL to FMGL is a standard procedure. However I am not finding any Standard Data Source to fetch the data from the FMGLFLEXT Table.
    Can anybody let me know if there is any standard datasource for this or should we create a custom data source to fetch the data from FMGLFLEXT using the FMGL_EXTSTRUCT_LEAD Extract Structure.
    Appreciate help in this regard.
    VB

    Hello Sasi and Kirun,
    Thanks for your reply,
    The requirement is resolved by the following:
    If you want to use your own totals table (in this scenario FMGLFLEXT) as your basis, you first have to create the corresponding extraction structure using transaction FAGLBW01. In this way, all fields of the totals table are transferred into the extraction structure. Further In the OLTP system, call up transaction FAGLBW03 and Configure the DataSource and save your settings.
    http://help.sap.com/saphelp_nw70/helpdata/en/be/928f40f5767d17e10000000a1550b0/frameset.htm
    Regards,
    VB

  • Email notifications from Verification and Validation routines

    I am trying to generate an email notification after we run a Verification or Validation routine once we make some changes in the DRM? Is it possibe? If so how can it be implemented and what versions of DRM supports the same?

    DRM does not suppor this feature. Nowhere in the documentation does this exist. If you want to do it on demand you have 2 options:
    1) use mdm-connect to run the verification/validation process saving the output to a file and write a script to take the file and mail it
    or
    2) create a custom API workflow process
    Those are your options.

  • Data Validation - a feature that Numbers really needs.

    Right now, the newly purchased Numbers app for iPad/iPhone is little more than a crippled document viewer for me because numbers doesn't support 'data validation' (as implemented in excel).
    Its not a hard concept and likely utilized in a LOT of spreadsheets on the planet.  Not supporting such a critical feature is a problem, as it makes numbers, at least for me, rather pointless as an authoring tool since I cannot change or update data in my worksheet without likely corrupting the document's data integrity.
    Hopefully, someone at Apple is working on fixing this.
    Given that one cannot use data validation - how do I lock down a spreadsheet so I don't accidentally change cell contents?
    The fact that there is no 'undo' button on the iPhone version that I do get on the iPad (same app) makes it worse.. I'm occasionally and unintentionally dragging selections of stuff around the page really hosing up the iPhone spreadsheet.
    So I need to just remember what needs to be updated, update the excel spreadsheet when I can, then delete the iWork-iCloud doc, upload the replacement, then refresh the iPhone/iPad version.. very cumbersome and not at all 'cloud-like' or usefull.
    Apple developers.. are you paying attention?

    Yeah I know that apple likely has the same system as Microsoft in sending general support to a forum such as this. And maybe thae same stupid moron that not paying attention to the forums if their users is a food idea.
    That doesn't change the point of the issue nor that apple directs ,e here to ask said question
    Written in the iPad split soft keypad that covers up the forum post I'm typing. Joy

Maybe you are looking for

  • Starting February 1, new apps and app updates submitted to the App Store must be built with Xcode 5

    Apple send out this message: "Starting February 1, new apps and app updates submitted to the App Store must be built with Xcode 5 and iOS 7 SDK. Learn more about building apps for iOS 7." A few questions about this to Adobe: - Which AIR SDK version i

  • KWin crash at each login

    Hello, This morning, my computer won't launch KWin, it crashes every times and I can't use anything. I tries to update my system with sudo pacman -Syu but it didn't done the trick. I had to switch to xfce (luckily it was already installed. The messag

  • Not Getting Emails - BIS Problems

    Hello there, I've had my 8330 (service provider: Bell Canada) since the Spring and yesterday I recieved a message saying: "SUBJECT: Action Required: Validate Password Validate the password for (myemail) in the BlackBerry Internet Service! Email messa

  • Itunes not seeing iPhone through wifi

    iTunes used to wirelessly notice my iPhone and I would be able to sync it through wifi but now iTunes only sees my iPhone if it is connected with the cord. how do i fix this problem?

  • Detection problem on HP webcam with JMF

    Hi, I'm trying NyARtoolkit and I need to use the video stream of my HP's webcam encrusted above the screen of my laptop (a HP Pavillon tx 2670ef) After the installation of JMF, I lunch JMStudio and I manage tu detect my webcam in : File->Preferences-