How to create an editable ALV?

How to create an editable ALV?

The follow program demonstrates how to make individual fields of an ALV grid editable (NetPR greater than 10).
Changes required from a basic ALV grid include adding a new field to ALV grid data table(it_ekko), Populating this
field with style attribute and adding an entry to layout control table. Also from the previous examples used on
this website you will also need to change the data type of the fieldcatalog, the layout and use a different function
module for displaying the report.
*& Report  ZDEMO_ALVGRID_EDIT                                          *
*& Example of a simple ALV Grid Report                                 *
*& The basic ALV grid, Enhanced to display specific fields as          *
*& editable depending on field value                                   *
REPORT  ZDEMO_ALVGRID_EDIT                 .
TABLES:     ekko.
TYPE-POOLS: slis.                                 "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
  menge TYPE ekpo-menge,
  meins TYPE ekpo-meins,
  netpr TYPE ekpo-netpr,
  peinh TYPE ekpo-peinh,
  field_style  TYPE lvc_t_styl, "FOR DISABLE
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko TYPE t_ekko.
*ALV data declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER LINE,
      wa_fieldcat TYPE lvc_s_fcat,
      gd_tab_group TYPE slis_t_sp_group_alv,
      gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
      gd_repid     LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
  PERFORM data_retrieval.
  PERFORM set_specific_field_attributes.
  PERFORM build_fieldcatalog.
  PERFORM build_layout.
  PERFORM display_alv_report.
*&      Form  BUILD_FIELDCATALOG
      Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
  wa_fieldcat-fieldname   = 'EBELN'.
  wa_fieldcat-scrtext_m   = 'Purchase Order'.
  wa_fieldcat-col_pos     = 0.
  wa_fieldcat-outputlen   = 10.
  wa_fieldcat-emphasize   = 'X'.
  wa_fieldcat-key         = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'EBELP'.
  wa_fieldcat-scrtext_m   = 'PO Item'.
  wa_fieldcat-col_pos     = 1.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'STATU'.
  wa_fieldcat-scrtext_m   = 'Status'.
  wa_fieldcat-col_pos     = 2.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'AEDAT'.
  wa_fieldcat-scrtext_m   = 'Item change date'.
  wa_fieldcat-col_pos     = 3.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'MATNR'.
  wa_fieldcat-scrtext_m   = 'Material Number'.
  wa_fieldcat-col_pos     = 4.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'MENGE'.
  wa_fieldcat-scrtext_m   = 'PO quantity'.
  wa_fieldcat-col_pos     = 5.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'MEINS'.
  wa_fieldcat-scrtext_m   = 'Order Unit'.
  wa_fieldcat-col_pos     = 6.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'NETPR'.
  wa_fieldcat-scrtext_m   = 'Net Price'.
  wa_fieldcat-edit        = 'X'. "sets whole column to be editable
  wa_fieldcat-col_pos     = 7.
  wa_fieldcat-outputlen   = 15.
  wa_fieldcat-datatype     = 'CURR'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
  wa_fieldcat-fieldname   = 'PEINH'.
  wa_fieldcat-scrtext_m   = 'Price Unit'.
  wa_fieldcat-col_pos     = 8.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
ENDFORM.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT
      Build layout for ALV grid report
FORM build_layout.
Set layout field for field attributes(i.e. input/output)
  gd_layout-stylefname = 'FIELD_STYLE'.
  gd_layout-zebra             = 'X'.
ENDFORM.                    " BUILD_LAYOUT
*&      Form  DISPLAY_ALV_REPORT
      Display report using ALV grid
FORM display_alv_report.
  gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
            i_callback_program      = gd_repid
           i_callback_user_command = 'USER_COMMAND'
            is_layout_lvc               = gd_layout
            it_fieldcat_lvc             = it_fieldcat
            i_save                  = 'X'
       TABLES
            t_outtab                = it_ekko
       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_ALV_REPORT
*&      Form  DATA_RETRIEVAL
      Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
  SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
   UP TO 10 ROWS
    FROM ekpo
    INTO  CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM.                    " DATA_RETRIEVAL
*&      Form  set_specific_field_attributes
      populate FIELD_STYLE table with specific field attributes
form set_specific_field_attributes .
  DATA ls_stylerow TYPE lvc_s_styl .
  DATA lt_styletab TYPE lvc_t_styl .
