Editing a field in ALV and validating the newly entered Value

Hi Experts,
   I have an ALV report in grid display (not object oriented). My requirement is to edit a field on the output and write the validations to validate the value that was edited on the ALV output.
This can be done using object oriented coding by using the method check_changed_data. For this to happen, i need to change the entire scope of my report into object oriented, which is like reinventing the wheel.
Since my report was developed using classical ABAP, what needs to be done to get this functionality. Any suggestions are welcome.
Thanks.

in the FM 'REUSE_ALV_GRID_DISPLAY'  import parameter IS_LAYOUT check out the columsn EDIT and EDIT_COLUMN. Also Use FM 'REUSE_ALV_EVENTS_GET' to get list possible event and pass a subroutine name which will be called when ever event is fired.
example:
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = 0
    IMPORTING
      et_events   = l_events.
  READ TABLE l_events WITH KEY name = slis_ev_top_of_page
                               INTO g_event.
  IF sy-subrc = 0.
    MOVE top_of_page TO g_event-form.
    APPEND g_event TO t_events.
  ENDIF.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_buffer_active    = 'X'
      i_callback_program = t_repid
      is_layout          = t_layout
      it_fieldcat        = t_fieldcat[]
      i_save             = t_save
      it_events          = t_events[]
    TABLES
      t_outtab           = g_editpos1[].

