Save in DB selected selectmanycomponenet values as string

I need to save selectmany component's multiple selected values in DB  as string where selected values are seperated with ;
I have already 1 similar example where i save selected values in seperate rows:
http://adf-use-cases.googlecode.com/files/fg.rar
For this example i have made javabean with get/set methods and button method which saves selected values in DB
Example:
C_ID | T_ID
1 | 3
1 | 6
2 | 1
But now i need modifie code and save selected values in DB as string, where values are sepereted with ;
for example
C_ID | Teritories
1 | City; wood;
2 | City; Other teritory;
or
C_ID | Teritories
1 | 4;5;1;
2 | 1;4;9;
Edited by: Raivis on May 14, 2012 7:51 AM

You need to modify the processShuttle method in the applicaiton as coded below: (And make sure that you have the VO and Iterator in the application as specified in comments)
    public String processShuttle() {
        BindingContext bctx = BindingContext.getCurrent();
        DCBindingContainer binding =
            (DCBindingContainer)bctx.getCurrentBindingsEntry();
        DCIteratorBinding iter =
            (DCIteratorBinding)binding.get("KloniTeritorijaView2Iterator");
        *//Assuming KloniTeritorijaView2Iterator is the Iterator for the new table Structure(KID, Territories)*
        //Removing all rows for the current Kloun Pk from KloniTeritorijaView
        for (Row r : iter.getAllRowsInRange()) {
            r.remove();
        List terrList = getSelectedTeritory();
        int size = terrList.size();
        StringBuffer territory = new StringBuffer();
        //Concatenating the selected Territories.
        if (size > 0) {
            for (int i = 0; i < size; i++) {
                territory.append(terrList.get(i)).append(";");
        //For this use case, only one row is needed.
        Row row = iter.getRowSetIterator().createRow();
        row.setNewRowState(Row.STATUS_INITIALIZED);
        row.setAttribute("KId", getCurrentKId());
        //        row.setAttribute("TId", terrList.get(i));
        *//If Territories is the attribute defined in the Table/VO, setting this attribute with the concatenated String.*
        row.setAttribute("Territories", territory.toString());
        iter.getRowSetIterator().insertRow(row);
        iter.setCurrentRowWithKey(row.getKey().toStringFormat(true));
        String ok = doCommit();
        return null;
    }

Similar Messages

  • How to select multiple values from the parameters in BI Publisher report

    How to select multiple values from the parameter drop down in BI Publisher, and how to handle this mulitple values from the report sql...

    Hi kishore,
    I have used all the steps as you mentioned in your previous reply....including checking Mulitple Selection Check Box..
    Iam able to get the results when I am selecting one value..
    and also I am able to handle multiple values the in the query by using IN :Parameter, but seems when we select more than one value from the parameter drop down i think the Bi Publisher is sending the values in concatenated form something ilke
    ex: "'ACCOUNT','HR','SALES'" ,and when trying to display the parameters values in the output, its throwing the error as 'missing right paranthesis' ....on the whole do you have any solution which would handle
    1.Single selection.
    2.Multiple selection.
    3.'ALL' Values.
    4.Separating the concatenated string into individual strings and dispaly them on the output of the report..etc..in case of Mulitple selection.
    Ex:
    Concatenated String from BI Publisher:"'ACCOUNT','HR','SALES'"
    Expected Output on the report:ACCOUNT,HR,SALES
    reply to this would be much appreciated....
    thanks,
    manoj

  • How to get selection criteria value in method IF_POWL_FEEDER~HANDLE_ACTION

    hi:
    As you know, we could get the leading selected POWL result data through parameter  c_selected and  c_selected in this method.
    but moreever, I want to get the selection criterai values in this method too just like the paramter i_selcrit_values in the method IF_POWL_FEEDER~GET_OBJECTS, how to do it?
    I have tried to define a attribute in my POWL class and save i_selcrit_values into this attribute in the method IF_POWL_FEEDERGET_OBJECTS, but in method IF_POWL_FEEDERHANDLE_ACTION, this attribute is still empty, so this workaround failed.
    thanks.

    hi guys:
    I have founded how to do it:
    METHOD get_selcrit.
      DATA ls_query TYPE powl_query_sty.
      DATA lt_selcrit TYPE rsparams_tt.
      FIELD-SYMBOLS <ls_selcrit> LIKE LINE OF lt_selcrit.
      CALL METHOD cl_powl_runtime_services=>get_current_query
        RECEIVING
          rs_query = ls_query.
      CALL METHOD cl_powl_query_accessor=>get_cached_selcrit
        EXPORTING
          i_query     = ls_query-query
        IMPORTING
          e_crit_para = lt_selcrit.
      READ TABLE lt_selcrit WITH KEY selname = iv_selname
        ASSIGNING <ls_selcrit>.
      IF <ls_selcrit> IS ASSIGNED.
        ev_selcrit = <ls_selcrit>-low.
      ENDIF.
    ENDMETHOD.

  • JOB_SUBMIT   with Selection Screen Value

    I have a requirement :
    with other select-options and parameters, i have two radio button, Foreground and Background:
    when Background radio button will be selected program should be scheduled as a background job.
    How i will pass selection screen value in JOB_SUBMIT ??
    Cheers.
    Srikanta

    Hi ,
    Try This
    *& Report  ZMMVB_PG_SL_CHANGE_BDC
    REPORT  zmmvb_pg_sl_change_bdc.
    TABLES : mara,t133a,marc.
    DATA i_t133a LIKE t133a OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
            matnr LIKE marc-matnr,
            werks LIKE marc-werks,
            ekgrp LIKE marc-ekgrp,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
             matnr LIKE marc-matnr,
             werks LIKE marc-werks,
             dispo LIKE marc-dispo,
    END OF itab1.
    DATA : fname LIKE ibipparms-path ,
           ename TYPE string,
           mode.
    DATA: BEGIN OF it_t133a OCCURS   0,
            bilds LIKE t133a-bilds,
            pstat LIKE t133a-pstat,
            guifu LIKE t133a-guifu,
            auswg LIKE t133a-auswg,
          END OF it_t133a.
    DATA:  ctr TYPE i,
           ctr_s(2) TYPE n,
           wrk(35),
           ch(1),
           viewno(2) TYPE n,
           guifu LIKE t133a-guifu.
    DATA: BEGIN OF it_views OCCURS 30.
            INCLUDE STRUCTURE mbildtab.   " Selection Views
    DATA: END OF it_views.
    DATA bdc_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-000.
    PARAMETERS : ek RADIOBUTTON GROUP rg1 ,
                 sl RADIOBUTTON GROUP rg1
    SELECTION-SCREEN END OF BLOCK b.
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-001.
    PARAMETERS : fg RADIOBUTTON GROUP rg2 DEFAULT 'X',
                 bg RADIOBUTTON GROUP rg2.
    SELECTION-SCREEN END OF BLOCK c.
    START-OF-SELECTION.
      IF fg = 'X'.
        mode = 'A'.
      ELSEIF bg = 'X'.
        mode = 'E'.
      ENDIF.
      IF ek = 'X'.
        guifu = 'SP09'.
        PERFORM bdc_ekgrp_change.
      ELSEIF sl = 'X'.
        guifu = 'SP12'.
        PERFORM bdc_mrpcontroller_change.
      ENDIF.
    *&      Form  BDC_EKGRP_CHANGE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM bdc_ekgrp_change .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = sy-repid
          dynpro_number = sy-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = fname.
      IF NOT ( fname IS INITIAL ) .
        ename = fname .
      ENDIF.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = ename
          filetype                = 'DAT'
        TABLES
          data_tab                = itab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF itab[] IS NOT INITIAL.
        LOOP AT itab.
          REFRESH bdc_data.
          IF itab-matnr NA sy-abcde AND itab-matnr NA '/*-_.'.
            UNPACK itab-matnr TO itab-matnr.
          ELSE.
            TRANSLATE itab-matnr TO UPPER CASE.
          ENDIF.
          SELECT SINGLE * FROM mara WHERE matnr = itab-matnr.
          IF sy-subrc NE 0.
            CONTINUE.
          ENDIF.
          PERFORM view_routine.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0060'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RMMG1-MATNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'RMMG1-MATNR'
                                        itab-matnr.
          CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
          CONDENSE wrk NO-GAPS.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0070'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                          wrk.   "'MSICHTAUSW-DYTXT(08)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTR'.
          CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
          CONDENSE wrk NO-GAPS.
          PERFORM bdc_field       USING   wrk  "'MSICHTAUSW-KZSEL(08)'
                                          'X'.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0080'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RMMG1-WERKS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTR'.
          PERFORM bdc_field       USING 'RMMG1-WERKS'
                                        itab-werks.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BU'.
    *  PERFORM bdc_field       USING 'MAKT-MAKTX'
    *                                '"HEX BOLT M16X1.5X100,B8.8,BP"'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'MARC-EKGRP'.
    *  PERFORM bdc_field       USING 'MARA-MEINS'
    *                                'NOS'.
          PERFORM bdc_field       USING 'MARC-EKGRP'
                                        itab-ekgrp.
    *  PERFORM bdc_field       USING 'MARA-MATKL'
    *                                '1702'.
    *  PERFORM bdc_field       USING 'MARC-USEQU'
    *                                '3'.
    *  PERFORM bdc_field       USING 'MARC-KORDB'
    *                                'X'.
          CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " BDC_EKGRP_CHANGE
    *&      Form  BDC_MRPCONTROLLER_CHANGE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM bdc_mrpcontroller_change .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = sy-repid
          dynpro_number = sy-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = fname.
      IF NOT ( fname IS INITIAL ) .
        ename = fname .
      ENDIF.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = ename
          filetype                = 'DAT'
        TABLES
          data_tab                = itab1
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF itab1[] IS NOT INITIAL.
        LOOP AT itab1.
          REFRESH bdc_data.
          IF itab1-matnr NA sy-abcde AND itab1-matnr NA '/*-_.'.
            UNPACK itab1-matnr TO itab1-matnr.
          ELSE.
            TRANSLATE itab1-matnr TO UPPER CASE.
          ENDIF.
          SELECT SINGLE * FROM mara WHERE matnr = itab1-matnr.
          IF sy-subrc NE 0.
            CONTINUE.
          ENDIF.
          PERFORM view_routine.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0060'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RMMG1-MATNR'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'RMMG1-MATNR'
                                        itab1-matnr.
          CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
          CONDENSE wrk NO-GAPS.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0070'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                           wrk.         "'MSICHTAUSW-DYTXT(11)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTR'.
          CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
          CONDENSE wrk NO-GAPS.
          PERFORM bdc_field       USING   wrk          "'MSICHTAUSW-KZSEL(11)'
                                        'X'.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '0080'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'RMMG1-WERKS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTR'.
          PERFORM bdc_field       USING 'RMMG1-WERKS'
                                        itab1-werks.
          PERFORM bdc_dynpro      USING 'SAPLMGMM' '4000'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=BU'.
    *      PERFORM bdc_field       USING 'MAKT-MAKTX'
    *                                    '"HEX BOLT M16X1.5X100,B8.8,BP"'.
    *      PERFORM bdc_field       USING 'MARA-MEINS'
    *                                    'NOS'.
    *      PERFORM bdc_field       USING 'MARC-DISGR'
    *                                    '701'.
    *      PERFORM bdc_field       USING 'MARC-EKGRP'
    *                                    'A00'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'MARC-DISPO'.
    *      PERFORM bdc_field       USING 'MARC-DISMM'
    *                                    'PD'.
          PERFORM bdc_field       USING 'MARC-DISPO'
                                        itab1-dispo.
    *      PERFORM bdc_field       USING 'MARC-DISLS'
    *                                    'MB'.
          CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " BDC_MRPCONTROLLER_CHANGE
    *&      Form  bdc_dynpro
    *       text
    *      -->PROGRAM    text
    *      -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdc_data.
      bdc_data-program  = program.
      bdc_data-dynpro   = dynpro.
      bdc_data-dynbegin = 'X'.
      APPEND bdc_data.
    ENDFORM.                        "BDC_DYNPRO
    *        Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdc_data.
      bdc_data-fnam = fnam.
      bdc_data-fval = fval.
      APPEND bdc_data.
    ENDFORM.                    "BDC_FIELD
    *&      Form  VIEW_ROUTINE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM view_routine .
      CLEAR viewno.
      SELECT * FROM t133a INTO CORRESPONDING FIELDS OF TABLE i_t133a
                    WHERE bilds = '21' AND guifu LIKE 'SP%'  .
      LOOP AT i_t133a .
        ch = i_t133a-pstat.
        IF mara-vpsta NA ch .
          DELETE i_t133a     .
          CONTINUE .
        ENDIF .
      ENDLOOP.
      SORT i_t133a BY guifu ASCENDING .
      LOOP AT i_t133a .
        viewno = viewno + 1 .
        IF i_t133a-guifu = guifu .
          EXIT .
        ENDIF .
      ENDLOOP .
    ENDFORM.                    " VIEW_ROUTINE
    Regards,

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

  • How i pass table column  value to string variable or return to java applete

    Hi Master,
    How do I pass a table column value into string variable. See my code below:
    import java.sql.*;
    public class Waheed {
    public Waheed() {
    public static void main (String args [])
    String s = "9 23 45.4 56.7";
    System.out.println ("going for connection");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select accid from accbal");
    System.out.println ("going for connection");
    while (rset.next())
    s= rset.getString("accid"); this line give me error
    System.out.println (rset.getString("accid"));
    System.out.println (s);
    catch(Exception e){
    e.printStackTrace();
    This line give me an error:
    s= rset.getString("accid");
    s is string variable
    Plese give me an idea how I can pass accid in s variable.
    Thanks.
    Aamir

    See the code sample in the following thread (try using upeercase).
    JDBC  connection
    Kuassi

  • How to get the viewrow value by string

    Using Jdev11.1.1.5.0-adfbc-ireport3.0.0
    here i'll describe: what i did.
    am using jsff(dynamic region) while hitting the af:tree nodes it will opens. ok fine
    i had somevo with manually wroten query. and query is fine no problem with that
    here i give sample not a original query
    select * from sometable where acctid = :pacctidi drag and drop the pacctid from corresponding execute params vo as selectoncechoice
    static vo
    Data value - account payable , advance
    Data Name - ap,ad
    in that jsff
    *page representation*
    account type :   account payable (ap) - select one choice type
                            advance           (ad) - select one choice type
    like this some select once choice and some inputs.
    Run report - command button
    .jsff code
    <af:selectOneChoice value="#{bindings.ACCT_TYPE.inputValue}"
                              label="Account Type"
                              shortDesc="#{bindings.ACCT_TYPE.hints.tooltip}"
                              id="soc3" required="true"
                              autoSubmit="true"
                              binding="#{backingBeanScope.SUP1040V.soc3}"
                              valuePassThru="true"
                              valueChangeListener="#{backingBeanScope.SUP1040V.ValueChangeListener1}">
            <f:selectItems value="#{bindings.ACCT_TYPE.items}" id="si3"/>
          </af:selectOneChoice>
    <af:commandToolbarButton text="Export in pdf" id="ctb2">
              <af:fileDownloadActionListener method="#{backingBeanScope.SUP1040V.Report}"
                                             />
            </af:commandToolbarButton>.java
         //while hitting the button following logs are appeared i show it as commented format.
        public void Report(FacesContext context, OutputStream out) throws IOException,Exception
                FacesContext ctx = FacesContext.getCurrentInstance();
                HttpServletRequest request =
                    (HttpServletRequest)ctx.getExternalContext().getRequest();
                HttpServletResponse response = 
                    (HttpServletResponse)ctx.getExternalContext().getResponse();
                BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                System.out.println("print binding" +bindings1 );
    //while using sop i get this in my log : :  print binding  ReportsPageFragments_SUP1040VPageDef_WEB_INF_TaskFlows_SUP1040_V_TF_xml_SUP1040_V_TF
                JUCtrlListBinding listBinding1 = (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
                System.out.println("print list bindings" +listBinding1 );
    //while using sop i get this in my log : :  print list  bindings0
                Object selectedValue1 = listBinding1.getSelectedValue();
                System.out.println("print selected value" + selectedValue1);
    //while using sop i get this in my log : :  print selected  valueViewRow [oracle.jbo.Key[AP ]]   
    request.setAttribute("ACCT_TYPE", //here i want the value  "AP" in  String  );
    if i use like this means
    request.setAttribute("ACCT_TYPE", soc1.getValue()  );  i get the index value.
    i need the dataname "ap" so i go above method which say wrotes ...
                request.getRequestDispatcher(response.encodeURL("/sup1040servlet")).forward(request,response);
                System.out.println("hihihihih");
                response.flushBuffer();
                ctx.responseComplete();
        public void ValueChangeListener1(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String AcctType = valueChangeEvent.getNewValue().toString();
            System.out.println("AcctType" + AcctType);
            FacesContext contxt = FacesContext.getCurrentInstance();
            valueChangeEvent.getComponent().processUpdates(contxt);
           BindingContainer bindings1 =
           BindingContext.getCurrent().getCurrentBindingsEntry();
           // Get the sepecific list binding
           JUCtrlListBinding listBinding1 =
           (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
           // Get the value which is currently selected
           Object selectedValue1 = listBinding1.getSelectedValue();
           System.out.println(selectedValue1);
        }if i get ap means my report runs. or else it will shows empty page.
    how to get the viewrowimpl class value as string.
    Edited by: ADF7 on Mar 24, 2012 7:27 AM

    ADF7,
    I'm not sure I understand what you are up to.
    As far as I understand you want to get the display value instead of the index
    I use this code
        public void StatusChangedListener(ValueChangeEvent valueChangeEvent)
            BindingContext lBindingContext = BindingContext.getCurrent();
            BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
            JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("Status");
            int newindex = (Integer) valueChangeEvent.getNewValue();
            Object row = list.getDisplayData(); // Wichtig um die liste zu laden!!!!
            Row lFromList = (Row) list.getValueFromList(newindex);
            Object lAttribute = lFromList.getAttribute("Value");
            String newVal = (String) lAttribute;
        }to get the value from a selectOneChoice component...
    Timo

  • Get Apex Select List value

    Hello,
    I've used APEX_ITEM.SELECT_LIST_FROM_QUERY in one of my dynamically built report.
    SELECT 'Add' "Add",(SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY (1,ENAME,'SELECT DISTINCT ENAME,EMPNO FROM EMP') FROM EMP WHERE ROWNUM=1) "SELECT",A.* FROM ('||OBJ_SQL||') A ORDER BY 2;
    OBJ_SQL we get from a table which contains a query. The query is different for each of the selection made in another region. Probably a select list with different countries and clicking on each country, the below dynamic report should be built. Each country will be having different columns. So we store all the countries and respective queries in a table. The report should appear as :
    Add is a link.
    Select is a select list with Employee Names.
    Some Other columns from the query corresponding to the country.
    My requirement is Whenever I click on Add link for any row, the different columns in each row should be inserted into a table. I tried using a javascript call to a function passing all the values like #COL2#,#COL3# etc. But for the select list, though I select SCOTT, the whole string (all employees are concatenated) is being sent.
    Is there a way we can pass only the selected value to the javascript function? How can we achieve this? Please help.
    The select list gets displayed perfectly.

    Hey.
    Somebody help me please.
    I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.
    SELECT DISTINCT ROLE AS GET_ROLE,
    JOB AS GET_JOB,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    ( 1, '%', 'SELECT DISTINCT CODE c,
    MODE m
    FROM T2
    WHERE ROLE = ' || ROLE
    ) AS GET_CODE
    FROM T1
    WHERE AGE >30 AND
    SEX = 'M' ;
    I was trying to use javascript :
    for (var i = 0; i < selectlist_name.options.length; i++)
    if (selectlist_name.options[ i ].selected)
    result=selectlist_name.options;
    but I don't know what is the name of this APEX_ITEM.SELECT_LIST_FROM_QUERY and what "selectlist_name" must be there.

  • WAD template with BSP Application - how to read selection screen values

    Hello,
    I've created Web template with Web Application Designer (WAD).
    I would like to extend  that page with BSP Application...
    Purpuse of this application is to read some information from tables
    on BW transaction server and display them within Web page.
    Question: How to read selection screen values from a Web template ?
    Thanks for any help,
    Pawel Borowiec

    Hi,
    The selection screen parameters will be on an inputField, so try and get the is of the inputfield generated by doing View source...
    And once you get the inputfield Id, you can read the value in the InputField(InF) by
    using the following code...!
    data : if_value type ref to cl_htmlb_inputfield.
    data : variable type string.
    if_value ?= cl_htmlb_manager=>get_data( request = request
                                                name    = 'inputField'
                                                id      = 'InF_ID_here'
           if if_value->value is not initial.
             variable  = if_value->value.
           endif.
    Hope this helps.
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • How to convert ResultSet's value to String

    Dear JDC's
    plz tell me how to convert ResultSet's value to String.
    kashif

    I want to read a whole array from a table into a String[]
    and then send it to another servlet before I forward it all to anther servlet with request.setParameter.....
    Any ideas how to solve it....that is how far I got so far:
    rs=pgresult("select count (answer) from answers where qid="+idnum);
                                                           numberofquestions = rs.getInt("mynumber");     
                                                           rs=pgresult("SELECT answer FROM answers WHERE qgroup="+qgroup);
                                                           allanswers = new String[numberofquestions];
                                                           allanswers = (String[])rs.getArray(1).getArray();     
                                                           req.setParameter("allanswers",allanswers);
                                                           RequestDispatcher dispatcher = req.getRequestDispatcher("editanswers");
                                                           dispatcher.forward(req,res);
    Tobi

  • Select any value with CTRL + mouse click

    Hi all,
    since ERP 6.0 and SAP GUI 6.40 I am used to be able to select any value in any input or display field (e.g. the name of a field of a table in transaction SE11) via holding down the CTRL key while clicking onto the desired value/field once. Then the whole value/string is selected.
    Now I am working on a freshly installed system but I can't find this setting anywhere. It does work to select a word within the ABAP source code editor, but not for any other, "normal" input fields.
    Any ideas where I can set this?
    Kind regards, Matthias

    Have a look at the last button on the right of the application toolbar. Button looks like monitor with test screen. Click it and use options.

  • Select a value in JComboBox by key stroke

    Hi all,
    I m trying to create a GUI with comboxes, in which users can select the value by pressing keys. e.g.
    ComboBox:
    Apple
    Boy
    Cat
    Dog
    when press 'A', it should go to "Apple", and something like this.
    In my case, the objects in the Combo box are not Strings, they are bean objects, e.g.
    public class Apple{
       private String name;
       private double weight;
       public Apple() {}
       public void setName(String name) {
          this.name = name;
       public String getName() {
          return this.name;
       public void setWeight(double weight) {
          this.weight = weight;
       public double getWeight() {
          return this.weight;
       public String toString() {
          return this.name;
    }in this Object, its 'toString' value is the value it's gona display in the ComboBox. Othger entries in combo box are likewise.
    I m not sure this is the problem or not, i just couldn't get the right value selected by key stroke.
    Anyone can help?
    Thanks!
    best regards

    Works fine for me in this example:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=613731

  • Fetching more than one row from a table after selecting one value from the dropdown

    Hi Experts,
    How can we fetch more than one row from a table after selecting one value from the dropdown.
    The scenario is that I have some entries in the dropdown like below
      A               B               C        
    11256          VID          911256  
    11256          VID          811256
    11256          SONY      11256
    The 'B' values are there in the dropdown. I have removed the duplicate entries from the dropdown so now the dropdownlist has only two values.for eg- 'VID' and'SONY'. So now, after selecting 'VID' from the dropdown I should get all the 'C' values. After this the "C' values are to be passed to other methods to fetch some data from other tables.
    Request your help on this.
    Thanks,
    Preeetam Narkhede.

    Hi Preetam!
    I hope I understand your request proberly, since this is more about Java and less about WebDynpro, but if I'm wrong, just follow up on this.
    Supposed you have some collection of your original table data stored in variable "origin". Populate a Hashtable using the values from column "B" (let's assume it's Strings) as keys and an ArrayList of whatever "C" is (let's assume String instances, too) as value (there's a lot of ways to iterate over whatever your datasource is, and since we do not know what your datasource is, maybe you'll have to follow another approach to get b and c vaues,but the principle should remain the same):
    // Declare a private variable for your Data at the appropriate place in your code
    private Hashtable temp = new Hashtable<String, ArrayList<String>>();
    // Then, in the method you use to retrieve backend data and populate the dropdown,
    // populate the Hashtable, too
    Iterator<TableData> a = origin.iterator();
    while (a.hasNext()) {
         TableData current = a.next();
         String b = current.getB();
         String c = current.getC();
         ArrayList<String> values = this.temp.get(b);
         if (values == null) {
              values = new ArrayList<String>();
         values.add(c);
         this.temp.put(b, values);
    So after this, you'll have a Hashtable with the B values als keys and collections of C values of this particular B as value:
    VID --> (911256, 811256)
    SONY --> (11256)
    Use
    temp.keySet()
    to populate your dropdown.
    After the user selects an entry from the dropdown (let's say stored in variable selectedB), you will be able to retrieve the collection of c's from your Hashtable
    // In the metod you handle the selection event with, get the c value collection
    //and use it to select from your other table
    ArrayList<String> selectedCs = this.temp.get(selectedB);
    // now iterate over the selectedCs items and use each of these
    //to continue retrieving whatever data you need...
    for (String oneC : selectedCs) {
         // Select Data from backend using oneC in the where-Clause or whatever...
    Hope that helps
    Michael

  • OptionTitle & selecting null value

    I have an Option [] bound to a DropDown. In the Option [] is an element of OptionTitle. I need my dropdown to set a selected value of null when the OptionTitle is selected.
    What happens at the moment is:
    If the underlying field is null the OptionTitle is selected (good)
    If I select an option the underlying value is selected. (good)
    If I reselect the OptionTitle the underlying value is not modified (bad).
    Any suggestions?

    sd4139, thanks for the suggestions: I'd go that route if i had to but the following workaround works for me:
    Add an Option with Value "" (empty string) Description "-None-" or whatever you want. the IntegerConverter in my case seems to convert this to a null. I suspect that the StringConverter does the same.
    I'm using one array for several dozen dropdowns over various pages so the valuechange event was gonna be a nightmare to implement.

  • Select the value ending with 'S'

    Hello ABAP experts,
    I am a BW guy, not much into ABAP. There is a small coding requirment. I am not sure if this can be done in one statment.
    select the value from the table which has value ending with 'S'.
    Solutions
    -- I can loop the table with 'LOOP'
    -- is there any statment to achive the value ending with 'S'
    Any suggestions are highly valuable.
    Many thx in advance.
    Sandhya

    Hi,
    Just try this.
    No need of loop.
    delete itab1 where ptr1 cp 'S' or ptr1 cp 's'.
    For more information about CP , just have a look on this.
    The logical expression
    <f1> CP <f2>
    is true if <f1> matches the pattern <f2>. If <f2> is of type C, you can use the following wildcards in <f2>:
    •     for any character string: *
    •     for any single character: +
    Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.
    If you want to perform a comparison on a particular character in <f2>, place the escape character # in front of it. You can use the escape character # to specify
    •     characters in upper and lower case
    •     the wildcard character "" (enter:#)
    •     the wildcard character "" (enter: # )
    •     the escape symbol itself (enter: ## )
    •     blanks at the end of a string (enter: #___ )
    Message was edited by: Jayanthi Jayaraman

Maybe you are looking for

  • Hard Drive "Input Output" Error When Attempting to Format

    A friend just gave me a nice PowerBook that seems to be in need of a fresh OS and when attempting to format the hard drive I am getting an "Input Output" error.  Any suggestions to overcome this issue and format the drive?

  • How can I get a transfer my contacts from iCloud to my pc?

    Dear Sir,           My contacts on my iPhone have been already copied to my iCloud account but they have been removed from "My Contacts". I need to get a copy of My Contacts on my "Outlook" or "Google Contacts". May you please help me to get this cop

  • Release procedure for p.o.

    hi sapgurus, here is the scenario, i have as issue ( for P.O value only) 1) if the value is < 2 lacks then one person  will release. 2) if the value is > 2 lacks then 2 persons will release

  • Crystal report for VS2008

    HI I try to create crystal report but when i add crystal report and i add new item i don't find any crystal report but in reporting tab there is a report and report wizard like this so this is same as crystal report or something else?  and how i down

  • [Newbie] Script output

    Can anyone help me out to get the output on two rows in excel. for /f "skip=3" %i in ('qfarm /load') do quser /server:%i | find /i /c "Active" && echo %i >> "c:\Temp\server.csv" I can get them on row A and B. Is there also away to get the total amoun