Need to delete the record based on the checkbox xselected

I am displaying the data from tables vbrk and vbrp.along   with that  data i am displaying the checkbox also.
here my requirement is when ever the user checks the checkboxes and click on delete button  the checkbox selected items should deleted and  need to display the remaining.
please any send me the example  how to process it.
thanks and regards
vamsi
[email protected]

Hi,
Herewith i am sending the sample coding for checkbox alv report. Kindly go through it. U can get some idea for your requirement.
REPORT  YMS_CHECKBOXALV.
TYPE-POOLS: slis.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
DATA: s_layout TYPE slis_layout_alv.
DATA: BEGIN OF itab OCCURS 0,
icon TYPE icon-id,
vbeln TYPE vbeln,
kunnr TYPE kunnr,
erdat TYPE erdat,
box TYPE c,
END OF itab.
DATA: v_repid TYPE syrepid.
START-OF-SELECTION.
Get the data.
SELECT vbeln kunnr erdat UP TO 100 ROWS
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE itab.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'No data found'.
LEAVE LIST-PROCESSING.
ENDIF.
Modify the record with red light.
itab-icon = '@0A@'.
MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.
v_repid = sy-repid.
Get the field catalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'ICON'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-seltext_l = 'Status'.
s_fieldcatalog-icon = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'VBELN'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'KUNNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'ERDAT'.
APPEND s_fieldcatalog TO t_fieldcatalog.
Set the layout.
s_layout-box_fieldname = 'BOX'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = s_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = t_fieldcatalog[]
TABLES
t_outtab = itab.
FORM SET_PF_STATUS *
--> EXTAB *
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'TEST2'.
ENDFORM.
FORM user_command *
--> UCOMM *
--> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
Check the ucomm.
IF ucomm = 'DETAIL'.
LOOP AT itab WHERE box = 'X'.
itab-icon = '@08@'.
MODIFY itab TRANSPORTING icon.
ENDLOOP.
ENDIF.
selfield-refresh = 'X'.
ENDFORM.
Thanks,
Shankar

