Setting check box (in detail block) as (non) updatable...

Hi,
I have a master-detail form. The form does execute a query when it opens. Now, according to a condition i want to do the check box(in detail block) as non- updatable.
I have tried to write the appropriate code in:
WHEN-NEW-RECORD-INSTANCE(in the master block level)
WHEN-NEW-ITEM-INSTANCE (in the detail block level)
POST-QUERY(in the detail block level)
but it does not work 'perfectly'. I mean that in most cases even one of the above triggers does not execute (for example the 'WHEN-NEW-RECORD-INSTANCE' but only after i click on this new record instance. I mean that after this on this new record the condition is estimated....)
or
it does execute but after i click on the checkbox (for example the 'WHEN-NEW-ITEM-INSTANCE').
The code i tried looks like the following:
if :block.item=<condition>
then
  set_item_property ('detail_block.chk_box',updatable,property_false);
else
set_item_property ('detail_block.chk_box',updatable,property_true);
end if;I consider to use the WHEN-CHECKBOX-CHANGED trigger and code which looks like:
if <condition>=true
then
    /*i set the value of the checkbox as the opposite of what it is just after the click on it...*/
  if :detail_block.chk_box=0
   then
     :detail_block.chk_box=1;
  else
    :detail_block.chk_box=0;
  end if;
  set_record_property(currect_record,status,query_status);
  set_item_property ('detail_block.chk_box',updatable,property_false);
end if;The truth is that i do not like very much this code, but is there any alternative...???
Note: I use Dev6i with patch 12
Thank you,
Sim

I build a little testform based on HR-schema-table DEMO_USERS and switch each second record to be not updateable, works without problems (code from POST-QUERY-trigger):
DEFAULT_VALUE('1', 'GLOBAL.SWITCH');
:GLOBAL.SWITCH:=3-:GLOBAL.SWITCH;
IF :GLOBAL.SWITCH=2 THEN
  SET_ITEM_INSTANCE_PROPERTY('DEMO_USERS.ADMIN_USER', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), UPDATE_ALLOWED, PROPERTY_TRUE);
ELSE     
  SET_ITEM_INSTANCE_PROPERTY('DEMO_USERS.ADMIN_USER', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), UPDATE_ALLOWED, PROPERTY_FALSE);
END IF;     Edited by: Andreas Weiden on 31.03.2009 21:24