Populate style variable (FIELD_STYLE) with style properties
The NETPR field/column has been set to editable in the fieldcatalog...
The following code sets it to be disabled(display only) if 'NETPR'
is gt than 10.
  LOOP AT it_ekko INTO wa_ekko.
    IF wa_ekko-netpr GT 10.
      ls_stylerow-fieldname = 'NETPR' .
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                             "set field to disabled
      APPEND ls_stylerow  TO wa_ekko-field_style.
      MODIFY it_ekko FROM wa_ekko.
    ENDIF.
  ENDLOOP.
endform.                    " set_specific_field_attributes

Similar Messages

  • How to make cell editable alv in WebDynpro for ABAP?

    I make Column editable ALV.(See under source code)
    But I can't make Cell editable ALV.
    How to make Cell editable ALV in WebDynpro for ABAP?
    and..how to get changed data?
    DATA: l_value TYPE REF TO cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model( ).
    * { EDITABLE
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_input_field     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_column          TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'TOTAL_COUNT' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'TOTAL_COUNT'.
      lr_column->set_cell_editor( lr_input_field ).
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= l_value.
      lr_table_settings->set_read_only( abap_false ).

    the code seems to be correct....but where are you writing it?
    put the code in the wddoinit method and it should work.
    have a look at this article..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1

  • How to create user editable Crystal Report with dynamic dataset

    What I would like to achieve:
    A program loads a report in runtime updates list of database fields (possibly includes sample data), open report in "Crystal Reports 2011" (or 2008) where user customizes report and saves it. Later on the program loads the report, fills actualized data and displays it in .net report viewer.
    What I do:
    CrReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument
    CrReport.Load(TemplateFilename)
    Dim Results As DataTable
    DataTable is filled from a database
    CrReport.SetDataSource(mResults)
    CrReport.SaveAs(NewReportPath, True)
    The NewReportPath is opened in the default program.
    What are the problems
    The report is open in preview mode (not in design).
    When the field is added to the report the designer asks for XML datasource on preview.

    The short answer is that it is not possible. I broke the question to other two: How to save a report that it opens without preview? and How to create user editable Crystal Report with dynamic dataset, where it is possible to find details. Key answer is Re: How to create an editable previewable report?

  • How to create and edit anomalous tables in DIAdem? Such as the example list.

    How to create and edit anomalous tables in DIAdem?
    Can the tables  be edited as in MS Word?
    帖子被yangafreet在08-21-2007 10:28 PM时编辑过了
    Attachments:
    table example.doc ‏26 KB

    Hi yangafreet,
    There is no way I know of to create a DIAdem table that looks like the table in your Word document.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to create Status in ALV reports?

    Hi experts,
                     I need to create a status in a alv report. but i am not getting how to create it. i have declared a variable type slis_formname. and appended the events with it. now how to create the status in form.answers will be rewarded.
    Thanks in advance,
    Ramana

    Hello Venkat,
    Copy the standard pf status of the ALV in SE41 and do the following.
      DATA: IT_EVENTS TYPE SLIS_T_EVENT,
            WA_EVENTS LIKE LINE OF IT_EVENTS.
      REFRESH: IT_EVENTS.
      CLEAR: WA_EVENTS,IT_EVENTS.
      WA_EVENTS-NAME = 'PF_STATUS_SET'.
      WA_EVENTS-FORM = 'STATUS'.
      APPEND WA_EVENTS TO IT_EVENTS .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = IT_VARIANT-REPORT
                I_CALLBACK_TOP_OF_PAGE  = 'TOP_OF_PAGE'
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                IT_FIELDCAT             = IT_FIELDCAT
                I_SAVE                  = 'A'
                IS_VARIANT              = IT_VARIANT
                IT_SORT                 = IT_SORT
                IT_EVENTS               = IT_EVENTS
           TABLES
                T_OUTTAB                = G_T_OUTTAB
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
          FORM status                                                   *
    FORM STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING RT_EXTAB.
    ENDFORM.
    If useful reward.
    Vasanth

  • ADF Faces - How to create an editable rich table at runtime

    Hi,
    JDeveloper version - 11.1.1.4.0
    I have been trying to create an editable table (wherein the user can enter text into the input text boxes contained in the columns added at runtime). The values thus entered are to be captured in the backing bean for further processing.
    Below are my attempts to achieve this in various ways but without success.
    Attempt 1 : Created a Read-Only Dynamic table by dropping the view object instance from the Data Control. Here, the default being output text components, I used input text components and programatically make it updatable in the backing bean, which however, shows as an output text component.
    1) UI - .jspx file
    <af:table rows="#{bindings.TestViewObject1.rangeSize}"
                        fetchSize="#{bindings.TestViewObject1.rangeSize}"
                        emptyText="#{bindings.TestViewObject1.viewable ? 'No data to display.' : 'Access Denied.'}"
                        var="row" rowBandingInterval="0"
                        value="#{bindings.TestViewObject1.collectionModel}"
                        selectedRowKeys="#{bindings.TestViewObject1.collectionModel.selectedRow}"
                        selectionListener="#{bindings.TestViewObject1.collectionModel.makeCurrent}"
                        rowSelection="single"
                        id="t1"
                        partialTriggers="::cb1 ::cb2"
                        binding="#{TestDynamicTable.t1}">
                <af:forEach items="#{TestDynamicTable.attributeDefns}"
                            var="def">
                  <af:column headerText="#{def.name}"
                             sortable="true" sortProperty="#{def.name}" id="c1">
                    <af:inputText value="#{row[def.name]}" id="it1"
                                  label="Label 1"
                                  autoSubmit="true" />               
                  </af:column>
                </af:forEach>
              </af:table>2) Backing bean -
        public void listenMeForAction(ActionEvent ae) {
           //adding attribute dynamically
          ViewAttributeDefImpl def = (ViewAttributeDefImpl)vo.addDynamicAttribute("testDynamicAttr"+columnCount);
          def.setUpdateableFlag(def.UPDATEABLE);
         byte b = def.UPDATEABLE;
         def.setEditable(true);
         //def.setProperty(def.ATTRIBUTE_CTL_TYPE,);
         //def.getUIHelper().HINT_NAME_UPDATEABLE
         def.setProperty(def.ATTRIBUTE_DISPLAY_HINT_DISPLAY, def.HINT_NAME_UPDATEABLE);
         columnCount ++ ;
         AdfFacesContext.getCurrentInstance().addPartialTarget(this.t1);
    Attempt 2 : Created a ADF table by dropping the view object instance from the Data Control. Here, the columns and its cells are added programatically in the backing bean. However
    1) UI - .jspx file
    <af:table value="#{bindings.Test5ViewObj1.collectionModel}" var="row"
                        rows="#{bindings.Test5ViewObj1.rangeSize}"
                        emptyText="#{bindings.Test5ViewObj1.viewable ? 'No data to display.' : 'Access Denied.'}"
                        fetchSize="#{bindings.Test5ViewObj1.rangeSize}"
                        rowBandingInterval="0"
                        id="richDynamicTable"
                        binding="#{TestDynamicTable.richDynamicTable}">
    </af:table>2) Backing bean - When the buildRichTable method is invoked from the constructor, the table shows the input text boxes as required, but the entered values is not getting retrieved (). Tried adding a valuchangelistener to the added cell, but this does not fire as well.
    Below code however, creates a new instance of RichTable. Also, if an overloaded method is invoked on an ActionEvent, the columns added are not displayed.
      //called from costructor 
      public void buildRichTable() {
        dynamicVO.clearCache();
        //create this table
        richDynamicTable = new RichTable();
        int noOfCols = 2;
        for(int i=0; i<noOfCols; i++) {
          //create new column for the table
          richDynamicCol = new RichColumn();
          richDynamicCol.setHeaderText("ColTest"+i);
           // richDynamicCol.isVisible()
           // richDynamicCol.setVisible(arg0);
          richDynamicCol.setParent(richDynamicTable);
          richDynamicTable.getChildren().add(richDynamicCol);
          richDynamicTable.getChildCount();
          richDynamicTable.getRowCount();
          richDynamicCell = new RichInputText();
          richDynamicCell.setLabel("aCell"+i);
         // richDynamicCell.isVisible()
            MethodExpression methodExpression = FacesContext.getCurrentInstance().getApplication().
                                                                      getExpressionFactory().createMethodExpression(
                                                                        FacesContext.getCurrentInstance().getELContext(),
                                                                        "#{TestDynamicTable.inputBoxValueChangeListener}",
                                                                        null,
                                                                        new Class[] {ValueChangeEvent.class});
          //this does not work too - on adding some text and tabbing out
          richDynamicCell.addValueChangeListener(new MethodExpressionValueChangeListener(methodExpression));
          richDynamicCell.setParent(richDynamicCol);
          richDynamicCell.setValue("#{row.ColTest"+i+"}");
          richDynamicCol.getChildCount();
          richDynamicCol.getChildren().add(richDynamicCell);
         dynamicVO.addDynamicAttribute("ColTest"+i);
        //dynamicVO.insertRow(dynamicVO.createRow());
        dynamicVO.getRowCount();
       AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicTable());
       AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicCol());
       AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicCell());
       buildTable = false;
       this.setDynamicVO(dynamicVO);
    //captures the input data
      public void captureRichTableData(ActionEvent ae) {
    //gives null below
        this.getDynamicVO().getCurrentRow().getAttribute("ColTest0");
        this.getDynamicVO().getCurrentRow().getAttribute("ColTest1");
    //again null   
        List<UIComponent> listCols = richDynamicTable.getChildren();
        for(UIComponent aColComp : listCols) {
            RichColumn aCol = (RichColumn)aColComp;
            List<UIComponent> listCells = aCol.getChildren();
            for(UIComponent aCellComp : listCells) {
              RichInputText anInputText = (RichInputText)aCellComp;
                anInputText.getValue();
      }Not sure what I must be missing. May be I need to add bindings to the text boxes added but cant figure how to go about it. I found some posts on dynamically adding columns pointing to displaying contained data. Any help would be highly appreciated.
    Thanks for your time.
    Dinu

    Hi,
    Not too sure if I am heading the right way, but tried adding the bindings and value expression at runtime for the added columns. The values added at the screen is again found null at the VO and RichInputText child / cell. The updated method is as below -
          buildRichTable() {
          //adding binding for the added cell
          DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
          if(bc.findCtrlBinding("ColTest"+i) == null) {
              bc.addControlBinding("ColTest"+i, new JUCtrlAttrsBinding(null,
                                                     bc.findIteratorBinding("Test5ViewObj1Iterator"),
                                                         new String[]{"ColTest"+i}));
          //the expression to be set in value attribute for richInputText component 
          String theExpression = "#{row.bindings."+"ColTest"+i+".inputValue}";
          //setting the expression
          richDynamicCell.setValueExpression("ColTest"+i, getValueExpression(theExpression)); 
          richDynamicCell.setAutoSubmit(true);
          richDynamicCol.getChildCount();
          richDynamicCol.getChildren().add(richDynamicCell);
        dynamicVO.addDynamicAttribute("ColTest"+i);
        dynamicVO.insertRow(dynamicVO.createRow());
        dynamicVO.getRowCount();
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicTable());
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicCol());
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getRichDynamicCell());
       buildTable = false;
       this.setDynamicVO(dynamicVO);
      private ValueExpression getValueExpression(String theExpression) {
       FacesContext fc = FacesContext.getCurrentInstance();
       Application app = fc.getApplication();
       ExpressionFactory elFactory = app.getExpressionFactory();
       ELContext elContext = fc.getELContext();
       return elFactory.createValueExpression(elContext, theExpression, Object.class);
      }It would be great help to have any leads.
    Thanks,
    Dinu

  • How to create an interactive alv report in which some parameters

    hi all,
    i want to create an interactive alv report in which some parameters in selection screen
    & when fill those & press f8 then an alv list display will show & when user double click on
    any row then those contents get shown in header details of module pool program  which call by
      tcode mentioned in same alv .And same an interactive alv report used for change & display.
    please help me give me some code same as  required above.
    ketan
    abap consultant.
    Edited by: ketan pande on Feb 14, 2009 6:09 AM

    Hi Ketan,
    Please find Sample Code.
    TYPE-POOLS:slis.
    DATA:
      w_carrid TYPE scarr-carrid,
      it_fieldcat TYPE slis_t_fieldcat_alv,
      fs_fieldcat LIKE LINE OF it_fieldcat,
      it_eventcat TYPE slis_t_event,
      fs_eventcat LIKE LINE OF it_fieldcat.
    DATA:
      t_spfli LIKE STANDARD TABLE OF spfli,
      fs_spfli LIKE LINE OF t_spfli,
      t_sflight LIKE STANDARD TABLE OF sflight,
      fs_sflight LIKE LINE OF t_sflight.
    SELECT-OPTIONS:
      s_carrid FOR w_carrid.
    START-OF-SELECTION.
      SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid IN s_carrid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-repid
          i_callback_user_command = 'PICK'
          i_structure_name        = 'SPFLI'
        TABLES
          t_outtab                = t_spfli
        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.
    *&      Form  PICK
    FORM pick USING command LIKE sy-ucomm
                    selfield TYPE slis_selfield.
      READ TABLE t_spfli INTO fs_spfli INDEX selfield-tabindex.
      CASE command.
        WHEN '&IC1'.
          SELECT * FROM sflight
          INTO TABLE t_sflight
         WHERE carrid = fs_spfli-carrid
           and connid = fs_spfli-connid.
          CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
             i_program_name               = sy-repid
           I_INTERNAL_TABNAME           =
             i_structure_name             = 'SFLIGHT'
           I_CLIENT_NEVER_DISPLAY       = 'X'
           I_INCLNAME                   =
           I_BYPASSING_BUFFER           =
           I_BUFFER_ACTIVE              =
            CHANGING
              ct_fieldcat                  = it_fieldcat
           EXCEPTIONS
             inconsistent_interface       = 1
             program_error                = 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.
          CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
           I_INTERFACE_CHECK              = ' '
           I_BYPASSING_BUFFER             =
           I_BUFFER_ACTIVE                = ' '
             i_callback_program             = sy-repid
           I_CALLBACK_PF_STATUS_SET       = ' '
           I_CALLBACK_USER_COMMAND        = ' '
           I_STRUCTURE_NAME               =
           IS_LAYOUT                      =
             it_fieldcat                    = it_fieldcat
           IT_EXCLUDING                   =
           IT_SPECIAL_GROUPS              =
           IT_SORT                        =
           IT_FILTER                      =
           IS_SEL_HIDE                    =
           I_DEFAULT                      = 'X'
           I_SAVE                         = ' '
           IS_VARIANT                     =
            it_events                      = it_eventcat
           IT_EVENT_EXIT                  =
           IS_PRINT                       =
           IS_REPREP_ID                   =
           I_SCREEN_START_COLUMN          = 0
           I_SCREEN_START_LINE            = 0
           I_SCREEN_END_COLUMN            = 0
           I_SCREEN_END_LINE              = 0
           IR_SALV_LIST_ADAPTER           =
           IT_EXCEPT_QINFO                =
           I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
         IMPORTING
           E_EXIT_CAUSED_BY_CALLER        =
           ES_EXIT_CAUSED_BY_USER         =
            TABLES
              t_outtab                       = t_sflight
          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.
      ENDCASE.
    ENDFORM.                    "pick
    Hope this will Be Helpful
    Thanks
    Kalyan

  • How to create an editable table in ADF 10g??

    Hi,
    I want to create a editable table using the Jdev 10g.. so that i can do read and write on the table. Can anyone tell me how i can create it...
    thanks in advance

    Hi,
    using ADF BC and ADF, one of the options when dragging a ViewObject from the data control palette is ADF Table. This creates an updateable table
    Frank

  • How to create full editable JComboBox  ?

    I need to create full editable comboBox -- i want to do it by extends the class JComboBox - but i dont realy know how to collect the chars that the user will be insert and show then on the control.
    Does someone know where can i find some example of editable JComboBox ?
    Thanks.

    JComboBox can already be made editable, so you need to clarify what exactly you mean by "full editable"
    Recommended reading: The Java&#8482; Tutorials: How to use Combo Boxes: [Using an Editable Combo Box|http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#editable]
    db

  • How to save the editable alv data to another program ?

    hi friends,
    please solve this issue..
    i have one editable alv grid report. after edit my data in the grid..
    i want to
                save those data (edited data )or
                download those data into another internal table or
                pass those data as input to another report program..
    how can i do this ?

    The form switch to edit mode could be :
    form p_edit.
      data : is_fieldcatalog type lvc_s_fcat ,
             it_ucomm        type table of syucomm with header line ,
             v_ucomm         type syucomm.
    * Switch Edit <-> Display
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname ne 'NUM' and
              is_fieldcatalog-fieldname ne 'RCODE'.
        if is_fieldcatalog-edit eq 'X'.
          clear is_fieldcatalog-edit.
        else.
          move 'X' to is_fieldcatalog-edit.
        endif.
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Change the status of the grid.
      if is_fieldcatalog-edit eq space.
        move '&REFRESH' to v_ucomm.
        call method obj_grid->set_function_code
             changing c_ucomm = v_ucomm.
        call method obj_grid->set_ready_for_input
             exporting i_ready_for_input = '0'.
      else.
        call method obj_grid->set_ready_for_input
             exporting i_ready_for_input = '1'.
      endif.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    * Set the column lines number.
      perform p_set_lines_num.
    * Clear the flag control.
      clear v_flag_control.
    * Messages.
      if is_fieldcatalog-edit eq space.
        move 'Passage en mode affichage.' to v_buff.
        perform p_add_message
                using v_buff
                      'ICON_DISPLAY'
      else.
        move 'Passage en mode édition.' to v_buff.
        perform p_add_message
                using v_buff
                      'ICON_CHANGE'
      endif.
    * Inactiv function.
      if is_fieldcatalog-edit eq space.
        set pf-status '100'.
      else.
        move '' to it_ucomm. append it_ucomm.
        set pf-status '100' excluding it_ucomm.
      endif.
    endform.                     " P_EDIT.
    and for the table:
    data : w_id(60).
    move 'ZTOTO' to w_id.
    export it_table[] to memory id w_id.
    in the other program, it's the same with the IMPORT instead of export.

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • How to create an editable List box

    Hi,
    Can any body help me out in creating an editable list box, I mean the options should be editable in the listbox. Thanks in advance.

    I mean, you have dropdown list box with some options.
    They will not be editable in the normal scenario. I want one of the options to be editable, similar to a textbox , when selected.
    Is that possible in JSF? If any one could help with Javascript also, its fine for me.

  • How to create an editable table in webdynpro for ABAP? Help!

    Hi Experts,
            I have a requirement where I have to create a webdynpro for ABAP table for new row/rows entry, delete row/rows and update row/rows data. This is something like table control in normal ABAP.
    how can I achieve this? Is there any such feature in ALV component?
    Any code sample will be really helpfull.
    Please help!
    Thanks
    Gopal

    Hi,
    yes, the ALV is integrated into WDA, have a look at this: http://help.sap.com/saphelp_nw2004s/helpdata/en/74/fd4142646ab46be10000000a155106/frameset.htm
    Regards, Heidi
    PS: look at the WDA Knowledge Center under https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943, there you can find several ALV tutorials
    Message was edited by: Heidi von Geisau

  • How To Create Header in ALV List Report

    Hi All,
    I want to create a Header for <b>MY ALV List Report</b>!
    How can i achieve the same. It should come above <b>ALV</b>.
    ALV report i had already written and it is coming correctly.
    Heading should look like this:
    <i>1st Line</i>
    <b>PROGRAM NAME: XXXXXX      CLIENT: XXXXXXXXXX   PAGE:XX</b>
    <i>2nd Line</i>
    <b>RUN DATE/TIME: XXXXX - XXXX     REPORT NAME/HEADER</b>
    How can i acheive the same in <b>ALV List Report</b>!
    I am amking use of <b>REUSE_ALV_LIST_DISPLAY</b> Function module.
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi Prasad,
    Use the sample code specified below as the guideline. For more info. refer to the documentation of the FM 'REUSE_ALV_COMMENTARY_WRITE'.
    DATA: first(01) type c,
    events type slis_t_event,
    gt_list_top_of_page type slis_t_listheader,
    ls_event type slis_alv_event.
    initialization.
    call function 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = events
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    read table events with key name = 'TOP_OF_PAGE'
    into ls_event.
    if sy-subrc = 0.
    move: 'TOP_OF_PAGE' to ls_event-form.
    append ls_event to events.
    clear ls_event.
    endif.
    End of additions
    Start-of-selection
    START-OF-SELECTION.
    Top-of-page
    TOP-OF-PAGE.
    PERFORM TOP_OF_PAGE.
    FORM TOP_OF_PAGE .
    data: ls_line type slis_listheader.
    if first is initial.
    ls_line-typ = 'S'.
    ls_line-key = 'Run Date :'.
    write: sy-datum to ls_line-key+10 mm/dd/yyyy.
    ls_line-info = 'Billing Date:'.
    write: s_fkdat-low to ls_line-info+15 mm/dd/yyyy.
    ls_line-info+28 = 'To'.
    write s_fkdat-high to ls_line-info+32 mm/dd/yyyy.
    append ls_line to gt_list_top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = gt_list_top_of_page.
    first = 'N'.
    else.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = gt_list_top_of_page.
    endif.
    ENDFORM. " top_of_page
    <b>Please mark helpful answer.</b>
    Regards,
    Amit Mishra

  • How to create an editable previewable report?

    The Situation (the report is  CrystalReports.Engine.ReportDocument):
    I load the report (.Load(Template)) and  set data (.SetDataSource(DataTable)). I save the report (.SaveAs or .Export). The Template does not necessary contains fields in DataTable used as datasource.
    When I open the created report in "Crystal Reports 2011" the report preview is shown.  When I switch to the design tab I can drag fields to the report, but when I switch to the preview again a dialog asking for ado.net xml datafile is shown and when canceled (I have no datafile) empty preview is shown. In Visual Studio 2010 (CRVS 2010?) I see the preview when I cancel the dialog and click the design and  the preview again.
    The Question:
    Is it possible to create a report containing data with the preview working after report is edited?
    Note:
    I can achieve the desired behavior with external data file, but this soulution is not very convenient.

    Ah... that helps a lot...
    A couple of ways to go about this. From your template report compare the fields that exist in the report with those your Query has and add them into the Report. You can use the Command Object to append the fields and then the report will need to be refreshed against the XML file. In this case though the report will need to be ran again.
    Another option is to export your data from your Query into a DataSet and simply .setlocation to the DS, great for small amounts of data, less than 2K rows or so but you'll have to test for the limits.
    Another option is to to use RAS to completely create the report from nothing. See these samples on how to:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Bottom line is if you change the fields in a report it is going to have to be refreshed so the report can add/update the field reference list saved in the RPT file. If they don't match CR will simply delete all fields it can't match up.
    If using RAS to Create the report and set it to the new field list then you can build your own "Report Designer"
    As for running the Query again, that depends on how and where the data exists. If you save your date results into an XML file then it won't hit the DB again.
    This will generate the XML file:
                ds.WriteXml(@"D:\Atest\list_of_workflows.xml");
                ds.WriteXmlSchema(@"D:\Atest\list_of_workflows.xsd");
    Then load the XML file into a Dataset and then simply use:
    rpt.SetDataSource(ds);
    To set the Report to the XML file.
    XML is the preferred way and it doesn't have any memory limitations as Active DataSets do. ( MS limitation due to security, CR can't access the original so we have to make a copy which effectively doubles the amount of memory required )
    Don

Maybe you are looking for

  • MRP and Open PO

    Hi all,      Our client till now have not used MRP. But now they are planning to use it. Every settings for MRP is done. But their requirement is "for a particular PO(which was created before MRP), 1000 quantities of a material are pending for GR. Ou

  • Adobe Reader 9

    Downloaded and Installed Adobe Reader 9. Had to download and install twice due to a problem on 1st Install. Did Uninstall Adobe Reader 9, Adobe.com and Adobe Air and restarted PC before 2nd download. Two Questions: I now have 2 NEW Icons on my Deskto

  • How to know MS Access Database is down through Java

    How i would know whether MS Access DataBase is down? Is there any specific code for it in Java Need a quick reply

  • Is 000001010000z a valid date time in Oracle?

    Hi, When working with Open LDAP connection from Oracle, I need to set and remove the value '000001010000z' for locking and unlocking the user account respectively. This is working fine. However, for some calculation, I need to convert this value as a

  • How do I reset Panther for Apple setup

    I have a G3 iMac that I no longer use and I want to give to a brother-in-law. So as to have a nice clean system I reformatted the hd and did a new install of Panther. To update the software I had to create an admin user and log on to use "software up