Similar Messages

  • Collect the records based on the field

    Hi ,
    I have a scenario like below.
    name   id     emailid
    X        1      XXX
    y        2      XXX
    z        3     YYY
    w       4      XXX
    So I want to send mail to XXX with X y and W information at a time i.e means in the single mail and mail should go to YYY with the Z information.
    please guide me on this.
    Thanks & Regards,
    Suresh.

    Hi ,
    Sort on itab mailid.
    lv_mail  = space.
    loop at itab into wa.
    if lv_mail ne wa-mail.
    lv_mail = wa-mail.
    endif.
    if lv_mail = wa-mail.
    read itab2 with mail = wa-mail.
    if sy-subrc eq zero.
    concatenate itab2-msg wa-masg into itab2-msg.
    modify itab2 at sy-tabix transporting msg.
    else.
    itab2-mail = wa-mail.
    itab2-msg= wa-msg.
    append itab2.
    endif.
    endif.
    endloop.
    loop on itab2.
    send mail.
    endloop.
    in some scenario we faced problem with using "at end".
    i am not sure exactly, think basis on type and key part of internal table.so the above is an suggestion from my side.
    Regards,
    Salini.
    Edited by: satya Visalini on Sep 19, 2008 10:05 AM
    Edited by: satya salini on Sep 19,  2008 10:08 AM

  • Filter the report based on the date

    Hi Experts,
    i am working with alv report, I need filter the records based on the field.
    So i tried like this.
    data : t_filter TYPE slis_t_filter_alv,
           w_filter TYPE slis_filter_alv.
    W_FILTER-FIELDNAME = 'WERKS'.
    W_FILTER-SIGN0 = 'I'.
    W_FILTER-OPTIO = 'BT'.
    W_FILTER-VALUF_INT = '1003'.
    W_FILTER-VALUT_INT = '1007'.
    APPEND W_FILTER TO t_FILTER.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = ' '
        I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = ' '
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
        IS_LAYOUT                         =
         IT_FIELDCAT                        = IT_FIELDCAT
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
         IT_FILTER                          = t_filter
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
         I_SAVE                            = 'A'
        IS_VARIANT                        =
        IT_EVENTS                         =
    But it is was not get the output,
    Pls help me how to write the code to filter the recodes.
    if any one post the code.
    Please help me.
    Thanks Advance
        IT_EV

    check the documentation of the fm
    Table with filter criteria
    Using this parameter, you can pass on filter criteria resulting from explicitly loading a display variant in advance, for example, to list output.
    This table should never be set up 'manually'.
    check these programs
    BCALV_TEST_FULLSCREEN_FILTER
    BCALV_TEST_LIST
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Oct 24, 2010 10:41 PM

  • Retrive Records based on the content in a Clob Feild

    Retrive Records based on the content in a Clob Feild
    I have a Table NoteFile which contains a Clob Feild NoteFileContent
    and is refrenced by PK DocID
    i need to Match DocID with other Tables Document and folderdocument
    My Query is as Below
    SELECT Doc.Pap_Doc_ID, Doc.Pap_Doc_Name , NF.NoteFileContent
    From NoteFile NF , Document Doc, folderdocument FD
    Where Doc.Pap_Doc_ID = FD.FoldDoc_ID and FD.FoldDoc_ParentID <> 3 and
    NF.DocID = DOC.Pap_Doc_ID And NF.NoteFileContent Like '%a%'
    The above query throws
    ORA-00600: internal error code, arguments: [504], [0x7ADEBE00], [2], [1],
    [cache buffers chains], [723], [0], [0x7ADEBE00]

    Hi,
    We can resize it.Always give the height and weight in
    percentage format. and turn off the horizontal n vertical scroll
    policy in u r main application.
    Hopes it helps you...

  • Web GUI new feature - creating a new record based on the current record

    Vincent,
    We need new feature in Web GUI:
    creating a new record based on the current record with data
    from Moscow with money

    It is already enabled, in the next release.
    If you joint TAB program, the march preview build contains it. User can select 1 or multiple users and make a copy.

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • On my iCloud account I can see an alternate email ID which can be used to login to my account, this email ID does not belong to me so I need to delete it. Please advice the best possible way as it does. It show any option to delete that ID

    On my iCloud account I can see an alternate email ID which can be used to login to my account, this email ID does not belong to me so I need to delete it. Please advice the best possible way as it does. It show any option to delete that ID

    Do the alternate e-mail address ends with me.com or icloud.com?

  • Select records based on the closest given time

    Dear SQL gurus,
    I have a table T1:
    Name Null? Type
    ID NOT NULL NUMBER(5)
    MOMENT NOT NULL DATE [DD.MM.YYYY HH24:MI]
    MEASUREMENT NOT NULL NUMBER(8,3)
    Example (ID, MOMENT, MEASUREMENT)
    -- START OF EXAMPLE --
    9380 18.11.2000 03:45 17.6
    9380 18.11.2000 04:30 17.3
    9380 18.11.2000 05:45 16.8
    9380 18.11.2000 06:15 16.8
    9380 18.11.2000 07:00 16.2
    9380 18.11.2000 07:30 16.2
    9380 18.11.2000 08:15 16
    9380 18.11.2000 08:45 15.7
    9380 18.11.2000 09:30 15.4
    9380 18.11.2000 10:00 15.4
    9380 18.11.2000 11:15 15.4
    9380 18.11.2000 11:45 15.4
    9380 18.11.2000 12:30 15.4
    9380 18.11.2000 13:00 15.4
    9380 18.11.2000 13:45 15.4
    --- END OF EXAMPLE --
    How to select records based on the:
    - time period specified by the day only [DD.MM.YYYY] - CONDITION 1
    - with values for 6AM only, and if not available, with values closest to 6AM - CONDITION 2
    (if the time gap in MOMENT field is too big, lets say > 5h then choose the average between the value before 6AM (ex. 4:15AM) and the value after the 6AM (ex. 9:45AM))
    CONDITION 1 (something like): moment between '01.01.2005' and '31.12.2004' - this is OK
    CONDITION 2: I do not know how to formulate, especially if 6AM value is not availabe, and I have to find the closest available value, or get the avergae from the two adjacent values.
    Maybe cursor magic??? Thanks a lot for your help.
    Rado

    About condition two, would the following select be of use to you? Picking the first record could be achived by rownum, analytic function, etc.
    WITH t1 AS (SELECT 9380 id, TO_DATE('18.11.2000 03:45', 'dd.mm.yyyy hh24:mi') moment,  17.6 measurement
                  FROM dual
                 UNION 
                SELECT 9380 id, TO_DATE('18.11.2000 04:30', 'dd.mm.yyyy hh24:mi') moment,  17.3 measurement
                  FROM dual
                 UNION
                SELECT 9380 id, TO_DATE('18.11.2000 05:45', 'dd.mm.yyyy hh24:mi') moment,  16.8 measurement
                  FROM dual
                 UNION
                SELECT 9380 id, TO_DATE('18.11.2000 06:15', 'dd.mm.yyyy hh24:mi') moment,  16.8 measurement
                  FROM dual
    SELECT id, moment, measurement, diff
      FROM (SELECT id, moment, measurement,
                   moment - TO_DATE(TO_CHAR(moment, 'dd.mm.yyyy ') || '06:00', 'dd.mm.yyyy hh24:mi') diff
              FROM t1
    ORDER BY abs(diff) asc, SIGN(diff) desc;
      C.

  • SQL Query to retrieve the All records based on the Max Dates.

    Hello all,
    I am trying to retrieve the newest record based on the date field (  nextDate  ).
    Currently there are only 4 records in the MC_Maintenance table and two in the Machine table.
    Machine table
    MC_id             EquipID          
    1                      0227
    MC_id             EquipID
    2                     0228
    MC_Maintenance table
    Maint_id           MC_id             Next_maint                  
    1                      2                      08/25/2010     
    2                      2                      07/01/2010
    3                      1                      06/11/2010
    4                      1                      07/11/2010
    What I  am trying to accomplish is,
    list the two machines from the Machine table with the MAX(Next_maint) controlling the MC_Maintenance output list
    These are the records that I would like to Display.
    Maint_id           MC_id             Next_maint                  
    1                      2                      08/25/2010
    4                      1                      07/11/2010                 
    Below is the SQL Query
    SELECT
           MC.MC_ID as ID,
            MC.complete_Date as completed,
            MC.next_maint as nextDate,
            MC.maint_notes as Notes,
            MC.facility as Facility,
            M.EquipId,
            M.name as name,
            M.SerialNumber as SN,
            M.dept as dept,
            M.Freq as freq
            From  MC_Maintenance MC, Machine M
            where  MC.MC_ID =  M.MC_ID
    '           USING MAX(nextDate )
    Any ideas would help.
    TJ

    I would have thought that was a simple group by problem?
    SELECT M.EquipID, MC.MC_ID, Max(MC.next_maint)
    FROM MC_Maintenance MC INNER JOIN Machine M ON MC.MC_ID = M.MC_ID
    GROUP BY M.EquipID, MC.MC_ID

  • Fetch the records based on number

    Hi experts,
        I have a req like if user give input as 5..it should fetch 5 records from database.
    for example database values are
    SERNR                MATNR
    101                                              A
    102                                              A
    103                                              A
    104                                              A
    105                                              A
    106                                              A
    107                                              A
    If user gives the input as 5 it should fetch 5 records like 101 to 105....Can any body plz help me how to write select query for this..
    Thanks in advance,
    Veena.
    Edited by: s veena on Jan 18, 2011 5:52 AM

    Hi Veena,
    You can use UPTO in your select query. For example
    SELECT MATNR FROM MARA INTO TABLE IT_MATNR UPTO P_NUMBER ROWS.
    "Here P_NUMBER is the Selection Screen Parameter
    It will fetch records based on the number in the parameter.
    Thanks & Regards,
    Faheem.

  • Delete the records which have the Data values are NULL before load data to BPC model

    Hi Everyone,
    I am loading the data from flat file to BPC Model (10.0 Version).
    Source data (Flat file) looks like below:
    RP_Employee RPT_Currency Data
    Test                USD                   8
    Test1              USD
    Test2              USD                    6
    My user requirement is that to delete the records which have the Data values are NULL before load data to BPC model.
    So,Please let me know how can i meet to this requirement.
    I am thinking that,it is possible by using start routine BADi. If i am correct please let me know process like creation of class and BADi implementation.
    Thanks in advance!!

    Hi Nilanjan,
    Please see my source data below:
    Account      Client       Employee     Time                Data
    123              XYZ            Vishu            2014.01               300
    456                                                       2014.01
    789              ABC         Alexander      2014.02               200
    If you see the second record,
    If data value is ZULL,  then the Employee or another dimension is also NULL.
    So I want to delete second records.
    If it is Start routine please share the code and steps to do.
    Thanks in advance!!
    Regards,
    Viswanath

  • Get value from the array based on the HashCode

    public static void runJoin(int[][] t1,int[][] t2)
         PrintWriter out=null;
         int rows = 1000;
         int cols = 7;
         int [][] myTable3 = new int[rows][cols];
         int x = 0;
         System.out.print("Running HashJoin:Method loads the "+
         "smaller table in the memory and applies a hashing function "+
         "to common column and stores it in another table. "+
         "The larger table is then read from the file. "+
         "The same hashing function is applied to Col n of the table and a       matching record in the first table is looked up. A match will create a row in Table 3. ");          
    //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               }
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
                   while(e.hasMoreElements())
    //How do I get the value from the array based on the HashCode? Do I need to do a loop here???                         
    hashCodes1.get(e.nextElement());           
              }catch(Exception e){}

    ok I got it......
              //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes and compare
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              Hashtable ht2 = new Hashtable();
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               
                   ht2.put(new Integer(hashCodest1[j]),It1[j]);
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
              Integer t3[] = new Integer[t2.length];
                   while(e.hasMoreElements())
                        t3[x] = (Integer) ht2.get(e.nextElement());                
                        x++;
              }catch(Exception e){}

  • How to implement Check box in the Rtf based on the value from XML datafield

    Hello All ,
    It would be great if any one can help me in implementing check box in the rtf based on the data filed value from the XML data.
    I need to get in the out put checked boxes like what we say Radio button Yes or No ( If Yes it should be marked ).
    If any one worked on this please help us...
    Thanks in Advance...

    Did you check the user guide,
    we have a section over there :)
    http://blogs.oracle.com/xmlpublisher/2007/05/22

  • Is it possible to find the  table based on the Date ?

    Dear Team ,
    Is it possible to find the table based on the Date ?
    I have created an table ,But forgot the Table Name .
    Is it possible to find the Tables created on particular Date .
    Regards ,
    Augustine

    as date is record the time also below query will work.
    select * from user_objects
    where
    object_type = 'TABLE' and
    to_date(created,'DD-MON-YYYY') =to_date('<your date value in DD-MON-YYYY format>','DD-MON-YYYY');
    Edited by: shaileshM on Feb 24, 2010 9:39 PM

  • I've to extract the data based on the sysdate...like today dd is 11,

    BM_PERF is the table name and
    BM_PERF_YR,BM_PERF_MONTH,BM_NOP_CT_1........BM_NOP_CT_31 are the column names.
    I've to extract the data based on the sysdate...like today dd is 11
    so i've to get data from BM_NOP_CT_11 and the column names changes dynamically based on the sysdate. don't use any procedures and functions.

    You could always pivot it into a more convenient form for querying:
    WITH t1 AS
         ( SELECT 2008 AS yr, 4 AS mnth
                , 20 AS dy1
                , 10 AS dy2
                , 15 AS dy3
                , 1  AS dy4
                , 17 AS dy5
                , 99 AS dy6
                , 55 AS dy7
                , 45 AS dy8
                , 33 AS dy9
                , 22 AS dy10
                , 74 AS dy11
                , 35 AS dy12
                , 62 AS dy13
                , 24 AS dy14
                , 85 AS dy15
           FROM dual )
       , t2 AS
         ( SELECT yr
                , mnth
                , sys.DBMS_DEBUG_VC2COLL
                  (dy1,dy2,dy3,dy4,dy5,dy6,dy7,dy8,dy9,dy10,dy11,dy12,dy13,dy14,dy15)
                  AS day_data
           FROM   t1 )
    SELECT t2.yr, t2.mnth, sys_op_ceg(t2.day_data,5) day_value
    FROM   t2;
            YR       MNTH DAY_VALUE
          2008          4 17
    1 row selected.Note that SYS_OP_CEG (first discovered by Padders) is undocumented and unsupported - for production code you'd need to pick the collection row using a WHERE clause, and for that you'd need a custom object and collection type with an attribute to hold the day number.
    Message was edited by:
    William Robertson
    ...like this:
    CREATE TYPE id_value_ot AS OBJECT
    ( id INTEGER, val NUMBER );
    CREATE TYPE id_value_tt AS TABLE OF id_value_ot ;
    WITH t1 AS
         ( SELECT 2008 AS yr, 4 AS mnth
                , 20 AS dy1
                , 10 AS dy2
                , 15 AS dy3
                , 1  AS dy4
                , 17 AS dy5
                , 99 AS dy6
                , 55 AS dy7
                , 45 AS dy8
                , 33 AS dy9
                , 22 AS dy10
                , 74 AS dy11
                , 35 AS dy12
                , 62 AS dy13
                , 24 AS dy14
                , 85 AS dy15
           FROM dual )
       , t2 AS
         ( SELECT yr
                , mnth
                , id_value_tt
                  ( id_value_ot(1,dy1)
                  , id_value_ot(2,dy2)
                  , id_value_ot(3,dy3)
                  , id_value_ot(4,dy4)
                  , id_value_ot(5,dy5)
                  , id_value_ot(6,dy6)
                  , id_value_ot(7,dy7)
                  , id_value_ot(8,dy8)
                  , id_value_ot(9,dy9)
                  , id_value_ot(10,dy10)
                  , id_value_ot(11,dy11)
                  , id_value_ot(12,dy12)
                  , id_value_ot(13,dy13)
                  , id_value_ot(14,dy14)
                  , id_value_ot(15,dy15) )
                  AS day_data
           FROM   t1 )
    SELECT yr, mnth, dd.val
    FROM   t2, TABLE(t2.day_data) dd
    WHERE  dd.id = 5;
            YR       MNTH        VAL
          2008          4         17
    1 row selected.

Maybe you are looking for