Similar Messages

  • Edit an field in alv and save it

    i have an report in alv, i have used func module 'alv_list_display'.
      i have to make an field edit'able,(so that i can edit,change the existing data) then i have to save the data so that the data is stored in the table.

    Hi,
    you have to use fieldcat-input = 'X', and edit = 'X'.to make the fields editable in alv display.and SAVE you need the SAVE button.
    report  ztest_alv_check     message-id zz           .
    type-pools: slis.
    data: x_fieldcat type slis_fieldcat_alv,
          it_fieldcat type slis_t_fieldcat_alv,
          l_layout type slis_layout_alv,
          x_events type slis_alv_event,
          it_events type slis_t_event.
    data: begin of itab occurs 0,
          vbeln like vbak-vbeln,
          posnr like vbap-posnr,
         end of itab.
    select vbeln
           posnr
           from vbap
           up to 20 rows
           into table itab.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-input = 'X'.
    x_fieldcat-edit = 'X'.
    x_fieldcat-col_pos = 1.
    append x_fieldcat to it_fieldcat.
    clear x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-input = 'X'.
    x_fieldcat-edit = 'X'.
    x_fieldcat-col_pos = 2.
    append x_fieldcat to it_fieldcat.
    clear x_fieldcat.
    l_layout-zebra = 'X'.
    call function 'REUSE_ALV_LIST_DISPLAY'
      exporting
        i_callback_program       = sy-repid
        is_layout                = l_layout
        i_callback_pf_status_set = 'STATUS'
        i_callback_user_command  = 'USER_COMMAND'
        it_fieldcat              = it_fieldcat
       tables
        t_outtab                 = itab
      exceptions
        program_error            = 1
        others                   = 2.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    "using the PF-status enable the SAVE button
    "give some OKCODE to SAVE button and handle it
    "using user_command form
    form status using p_extab type slis_t_extab.
    *- Pf status
      set pf-status 'STATUS'.
    endform.                 " STATUS
    form user_command using r_ucomm     like sy-ucomm
                                   rs_selfield type slis_selfield.
      case r_ucomm.
        when 'BACK' or 'CANC' or 'EXIT'.
          leave to screen 0.
        when 'SAVE'.
         "here you have to find the changed records,and   modify the DB.
      endcase.
    endform.                    "USER_COMMAND
    Regards
    vijay

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • Creating a module pool screen and upload the data entered,

    Dear Experts,
    As i am new to this area, can any one suggest me how can i design a module screen and also the data entered in the screen should be saved in Ztable.
    It would be of great help if any one provides material sort of thing.
    Thanks in advance..

    Hi
    Goto SE51 and design your screen.
    For each control specify the name. For a few controls you need to specify the function codes as well. Until you specify all the mandatory details the controls will remain pink.
    When you are done, Save and Activate.
    Click on Flow Logic button.
    Specify the modules you want to use in PBO and PAI.
    In the program declare data objects having same name as your screen fields.
    When you enter data in the screen fields, the values are automatically stored in the data objects you declared having the same name.
    If you want to insert the details into a ztbl, simply use insert queries and pass data using the data objects you have defined.
    If you are going for BDC:
    First ensure that your screens and code work correctly. Then do the BDC recording for one value. Modify the recorded program according to your requirement.
    Hope this helps
    Regards,
    Jayanthi.K

  • How to control and use the search criteria values "%" ?

    Hi,
    When I searched some information in my employee name. I filled in search criteria values "%" and selected the "Go" button to see the result. But I got errors that the search criteria values should not begin with a "%" or "_" for at least one if the listed fields.
    How to control and use the search criteria values "%" ?
    Thanks,
    sinolee

    sinolee,
    These kinds of details are mentioned in Dev guide. Always have a look into dev guide before posting.
    --Shiv                                                                                                                                                                                                                                                   

  • Web Browser in the output of Report and save the text entered in browser

    Hi All,
    I am having a requirement that i has to show the web browser in the output of the basic list and i has to save the text entered in the web browser and not the URL.
    For example.
    if i am displaying the web browser in the basic list of my report.
    i am having a field to give the URL and i will the give the URL as WWW.GOOGLE.COM and press enter, then the web page will be loaded in the basic list. i am entering some text in the search area .
    let the text may be "SAP-ABAP".
    now i has to save the text "SAP-ABAP" in to my database.
    So , if you have any suggestions please reply to this.
    Thanks in advance.
    Regards,
    Phani.

    Of course there is not going to be any specific example which has been taylored to your exact requirement, which is why you should be looking outside the box.  The reason I suggested that program is so that you can see how to allow the user to access a web page and enter a value, and then allow the application server to access this value, which of course can then be stored on the database. 
    As for you exact requirement, if you are looking to specifically throw a browser with www.google.com in the browswer and have the user enter a value in the search, and then expect that this value be returned to the application which was entered, I don't see a clean/easy way to do this.  Why? Because once the user is veiwing google in the browser, it is now out of your control, because that page is not running on your server.  Not if google had some API, that would be a different story.
    Regards,
    Rich Heilman

  • All my movies are in 4:3 scale. I need to finalize a dvd, and when the movie enters in iDVD, burns in 16:9 format. What must I do?

    I need a help from you. All my movies are in 4:3 scale.
    I use always the same Easy SepUp in Final Cut. My movies is compressed as DV NTSC in 4:3 format.
    I need to finalize a dvd, and when the movie enters in iDVD, the preview appears already written in green "widescreen preview", and so the finallized dvd goes to 16:9 format.
    I checked in Idvd, and the size is choosed to 4:3.
    Interestingly, I've used iDVD several times, including by using templatesmade ​​to 16:9, and changing the format to 4:3 it always worked well.
    Maybe is an Idvd update that causes it?

    Sorry,I know this is a month late, but I think I remember this happening to myself some time ago. As I can best recall, I believe I had used an MP3 music file in my project (exported from FCP 7) and that was the cause in some strange way. I remember deleting a file (again, I believe the mp3 file)  and then it worked fine as 4:3.Not positive, but  I hope this helps.

  • How do i unzip and run the newly downloaded Adobe Encore trial version on a windows computer?

    how do i unzip and run the newly downloaded Adobe Encore trial version on a windows computer?

    First, there is no such thing as an Encore trial, due to licensing of 3rd party program modules
    Second, Encore is installed as a bundle with Premiere Pro CS6
    Third, the CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 will help
    The bottom section of the link above has several Adobe links, and other information, on downloading Premiere Pro CS6 and the bundled Encore CS6, and the TWO ADDED downloads for the Encore library content, to author a DVD or BluRay... and the tutorial list includes learning how to use Encore... pay particular attention to the picture in reply 3 at this link - https://forums.adobe.com/thread/1516173 (picture first posted by Ann Bens and reposted by Stan Jones)

  • How can I select an area of a picture (larger than one pixel) and find the average RGB values of all the pixels contained inside the area?

    I'm analysing the differences between several different images and I would like to select a large area of each (such as with lasso tool) and find the average RGB value of all of the pixels within the selection area made/

    With the selection you could do a copy paste and use the histogram of the new layer set the histogram source to selected layer.  The eye dropper sample size may also to get the average  of a square area around a point.

  • How to select and store the dynamically clicked values in the checkboxes?

    Hi Gurus
    How to select and store the dynamically clicked values in the checkboxes?
    Scenario:-
    I am having a tree structure but I am not getting that user has clicked the which nodes.
    So how to do it.
    Pls.

    Hi,
    Once again, this is dependent on what your implementation expects. It would seem that your implementation is expecting all of the API to be coded in Java Card so it would make sense that you would load these packages like any other package. Loading an applet is not a special case, it just has an extra step of installing instances of it (and can actually be installed). Any other Java package just needs to be loaded. As such, just load your CAP files for each package of the API before loading any code that depends on it.
    Cheers,
    Shane

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • Can the Parameter Enter Value screen size be adjusted?

    I have a report that will have up to 4 to 5+ different individual Parameters that will require the users to populate. 
    Since I am using a larger number of parameters the Enter Value screen size is small and not all of the parameters are displayed on one screen.   the users are required to scroll down in order to see and populate the other Parameter selections. 
    Is there a way to adjust the default size of the Parameter enter Value screen that the end users will see when using the Cyrstal Report Viewer?

    Try Service Pack 3, if still not then it's likely the type of parameters you are using.
    Bottom line is if there is no option to change the size of that window. I believe someone asked for this and I entered it in as an enhancement request. Some future version may eventually have the ability to auto-size.
    At the top of this forum you'll see a Feature Request link, add your suggestion there, search first though in both of the links.
    Thank you
    Don

  • How to find the user entered value is Integer or not?

    hi,
    i want to find, whether the user entered value is Integer or not. If it is Integer, i wanna continue the program. otherwise send an error message. i tried to find for function in API. But i couldn't. can somebody help me with sample code. very urgent.

    Do a Integer.parseInt(<string value>) in a try catch block If a NumberFormatException is thrown, the entered number is not an integer.

  • Regarding Editable Quantity field in ALV Grid

    Hi Experts,
    I need your advice in this 2 scenarios.
    1.I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator. If i take a char field and display the field is editable then user may mistakenly type a,bcd...z/ special characters which it should not capture. Is there any char data type data element which accepts only integers. Because after that i need to save that value in z database table quantity field.
    2. when there i raised an error message after validation of that editable field in alv output(by events), the user wants all other rows in that grid as uneditable except the row which has got error till this error is solved. Is this possible. If yes how.
    Please share your valuable suggestions.

    Hi abilash n      
    as in dictionary, all quantity fields should have a reference to the unit field which then defines the number of decimals.
    The rest is done automatically as long as you do it standard way. In field catalog you have to set the fcat-qfieldname to the name of the field that has the unit.
    If you do so, also totals will be grouped by unit.
    SAP has really done a great thing by inventing  units for quantities (and currency keys for currency amounts). Only developers do not understand and thus refuse to use it.
    Regards,
    Clemens

  • Edit a field in ALV tree in a subscreen of a module pool

    Hi
    I want to make a field editable in the ALV tree based on some condtions in a subscreen of a module pool.  I used the edit = 'X' field in the fieldcatalog still it  is showing the field as display and not edit.
    Please help me to get the field as editable and save it to the database table.
    Please not this is ALV TREE
    Regards,
    Mozila

    Hi Mayank,
    Thanks for the reply
    I am using oops method.
    I tried making the field which is to be made editable  as wa_fieldcatalog-edit = 'X'. But its not working. I didnt get you when you said  edit in layout object.
    I also went through the demo programs but these programs are not having editable fields.
    My code is as follows:
    IF tree4 IS INITIAL.
    * create container for alv-tree
      l_tree_container_name = 'TREE4'.
      CREATE OBJECT l_custom_container
        EXPORTING
          container_name              = l_tree_container_name
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5.
    * create tree control
      CREATE OBJECT tree4
        EXPORTING
          i_parent                    = l_custom_container
          i_node_selection_mode       = cl_gui_column_tree=>node_sel_mode_multiple
          i_item_selection            = 'X'
          i_no_html_header            = 'X'
          i_no_toolbar                = 'X'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7.
    * create hierarchy
      CALL METHOD tree4->set_table_for_first_display
        EXPORTING
          is_layout       = s_layo
        CHANGING
          it_sort         = it_sort
          it_outtab       = it_final
          it_fieldcatalog = it_fieldcat.
    ELSE.
      CALL METHOD tree4->refresh_table_display
        EXPORTING
          it_sort           = it_sort
        EXCEPTIONS
          program_error     = 1
          failed            = 2
          cntl_system_error = 3
          others            = 4
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endif.

Maybe you are looking for

  • Null keys not supported

    Hi. I have created a simple Entity Bean called User with just 2 fields and no business methods. I am using Personal Oracle8 database and sun's JdbcOdbcDriver. The connection pool is configured properly. When I try to deploy this bean, I get an error

  • Requirement to change the accounting date

    Hi All, A customer wants to have the accounting date on the journal entries influence by the date they need the goods. Basically what they want is to create a requisition, fill at line level the date required and have this date being used as the acco

  • Java on Moxa IA241 ARM9

    I am trying to install a jre on a moxa IA241 with a ARM9 CPU. It is running some kind of custom linux distro. /proc/cpuinfo says the following: Processor : ARM922Tid(wb) rev 1 (v4l) BogoMIPS : 76.39 Features : swp half thumb CPU implementer : 0x66 CP

  • Freezes when adding files

    all was perfectly well, until i hit the update button and got 7.5. Now as soon as i try to add a file or a folder. Itunes freezes up and (though it still adds the files, about one album per two hours. And i get the "not responding" message if i try t

  • Parsing Schema

    Hi, I created a schema on a database. It doesn't appear in a list of schemas when creating a new application. How do I add in there? Thanks,