Similar Messages

  • How to set check box in alv

    Hello Sir,
      I am Developing One Report In ALV, But  I want One Column Of ALV Should Be In Checkboxes .How Can I set Check Box In Field Catalog.
    Plz Help Me.

    hi,
    Try like this.
    *& Report  ZTEST_ALV
    REPORT  ztest_alv.
    TYPE-POOLS
    TYPE-POOLS: slis. " Type pool for ALV
    Tables
    TABLES: vbak, vbap.
    INTERNAL TABLES
    DATA: BEGIN OF g_t_itab OCCURS 0,
    sel TYPE c,
    vbeln LIKE vbak-vbeln,
    erdat LIKE vbak-erdat,
    vbtyp LIKE vbak-vbtyp,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE vbak-vtweg,
    spart LIKE vbak-spart,
    netwr LIKE vbak-netwr,
    kunnr LIKE vbak-kunnr,
    END OF g_t_itab.
    DATA: BEGIN OF g_t_item OCCURS 0,
    vbeln LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    matnr LIKE vbap-matnr,
    arktx LIKE vbap-arktx,
    END OF g_t_item.
    Data fields used for ALV call - simple list
    DATA : g_f_repid LIKE sy-repid.
    DATA : g_t_fieldcat TYPE slis_t_fieldcat_alv.
    DATA : g_r_fieldcat TYPE slis_fieldcat_alv.
    DATA : g_t_events TYPE slis_t_event.
    DATA : g_r_events TYPE slis_alv_event.
    DATA : g_r_layout TYPE slis_layout_alv.
    DATA : g_r_x_variant LIKE disvariant.
    DATA : g_r_variant LIKE disvariant.
    DATA : g_f_exit(1) TYPE c.
    DATA : g_f_save(1) TYPE c.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF BLOCK b1.
    START OF SELECTION
    START-OF-SELECTION.
      PERFORM get_data.
    END OF SELECTION
    END-OF-SELECTION.
      PERFORM set_alv_parameters.
      PERFORM display_list.
    *& Form get_data
    Get data from DB tables
    FORM get_data.
      CLEAR: g_t_itab.
      REFRESH: g_t_itab.
      SELECT vbeln erdat vbtyp vkorg vtweg spart netwr kunnr
      FROM vbak
      INTO CORRESPONDING FIELDS OF TABLE g_t_itab
      WHERE
      vbeln IN s_vbeln.
    ENDFORM. " get_data
    *& Form set_alv_parameters
    Set alv parameters , layout, events, fieldcatlog
    FORM set_alv_parameters.
      PERFORM set_filedcatlog.
    ENDFORM. " set_alv_parameters
    *& Form display_list
    text
    FORM display_list.
      g_f_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = g_f_repid
         is_layout          = g_r_layout
          it_fieldcat        = g_t_fieldcat[]
          it_events          = g_t_events[]
        TABLES
          t_outtab           = g_t_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.
    ENDFORM. " display_list
    *& Form set_filedcatlog
    text
    FORM set_filedcatlog.
      DATA: l_r_fieldcat TYPE slis_fieldcat_alv. " For column heading
      CLEAR : g_t_fieldcat,
      g_t_fieldcat[].
    <b>  l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'SEL'.
      l_r_fieldcat-checkbox = 'X'.
      l_r_fieldcat-outputlen = 2.
      l_r_fieldcat-col_pos = 1.
      l_r_fieldcat-edit = 'X'.
      l_r_fieldcat-input = 'X'.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.</b>
    Sales Order
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'VBELN'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'VBELN'.
      l_r_fieldcat-col_pos = 2.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Creation date
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'ERDAT'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'ERDAT'.
      l_r_fieldcat-col_pos = 3.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    document category
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'VBTYP'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'VBTYP'.
      l_r_fieldcat-col_pos = 4.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Sales organization
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'VKORG'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'VKORG'.
      l_r_fieldcat-col_pos = 5.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Distribution channel
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'VTWEG'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'VTWEG'.
      l_r_fieldcat-col_pos = 6.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Division
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'SPART'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'SPART'.
      l_r_fieldcat-col_pos = 7.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Net Value
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'NETWR'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'NETWR'.
      l_r_fieldcat-col_pos = 8.
      l_r_fieldcat-do_sum = 'X'.
      l_r_fieldcat-emphasize = 'C500'.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    Distribution channel
      l_r_fieldcat-tabname = 'G_T_ITAB'.
      l_r_fieldcat-fieldname = 'KUNNR'.
      l_r_fieldcat-ref_tabname = 'VBAK'.
      l_r_fieldcat-ref_fieldname = 'KUNNR'.
      l_r_fieldcat-col_pos = 9.
      APPEND l_r_fieldcat TO g_t_fieldcat.
      CLEAR l_r_fieldcat.
    ENDFORM. " set_filedcatlog

  • HOW TO TRIGGER CHECK BOX EVENT IN BLOCKED LIST OUT PUT

    Hi Abapers,
    I am developing ALV Blocked list using 3 internal tables.
    in output list my requirement is if I click one check box in one intrrnal table the below internal table checkboxes should be checked.
    how to solve this problem this is very urgent to me I hope somebody will help me.
    Regards
    Shashikumar.G

    Hi
    First you need to register the events of clicking of the checkbox.
    Once registerred, you can capture that event and when occured, you can set the checkboxes for below internal table.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm</a>
    Regards
    Raj

  • Check box in ALV BLOCK List

    Hi All,
    iam Using ALV BLOCK list to print the output along with check boxes, iam able to print the output along with the check boxes but when i select any of the check box and click button on application tool bar it is going to dump  and saying,
    FIELD SYMBOL HAS NOT YET BEEN ASSIGNED.
    i populated layout with following fields.
      w_layout-box_fieldname = 'BOX'.
      w_layout-box_tabname = 'T_FINAL2'.
    Plz Help me out.
    Thanks in Advance.
    Neha

    *& Report  BCALV_TEST_BLOCK_LIST
    report  bcalv_test_block_list.
    types: g_ty_t_carrid  type standard table of alv_tab,
           g_ty_t_connid  type standard table of alv_chck,
           g_ty_t_curr    type standard table of alv_cur,
           g_ty_s_sflight type alv_t_t2,
           g_ty_s_carrid  type alv_tab,
           g_ty_s_connid  type alv_chck,
           g_ty_s_curr    type alv_cur.
    constants: con_sflight type lvc_fname value 'ALV_T_T2',
               con_scarr   type lvc_fname value 'ALV_TAB',
               con_spfli   type lvc_fname value 'ALV_CHCK',
               con_scurx   type lvc_fname value 'ALV_CUR',
               con_event_01 type lvc_fname value 'PF_STATUS_SET',
               con_event_02 type lvc_fname value 'USER_COMMAND',
               con_event_03 type lvc_fname value 'CALLER_EXIT',
               con_event_04 type lvc_fname value 'LIST_MODIFY',
               con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',
               con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',
               con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',
               con_event_08 type lvc_fname value 'REPREP_MODIFY',
               con_event_09 type lvc_fname value 'TOP_OF_PAGE',
               con_event_10 type lvc_fname value 'END_OF_PAGE',
               con_event_11 type lvc_fname value 'TOP_OF_LIST',
               con_event_12 type lvc_fname value 'END_OF_LIST',
               con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',
               con_event_14 type lvc_fname value 'END_OF_COVERPAGE',
               con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',
               con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',
               con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE'.
    DATA                                                                 *
    tables: sscrfields.   " for processing the FCODEs in Selektion screens
    include <icon>.
    include <symbol>.
    type-pools: slis, kkblo.
    types: g_ty_t_icon  type standard table of icon,
           g_ty_t_icont type standard table of icont,
           begin of g_ty_s_plane,
             carrid    type g_ty_s_sflight-carrid,
             connid    type g_ty_s_sflight-connid,
             planetype type g_ty_s_sflight-planetype,
             seatsmax  type g_ty_s_sflight-seatsmax,
           end   of g_ty_s_plane,
           g_ty_t_plane type sorted table of g_ty_s_plane
                             with unique key carrid connid,
           begin of g_ty_s_fcat_curr,
             fieldname  type lvc_fname,
             cfieldname type lvc_fname,
             currency   type lvc_s_fcat-currency,
           end   of g_ty_s_fcat_curr,
           g_ty_t_fcat_curr type sorted table of g_ty_s_fcat_curr
                                 with unique key fieldname,
           begin of g_ty_s_sort.
    include type slis_sortinfo_alv.
    types: end   of g_ty_s_sort,
           g_ty_t_sort type sorted table of g_ty_s_sort
                            with unique key spos fieldname,
           begin of g_ty_s_test,
             list_amount              type num1,
             select_amount            type i,
             only_db_info             type char1,
             db_short                 type char1,
             excp_display             type char1,
             excp_condense            type char1,
             layo_title               type lvc_s_layo-grid_title,
             layo_zebra               type char1,
             layo_no_vert_lines       type char1,
             layo_no_horiz_lines      type char1,
             layo_cell_merge          type char1,
             layo_count               type char1,
             layo_box                 type char1,
             layo_no_colhead          type char1,
             layo_column_optimize     type char1,
             layo_keys_hotspot        type char1,
             layo_no_keyfix           type char1,
             layo_no_hotspot          type char1,
             layo_hotspot_rows        type i occurs 0,
             layo_hotspot_columns     type lvc_fname occurs 0,
             layo_no_scrolling        type char1,
             layo_no_authcheck        type char1,
             layo_no_min_linesize     type char1,
             layo_min_linesize        type sylinsz,
             layo_max_linesize        type sylinsz,
             layo_group_change_edit   type char1,
             layo_get_selinfo         type char1,
             layo_confirmation_prompt type char1,
             layo_f2code              type syucomm,
             layo_reprep              type char1,
             sum_before               type char1,
             sum_no_sumline           type char1,
             sum_no_sumchoice         type char1,
             sum_numc                 type char1,
             sum_no_unitsplit         type char1,
             sum_totals_only          type char1,
             sum_totals_text          type symsgli,
             sum_no_subtotals         type char1,
             sum_no_subchoice         type char1,
             sum_subtotals_text       type symsgli,
             prnt_print               type char1,
             prnt_reserve_lines       type lvc_s_prnt-reservelns,
             prnt_no_listinfo         type char1,
             prnt_no_selinfo          type char1,
             prnt_with_title          type char1,
             prnt_footline            type lvc_s_prnt-footline,
             prnt_printinfo           type char1,
             prnt_no_coverpage        type char1,
             prnt_no_new_page         type char1,
             prnt_no_change_print_params type char1,
             color_rows               type i occurs 0,
             color_fields_column      type lvc_fname occurs 0,
             color_fields_cell        type lvc_fname occurs 0,
             fcat_no_out_fields       type lvc_fname occurs 0,
             fcat_tech_fields         type lvc_fname occurs 0,
             fcat_fix_column_fields   type lvc_fname occurs 0,
             fcat_do_sum_fields       type lvc_fname occurs 0,
             fcat_no_sum_fields       type lvc_fname occurs 0,
             fcat_curr_fields         type g_ty_t_fcat_curr,
             curr_amount              type i,
             curr_space               type char1,
             t_sort                   type g_ty_t_sort,
             no_info_popup            type char1,
             info_popup_once          type char1,
             events_info_popup        type lvc_fname occurs 0,
             events                   type lvc_fname occurs 0,
             buffer_active            type char1,
             bypassing_buffer         type char1,
           end   of g_ty_s_test,
           begin of g_ty_s_outtab.
    include type g_ty_s_sflight.
    types:   list                 type num1,
             box                  type char1,
             count                type i,
             lights               type char1,
             checkbox             type char1,
             hotspot              type char1,
             color(4)             type c,
             tabcolor             type slis_t_specialcol_alv,
             price2               type g_ty_s_sflight-price,
             currency2            type g_ty_s_sflight-currency,
             char(10)             type c,
             string               type string,
             int1                 type int1,
             int2                 type int2,
             int4                 type int4,
             numc(10)             type n,
             dec(10)              type p decimals 2,
             fltp                 type f,
             dats                 type d,
             tims                 type t,
             icon                 type icon-id,
             icon_qinfo           type icon-name,
             symbol               type icon-id,
           end   of g_ty_s_outtab,
           g_ty_t_outtab type table of g_ty_s_outtab.
    constants: con_true         type char1 value 'X',
               con_ok   type sy-ucomm value 'OK',
               con_exit type sy-ucomm value 'EXIT',
               con_canc type sy-ucomm value 'CANC',
               con_back type sy-ucomm value 'BACK'.
    data: gt_outtab1 type g_ty_t_outtab,
          gt_outtab2 type g_ty_t_outtab,
          gt_outtab3 type g_ty_t_outtab,
          gt_outtab4 type g_ty_t_outtab,
          gt_outtab5 type g_ty_t_outtab,
          gt_outtab6 type g_ty_t_outtab,
          gt_outtab7 type g_ty_t_outtab,
          gt_outtab8 type g_ty_t_outtab,
          gt_outtab9 type g_ty_t_outtab.
    data: gt_outtab   type g_ty_t_outtab with header line,
          gs_test     type g_ty_s_test.
    data: g_repid     type sy-repid.
    data: g_field     type lvc_s_fcat-fieldname,
          g_int_field type i.
          CLASS random DEFINITION
    class random definition.
      public section.
        types:
          value(16) type p decimals 0,
          numcv(15) type n.
        constants:
          max type random=>value value 4294967295.
        class-methods:
      computes a random natural number from the set {0, ..., random=>max}.
          number returning value(rval) type random=>value,
      computes a random character from the set {A-Za-z0-9}
          c returning value(rval) type char01,
      computes a random string consisting of "len" random characters
          string importing len type i
                 returning value(rval) type string,
      computes a date
          dats returning value(rval) type d,
      computes a time
          time returning value(rval) type t,
      computes a random numc from the set {low, ..., high}
          numc importing low type random=>numcv high type random=>numcv
            returning value(rval) type random=>numcv,
      computes a random integer from the set {low, ..., high}
          i importing low type i high type i
            returning value(rval) type i,
      computes a random integer from the set {low, ..., high}
          int2 importing low type int2 high type int2
               returning value(rval) type int2,
      computes a random integer from the set {low, ..., high}
          int1 importing low type int1 high type int1
               returning value(rval) type int1,
      computes a random float from the interval [low ; high]
          f importing low type f high type f
            returning value(rval) type f,
      computes a random character from the set {A-F0-9}
          hex returning value(rval) type char01,
      computes a random character from the set {0-1}
          x returning value(rval) type char01,
      method "random=>class_constructor"
          class_constructor.
      private section.
        class-data:
      precomputed maximal index (= string length - 1) of "random=>chars"
      or of "random=>x_data".
          charsmax type i,
          xmax type i,
      random number seed value.
      (Used in method "random=>number".)
          seed type random=>value.
        constants:
      characters for class-method "random=>hex"
          hex_data(100) type c value 'ABCDEF' &
                                     '0123456789',
      characters for class-method "random=>x"
          x_data(100) type c value '01',
      characters for class-metshod "random=>c"
          chars(100) type c value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' &
                                  'abcdefghijklmnopqrstuvwxyz' &
                                  '0123456789'.
    endclass.                    "random DEFINITION
          CLASS random IMPLEMENTATION
    class random implementation.
    implementation of the methods for randomizing the values
      method x.
        data: ri type i.
        ri = random=>i( low = 0  high = random=>xmax ).
        move x_data+ri(1) to rval.
      endmethod.                    "x
      method hex.
        data: ri type i.
        ri = random=>i( low = 0  high = random=>charsmax ).
        move hex_data+ri(1) to rval.
      endmethod.                    "hex
      method number.
        constants:
          a(3) type p  value 67301,        " Coefficient
          c(1) type p  value 1,            " Increment
          m(6) type p  value 4294967296.   " Modulus 2**32
        random=>seed = ( a * random=>seed + c ) mod m.
        rval = random=>seed.
      endmethod.                    "number
      method c.
        data:
          ri type i.
        ri = random=>i( low = 0  high = random=>charsmax ).
        move chars+ri(1) to rval.
      endmethod.                    "c
      method string.
        data:
          char(1) type c.
        clear rval.
        do len times.
          char = random=>c( ).
          concatenate rval char into rval.
        enddo.
      endmethod.                    "string
      method dats.
        data: l_date      type sy-datum,
              l_day(2)    type n,
              l_month(2)  type n,
              l_year(4)   type n,
              l_value     type random=>numcv,
              l_low       type random=>numcv,
              l_high      type random=>numcv.
        l_year  = sy-datum+0(4).
        l_low   = l_year - 5.
        l_high  = l_year + 5.
        l_value = random=>numc( low = l_low high = l_high ).
        l_year  = l_value+11(4).
        l_value = random=>numc( low = 1 high = 12 ).
        l_month = l_value+13(2).
        case l_month.
          when 2.
            l_high = 28.
          when 4 or 6 or 9 or 11.
            l_high = 30.
          when others.
            l_high = 31.
        endcase.
        l_value = random=>numc( low = 1 high = l_high ).
        l_day   = l_value+13(2).
        l_date+0(4) = l_year.
        l_date+4(2) = l_month.
        l_date+6(2) = l_day.
        rval = l_date.
      endmethod.                    "dats
      method time.
        data: l_time      type t,
              l_hour(2)   type n,
              l_min(2)    type n,
              l_sec(2)    type n,
              l_value     type random=>numcv.
        l_value = random=>numc( low = 0 high = 60 ).
        l_sec   = l_value+13(2).
        l_value = random=>numc( low = 0 high = 60 ).
        l_min   = l_value+13(2).
        l_value = random=>numc( low = 1 high = 24 ).
        l_hour  = l_value+13(2).
        l_time+0(2) = l_hour.
        l_time+2(2) = l_min.
        l_time+4(2) = l_sec.
        rval = l_time.
      endmethod. "time
      method numc.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method i.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method int2.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method int1.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method f.
      Go from {0,...,random=>max} to [low;high]
        rval = ( ( high - low ) * random=>number( ) ) / random=>max
               + low.
      endmethod.                    "f
      method class_constructor.
        charsmax = strlen( chars ) - 1.
        xmax = strlen( x_data ) - 1.
        seed = 1.
      endmethod.                    "class_constructor
    endclass.                    "random IMPLEMENTATION
    SELECTION-SCREEN                                                     *
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 30,
    p_dbinfo as checkbox,
    p_dbshrt as checkbox.
    selection-screen end of block gen.
    parameters:
    p_list type num1 default 3.
    selection-screen begin of block tit with frame title text-tit.
    parameters:
    p_tit01 type lvc_s_layo-grid_title default text-p01. "TITLE
    selection-screen end of block tit.
    selection-screen begin of block lay with frame title text-lay.
    parameters:
    p_lay01 as checkbox. "ZEBRA
    selection-screen skip.
    parameters:
    p_lay02 as checkbox, "NO HORIZONTAL LINES
    p_lay03 as checkbox. "NO VERTICAL LINES
    selection-screen skip.
    parameters:
    p_lay04 as checkbox. "NO SCROLLING
    selection-screen skip.
    parameters:
    p_lay06 type syucomm,                                       "F2CODE
    p_lay07 as checkbox. "CONFIRMATION PROMPT
    selection-screen end of block lay.
    selection-screen begin of block spa with frame title text-spa.
    parameters:
    p_spa01 as checkbox, "BOX
    p_spa02 as checkbox, "COUNT FELD
    p_spa03 as checkbox, "NO COLUMN HEADERS
    p_spa04 as checkbox. "COLUMN OPTIMIZE
    selection-screen begin of block hot with frame title text-hot.
    parameters:
    p_hot01 as checkbox. "NO HOTSPOT
    parameters:
    p_hot02 as checkbox. "Hotspot auf Zeilenebene
    select-options:
    p_hotf02 for g_int_field no intervals default 1.
    parameters:
    p_hot03 as checkbox.
    select-options:
    p_hotf03 for g_field no intervals.
    selection-screen end of block hot.
    selection-screen begin of block mrg with frame title text-mrg.
    parameters:
    p_mrg01 radiobutton group mrge, "Default
    p_mrg02 radiobutton group mrge, "kein Merge
    p_mrg03 radiobutton group mrge. "Merge
    selection-screen end of block mrg.
    selection-screen begin of block out with frame title text-out.
    parameters:
    p_out01 as checkbox.
    select-options:
    p_outf01 for g_field no intervals.
    selection-screen end of block out.
    selection-screen begin of block tec with frame title text-tec.
    parameters:
    p_tec01 as checkbox.
    select-options:
    p_tecf01 for g_field no intervals.
    selection-screen end of block tec.
    selection-screen begin of block fix with frame title text-fix.
    parameters:
    p_fix01 as checkbox.
    select-options:
    p_fixf01 for g_field no intervals.
    selection-screen end of block fix.
    selection-screen begin of block txt with frame title text-txt.
    selection-screen pushbutton /1(50) text-pb2 user-command pb02.
    selection-screen end   of block txt.
    selection-screen begin of block cur with frame title text-cur.
    parameters:
    p_curanz type i,
    p_curspc as checkbox default space.
    selection-screen skip.
    select-options:
    p_curf00 for g_field no intervals.
    parameters:
    p_cur01 radiobutton group cur default 'X',
    p_curf01 type lvc_s_fcat-fieldname.
    parameters:
    p_cur02 radiobutton group cur,
    p_curf02 type g_ty_s_sflight-currency.
    selection-screen end of block cur.
    selection-screen begin of block sort with frame title text-srt.
    selection-screen pushbutton /1(20) text-pb1 user-command pb01.
    selection-screen end   of block sort.
    selection-screen end of block spa.
    selection-screen begin of block key with frame title text-key.
    parameters:
    p_key01 as checkbox, "KEYFELDER ALS HOTSPOT
    p_key02 as checkbox. "NO KEY FIXIERUNG
    selection-screen end of block key.
    selection-screen begin of block exp with frame title text-exp.
    parameters:
    p_excp01 as checkbox, "EXCEPTION
    p_excp_c as checkbox. "EXCEPTION CONDENSE
    selection-screen end of block exp.
    selection-screen begin of block sum with frame title text-sum.
    parameters:
    p_sum01 as checkbox, "SUM BEFORE
    p_sum02 as checkbox, "NUMC
    p_sum03 as checkbox, "NO UNITSPLIT
    p_sum04 as checkbox, "TOTALS ONLY
    p_sum05 as checkbox, "NO SUMCHOICE
    p_sum06 as checkbox, "NO SUMLINE
    p_sum07 type sy-msgli, "TOTALS TEXT
    p_sum08 as checkbox, "NO SUBCHOICE
    p_sum09 as checkbox, "NO SUBTOTALS
    p_sum10 type sy-msgli. "SUBTOTALS TEXT
    selection-screen begin of block dos with frame title text-dos.
    parameters:
    p_dos01 as checkbox.
    select-options:
    p_dosf01 for g_field no intervals.
    selection-screen end of block dos.
    selection-screen begin of block nos with frame title text-nos.
    parameters:
    p_nos01 as checkbox.
    select-options:
    p_nosf01 for g_field no intervals.
    selection-screen end of block nos.
    selection-screen end of block sum.
    selection-screen begin of block col with frame title text-col.
    parameters:
    p_col01 as checkbox.
    select-options:
    p_colf01 for g_int_field no intervals default 1.
    parameters:
    p_col02 as checkbox.
    select-options:
    p_colf02 for g_field no intervals.
    parameters:
    p_col03 as checkbox.
    select-options:
    p_colf03 for g_field no intervals.
    selection-screen end of block col.
    selection-screen begin of block prn with frame title text-prn.
    parameters:
    p_lpr01 as checkbox default 'X'. "GROUP CHANGE EDIT
    selection-screen skip.
    parameters:
    p_lpr02 as checkbox. "GET SELINFO
    selection-screen skip.
    parameters:
    p_lpr03 as checkbox, "NO MIN LINESIZE
    p_lpr04 type sylinsz, "MIN LINESIZE
    p_lpr05 type sylinsz. "MAX LINESIZE
    selection-screen skip.
    parameters:
    p_prn01 as checkbox, "PRINT
    p_prn02 type lvc_s_prnt-reservelns, "RESERVE LINES
    p_prn03 as checkbox, "NO LISTINFO
    p_prn04 as checkbox, "NO SELINFO
    p_prn05 as checkbox, "TITEL
    p_prn06 type lvc_s_prnt-footline, "FOOTLINE
    p_prn07 as checkbox, "PRINT INFO
    p_prn08 as checkbox, "NO COVERPAGE
    p_prn09 as checkbox, "NO NEW PAGE
    p_prn10 as checkbox. "NO CHANGE PRINT PARAMS
    selection-screen end of block prn.
    selection-screen begin of block evt with frame.
    parameters:
    p_evt01 as checkbox, "PF_STATUS_SET
    p_evt02 as checkbox. "USER_COMMAND
    selection-screen skip.
    parameters:
    p_evt03 as checkbox, "CALLER_EXIT
    p_evt04 as checkbox, "LIST_MODIFY
    p_evt05 as checkbox, "BEFORE_LINE_OUTPUT
    p_evt06 as checkbox. "AFTER_LINE_OUTPUT
    selection-screen skip.
    parameters:
    p_evt07 as checkbox, "SUBTOTAL_TEXT
    p_evt08 as checkbox. "REPREP_SEL_MODIFY
    selection-screen skip.
    parameters:
    p_evt09 as checkbox, "TOP_OF_PAGE
    p_evt10 as checkbox, "END_OF_PAGE
    p_evt11 as checkbox, "TOP_OF_LIST
    p_evt12 as checkbox. "END_OF_LIST
    selection-screen skip.
    parameters:
    p_evt13 as checkbox, "TOP_OF_COVERPAGE
    p_evt14 as checkbox. "END_OF_COVERPAGE
    selection-screen skip.
    parameters:
    p_evt15 as checkbox, "FOREIGN_TOP_OF_PAGE
    p_evt16 as checkbox. "FOREIGN_END_OF_PAGE
    selection-screen skip.
    parameters:
    p_evt17 as checkbox. "GROUPLEVEL_CHANGE
    selection-screen end of block evt.
    INITIALIZATION                                                       *
    initialization.
      perform f01_f4_field using 'SUM' space changing p_dosf01-low.
      p_dosf01-option = 'EQ'.
      p_dosf01-sign   = 'I'.
      append p_dosf01.
      perform f01_f4_field using 'SUM' space changing p_nosf01-low.
      p_nosf01-option = 'EQ'.
      p_nosf01-sign   = 'I'.
      append p_nosf01.
      perform f01_f4_field using 'KEY' space changing p_outf01-low.
      p_outf01-option = 'EQ'.
      p_outf01-sign   = 'I'.
      append p_outf01.
      perform f01_f4_field using space space changing p_tecf01-low.
      p_tecf01-option = 'EQ'.
      p_tecf01-sign   = 'I'.
      append p_tecf01.
      perform f01_f4_field using space space changing p_fixf01-low.
      p_fixf01-option = 'EQ'.
      p_fixf01-sign   = 'I'.
      append p_fixf01.
      perform f01_f4_field using 'CURR' space changing p_curf00-low.
      p_curf00-option = 'EQ'.
      p_curf00-sign   = 'I'.
      append p_curf00.
      perform f01_f4_field using 'CUKY' space changing p_curf01.
      perform f01_f4_field using space space changing p_hotf03-low.
      p_hotf03-option = 'EQ'.
      p_hotf03-sign   = 'I'.
      append p_hotf03.
      perform f01_f4_field using space space changing p_colf02-low.
      p_colf02-option = 'EQ'.
      p_colf02-sign   = 'I'.
      append p_colf02.
      perform f01_f4_field using space space changing p_colf03-low.
      p_colf03-option = 'EQ'.
      p_colf03-sign   = 'I'.
      append p_colf03.
    AT SELECTION-SCREEN                                                  *
    at selection-screen.
      case sscrfields-ucomm.
        when 'PB01'.
          call screen 1001 starting at 1 1 ending at 80 20.
        when 'PB02'.
          call screen 1002 starting at 1 1 ending at 80 20.
      endcase.
    AT SELECTION-SCREEN ON VALUE-REQUEST                                 *
    at selection-screen on value-request for p_dosf01-low.
      perform f01_f4_field using 'SUM' 'X' changing p_dosf01-low.
    at selection-screen on value-request for p_nosf01-low.
      perform f01_f4_field using 'SUM' 'X' changing p_nosf01-low.
    at selection-screen on value-request for p_outf01-low.
      perform f01_f4_field using 'KEY' 'X' changing p_outf01-low.
    at selection-screen on value-request for p_tecf01-low.
      perform f01_f4_field using space 'X' changing p_tecf01-low.
    at selection-screen on value-request for p_fixf01-low.
      perform f01_f4_field using space 'X' changing p_fixf01-low.
    at selection-screen on value-request for p_curf00-low.
      perform f01_f4_field using 'CURR' 'X' changing p_curf00-low.
    at selection-screen on value-request for p_curf01.
      perform f01_f4_field using 'CUKY' 'X' changing p_curf01.
    at selection-screen on value-request for p_hotf03-low.
      perform f01_f4_field using space 'X' changing p_hotf03-low.
    at selection-screen on value-request for p_colf02-low.
      perform f01_f4_field using space 'X' changing p_colf02-low.
    at selection-screen on value-request for p_colf03-low.
      perform f01_f4_field using space 'X' changing p_colf03-low.
    at selection-screen on value-request for p_lay06.
      perform f01_f4_fcode using space
                                 space
                        changing p_lay06.
    START-OF-SELECTION                                                   *
    start-of-selection.
      g_repid               = sy-repid.
      gs_test-select_amount = p_amount.
      gs_test-only_db_info  = p_dbinfo.
      gs_test-db_short      = p_dbshrt.
      gs_test-list_amount = p_list.
      gs_test-layo_title               = p_tit01.
      gs_test-layo_zebra               = p_lay01.
      gs_test-layo_no_horiz_lines      = p_lay02.
      gs_test-layo_no_vert_lines       = p_lay03.
      gs_test-layo_no_scrolling        = p_lay04.
      gs_test-layo_f2code              = p_lay06.
      gs_test-layo_confirmation_prompt = p_lay07.
      gs_test-layo_box                 = p_spa01.
      gs_test-layo_count               = p_spa02.
      gs_test-layo_no_colhead          = p_spa03.
      gs_test-layo_column_optimize     = p_spa04.
      gs_test-layo_no_hotspot          = p_hot01.
      if p_hot02 eq con_true.
        loop at p_hotf02.
          if not p_hotf02-low is initial.
            append p_hotf02-low to gs_test-layo_hotspot_rows.
          endif.
        endloop.
      endif.
      if p_hot03 eq con_true.
        loop at p_hotf03.
          if not p_hotf03-low is initial.
            append p_hotf03-low to gs_test-layo_hotspot_columns.
          endif.
        endloop.
      endif.
      case con_true.
        when p_mrg01.
          gs_test-layo_cell_merge          = space.
        when p_mrg02.
          gs_test-layo_cell_merge          = 'N'.
        when p_mrg03.
          gs_test-layo_cell_merge          = 'Y'.
      endcase.
      if p_out01 eq con_true.
        loop at p_outf01.
          if not p_outf01-low is initial.
            append p_outf01-low to gs_test-fcat_no_out_fields.
          endif.
        endloop.
      endif.
      if p_tec01 eq con_true.
        loop at p_tecf01.
          if not p_tecf01-low is initial.
            append p_tecf01-low to gs_test-fcat_tech_fields.
          endif.
        endloop.
      endif.
      if p_fix01 eq con_true.
        loop at p_fixf01.
          if not p_fixf01-low is initial.
            append p_fixf01-low to gs_test-fcat_fix_column_fields.
          endif.
        endloop.
      endif.
      gs_test-curr_amount = p_curanz.
      gs_test-curr_space  = p_curspc.
      if p_cur01 eq con_true or p_cur02 eq con_true.
        data: ls_fcat_curr type g_ty_s_fcat_curr.
        loop at p_curf00.
          clear ls_fcat_curr.
          if not p_curf00-low is initial.
            ls_fcat_curr-fieldname = p_curf00-low.
            case con_true.
              when p_cur01.
                ls_fcat_curr-cfieldname = p_curf01.
              when p_cur02.
                ls_fcat_curr-currency   = p_curf02.
            endcase.
            append ls_fcat_curr to gs_test-fcat_curr_fields.
          endif.
        endloop.
      endif.
      gs_test-layo_keys_hotspot        = p_key01.
      gs_test-layo_no_keyfix           = p_key02.
      gs_test-excp_display             = p_excp01.
      gs_test-excp_condense            = p_excp_c.
      gs_test-sum_before               = p_sum01.
      gs_test-sum_numc                 = p_sum02.
      gs_test-sum_no_unitsplit         = p_sum03.
      gs_test-sum_totals_only          = p_sum04.
      gs_test-sum_no_sumchoice         = p_sum05.
      gs_test-sum_no_sumline           = p_sum06.
      gs_test-sum_totals_text          = p_sum07.
      gs_test-sum_no_subchoice         = p_sum08.
      gs_test-sum_no_subtotals         = p_sum09.
      gs_test-sum_subtotals_text       = p_sum10.
      if p_dos01 eq con_true.
        loop at p_dosf01.
          if not p_dosf01-low is initial.
            append p_dosf01-low to gs_test-fcat_do_sum_fields.
          endif.
        endloop.
      endif.
      if p_nos01 eq con_true.
        loop at p_nosf01.
          if not p_nosf01-low is initial.
            append p_nosf01-low to gs_test-fcat_no_sum_fields.
          endif.
        endloop.
      endif.
      gs_test-layo_group_change_edit   = p_lpr01.
      gs_test-layo_get_selinfo         = p_lpr02.
      gs_test-layo_no_min_linesize     = p_lpr03.
      gs_test-layo_min_linesize        = p_lpr04.
      gs_test-layo_max_linesize        = p_lpr05.
      gs_test-prnt_print                  = p_prn01.
      gs_test-prnt_reserve_lines          = p_prn02.
      gs_test-prnt_no_listinfo            = p_prn03.
      gs_test-prnt_no_selinfo             = p_prn04.
      gs_test-prnt_with_title             = p_prn05.
      gs_test-prnt_footline               = p_prn06.
      gs_test-prnt_printinfo              = p_prn07.
      gs_test-prnt_no_coverpage           = p_prn08.
      gs_test-prnt_no_new_page            = p_prn09.
      gs_test-prnt_no_change_print_params = p_prn10.
      if p_col01 eq con_true.
        loop at p_colf01.
          if not p_colf01-low is initial.
            append p_colf01-low to gs_test-color_rows.
          endif.
        endloop.
      endif.
      if p_col02 eq con_true.
        loop at p_colf02.
          if not p_colf02-low is initial.
            append p_colf02-low to gs_test-color_fields_column.
          endif.
        endloop.
      endif.
      if p_col03 eq con_true.
        loop at p_colf03.
          if not p_colf03-low is initial.
            append p_colf03-low to gs_test-color_fields_cell.
          endif.
        endloop.
      endif.
      if p_evt01 eq con_true.
        append con_event_01 to gs_test-events.
      endif.
      if p_evt02 eq con_true.
        append con_event_02 to gs_test-events.
      endif.
      if p_evt03 eq con_true.
        append con_event_03 to gs_test-events.
      endif.
      if p_evt04 eq con_true.
        append con_event_04 to gs_test-events.
      endif.
      if p_evt05 eq con_true.
        append con_event_05 to gs_test-events.
      endif.
      if p_evt06 eq con_true.
        append con_event_06 to gs_test-events.
      endif.
      if p_evt07 eq con_true.
        append con_event_07 to gs_test-events.
      endif.
      if p_evt08 eq con_true.
        append con_event_08 to gs_test-events.
      endif.
      if p_evt09 eq con_true.
        append con_event_09 to gs_test-events.
      endif.
      if p_evt10 eq con_true.
        append con_event_10 to gs_test-events.
      endif.
      if p_evt11 eq con_true.
        append con_event_11 to gs_test-events.
      endif.
      if p_evt12 eq con_true.
        append con_event_12 to gs_test-events.
      endif.
      if p_evt13 eq con_true.
        append con_event_13 to gs_test-events.
      endif.
      if p_evt14 eq con_true.
        append con_event_14 to gs_test-events.
      endif.
      if p_evt15 eq con_true.
        append con_event_15 to gs_test-events.
      endif.
      if p_evt16 eq con_true.
        append con_event_16 to gs_test-events.
      endif.
      if p_evt17 eq con_true.
        append con_event_17 to gs_test-events.
      endif.
      gs_test-buffer_active            = space.
      gs_test-bypassing_buffer         = space.
    END-OF-SELECTION                                                     *
    end-of-selection.
      perform f01_call_list.
    *&      Form  f01_call_list
          text
    form f01_call_list .
      data: ls_prnt   type slis_print_alv,
            lt_excl   type slis_t_extab,
            l_exit    type char1,
            ls_exit   type slis_exit_by_user,
            l_list    type num1.
      call function 'REUSE_ALV_BLOCK_LIST_INIT'
        exporting
          i_callback_program       = g_repid
          i_callback_pf_status_set = ' '
          i_callback_user_command  = ' '
          it_excluding             = lt_excl.
      do gs_test-list_amount times.
        add 1 to l_list.
        perform f01_append_list using l_list.
      enddo.
      perform f01_set_prnt changing ls_prnt.
      call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        exporting
          i_interface_check       = ' '
          is_print                = ls_prnt
          i_screen_start_column   = 0
          i_screen_start_line     = 0
          i_screen_end_column     = 0
          i_screen_end_line       = 0
        importing
          e_exit_caused_by_caller = l_exit
          es_exit_caused_by_user  = ls_exit
        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.                    " f01_call_list
    *&      Form  f01_append_list
          text
    form f01_append_list using value(i_list) type num1.
      data: ls_layo   type slis_layout_alv,
            lt_fcat   type slis_t_fieldcat_alv,
            lt_sort   type slis_t_sortinfo_alv,
            lt_evts   type slis_t_event,
            l_tabname type slis_tabname.
      field-symbols: <l_table> type any.
      perform f01_get_outtab using i_list.
      case i_list.
        when 1.
          gt_outtab1 = gt_outtab[].
        when 2.
          gt_outtab2 = gt_outtab[].
        when 3.
          gt_outtab3 = gt_outtab[].
        when 4.
          gt_outtab4 = gt_outtab[].
        when 5.
          gt_outtab5 = gt_outtab[].
        when 6.
          gt_outtab6 = gt_outtab[].
        when 7.
          gt_outtab7 = gt_outtab[].
        when 8.
          gt_outtab8 = gt_outtab[].
        when 9.
          gt_outtab9 = gt_outtab[].
      endcase.
      perform f01_set_layo changing ls_layo.
      perform f01_set_fcat changing lt_fcat.
      perform f01_set_evts changing lt_evts.
      concatenate 'LIST_' i_list into l_tabname.
      case i_list.
        when 1.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab1
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
        when 2.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab2
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
        when 3.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab3
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-ms

  • How to update field when check box checked

    Hi All,
    I am using oracle Forms 10g,
    I have a block with 20 fields.So first 10 Fields are not updatable and remaining are Editable. So the user will enter the Data and changes the data.And check the Check box and save the data.
    Inside the save button i have written the update code.
    When the user Edit two or three records and click three Check box and click the save button only one record is getting entred in my custom table.
    This is my code please correct me where i went worng.
    This is my code inside my button
    declare
    Begin
    If :ASSEMBLIES_BLOCK.CHECK_IN_OUT='Y' THEN
    IF SHOW_ALERT ('UPDATE_ALERT') = alert_button1 THEN
    LOOP
    XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGOSTICS_UPDATE;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    NEXT_RECORD;
    END LOOP;
    STANDARD.COMMIT;
    fnd_message.set_string ('Transaction Saved Successfully');
    fnd_message.show;
    ELse
    NULL;
    END If;
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    WHEN OTHERS
    THEN
    NULL;
    END;
    I have write a procedure in program unit.
    XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGOSTICS_UPDATE
    Assemblies block is my current block that user enter the data and click the check box and save the data.
         Update XXTLX_PO_ASSEMBLIES set CASE_NO=nvl(:assemblies_block.CASE_NO,Null),
              PACKAGE_TYPE=nvl(:assemblies_block.PACKAGE_TYPE,null),
              PACKAGE_QTY=nvl(:assemblies_block.PACKAGE_QTY,Null),
              GROSS_WT=nvl(:assemblies_block.GROSS_WEIGHT,Null),
              OPI_DATE=nvl(:assemblies_block.OPI_DATE,Null)               
              Where ponum=:DETAIL_BLOCK.PO_NUMBER
              AND PO_LINE_NUM=:DETAIL_BLOCK.LINE_NUM          
              AND BOM_NO=:assemblies_block.BOM_NO;
    So when we click the multiple check box and save the data only one data is entering.
    Thanks & Regards
    Srikkanth

    I guess I don't understand.
    >
    ... my requirement is only the checked fields need to get updated. If in a block there are 10 records means ill update only the 3rd and 4th record and then click the check box.. and then ill click the save button.
    >
    Is this block a database block or a non-database block? If it is a database block then Oracle can handle updates to that block for you because if keeps tabs if a record was updated or not and you wouldn't need to do an UPDATE statement.
    If it is a non-database block, and you are looping through each record and only updating the items that have checkboxes next to them you would still have to go to the first record then step through each record and see if it needs to be updated. I am just guessing here because I don't think I have a good grasp on what you are doing, but you could change your XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGISTICS_UPDATE package to only update the items that have checkboxes next to them, by checking each checkbox:
    -- Check Case No
    if nvl(:assemblies_block.chase_no_check,'N') = 'Y' then
      update xxtlx_po_assemblies
         set case_no = :assemblies_block.case_no
       where ponum = :detail_block.po_number
         and po_line_num = :detail_block.line_num
         and bom_no = :assemblies_block.bom_no;
    end if;
    -- Check Package Type
    if nvl(:assemblies_block.package_type_check,'N') = 'Y' then
      update xxtlx_po_assemblies
         set package_type = :assemblies_block.package_type
       where ponum = :detail_block.po_number
         and po_line_num = :detail_block.line_num
         and bom_no = :assemblies_block.bom_no;
    end if;
    -- Check Package Qty
    .

  • Check box problum

    Hi master
    I use master detail form
    I have colum is name active and datatype is number
    I set property of check box
    Name                active
    Datatype          number
    Max len          1
    Check               yes
    Database item           yes
    Colum name          active
    But when I run form then give me that error
    FRM-30174: Checked and Unchecked check box values must be distinct.
    Check Box ACTIVE
    Item: ACTIVE
    Block: cahrtofacc
    Form: MASTERDETAIL
    FRM-30085: Unable to adjust form for output.
    Please give me idea or sample
    Thanking you
    Aamir

    Set the properties
    Value when Checked
    Value when Unchecked
    to different values and consider setting
    Check Box Mapping of Other Values

  • How i can Insert selected records in database table using check box.

    Hi Friends,
    I have non database block, which displayed multiple records, now I add a Check Box to this block and now I want to insert the records in a database table which I checked. So when I press a button, all the checked records are inserted in the table.
    Please send me the code of this solution.
    Thanks in advance.
    Shahzad

    I have almost the exact scenario but instead of inserting into the DB, I want to find the Checked records and process them in PL/SQL script.
    I currently have a cursor that looks for all the checked records. It's only getting the first record, so I figured I need to loop through the block looking for checked records.
    Also can I save them to a temp or PL/SQL table to process later?

  • Display description, but non-updatable data block

    To display my Item_Description, I've created a post-query trigger to lookup Item_Description based on Item_Num, which works fine, except if the user does not have update priveledge. By default the data block is non-updatable. If the user has update, then the block is set updatable at run-time.
    Problem is, for a non-update priveledge user, the form errors when the trigger attempts to set the description field. [Even though the field is set updatable by default.]
    What am I missing? Thanks.

    I'm confused. You say:
    "By default the data block is non-updatable."
    but then you say:
    "...the field is set updatable by default."
    If the data block is not updateable, then you can't make the item updateable.
    Assuming the default is non-updateable, and a user does not have update privilege, then the error message you are getting is correct because the trigger is trying to do an update when the item is non-updateable.
    If you need the trigger to do an update, then you need to make the item updateable. If you don't want the trigger to do an update for this user, then first check if the item is updateable (use the get_item_property), and if it is updateable, then let the trigger do the update.
    Message was edited by:
    Mark Roberts

  • How to select the check box automatically

    Hi All,
    I'm using forms 6i.I have 3 check boxes.If i Select the 2nd and 3rd check box then the fist check box should be selected automatically.The 2nd and 3rd check boxes are mutliarray block attached to each other while the !st check box is not attached to them. while Can someone please tell me how to write the code for this?
    With Regards,
    Gowtham
    Message was edited by:
    Gowtham1232
    Message was edited by:
    Gowtham1232

    It's not very clear, but I think that having a WHEN-CHECKBOX-CHANGED trigger on checkbox2 and checkbox3 that says
    IF :checkbox2 = 'Y' and :checkbox3 = 'Y' THEN
      :checkbox1 := 'Y';
    ELSE
      :checkbox1 := 'N';
    END IF;assuming 'Y' is the checked value of each checkbox and 'N' the unchecked.

  • Selection screen change with check box and radio buttons

    hi frieds
    i have an requirement that
    there is a check box in the selection screen and bydefault it has been check if it check the selection box shuld be disable
    if it uncheck the check box then selection block should enabled and in that againg two radion buttons are there. Bydefualt one radio button is enabled so that correspondng parameter is allow to enter input data. if i select the othere radio button the immeditely it allow the correpnding field entry and other radio button should be disabled with that field.
    please send the piece of code...
    regards
    vijay

    Hi,
    Use the event AT SELECTION-SCREEN OUTPUT.
    Here is an example:
    at selection-screen output.
      if gv_ucomm = 'RG1'.
        loop at screen.
          if pa_rgor = 'X'.
            if screen-name+7(1) = '2' or
               screen-name+7(1) = '1'.
              screen-input = 0.
            endif.
          endif.
          if pa_rgof = 'X'.
            if screen-name+7(1) = '1' or
               screen-name+7(1) = '3'.
              screen-input = 0.
            endif.
          endif.
          if pa_rgaa = 'X'.
            if screen-name+7(1) = '2' or
               screen-name+7(1) = '3'.
              screen-input = 0.
            endif.
          endif.
          modify screen.
        endloop.
      endif.

  • ABAP TREE REPRT with check boxes

    Hi,
    I am doing tree report where i need check box for each and every node and if user clicks on the check box the details of the nodes should be seen for the boxes that are checked
    this program is written in normal abap not in oops
    correct inputs are rewarded
    Thanks
    Rasheed
    Edited by: Rasheed salman on Oct 10, 2008 7:02 AM

    check this thread alv tree checbox problem when attempt to get the selected checjboxes

  • URGENT HELP PLS :  Issue with Multi Level Master Detail block

    This is an issue someone else had posted in this forum few years back but there was no solution mentioned, I have run into this same issue , The problem is as explained below.
    Any help on this is appreciated.
    Scenario:
    There are 3 Blocks in the form : A (Master Block)
    : B (Detail of A )
    : C (Detail of B )
    There is master detail relation created between A and B and B and C. So initially when we query for a record in Master A, it shows all records properly in B and C.
    Now if i navigate to the first record of B , and then second record of B , records corresponding to that record shows up properly in C block.
    Till now everything works fine.
    Issue 1:
    But in case after querying initially on Master Block A,If I go directly to the second record of B block, it clears the whole B block and C block.
    Issue 2:
    Same thing happens if I am on C block ( corresponding to second record of B block) and then navigate to first record in B block , it again clears the whole B block and C block.
    Please Help !!
    Thanks !

    Thanks Xem for Your reply , I tried those settings but it did not help..here is the original link that to the thread that talks about the same problem ,
    Issue with Multi Level Master Detail block
    The last update to this was the following :
    "I figured out that this is happening because Block Status is set to 'Changed' and this is causing it to clear out the blocks.
    But cant figure out why the status is setting to 'Changed' "
    Any Help from the form Gurus on this form in this matter is truely appreicated !!
    Thanks,
    Zid.

  • Query a detail block

    Dear members,
    I use Forms 6i c/s, with a 8.1.7 database.
    I have two blocks, with a master-detail relation between them.
    When I try to search for records in the detail block (Enter-Query / Execute-Query), I get only one record: the one that was synchronized from the master block.
    I'd like to find a way to get all the records when querying the detail block, while keeping the master-detail relation.
    Any idea ?
    Is it just the "Copy value from item" on the detail block side that narrows the records to just one ?
    Or can I modify something in the triggers/procedures created by the relation ?
    Thanks for your help.

    I understood your idea of a separate search block, but >one thing remains unclear: where do I populate the >results ?You still query the original M-D blocks to get results by setting the master/detail block's default-where property and execute_query on the block respectively.
    You need to concate the user inputs into a string for default-where as user may input ename and sal two fields to find out how many departments and dependents info.
    The separate dialog even allows user to input detail block's ename, sal and master block's loc fields to get the specific department, which default M-D cannot do this.
    In addition, default search button does not allow you set one master or detail block default-where and execute-query, then go to detail or master block to set default-where and execute-query.
    You do a simple testing on tables of dept and emp, then you will sense this.
    Good luck.

  • Update database using check boxes

    I have a query region that produces a checkbox and an associated line with the checkbox. The data in the database that is a "Y", produces a checked box.
    select check_box_seq,
    htmldb_item.checkbox(1,is_it_checked,decode(is_it_checked,'Y','CHECKED')) D,
    check_box_text R
    from check_box_tbl
    What I need to happen is to change one or more check boxes. I have a MultiRow Update process, with a process point of On Submit - After Computations and Validations with a PL/SQL conditional processing of:
    FOR I in 1.. HTMLDB_APPLICATION.F_F01.COUNT LOOP
    update table check_box_tbl set is_it_checked = Y
    where check_box_seq = htmldb_item.application.g_f01(i);
    END LOOP;
    But the data in the database does not change. I have read numerous discussion on this thread but I have not found exactly what I need or can not recognize it.
    How can I get the data in the database to change when I either change a checked box or after I have changed all boxes and then press the SUBMIT.

    I am having a similar problem that I cannot find the answer to. (See my process below). I don't think that the process is "grabbing" the checked values in the SDN column. It is using NULL, so therefore no rows are being inserted in the table. Shg_id and SDN are both primary keys in this table, so I need to insert both. Shg_id has an assigned value already.
    My process is this:
    DECLARE
    l_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_selected := HTMLDB_UTIL.STRING_TO_TABLE(:P312_SDN);
    FOR i IN 1..l_selected.count
    LOOP
    INSERT INTO shgm (Shg_id, SDN)
    VALUES (:P312_Shg_id, l_selected (i));
    END LOOP;
    END;

  • Adobe Acrobat Check Box Problems

    Hello,
    I am setting up a form within Adobe Acrobat Pro v 9. I have been able to set check boxes up within the form that when you click on them they make a field visible. The problem is that when you uncheck them the field stays visible. I am trying to get it where when you click on it and the check mark is there the field is visible but when you uncheck it the same field that became visible when you checked it becomes invisible.
    If you are responding an example of a checkboxes name and the field name would be Checkbox Numbers and then the field name would be Numbers Font.
    Thanks for your help!
    J .:

    Hey this is great! Works seemlessly.
    Is there a way to do the same thing with JavaScript to control layers?
    So say we use the original checkbox which is named Checkbox Numbers.
    Whenever we click on Checkbox Numbers to be checked we want the layer named
    Numbers be visible however when we uncheck it we want it to become
    invisible.
    Is that possible through JavaScript and if so what would that code be?
    (Sorry I'm not a programmer)
    Thanks for your help!

Maybe you are looking for

  • Mail Alert to Managing Director for every transaction for customer & vendor

    Dear Gurus, Please let me know how & where to do setting for mail alert to Managing Director for every transaction for customer & vendor, Like for Customer: Sales Order, PGI, Invoice, Payment receipt................        for Vendor: Purchase Order,

  • Access denied to NetPoint.PaymentProviderImplementation.dll

    Hello, I have set up the Bussiness One E-commerce and I have a problem when I am trying to make an order. After I press continue after the "Billing" step, the text below appears: An Internal Error has occurred. Version      2007.1.650.0 Message      

  • Outer join between two Contexts not working

    Hi, I have two contexts. A Context and B Context. To define hierachy or to show the both contexts data in single table/report in Web-I, i joined main tables of both contexts with a join. In those main two tables i want to show the table1 data irrespe

  • Is it possible to design a website completely in Fireworks?

    Just wondering if this is possible I used to be a engineering designer (& learned dozens of progams while in the field) & I'm trying to help my buddy with his new business building a website. I have no desire or need to learn code. Fireworks seems ea

  • Some iPod songs are scratching/skipping/call it what you want...

    Hey, After returning a faulty iPod in for this "new" 60GB iPod I had some trouble. When I uploaded the songs, some of them would make a scratching noise like a bad cd in an old cd player. I've tried to restore my ipod twice, and even tried uploading