ItemUpdated and CheckBox

I have a datagrid filled from a RO. There are a bunch of form fields outside of the Datagrid. When I press on a record the fields get filled in. That works perfect. One of the fields is a combobox. So I change some things in the fields and do an update. I update a DB and also use the itemUpdate to keep everything matching the screen to the DB. When I click to another record and then back the fields are changed and most all is perfect. The only thing I cannot do is get the Checkbox to Update. I press on the checkbox press an update button and the click to another record and then back and the checkbox does not show me if I selected "true" The DB updates just the Checkbox does not represent the data.
This is fired when the update button is pressed:
public function updateVehicle():void {
        if (mainList.selectedItem !== null) {
            vehicleList.setItemAt({ID:ID.text, Vin:Vin.text,
                State:State.text,
                Plate:Plate.text,
                BrandID:BrandID.text,
                BrandID2:BrandID2.text,
                DrCheck:DrCheck.selected,
                PsCheck:PsCheck.selected
                }, mainList.selectedIndex);
                sendFormdata();
                var currentlySelectedItem : Object = mainList.selectedItem;
          currentlySelectedItem.Vin =  Vin.text;
          currentlySelectedItem.State =  State.text;
          currentlySelectedItem.Plate =  Plate.text;
          currentlySelectedItem.Brand =  BrandID.text;
          currentlySelectedItem.Brand2 =  BrandID2.text;
          currentlySelectedItem.DrCheck =  DrCheck.selected;
          currentlySelectedItem.PsCheck =  PsCheck.selected;
          vehicleList.itemUpdated(currentlySelectedItem);
          Alert.show("The database has been updated.")
DrCheck and PsCheck are the id's of the checkboxs. the Brand and Brand2 are comboboxs (works great) and the rest are textinputs. I know I asked a very similar question the other day. Once you get one thing (2 days) 5 minutes goes by and stuck again. If I didnt love CF and Flex so much Id hate it.
Thanks
George

On my original post has the update function that gathers the fields data to send to an update function, the second half of the function does the the itemUpdate. The BrandID and BrandID2 are for the comboboxs and the DrCheck and PsCheck are for the Checkboxs:
<mx:ComboBox id="BrandID" prompt="Select a Brand" dataProvider="{newBrands}" selectedItem="{BrandID.text}" labelField="label" width="150"
             themeColor="#73B9B9"/>
<mx:CheckBox label="Pending" id="DrCheck" themeColor="#73B9B9"/>
When the program first loads I can pick in a DG and it changes the ComboBox to match whats in the ArrayCollection. That part is working. The Checkbox does not. Seems like I have it right, just does not get the true false values back into the collection. So when I make a change like check a box and press update the DB updates but if I leave the row and then select back on the first record the checkbox is always false, unless I reload all the data.
Thanks
G

Similar Messages

  • Is it possible to have sorting by group and checkboxes in the same ALV

    Hi there,
    Does anyone know whether it is possible to have sorting and group on one field in ALV and checkboxes set on another field in ALV?
    eg.
    Fieldname
    ===========
    Name----
    Text
    Allowance----
    Numeric -> Sort & Group
    Verified----
    Checkbox
    How do I code it if it is possible to have grouping and check box all in one ALV.  Meaning I want some data that are the same to merge using sort, while still having the checkbox available for my other field (Verified).
    Thanks in advance.
    Lawrence

    hi,
    GROUP BY clause is used on database tables with select statement.
    sort is used on internal tables.
    can u clearly explain y u need group by and sort on the same field.
    if u are extracting from dbtable using grou by clause on a field, then no need to sort it again.
    if u want sort u can do it by giveing "sort itab by field". thats not a problem.
    now coming to check box.instead of using SLIS type field catalog, u use LVC type.
    in LVC_S_LAYO, u can fine box_fname.
    while defining layout, u declare a variable of type LVC_S_LAYO
    AND GIVE BOX_FNAME = internal table field name

  • Commandlink and checkbox in a region(.jsff).

    Hi all,
    I have a commandlink and checkbox in a region(.jsff).
    when i tried to call a method using propertychangeListener or Actionlistener ..
    methosd is not calling ...
    Plase give any solution...

    Hi,
    not enough information - sorry
    Frank

  • HttpContext in itemDeleting Event Handler (works on itemUpdating and itemAdding)

    Hello
    How can I redirect to a custom page in the itemDeleting event handler.
    I don´t know why but the HttpContext is not available in the event handlers.
    My objective is to redirect to some page in the itemDeleting after setting the properties.Cancel = true event handlers and replace/avoid the standard sharepoint error page. For that i need the HttpContext.
    One thing curious is that the following solution works for the itemAdding and itemUpdating and I can access the HttpContext.
    Code Snippet
    public class MyEventHandler: SPItemEventReceiver
    private HttpContext current;
    public MyEventHandler() : base()
    current = HttpContext.Current;
    I hope you can help me solve this problem.
    Thanks for the help.
    Regards,
    André

    Hello all
    The following solved my problem.
    About getting the current httpcontext inside the event handler itemdeleting i have found here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3120467&SiteID=1) a way to get it.
    In my scenario I want to cancel the event handler and redirect the user to a custom page or just avoid the sharepoint error page and return to source page.
    Code Snippet
    public override void ItemDeleting(SPItemEventProperties properties)
    base.ItemDeleting(properties);
    //event handler code
    properties.Cancel = true;
    properties.Status = SPEventReceiverStatus.CancelNoError;
    SPSite site = new SPSite(http://mysiteurl);
    SPWeb web = site.OpenWeb("mywebapplication");
    if (HttpContext.Current == null)
    HttpRequest request = new HttpRequest("", web.Url, "");
    HttpContext.Current = new HttpContext(request, new HttpResponse(new StringWriter()));
    HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
    //to redirect to a custom url just replace the web.Url for a custom one
    SPUtility.Redirect(web.Url, SPRedirectFlags.UseSource, HttpContext.Current);
    Hope this helps,
    Regards,
    André Cunha
    Hello Andre,
    I am trying to add a code on Item Updating event. 
    I am unable to redirect my page to a custom Url. Please help me I tried to set values for Context object still I was unable to redirect to another page. 

  • Alv and checkboxs

    Guys,
    Ive a problem with a ALV and checkboxs. i have one with column type checkbox, i need mark rows and take them afterward using a button (in ALV) but rows arent marked when i use button. i have seen that it only happend when i use double click in grid (alv).
    How could i use only button after marked my rows ?????
    Thanks

            wa_fieldcat-edit = 'X'.
            modify i_fieldcat from wa_fieldcat index sy-tabix.
    * Form f_alv_edit_oruser                                               *
    * Form for display alv                                                 *
    form f_alv_edit_oruser.
        call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            it_fieldcat                 = i_fieldcat[]
            is_layout                   = pt_grplayout2
            i_callback_program          = 'YSCCU0007'
            i_callback_html_top_of_page = p_header
            i_callback_user_command     = v_user_command1
            it_events                   = i_events[]
          tables
            t_outtab                    = i_yscchdr.
    endform.                                 " F_alv_edit_oruser
    * Form  f_user_command1                                                *
    * This form will handle the user command from fm REUSE                 *
    form f_user_command1 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'.
       endcase.
      rs_selfield-refresh = c_x.             " Grid refresh
    endform.                                 " F_user_command1

  • Text Field and Checkboxes

    Ok... i wish i can show my form without  letting everyone have axx to it.
    But anyway, ive searched and i think i found part of the answer but i am still confused.  http://forums.adobe.com/message/2033382#2033382
    I have a form created completely. It has radio fields, text fields and checkboxes.  I have two problems
    One when ppl are typing in the text field area, it seems to lend in with the question, so if not paying attn, u wont know that they answered a question.
    Currently i have the stuff set at Myriad Pro  size 10.. Thats what i used to type comments and what not.
    But when the end user flls out the form, i want it to at least be in bold or something.. Or maybe Times new roman Or something different from the question font itself.
    Two.. in checkboxes, the default is X. Thats very light.  I need that to be noticeable... So either make em a bod X or  a way to increase the size of the tick without increasing the size of the box itself.. I just tried to use the STAR..And its bold enuf, but its small. It would be better if the star was a lil bigger.
    Currently i think i have 150 checkboxes and about 50 text area and fields.
    I thought about making the text thing rich format, but they cant do that for every field...  id rather tdo that by default in the back end of the form itself.
    I hope im not sounding confusinf

    i know the square and circle are a bit ugly - but there is no chance you'll miss them
    alternatively try adjusting the size a bit under -size you can take a standard checkboxes size from 10 to 12 without increasing its area for example - select the checkbox-objects-field-size - change to 12 eg - adds a bit of weight
    i use squares when i need visual weigh -
    for the text - might be worth having a test at setting input field values with a baseline shift -- thats basically make text bigger or smaller than, you guessed it, baseline -- this from the livecycle scripting reference
    TextField1.font.baselineShift = "+5pt"; should do it for example --
    scripting reference follows --- good luck
    ""baselineShift
    Specifies a positive measurement that shifts a font up from the baseline or a negative measurement that
    shifts a font down from the baseline.
    Syntax
    Reference_Syntax.baselineShift = "0in | measurement"
    Type Values
    String ● fit (default)
    The application scales the image proportionally to the maximum size of the container’s
    content region.
    ● none
    The application scales the image to the size of entire container’s content region. This may
    result in different scale values being applied to the image's X and Y coordinates.
    ● actual
    The image is rendered using the dimensions stored in the image content. The extent of the
    container’s region does not affect the sizing of the image.
    ● width
    The application scales the image proportionally to the width of the container’s content
    region. The image might be taller or shorter than the content region.
    ● height
    The application scales the image proportionally to the height of the container’s content
    region. The image might be wider or narrower than the content region.
    Model Object
    Form Model image
    Adobe LiveCycle Designer ES Scripting Properties
    LiveCycle Designer ES Scripting Reference before 156
    Values
    Applies to
    Version
    XFA 2.1
    Examples
    JavaScript
    TextField1.font.baselineShift = "-5pt";
    FormCalc
    TextField1.font.baselineShift = "-5pt"

  • Radio buttons and checkboxes using panels......

    Please help..
    I am using radiobuttons and checkboxes with prices on them.. and once an item is selected the total is output.. this works when I don't use panels.. the minute I use panels it does not register what I am using.. can anyone help..
    is there something that I am leaving out.. the basics would be great. please help.
    Asmeen

    Are you really sure this is an advanced language topic?

  • IF EXIT and Checkbox.. need help

    Hi there,
    i have a Problem.
    I am new in ABAP and try out now a lot of thing. Now i have a problem and i dont know how to solve it... Here is my Code.. After that i tell you my problem.
    *& Report  Z_TEILNEHMERLISTE_EINFUEGEN
    REPORT  Z_TEILNEHMERLISTE_EINFUEGEN.
    *Tabelle deklarieren
    TABLES zteilnehmer02.
    SELECTION-SCREEN BEGIN OF BLOCK teilnehmer WITH FRAME TITLE text-001.
    *Eingabefelder deklarieren
    PARAMETERS: nummer TYPE zteilnehmer02-tnummer,
                name   TYPE zteilnehmer02-tname LOWER CASE,
                gebdat TYPE zteilnehmer02-tgeburtsdatum LOWER CASE,
                geschl TYPE zteilnehmer02-tgeschlecht LOWER CASE,
                kurspr TYPE zteilnehmer02-tkurspreis LOWER CASE,
                waehru TYPE zteilnehmer02-twaehrung LOWER CASE,
                kfz    TYPE zteilnehmer02-zzkfztyp LOWER CASE,
                kursti TYPE zteilnehmer02-zzkurstitel LOWER CASE.
    SELECTION-SCREEN END OF BLOCK teilnehmer.
    *Workarea deklarieren die dann in die DB Tabelle zteilnehmer02 gechrieben wird
    DATA: wa_teil LIKE zteilnehmer02.
    *deklarieren der Felder
    wa_teil-tnummer = nummer.
    wa_teil-tname = name.
    wa_teil-tgeburtsdatum = gebdat.
    wa_teil-tgeschlecht = geschl.
    wa_teil-tkurspreis = kurspr.
    wa_teil-twaehrung = waehru.
    wa_teil-zzkfztyp = kfz.
    wa_teil-zzkurstitel = kursti.
    *Daten werden nun aus der Workarea wa_teil in die Tabelle zteilnehmer02 geschrieben
    INSERT INTO zteilnehmer02 VALUES wa_teil.
    *Wenn das Feld tnummer leer ist dann mache nichts... AUSSER es ist oben die Checkbox vollstli angehackt.. dann zeige die komplette Liste
    IF wa_teil-tnummer IS INITIAL.
      EXIT.
    ENDIF.
    *wenn Returncode irgendwas anderes als NULL dann gib Fehlermeldung aus und schreibe den Datensatz NICHT
    IF sy-subrc NE 0.
      ROLLBACK WORK.
      WRITE: / 'Fehler beim anlegen des neuen Teilnehmer mit der Nummer', wa_teil-tnummer, '. Diese Nummer existiert bereits.'.
      ELSE.
    *Wenn RC=0 dann gib folgende Meldung aus nachdem der Datensatz geschrieben wurde
      WRITE: / 'Neuer Teilnehmer mit Teilnehmernummer ', wa_teil-tnummer, 'eingetragen'.
    ENDIF.
    SELECTION-SCREEN BEGIN OF BLOCK anzeige WITH FRAME TITLE text-002.
      PARAMETERS vollstli AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK anzeige.
    *Checkbox prüfen
    IF NOT vollstli IS INITIAL.
    * vollständigen Tabelleninhalt ausgeben
      SELECT * FROM zteilnehmer02.
        WRITE: / zteilnehmer02-tnummer,
                 zteilnehmer02-tname,
                 zteilnehmer02-tgeburtsdatum,
                 zteilnehmer02-tgeschlecht,
                 zteilnehmer02-tkurspreis,
                 zteilnehmer02-twaehrung,
                 zteilnehmer02-zzkfztyp,
                 zteilnehmer02-zzkurstitel.
       ENDSELECT.
       SKIP.
    ENDIF.
    As you can see above i wrote:
    IF wa_teil-tnummer IS INITIAL.
      EXIT.
    ENDIF.
    But in a another BLOCK i have a CHECKBOX. When i "check" the Box i become a List of all Members. But this will not work because the field wa_teil-tnummer IS INITIAL so the program EXIT.
    How can i solve this?
    Thanks
    Bjoern
    Edited by: bjoern bayerschmidt on Jun 3, 2009 1:27 PM
    Edited by: bjoern bayerschmidt on Jun 3, 2009 1:28 PM

    Sorry,
    i did not see that the code look so horrible ^^
    So i have a EXIT here:
    IF wa_teil-tnummer IS INITIAL.
      EXIT.
    ENDIF.
    But AFTER this Code i have a CHECKBOX too.
    SELECTION-SCREEN BEGIN OF BLOCK anzeige WITH FRAME TITLE text-002.
      PARAMETERS vollstli AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK anzeige.
    *Checkbox prüfen
    IF NOT vollstli IS INITIAL.
    * vollständigen Tabelleninhalt ausgeben
      SELECT * FROM zteilnehmer02.
        WRITE: / zteilnehmer02-tnummer,
                 zteilnehmer02-tname,
                 zteilnehmer02-tgeburtsdatum,
                 zteilnehmer02-tgeschlecht,
                 zteilnehmer02-tkurspreis,
                 zteilnehmer02-twaehrung,
                 zteilnehmer02-zzkfztyp,
                 zteilnehmer02-zzkurstitel.
       ENDSELECT.
       SKIP.
    ENDIF.
    So the CHECKBOX do not work when the FIELD wa_teil-tnummer IS INITIAL, because it comes BEFORE the CHECKBOX comes. Do you know what i mean.
    The CHECKBOX do Only work when i put some DATA in the field wa_teil-tnummer. But i want that the CHECKBOX works too when the Field is empty.
    Thanks
    Bjoern
    Edited by: bjoern bayerschmidt on Jun 3, 2009 1:33 PM
    Edited by: bjoern bayerschmidt on Jun 3, 2009 1:34 PM

  • REUSE_ALV_GRID_DISPLAY_LVC and checkboxes

    Hi all,
    please forgive the HUGE post, the code snip is quite significant. My task is to provide a search option for contract numbers then, after selection's done, show a grid with all the results from the search option where every row represents a contract. Addictionally, I want a checkbox for selection for every row, in order to provide a second, decisional step before processing these contracts.
    In order to do so, I used the REUSE_ALV_GRID_DISPLAY but cannot manage to make the checkboxes visible. Note that the solution is working, because clicking in the first field of a row implies adding the row (so, the contract) to a table that will then processed after a particular event's raised (in this case, clicking a specified button).
    Can anybody help me understanding why there are no checkboxes in the first columns? A very similar solution worked for me on another project... can't understand what's wrong with this.
    Here's the code:
    REPORT  z_myproject         .
    * PARAMETERS
    TYPES: BEGIN OF t_ztab_alv,
            sel,
    *        cancellato TYPE c,
            object_id TYPE crmt_object_id,
            description TYPE crmt_process_description,
            logical_system TYPE crmt_logsys,
           END OF t_ztab_alv.
    TYPES: ty_tt_crmd_orderadm_h TYPE TABLE OF crmd_orderadm_h.
    DATA:  it_contract TYPE TABLE OF t_ztab_alv,
           wa_contract TYPE t_ztab_alv,
           l_index TYPE i,
           conditions TYPE string.
    INITIALIZATION.
    * Selection Screens and Parameters
    SELECTION-SCREEN BEGIN OF BLOCK main_sel WITH FRAME TITLE text-001.
    SKIP.
    SELECT-OPTIONS s_ctrid FOR wa_contract-object_id.
    SKIP.
    SELECTION-SCREEN END OF BLOCK main_sel.
    PARAMETERS: flag TYPE xfeld.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ctrid-low.
      DATA: it_help_item TYPE TABLE OF t_ztab_alv,
            it_return TYPE TABLE OF ddshretval.
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE it_help_item
        FROM crmd_orderadm_h
        WHERE object_type = 'BUS2000113'.
      IF sy-subrc = 0.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield    = 'OBJECT_ID'
            dynprofield = 'OBJECT_ID'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
          TABLES
            value_tab   = it_help_item
            return_tab  = it_return.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ctrid-high.
      DATA: it_help_item TYPE TABLE OF t_ztab_alv,
            it_return TYPE TABLE OF ddshretval.
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE it_help_item
        FROM crmd_orderadm_h
        WHERE object_type = 'BUS2000113'.
      IF sy-subrc = 0.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield    = 'OBJECT_ID'
            dynprofield = 'OBJECT_ID'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
          TABLES
            value_tab   = it_help_item
            return_tab  = it_return.
      ENDIF.
    START-OF-SELECTION.
    * Retrieve values from the sel_opt.
      SELECT * FROM crmd_orderadm_h
        INTO CORRESPONDING FIELDS OF TABLE it_contract
          WHERE object_id IN s_ctrid.
    * Now let's kick our ALV out!
    * General Data
      TYPE-POOLS: slis.
      DATA: gs_layout TYPE lvc_s_layo,
            g_exit_caused_by_caller,
            gs_exit_caused_by_user TYPE slis_exit_by_user,
            g_repid LIKE sy-repid.
      DATA:
          gt_events      TYPE slis_t_event,
          gt_list_top_of_page TYPE slis_t_listheader,
          g_status_set   TYPE slis_formname VALUE 'PF_STATUS_SET',
          g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
          g_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE',
          g_top_of_list  TYPE slis_formname VALUE 'TOP_OF_LIST',
          g_end_of_list  TYPE slis_formname VALUE 'END_OF_LIST',
          it_fieldcat TYPE lvc_t_fcat,
          wa_fieldcat TYPE lvc_s_fcat.
    *"Variants
      DATA: gs_variant LIKE disvariant,
            g_save.
      g_repid = sy-repid.
      g_save           = 'A'.
    * This is the main flow. Initialize the layout and manage events.
      PERFORM layout_init USING gs_layout.
      PERFORM eventtab_build USING gt_events[].
      gs_variant-report = g_repid.
      g_save           = 'A'.
    END-OF-SELECTION.
    *"List Header for Top-Of-Page
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *       I_BACKGROUND_ID    = 'ALV_BACKGROUND'
             i_buffer_active    = 'X'
             i_callback_program = g_repid
             i_callback_pf_status_set = 'SET_PF_STATUS'
             i_callback_user_command  = g_user_command
             i_structure_name   = 'ZCTR_TAB_ALV'
             is_layout_lvc          = gs_layout
             it_fieldcat_lvc    = it_fieldcat
             i_save             = g_save
             is_variant         = gs_variant
             it_events          = gt_events[]
    *      I_SCREEN_START_COLUMN    = 0     "Use coordinates for
    *      I_SCREEN_START_LINE      = 0     "display as dialog box
    *      I_SCREEN_END_COLUMN      = 0
    *      I_SCREEN_END_LINE        = 0
        IMPORTING
             e_exit_caused_by_caller = g_exit_caused_by_caller
             es_exit_caused_by_user  = gs_exit_caused_by_user
        TABLES
             t_outtab = it_contract
        EXCEPTIONS
             program_error = 1
             OTHERS        = 2.
      IF sy-subrc = 0.
        IF g_exit_caused_by_caller = 'X'.
    *"  Forced Exit by calling program
    *"  <do_something>.
        ELSE.
    *"  User left list via F3, F12 or F15
          IF gs_exit_caused_by_user-back = 'X'.       "F3
    *"    <do_something>.
          ELSE.
            IF gs_exit_caused_by_user-exit = 'X'.     "F15
    *"      <do_something>.
            ELSE.
              IF gs_exit_caused_by_user-cancel = 'X'. "F12
    *"        <do_something>.
              ELSE.
    *"        should not occur!
    *"        <do_Abnormal_End>.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ELSE.
    *"Fatal error callin ALV
    * MESSAGE AXXX(XY) WITH ...
      ENDIF.
    *"Form routines
    *&      Form  LAYOUT_INIT
    *       text
    *      -->RS_LAYOUT  text
    FORM layout_init USING rs_layout TYPE lvc_s_layo.
    *"Build layout for list display
      rs_layout-cwidth_opt = 'X'.
      rs_layout-zebra             = 'X'.
      rs_layout-box_fname     = 'SEL'.
    ENDFORM.                    "LAYOUT_INIT
    *&      Form  EVENTTAB_BUILD
    *       text
    *      -->RT_EVENTS  text
    FORM eventtab_build USING rt_events TYPE slis_t_event.
    *"Registration of events to happen during list display
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = rt_events.
      READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE g_top_of_page TO ls_event-form.
        APPEND ls_event TO rt_events.
      ENDIF.
    ENDFORM.                    "EVENTTAB_BUILD
    *&      Form  TOP_OF_PAGE
    *       text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
    *           I_LOGO             = 'ENJOYSAP_LOGO'
                it_list_commentary = gt_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    *       FORM SET_PF_STATUS                                         *
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD'.
      "Copy of 'STANDARD' pf_status from fgroup SALV
    ENDFORM.                    "set_pf_status
    *       FORM USER_COMMAND                                             *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      DATA : it_sel_lines TYPE TABLE OF t_ztab_alv,
             l_lines TYPE i,
             l_mult_lines TYPE flag,
             l_obj_id TYPE char35,
             t_contratti TYPE ty_tt_crmd_orderadm_h,
             wa_contratti TYPE crmd_orderadm_h.
    * Calculate sel_lines.
      REFRESH it_sel_lines.
      CASE r_ucomm.
        WHEN  'ZCANCELLA'.                 "set attribute button
          REFRESH t_contratti.
          LOOP AT it_contract INTO wa_contract WHERE sel = 'X'.
            SELECT SINGLE *
               FROM crmd_orderadm_h
                 INTO wa_contratti
                    WHERE object_id = wa_contract-object_id.
            IF sy-subrc = 0.
              APPEND wa_contratti TO t_contratti.
            ENDIF.
          ENDLOOP.
        MOVE 'X' TO rs_selfield-refresh.
    *  do something with the selected entries.
        PERFORM do something USING t_contratti.
      ENDCASE.
      COMMIT WORK AND WAIT.
      CLEAR r_ucomm.
      MOVE 'X' TO rs_selfield-refresh.
    ENDFORM.                    "USER_COMMAND

    Hello Byju, hello all...
    ...first of all, sorry for the BIG delay in answering but I had to leave a bit this task for other priorities... now I'm back on it to work. Oh, and obviously, happy new year mates
    I tried by myself to follow what you called "option(2)"... a popup screen (simpliest possible).
    In order to do so, I tried the following code, but I don't know how to manage the "no" answer.... I mean, the popup works but if I press "No", I don't want the code to follow to be executed (sounds like I have to translate into code "do nothing of what follows, simply return to the alv screen").
    The code:
    WHEN  'ZCANCELLA'.                 "set attribute button
          REFRESH t_contratti.
          LOOP AT it_contract INTO wa_contract WHERE sel = 'X'.
           IF wa_contract-object_id BETWEEN 8400000000 AND 8499999999.
            popupneeded = 'X'.
           ENDIF.
          ENDLOOP.
          IF popupneeded EQ 'X'.
           CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
    *          TITLEBAR                    = 'ATTENZIONE'
    *          DIAGNOSE_OBJECT             = ' '
               text_question               = '84* contracts in the selection. Continue?  '
    *          TEXT_BUTTON_1               = 'Yes'(001)
    *          ICON_BUTTON_1               = ' '
    *          TEXT_BUTTON_2               = 'No'(002)
    *          ICON_BUTTON_2               = ' '
    *          DEFAULT_BUTTON              = '1'
               DISPLAY_CANCEL_BUTTON       = SPACE
    *          USERDEFINED_F1_HELP         = ' '
    *          START_COLUMN                = 25
    *          START_ROW                   = 6
    *          POPUP_TYPE                  =
    *          IV_QUICKINFO_BUTTON_1       = ' '
    *          IV_QUICKINFO_BUTTON_2       = ' '
            IMPORTING
               ANSWER                      = w_answer.
    *        TABLES
    *          PARAMETER                   =
    *        EXCEPTIONS
    *          TEXT_NOT_FOUND              = 1
    *          OTHERS                      = 2
           IF w_answer ne '1'.
    * to manage -> refresh the alv of selection and do nothing.
           endif.
          ENDIF.
          LOOP AT it_contract INTO wa_contract WHERE sel = 'X'.
            SELECT SINGLE *
                FROM crmd_orderadm_h INTO wa_contratti
                   WHERE object_id = wa_contract-object_id.
            IF sy-subrc = 0.
              APPEND wa_contratti TO t_contratti.
            ENDIF.
          ENDLOOP.
        MOVE 'X' TO rs_selfield-refresh.
    *  delete selected contracts.
      PERFORM cancella_ctr USING t_contratti.
    Also...I added a new field in the ALV mask, called "deleted"... it's a checkbox I'd like to check after the deletion phase to show that a selected contract's been deleted. The behaviour in my mind should be as follows:
    - ALV screen that shows contracts;
    - selection of some of these contracts;
    - click on the button "delete";
    - eventually, popup of the warning screen;
    - after the deletion, return to the previous ALV in which the previously selected lines have the "deleted" field marked (it's not significant to verify that these entries have really been deleted... if something goes wrong, an exception is raised and managed).
    Guess it's a simple "come back to the alv screen and refresh" issue, so maybe you can help me with a clarifying example
    Thanks in advance!
    Edited by: Matteo Montalto on Jan 7, 2009 10:15 AM

  • How can I update multiple rows in table using a single form button and checkboxes

    I have a project where the visitors can select multiple productos and once the click on the PURCHAS button it updates the selected records.

    You have not mentioned the programming language that you are using, but here's a link that could help you if you are using ASP.
    http://csharpdotnetfreak.blogspot.com/2009/05/edit-multiple-records-gridview-checkbox.html
    Also, have a look at this discussion thread
    http://forums.asp.net/t/1470882.aspx

  • Is there anywhere where Apple describes the function and use of every field and popup and checkbox in the email setup "panes"???

    So you call up an account in email
    Account Information is selecgted in the 3-choice menu-bar/button (what is that thing called, anyway? An "inspector"? (frown).
    Then check "enable this account"--is selectable
    Then Account type: iCloud IMAP or example--this is NOT selectable.
    Then "Description field" What's it for, where does it show up, especially if it shows up in other "related" or "integrated" programs?
    Alias popup: What's this for? How do you use it. What approaches, strategies, effects might one employ?
    Email address is pretty straight forward--but see "user.name" in the "server sub-box/sub-pane" below.
    Full Name:  What full name? Where does it appear in use? I cannot access it from the pane/panel, so how do I set it, or who/what sets it?
    Outgoing mail server (SMTP): OK, here's a popup that isn't congruent with "account type" in the first sub-pane. Or is IMAP only an extroverted function/setting, and (SMTP) is a introverted one (IMAP for outbound, SMTP for inbound)?
    Now comes Confusion: Outgoing Mail Server popup menu, which leads you off to a wholenother pane that lets you create new/delete old incoming server names.
    There's a Description (what's that for, what does it do?  Ditto Server name--I get than's something like smtp.ISP.Com or IMAP.ISP.com). You can set those fields in the + menu Account Information Pane, with its blank text fields. And you can also "double-click to enter" that field in the list itself. Why is that?And then I can select Advanced, and get another batch of checkboxes, fields, and popups.
    But I left the Account Information pane before asking, What is this Thread-Lock Stitching Certificate thing? (Or is that Transport Layer Secrecy Sertificate, what?  None is displaying now, but if I popup what's beneath it a humongously long "ID" string, which I take to be, what, my Apple ID? A public key/ provate key encryption string/key? How do I use it if I'm trying to keep the National Surveillance Agency from eavesdropping, "in the clear," my every blessed keystroke, "phrase-stroke" (think VoIP), and if I use the thing, can the president just press a button and send a drone to blow me off the planet (and anyone near me at the time--always great fun for friends and family)?
    And never mind router and FiOS, etc., modem settings. and the Network settings outside of email....
    I guess my bottom line is, the user is presented with a rich smorgasbord of significant choices by all of the panes and panels, etc., on the mac, iMac, iPad-Phone-Watch real soon now, mac pro, macbook pro, etc.  But the specific description of the proper use of these description/instruction on their use and function is impoverished.  I think manuals used to handle some of these issues. But where are the manuals? Or am I just so overwhelmed by the complexity of what was once a simple user interface that I can't see pointers (in light grey type on lighter grey backgrounds--what the heck is wrong with black type, I'd like to know!) staring me in the phiz. Oh, help.

    Hi Cff7dxp,
    I am glad to hear that your issue has been resolved from the provided troubleshooting steps. Please feel free to post in Lenovo Community Forums if you have any further queries!
    Did someone help you today? Press the star on the left to thank them with a Kudo’s!
    Cheers!
    Hemanth Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Alv grid and checkboxes

    I'm using the function 'reuse_alv_grid_display' to display an internal table with the first column as a checkbox. Everything displays fine, but the checkbox column is grayed out and I can't check or uncheck the rows as needed. How do I activate this column so I can check or uncheck rows as needed.

    Edward,
    For all the fields where you want the user to enter / edit the data, you should check EDIT field of the field catalog for that field.
    Regards,
    Ravi
    Note : Please mark the helpful answers.

  • How to create dropwdown list box values and checkbox in screen painter.

    Hi Experts,
    I need to know the creation of dropdown list box values and the checkbox to use in screen painter.
    I have 3 values to insert as:-
    INR,USD,EUR
    if user selects INR/USD/EUR, then it will store into the table field.
    And also want to know the checkbox functioning in screen painter, i.e. what should we write in PBO/PAI.
    I have found some sites to get knowledge, but didnot found anything that relates to my questions.
    So please help me!
    Thanks,
    Deepanshu

    Hi,
    For dropdown list box in Screen create a input field and choose Drop down by index.
    To populate the values write the logic in PBO as follows
    TYPE-POOLS : VRM
    DATA : field_id TYPE VRM_ID ,
                values  TYPE VRM_VALUES,
                 value   LIKE LINE OF values.
    PROCESS BEFORE OUTPUT
    MODULE list_fill_100
    MODULE list_fill_100 OUTPUT
    SELECT f1 f2 f3  FROM tab WHERE condition.
    value-KEY = f1.
    value-TEXT = f2
    APPEND value TO VALUES
    CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = 'i/o screen field'
                values = values.
    ENDMODULE.

  • Having some trouble with hidden and checkboxes on tabular forms

    My query is as follows:
    select distinct tt.name tasktype,ct.name costtype,htmldb_item.checkbox(3,1,NULL,'Y:N',':') "Add Cost", htmldb_item.text(4,defabscost,9) defabscost,
    htmldb_item.hidden(5,tt.tasktypeid) tasktypeid, htmldb_item.hidden(6,ct.costtypeid) costtypeid
    from acct.defabscost d
    inner join work.tasktype tt
    on d.tasktypeid = tt.tasktypeid
    inner join acct.costtype ct
    on d.costtypeid = ct.costtypeid
    I have it wrapped within a function, which works fine. My issues are that I want to have the checkboxes function as row selectors. Basically, not pointing to primary keys (I have a compound primary key on this table). If selected, fill in the table, if not selected, erase from table. Also, My hidden items kinda contain the "primary keys". When I set these as hidden, I see the column, but there is no data. I don't want to see the columns at all, but when I set these to "hidden" in the attributes, I can't reference them with htmldb_application.g_FXX. Any suggestions?

    I actually figured out how to get the htmldb_item.hidden part working properly. I misread the guide, thought it was a comma between fields and not a concatenation. Works fine. But I still need to get the checkbox to work like I want.

  • ALV and checkbox display

    hi all, i have a few problems here.
    Firstly, i need to display records in an ALV from an internal table.
    Secondly, i need to include checkboxes beside each and every records for the user to choose which records he wants to see.
    Thirdly, after the user has checked the fieldss that he wants, i need to display the details of all the records based on the ticked checkboxes in another screen.
    please help me if anyone knows.
    thx!

    Hi Meei,
    Thats very simple ....
    1 . In the internal table where you are displaying declare some thing like below.
    Data : begin of i_department occurs 0,
             vbeln  like ztmsh-vbeln,   "Sales and Distribution Docu No
             deprt  like ztmsh-deprt,   "Department
             meala  like ztmsd-meala,   "Meal Allowance
             sitea  like ztmsd-sitea,   "Site Allowance($)
             CHECKBOX(1) TYPE C,declare some thing here for creating check box
           end of i_department.
    2. Build a field catlog for the check box something like below..
    i_temp-fieldname = 'CHECKBOX'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-col_pos = 1.
      i_temp-CHECKBOX = 'X'.
      i_temp-outputlen = 4.
      i_temp-seltext_l = 'Flag'.
      i_temp-input = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    3. Now u can see the checkbox in the output once you select it will automatically flag in your internal table.and using the USer-command u can play around.
                  I have pasted a entire coding here pls check the flow.
    REPORT  Z_TIME_SHEET_REPT.
    TABLES
    Tables : ztmsh, "Time Sheet Header
             ztmsd, "Time Sheet Data
             zempy. "Employee
    Data Definations
    Internal Table for Employee input data
    Data : begin of i_employee occurs 0,
             vbeln  like ztmsh-vbeln,   "Sales and Distribution Document Number
             deprt  like ztmsh-deprt,   "Department
             tmsdt  like ztmsh-tmsdt,   "Date
             jbcpl  like ztmsh-jbcpl,   "Job Complete
             empid  like zempy-empid,   "Employee ID
             empnam(50) type c ,        "Employee Name
             nmltm  like ztmsd-nmltm,   "Normal Time
             ovrtm  like ztmsd-ovrtm,   "Over Time
             meala  like ztmsd-meala,   "Meal Allowance
             sitea  like ztmsd-sitea,   "Site Allowance($)
           end of i_employee.
    Internal Table For Department Input Data
    Data : begin of i_department occurs 0,
             vbeln  like ztmsh-vbeln,   "Sales and Distribution Document Number
             deprt  like ztmsh-deprt,   "Department
             tmsdt  like ztmsh-tmsdt,   "Date
             jbcpl  like ztmsh-jbcpl,   "Job Complete
             nmltm  like ztmsd-nmltm,   "Normal Time
             ovrtm  like ztmsd-ovrtm,   "Over Time
             hlftm  like ztmsd-hlftm,                           "1.5 Time
             dbltm  like ztmsd-dbltm,   "Double Time
             meala  like ztmsd-meala,   "Meal Allowance
             sitea  like ztmsd-sitea,   "Site Allowance($)
             CHECKBOX(1) TYPE C,
           end of i_department.
    Temp Internal tablee for holding department values
    Data : begin of i_t_dept occurs 0,
            vbeln  like ztmsh-vbeln,   "Sales and Distribution Document Number
            deprt  like ztmsh-deprt,   "Department
            tmsdt  like ztmsh-tmsdt,   "Date
            jbcpl  like ztmsh-jbcpl,   "Job Complete
            nmltm  like ztmsd-nmltm,   "Normal Time
            ovrtm  like ztmsd-ovrtm,   "Over Time
          end of i_t_dept.
    internal table for detailed data
    data : begin of i_detail occurs 0 ,
             vbeln  like ztmsh-vbeln,   "Sales and Distribution Document Number
             deprt  like ztmsh-deprt,   "Department
             tmsdt  like ztmsh-tmsdt,   "Date
             jbcpl  like ztmsh-jbcpl,   "Job Complete
             nmltm  like ztmsd-nmltm,   "Normal Time
             ovrtm  like ztmsd-ovrtm,   "Over Time
             cadsv  like ztmsh-cadsv,   "CAD Services
             stsvy  like ztmsh-stsvy,   "SiteSurvey
             cstdw  like ztmsh-cstdw,   "Construction Drawing
             sppln  like ztmsh-sppln,   "Space Planning
             dsndw  like ztmsh-dsndw,   "Design Drawings
             drw3d  like ztmsh-drw3d,   "3D Drawings
             dwplt  like ztmsh-dwplt,   "Drawing Plots
             otamt  like ztmsh-otamt,   "Others
             inact  like ztmsh-inact,   "In store Activity type
             ictnq  like ztmsh-ictnq,   "In store Activity Quantity
             inctn  like ztmsh-inctn,   "In store Activity Loading
             mitim  like ztmsh-mitim,   "Movement Volume in Type
             mivlm  like ztmsh-mivlm,   "Movement Volume in Loading
             motim  like ztmsh-motim,   "Movement Volume Out Type
             movlm  like ztmsh-movlm,   "Movement Volume Out Loading
             outtm  like ztmsh-outtm,   "Out of Store Activity Type
             outact like ztmsh-outact,  "Out of Store Activity Loading
             frklft like ztmsh-frklft,  "Forklift
             strpt  like ztmsh-strpt,   "Storage Protection
             rbbsh  like ztmsh-rbbsh,   "Rubbish
             crtes  like ztmsh-crtes,   "Crates
             vhlhr  like ztmsh-vhlhr,   "Vechile
             toll   like ztmsh-toll,    "Toll
             park   like ztmsh-park,    "Parking
             hrdwr  like ztmsh-hrdwr,   "Hardware
             trlly  like ztmsh-trlly,   "# of Trollys
             dolly  like ztmsh-dolly,   "# of Dollies
             oepno  like ztmsh-oepno,   "# of Other Equipment
             oteqp  like ztmsh-oteqp,   "Other Eqipment
           end of i_detail.
    ALV Field Catlog declaration
    TYPE-POOLS : slis.
    data : i_depart TYPE slis_t_fieldcat_alv,
           i_emp TYPE slis_t_fieldcat_alv,
           i_design TYPE slis_t_fieldcat_alv,
           i_warehouse TYPE slis_t_fieldcat_alv,
           i_transport TYPE slis_t_fieldcat_alv,
           i_install TYPE slis_t_fieldcat_alv,
           i_temp TYPE slis_fieldcat_alv,
           l_layout TYPE slis_layout_alv.
    Events
    DATA: v_events TYPE slis_t_event,
          wa_event TYPE slis_alv_event.
    Tempary Variables
    data: wa_nmltm type p decimals 2,
          wa_ovrtm type p decimals 2,
          wa_meala type p decimals 2,
          wa_sitea type p decimals 2,
          wa_HLFTM type p decimals 2,
          wa_DBLTM type p decimals 2,
          w_nmltm(5) type c,
          w_ovrtm(5) type c,
          w_meala(5) type c,
          w_sitea(5) type c,
          wa_first(25) type c,
          wa_last(25)  type c.
    data : repid type sy-repid.
    Selection Screen
    *Select options
    selection-screen begin of block blk1.
    select-options :  s_vbeln for ztmsh-vbeln,
                      s_tmsdt for ztmsh-tmsdt.
    selection-screen end of block blk1.
    Radio Buttons
    selection-screen begin of block blk2 WITH FRAME TITLE TLT1.
    Parameters: dept radiobutton GROUP SX,
      emp radiobutton GROUP SX.
    selection-screen end of block blk2.
    Intialization
    INITIALIZATION.
      TLT1 = 'Time Sheet Summary Report'.
      repid = sy-repid.
      s_tmsdt-low = sy-datum.
      s_tmsdt-high = sy-datum.
      append s_tmsdt.
    START-OF-SELECTION.
    START-OF-SELECTION.
      if dept = 'X'.
        perform 100_time_sheet.
        perform 200_build_field_catlog.
        perform 400_ALV_Display.
      elseif emp = 'X'.
        perform 100_time_sheet.
        perform 500_build_field_catlog.
        Perform 600_ALV_display.
      endif.
    *&      Form  100_time_sheet
         text
    FORM 100_time_sheet.
      select * from ztmsh
           where vbeln in s_vbeln
             and tmsdt in s_tmsdt.
        if ztmsh-vbeln ne space.
          perform empl_calcuation .
          if emp = 'X'.
            clear i_employee.
          elseif dept = 'X'.
            clear i_department.
          endif.
        ENDIF.
      endselect.
    ENDFORM.                    " 100_time_sheet
    *&      Form  200_build_field_catlog
         Department Wise Summary Report
    FORM 200_build_field_catlog .
      refresh i_depart.
      i_temp-fieldname = 'CHECKBOX'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-col_pos = 1.
    i_temp-fix_column = 'X'.
      i_temp-CHECKBOX = 'X'.
      i_temp-outputlen = 4.
      i_temp-seltext_l = 'Flag'.
      i_temp-input = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'VBELN'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'VBELN'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Work Order No'.
      i_temp-col_pos = 2.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'DEPRT'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'DEPRT'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Department'.
      i_temp-col_pos = 3.
      i_temp-outputlen = 15.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'TMSDT'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'TMSDT'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Time Sheet Date'.
      i_temp-col_pos = 4.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'JBCPL'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'JBCPL'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Time Sheet Status'.
      i_temp-col_pos = 5.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'NMLTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'NMLTM'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Total NH'.
      i_temp-col_pos = 6.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'OVRTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'OVRTM'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Total AH'.
      i_temp-col_pos = 7.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'HLFTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'HLFTM'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Total 1.5 Time'.
      i_temp-col_pos = 8.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'DBLTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'DBLTM'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Total 2.0 Time'.
      i_temp-col_pos = 9.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'MEALA'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'MEALA'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Tot Meal Allowence'.
      i_temp-col_pos = 10.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'SITEA'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'SITEA'.
      i_temp-tabname = 'I_DEPARTMENT'.
      i_temp-seltext_l = 'Tot Site Allowence($)'.
      i_temp-col_pos = 11.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_DEPART.
      CLEAR i_temp.
    ENDFORM.                    " 200_build_field_catlog
    *&      Form  300_populate_events
          Top Of Page Events for Warehouse Report
    FORM 300_populate_events .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = v_events.
      READ TABLE v_events
              INTO wa_event
              WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc EQ 0.
        wa_event-form = 'TOP_OF_PAGE'.
        MODIFY v_events
        FROM wa_event TRANSPORTING form
              WHERE name = wa_event-form.
      endif.
    ENDFORM.                    " 300_populate_events
    *&      Form  400_ALV_Display
          Department ALV Display
    FORM 400_ALV_Display .
      sort i_department by vbeln deprt tmsdt.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM             = repid
         I_CALLBACK_PF_STATUS_SET       = 'PO_STATUS '
         I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
         I_STRUCTURE_NAME               = 'i_department'
         IS_LAYOUT                      = l_layout
         IT_FIELDCAT                    = i_depart
        IT_EVENTS                      = v_events
        TABLES
          T_OUTTAB                       = i_department
       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.
    ENDFORM.                    " 400_ALV_Display
    *&      Form  500_build_field_catlog
          Employee wise Summary Report
    FORM 500_build_field_catlog .
      refresh i_depart.
    i_temp-ref_fieldname = 'VBELN'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'VBELN'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Work Order No'.
      i_temp-col_pos = 1.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'DEPRT'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'DEPRT'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Department'.
      i_temp-col_pos = 2.
      i_temp-outputlen = 15.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'TMSDT'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'TMSDT'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Time Sheet Date'.
      i_temp-col_pos = 3.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'JBCPL'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'JBCPL'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Time Sheet Status'.
      i_temp-col_pos = 4.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'EMPID'.
    i_temp-ref_tabname = 'ZEMPY'.
      i_temp-fieldname = 'EMPID'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Employee ID'.
      i_temp-col_pos = 5.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'JBCPL'.
    i_temp-ref_tabname = 'ZTMSH'.
      i_temp-fieldname = 'EMPNAM'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Employee Name'.
      i_temp-col_pos = 6.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'NMLTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'NMLTM'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Total NH'.
      i_temp-col_pos = 7.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'OVRTM'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'OVRTM'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Total AH'.
      i_temp-col_pos = 8.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'MEALA'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'MEALA'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Tot Meal Allowence'.
      i_temp-col_pos = 9.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    i_temp-ref_fieldname = 'SITEA'.
    i_temp-ref_tabname = 'ZTMSD'.
      i_temp-fieldname = 'SITEA'.
      i_temp-tabname = 'I_EMPLOYEE'.
      i_temp-seltext_l = 'Tot Site Allowence($)'.
      i_temp-col_pos = 10.
    i_temp-fix_column = 'X'.
      APPEND i_temp TO i_emp.
      CLEAR i_temp.
    ENDFORM.                    " 500_build_field_catlog
    *&      Form  600_ALV_display
          Employee Wise ALV Display
    FORM 600_ALV_display .
      sort i_employee by vbeln deprt tmsdt.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
           I_CALLBACK_PROGRAM             = repid
        I_CALLBACK_PF_STATUS_SET       = 'PO_STATUS '
        I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
           I_STRUCTURE_NAME               = 'i_employee'
           IS_LAYOUT                      = l_layout
           IT_FIELDCAT                    = i_emp
        IT_EVENTS                      = v_events
          TABLES
            T_OUTTAB                       = i_employee
         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.
    ENDFORM.                    " 600_ALV_display
    *&      Form Po-Status.
    FORM po_status  USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZBUTTON' EXCLUDING rt_extab.
    ENDFORM.                    "po_status
    *&      Form User_command.
    FORM user_command USING ucomm LIKE sy-ucomm
                                selfield TYPE slis_selfield.
      data : valid type i,
             cnt like ztmsh-deprt.
      clear i_department.
      loop at i_department where CHECKBOX = 'X'.
        on change of i_department-deprt.
    if cnt ne space.
          if valid ne 0.
            message 'Please select same department' type 'I'.
            valid = 2.
            exit.
            cnt = i_department-deprt.
          endif.
        endon.
        valid = 1.
      endloop.
      if valid = 1.
        case ucomm.
          when 'DESIGN'  .
            perform transfer_table.
            perform design_report.
            perform des_build_field_catlog.
            Perform design_ALV_display.
          when 'WAREHOUSE'.
            perform transfer_table.
            perform design_report.
            perform war_build_field_catlog.
            perform 300_populate_events.
            perform warehouse_ALV_display.
          when 'TRANSPORT'.
            perform transfer_table.
            perform design_report.
            perform tran_build_field_catlog.
         perform top_of_page.
            perform Transport_ALV_display.
          when 'INSTALLAT'.
            perform transfer_table.
            perform design_report.
            perform inst_build_field_catlog.
            perform Install_ALV_display.
        endcase.
      elseif valid = 0.
        message 'Please select a department' type 'I'  .
      endif.
    endform.                    "user_command
    *&      Form  empl_calcuation
         Employee total hours calculation
    FORM empl_calcuation  .
      data : w_hours(3)   type C,
             w_min(3)     type c,
             w_hours1(3)  type c,
             w_min1(3)    type c,
             w_hours2(3)  type c,
             w_min2(3)    type c,
             w_hours3(3)  type c,
             w_min3(3)    type c,
             w_hours4(3)  type c,
             w_min4(3)    type c,
             t_nmltm(5)   type c,
             t_ovrtm(5)   type c,
             t_meala(5)   type c,
             t_sitea(5)   type c,
             t_HLFTM(5)   type c,
             t_DBLTM(5)   type c,
             temp         type i.
      clear :wa_nmltm,
             wa_ovrtm,
             wa_meala,
             wa_sitea,
             wa_HLFTM,
             wa_DBLTM.
    To convert into Minutes
      select * from ztmsd
               where vbeln = ztmsh-vbeln
                 and tmsdt = ztmsh-tmsdt
                 and deprt = ztmsh-deprt.
    *uncommenting the below code between the select and endselect will work
    *for normal time scenario (eg: 2.55+3.55 =6.50)                                                                     *
    Normal Time
        t_nmltm = ztmsd-nmltm.
       SPLIT t_nmltm at '.' into w_hours w_min.
       temp = w_hours.
       w_hours = temp.
       w_hours = w_hours * 60.
        wa_nmltm = wa_nmltm + t_nmltm.
    Over Time
        t_ovrtm = ztmsd-ovrtm.
       SPLIT t_ovrtm at '.' into w_hours1 w_min1.
       temp = w_hours1.
       w_hours1 = temp.
       w_hours1 = w_hours1 * 60.
        wa_ovrtm = wa_ovrtm + t_ovrtm.
    Meal Allowence
        t_meala = ztmsd-meala.
       SPLIT t_meala at '.' into w_hours2 w_min2.
       temp = w_hours2.
       w_hours2 = temp.
       w_hours2 = w_hours2 * 60.
        wa_meala = wa_meala + t_meala .
    Site Allowence
        t_sitea = ztmsd-sitea.
        wa_sitea = wa_sitea + t_sitea.
        if dept = 'X'.
    1.5 Time
          t_HLFTM = ztmsd-HLFTM.
       SPLIT t_HLFTM at '.' into w_hours3 w_min3.
       temp = w_hours3.
       w_hours3 = temp.
       w_hours3 = w_hours3 * 60.
          wa_HLFTM = wa_HLFTM +  t_hlftm.
    Double Time
          t_DBLTM = ztmsd-DBLTM.
       SPLIT t_DBLTM at '.' into w_hours4 w_min4.
       temp = w_hours4.
       w_hours4 = temp.
       w_hours4 = w_hours4 * 60.
          wa_DBLTM = wa_DBLTM +  t_dbltm.
        endif.
      endselect.
      if sy-subrc = 0.
    uncommenting the below will work for normal time scenario
          (eg: 2.55+3.55 =6.50)
    and change in the appending coloum wa_ to t_
      to convert into Hours
       perform min_to_hrs_nmltm using wa_nmltm changing t_nmltm.
       perform min_to_hrs_ovrtm using wa_ovrtm changing t_ovrtm.
       perform min_to_hrs_meala using wa_meala changing t_meala.
       perform min_to_hrs_sitea using wa_sitea changing t_sitea.
        if emp = 'X'.  "Report By Employee
        Employee Id
          select single empid deprt into ztmsd
             from ztmsd
             where vbeln = ztmsh-vbeln.
          if sy-subrc = 0.
        Employee Name
            select single empye_f empye_l
             into (wa_first,wa_last )
              from zempy
               where empid = ztmsd-empid.
            if sy-subrc = 0 .
              concatenate wa_first
                          wa_last
                          into i_employee-empnam.
              Appending To internal Table
              i_employee-empid = ztmsd-empid.
              i_employee-deprt = ztmsh-deprt.
              i_employee-nmltm = wa_nmltm.
              i_employee-ovrtm = wa_ovrtm.
              i_employee-meala = wa_meala.
              i_employee-sitea = wa_sitea.
              i_employee-vbeln = ztmsh-vbeln.
              i_employee-tmsdt = ztmsh-tmsdt.
              i_employee-jbcpl = ztmsh-jbcpl.
              APPEND i_employee.
            endif.
          endif.
        elseif dept = 'X'.    "Report By  Department
    uncommenting the below will work for normal time scenario
          (eg: 2.55+3.55 =6.50)
    and change in the appending coloum wa_ to t_
          perform min_to_hrs_HLFTM using wa_HLFTM changing t_HLFTM.
          perform min_to_hrs_DBLTM using wa_DBLTM changing t_DBLTM.
              Appending To internal Table
          i_department-deprt = ztmsh-deprt.
          i_department-nmltm = wa_nmltm.
          i_department-ovrtm = wa_ovrtm.
          i_department-meala = wa_meala.
          i_department-sitea = wa_sitea.
          i_department-vbeln = ztmsh-vbeln.
          i_department-tmsdt = ztmsh-tmsdt.
          i_department-jbcpl = ztmsh-jbcpl.
          i_department-hlftm = t_hlftm.
          i_department-dbltm = t_dbltm.
          APPEND i_department.
        endif.
      endif.
    ENDFORM.                    " empl_calcuation
    *&      Form  min_to_hrs_nmltm
          text
         -->P_WA_NMLTM  text
    FORM min_to_hrs_nmltm  USING    P_WA_NMLTM
                           CHANGING P_T_nmltm.
      data : hours(2)     type c,
             minutes_n(2) type c,
             nmltm(10)    type c.
      if p_wa_nmltm >= 60.
        hours = P_WA_NMLTM / 60.
      endif.
      minutes_n = P_WA_NMLTM MOD 60.
      concatenate hours
                   minutes_n
                   into P_T_nmltm.
    ENDFORM.                    " min_to_hrs_nmltm
    *&      Form  min_to_hrs_ovrtm
          text
    FORM min_to_hrs_ovrtm  USING    P_WA_OVRTM
                           CHANGING P_T_OVRTM.
      data : hours(2)     type c,
             minutes_n(2) type c.
      if p_wa_ovrtm >= 60.
        hours = P_WA_OVRTM / 60.
      endif.
      minutes_n = P_WA_OVRTM MOD 60.
      concatenate hours
                   minutes_n
                   into P_T_OVRTM.
    ENDFORM.                    " min_to_hrs_ovrtm
    *&      Form  min_to_hrs_meala
    FORM min_to_hrs_meala  USING    P_WA_meala
                           CHANGING P_T_MEALA.
      data : hours(2)     type c,
             minutes_n(2) type c.
      if p_wa_meala >= 60.
        hours = P_WA_meala / 60.
      endif.
      minutes_n = P_WA_meala MOD 60.
      concatenate hours
                  minutes_n
                  into P_T_meala.
    ENDFORM.                    " min_to_hrs_meala
    *&      Form  min_to_hrs_sitea
    FORM min_to_hrs_sitea  USING    P_WA_sitea
                           CHANGING P_T_SITEA.
      data : hours(2)     type c,
             minutes_n(2) type c.
      if p_wa_sitea >= 60.
        hours = P_WA_sitea / 60.
      endif.
      minutes_n = P_WA_sitea MOD 60.
      concatenate hours
                  minutes_n
                  into P_T_sitea.
    ENDFORM.                    " min_to_hrs_sitea
    *&      Form  min_to_hrs_HLFTM
    FORM min_to_hrs_HLFTM  USING    P_WA_HLFTM
                           CHANGING P_T_HLFTM.
      data : hours(2)     type c,
             minutes_n(2) type c.
      if p_wa_hlftm >= 60.
        hours = P_WA_HLFTM / 60.
      endif.
      minutes_n = P_WA_HLFTM MOD 60.
      concatenate hours
                  minutes_n
                  into P_T_HLFTM.
    ENDFORM.                    " min_to_hrs_HLFTM
    *&      Form  min_to_hrs_DBLTM
    FORM min_to_hrs_DBLTM  USING    P_WA_DBLTM
                           CHANGING P_T_DBLTM.
      data : hours(2)     type c,
             minutes_n(2) type c.
      if p_wa_dbltm >= 60.
        hours = P_WA_DBLTM / 60.
      endif.
      minutes_n = P_WA_DBLTM MOD 60.
      concatenate hours
                  minutes_n
                  into P_T_DBLTM.
    ENDFORM.                    " min_to_hrs_DBLTM
    *&      Form  design_report
    FORM design_report .
      select * into corresponding fields of table i_detail
            from ztmsh for all entries in i_t_dept
            where vbeln = i_t_dept-vbeln
              and deprt = i_t_dept-deprt
              and tmsdt = i_t_dept-tmsdt .
      loop at i_detail.
        read table i_t_dept with key vbeln = i_detail-vbeln
                                     deprt = i_detail-deprt
                                     tmsdt = i_detail-tmsdt .
        if sy-subrc = 0.
          i_detail-nmltm = i_t_dept-nmltm.
          i_detail-ovrtm = i_t_dept-ovrtm.
          modify i_detail.
        endif.
      endloop.
    ENDFORM.                    " design_report
    *&      Form  transfer_table
    Doin some operation using the checkbox
    FORM transfer_table .
      clear i_t_dept[].
      loop at i_department where checkbox = 'X'.
        move-corresponding : i_department to i_t_dept.
        append i_t_dept.
      endloop.
    ENDFORM.                    " transfer_table
    Regards,
    karthik.
    Edited by: karthikeyan sukumar on Jan 3, 2008 9:46 AM

Maybe you are looking for