Radio fields in Field loop

Hi,
I need to display users (satifying some criteria) in a tabular form (SortableTable). and each row should have a radio followed by the selected user's name.
when I select a user by clicking on the radio button, I need that selected users name to be saved in another field 'selecteduser'. Code is as following.
<Field name='resultsTable'>
<FieldLoop for='user' in='alluserslist'>
<Field name='userid'>
<Display class='Radio'>
<Property name='value'>
<ref>user</ref>
</Property>
</Display>
</Field>
<Field>
<Display class='Label'>
<Property name='value'>
<ref>user</ref>
</Property>
</Display>
</Field>
</FieldLoop>
</Field>
<Field name=':variables.selecteduser'>
<Expansion>
<block>
<ref>userid.value</ref>
</block>
</Expansion>
</Field>
============
userid.value is always returning the user in the first row even after selecting another user in different row.
Please help me
Thanks

Hi,
You can try with the following code :
<Field name='resultsTable'>
<FieldLoop for='user' in='alluserslist'>
<Field name='userid'>
     <Display class='Radio'>
     <Property name='labels'>
     <ref>user</ref>
     </Property>
     <Property name='disableAutomaticPostDataVerification' value='true'/>
     </Display>
</Field>
</FieldLoop>
</Field>
<Field name=':variables.selecteduser'>
<Expansion>
     <block trace='true' name='...test'>
     <ref>userid.value</ref> // here u'll get the selected radio button value
     </block>
</Expansion>
</Field>

Similar Messages

  • Crystal Reports Field Loop

    Hi Guys,
    I want to add a field in my report, by the name of week number.
    Obviously I need it to repeat 52 times in either the details or group header section.
    So I created a formula field with a loop, and I want it to print out from 1 to 52 (i.e. there will be 52 detail sections, from 1 all the way to 52).
    This is the code I got now:
    Local NumberVar i;
    For i := 1 to 52 Do
       If i <= 52 Then
          {@Week Number} = i
          Exit For
       End If
    Next I
    Its not working, saying that the remaining text does not appear part of the formula (highlighting from "Exit For" line).
    Any help or alternative ways I can get this done?
    Thanks
    Regards
    Dario

    Hi There
    Please try this
    Local NumberVar i;
    For i := 1 to 52 Do
    If i <= 52 Then
    {@Week Number} = i  ;
    Exit For
    Regards

  • ABAP Screen: Implicit transferring fields / LOOP AT TC

    Hello experts,
    I developed a table control in the following way:
    process before output.
      module status_0110.
      loop with control tc_liqivp_items.
        module item_get.
        module screen_modify.
      endloop.
    process after input.
      loop with control tc_liqivp_items.
        chain.
          field: gs_liqivp_items-umzeichart,
                 gs_liqivp_items-endpa
                 module endpa_check on chain-request.
        endchain.
        chain.
          field: gs_liqivp_items-umzeichart,
                 gs_liqivp_items-umz_fenster,
                 gs_liqivp_items-endpa
                 module item_modify on chain-request.
        endchain.
      endloop.
    The control is defined as following:
    controls: tc_liqivp_items  type tableview using screen 110.
    The screen 110 is defined as subscreen.
    I use the classical table control (using loop at TCu2026); in PAI the fields will be transferred implicitly from the table control to the assigned structure gs_liqivp_items.
    Within the table control loop, however in structure not all fields are filled correctly (some fields comes from the last line of the internal table).
    E.g.:
    10     Testline1 3.25 CHF     red      blue
    20     Testline1 4.25 CHF     green      blue
    30     Testline1 6.10 CHF     white      blue
    40     Testline1 6.50 CHF     yellow     blue
    If I change the value in line 1 from 3.25 to 4.25 CHF also the fields red and blue will be overwritten by the last line. The result is:
    10     Testline1 4.25 CHF     yellow     blue
    20     Testline1 4.25 CHF     green      blue
    30     Testline1 6.10 CHF     white      blue
    40     Testline1 6.50 CHF     yellow     blue
    Only the price field is set as input field.
    Do you have any idea for this issue?
    Thanks for your support!
    Regards,
    Kurt

    Hi,
    In PAI  " Flow logic
    process after input.
      loop with control tc_liqivp_items.
        chain.
          field: gs_liqivp_items-umzeichart,
                 gs_liqivp_items-endpa
                 module endpa_check on chain-request.
        endchain.
        chain.
          field: gs_liqivp_items-umzeichart,
                 gs_liqivp_items-umz_fenster,
                 gs_liqivp_items-endpa
                 module item_modify on chain-request.
        endchain.
        module move_to_progam.  " Add this in your program
      endloop.
    In program  " To Transfer the data of each row of Table control to Internal Table of the Program
    MODULE MOVE_TO_PROGAM INPUT. " replace the following variables/Internal Tables with the ones you declared
      DESCRIBE TABLE itab LINES tc-lines.
      if  tc-lines < tc-current_line.
        append gs_liqivp_items to  itab.
      else.
        modify itab from gs_liqivp_items INDEX tc-current_line.
      endif.
    ENDMODULE.
    Hope this would serve your purpose
    Cheerz
    Ramchander Rao.K

  • Required field loop

    I have two fields: field1 and field2. Both are set as “User Entered - Required”. I am trying to enforce that they cannot be empty. I made the following routine, but when I leave field1 empty and click on the field2 (which is also empty) I get stuck in an infinite loop of the same error message from both fields.
    Using FormCalc on the Exit event:
    if ($.isNull) then
        xfa.host.messageBox("Field cannot be blank!")
        $host.setFocus  ($.name)
    endif

    You have to have one way or other..
    Change both the field's option to "User Entered - Optional". That can remove the infinite loop.
    If you want to check the required value with the script in the Exit event, then you also need to check for both the field's input before user submit the form.. So if you are using a Submit button, preSubmit event you have to check for the field value.
    Thanks
    Srini

  • Contact phonenumber defaults as radio field

    When I add a contact on my iPhone (4) running iOS 7.0.2 the phone number defaults to 'home'...
    As soon as I turn on Exchange Contacts sync the phone number field defaults to 'radio' when creating new contacts with phone numbers.
    The issue does NOT occur when I only sync mail or calendar. Only when I tap on Contacts within the ActiveSync account.
    One of our users reported this issue so I went testing it...
    Our company runs Exchange Server 2010 SP2 RU6
    I added some screenshots.
    Exchange Contacts Sync OFF: (field label says home)
    Exchange Contact Sync ON: (field label says radio)
    Problem is that the phonenumbers tagged with radio are not synced, because the field does not exist in Exchange/Outlook.

    GetSQLValueString(isset($_POST['contact']) ? "true" : "", "defined","'Y'","'N'"));
    In your form, you have given the value as "Yes" and "No", yet in the database you have defined the value as "Y" and "N"
    Personally, I would change the values in the form to correspond with those in the database.

  • Error while Retrieving users from DB using Field Loop

    Hi,
    Im working on IDM 6.0 in Sun Appserver 8.1, with waveset on SQL Server2000.
    I have a rule that list all the users from a table in SQL Server2000.
    Ive used this rule in a form to get list of all users. This rule works fine in BPE and the drivers are properly placed
    When I view the Form I get the following error.
    XPRESS exception ==> com.waveset.util.WavesetException: Can't call method queryList on class com.waveset.util.JdbcUtil ==> com.waveset.util.WavesetException: ==> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Could not find server 'com' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

    I was able to solve the error but how can I display the all fields retrieved by the query. (like select name,comments from tablename)
    This is my code. I just need to display comments
    <FieldLoop for='cdata1'>
      <expression>
        <rule name='MSSQL DB Connect'/>       <!-- This rule lists all users.-->
      </expression>
      <Field name='accounts[$(cdata1)].name'>
        <Display class='Text'>
          <Property name='size'>
            <Integer>10</Integer>
          </Property>
          <Property name='value'>
            <ref>cdata1</ref>               <!-- prints user -->
          </Property>
        </Display>
      </Field>
      <Field name='accounts[$(cdata1)].comments'>  
        <Display class='TextArea'>
          <Property name='rows'>
            <Integer>1</Integer>
          </Property>
          <Property name='columns'>
            <Integer>15</Integer>
          </Property>
        </Display>
      </Field>
    </FieldLoop>Thanx

  • Dynamic radio buttons in for loop

    Hello,
    what i am trying to do is create several radio buttons in a while loop, then assign an action listener and also some text to them. After doing this i want to add the radio button to a panel, so far i have the following code:
    JPanel content = new JPanel();
    for(int i=0;i<a.size();i++){
        JRadioButton radio = new JRadioButton("Radio" + i);            
        // code to add an action listener to go here
        content.add(radio)
    }Many thanks in advance for some help.

    Encephalopathic wrote:
    psamatt wrote:
    Thanks DrClap, this is the sort of post that i was awaiting on :)and you'd have gotten that a lot sooner if you had asked a clear question in the first place. Much luck.Sometimes I think this forum is providing a basic service: teaching people how to ask questions. If they finally learn, the scales fall from their eyes and they cry with joy, "now I see, I can't merely say 'i'm doing this thing like and it's not you-know. What should I do or whatever?' I actually have to be clear and not assume the person I'm talking to is a mind reader! What wasn't I taught this at University?

  • To suppress certain fields based on radiobutton selection

    hi experts,
    I am having the requirement that on selection of presentation server(radio button) i need to suppress some fields like file path and name in application server(radio button) which are mandatory when application server is selected.
    Now my problem is if I leave the fields in application server blank and select presentation server then it is asking to fill in all required fields.
    Here is the code i am using:
    Selection Screen                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t08.
    *FOR APPLICATION SERVER FILE
    PARAMETERS: po_appln RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND upload,
                po_ipath TYPE filepath-pathintern  OBLIGATORY MODIF ID app,
                po_ifile TYPE rlgrap-filename       OBLIGATORY MODIF ID app.
    SELECTION-SCREEN SKIP 1.
    *FOR PRESENTATION SERVER FILE
    PARAMETERS: po_dsktp RADIOBUTTON GROUP rad1,
                po_dfile TYPE rlgrap-filename     OBLIGATORY MODIF ID prn.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM modify_screen.
    form MODIFY_SCREEN .
    *When application server radio button is checked
      LOOP AT SCREEN.
        IF po_appln EQ  'X' AND screen-group1 EQ 'PRN'.
          screen-output = '0'.
          screen-active = '0'.
          screen-input  = '0'.
        ENDIF.
        IF po_appln EQ  'X' AND screen-group1 EQ 'APP'.
          screen-input  = '1'.
        ENDIF.
    *When presentation server radio button is checked
        IF po_dsktp EQ 'X' AND screen-group1 EQ 'APP'.
          screen-output = '0'.
          screen-active = '0'.
          screen-input  = '0'.
        ENDIF.
        IF po_dsktp EQ 'X' AND screen-group1 EQ 'PRN'.
          screen-input  = '1'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    endform.         
    Can some one please help me

    Hi,
    Remove the obligatory extension in the selection-screen. Then the mandatory check will not be done when you select the radio-button.
    To handle the mandatory check of the path and file, do the checking in the event 'AT SELECTION-SCREEN'
    if sscrfields-ucomm = 'ONLI'. (Declare TABLES: SSCRFIELDS in the data declarations)
    if ipath is initial.
    message E001(z...)  with 'Please enter a file path'.
    endif.
    Regards,
    Vidya Chowdhary A.

  • Field catalog in alv with classes(OOPS)

    please refer the code below of field catalog prepared.
    this code is for preparing field catalog using ALV and OOPS.In the below field catalog, do_sum is not working.it is going to dump.
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      ls_fcat-fieldname = 'VBELN1'.
      ls_fcat-ref_field = 'VBELN'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Invoice No'.
      ls_fcat-seltext = 'Invoice No'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ls_fcat-fieldname = 'DMBTR'.
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-ref_table = 'BSAD'.
      ls_fcat-coltext = 'Value of Invoice'.
      ls_fcat-seltext = 'Value of Invoice'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.                    "PREPARE_FIELD_CATALOG
    I would apreciate u response.
    regards,
    veera.

    Hello Veeranjaneyulu
    I prefer to use function module <b>LVC_FIELDCATALOG_MERGE</b> to build my fieldcatalogs.
    If you need fields from different structure that is no problem. Simply call the function module for each structure and collect the result in the same itab (e.g. lt_fcat).
    Finally, you delete all fields that you do not need.
    If the order is important to you then re-order the fields:
    LOOP AT lt_fcat INTO ls_fcat.
      ls_fcat-col_pos = syst-tabix.
      MODIFY lt_fcat from ls_fcat.
    ENDLOOP.
    Regards
       Uwe

  • Accessing the variable in field symbol of nested internal table

    Hi,
    I am unable to access the variable in field symbol.
    The data in field symbol has nested structure. We need to access a variable in nested structure.
    Please find the code below:
          LOOP AT <i_fincorp> into <fs_fincorp>.
            l_madefor = <FS_FINCORP>-data_UI-ZZ0010.
          ENDLOOP.
    datatype of <i_fincorp> is type any table and <fs_fincorp> is type any.
    there is a structure 'data_ui' in <i_fincorp> and we need value of field 'ZZ0010' in data_ui structure.
    But, we are getting syntax error for statement in loop stating "There is no component like 'data_ui' in <fs_fincorp>".
    Can anyone please help me solving this issue.
    Regards,
    Santosh

    So simply access it dynamically
    data: nested_field type c length 50.
    field-symbols <nested_field> type any.
    "build the nested field name dynamically
    concatenate
           'DATA_UI'    "first give structure name
           'ZZ0010'  "then give field name (all in uppercase!)
    into nested_field
    separated by '-'.  "now you have DATA_UI-ZZ0010
    "so assing this nested field
    LOOP AT <i_fincorp> into <fs_fincorp>.
       assign component (nested_field) of structure <fs_fincorp> into <nested_field>. 
    ENDLOOP.
    Regards
    Marcin

  • Adding field in a smart form select statement

    hi,
    i am modifying a report in which i have to add sortl from kna1 in the select statement .
    when i try to modify the statement it gives error as i ahev defined the value in the global variable .
    plzz help me out as help will be definately rewarded.

    Ric,
    loop at ivbrk.
    select name1 name2 name3 name4 stras pstlz ort01 land1 from
    kna1 into (vname11, vname12, vname13, vname14, vstrask, vpstlzk,
    vort01k, vland1) where kunnr = ivbrk-kunrg.
    endselect.
    endloop.
    Seems you are modifying the  select statement in the smartform which is selecting some data based on the internal table data that is there in the driver program.
    If I am not wrong you want to select SORTL too in the above given select statement.
    In the Global Definitions declare a variable like vsort type kna1-sortl and then in the select statement add this sortl field.
    loop at ivbrk.
    select name1 name2 name3 name4 stras pstlz ort01 sortl land1 from kna1 into (vname11, vname12, vname13, vname14, vstrask, vpstlzk,vort01k, vsortl, vland1)
    where kunnr = ivbrk-kunrg.
    endselect.
    endloop.
    Do check the select statement how you are writing.
    K.Kiran.

  • Mapping ECC PO fields to R/3 PO fields

    Hi Experts,
    I was trying map ECC Po fields to R/3 fields which are not mapping in standard way automatically. Like Tracking No and Good Recipient name.
    I am using the BADI BBP_ECS_PO_OUT_BADI to map these fields.
    However i am able to map and see those fields in the back end.
    The same thing i was trying to do for the Text fields. Suppose, mapping vendor text to item text .these fields are not able to transfer through this BADI.
    for this i am using the BADI BBP_PO_INBOUND_BADI in R/3 to map these fields . I am able to map and see those text fields in R/3 also. But wonder now i am not able to see Tracking No and Good Recipient name fields in R/3 .
    Any pointer to solve this issue, really a help for me.
    Thanks in Advance.

    Hi Disha ,
    Thank you so much for your reply ,
    Actually i have implemted the BBP_ECS_PO_OUT_BADI this BADI only in SRM side .When i have implemeted i can see Tracking No and Goods recipient are mapping correctly in Back End . But the thing is only the text fields are not mapping the correctly. though code was correct .
    So i have implemeted the BBP_PO_INBOUND_BADI BADI in the R/3 side , through this one i can able to map the text fiedls , where as this time Tracking No and Goods recipient are not mapping .Any pointers for this , will really help for me .
    *See my code for BBP_ECS_PO_OUT_BADI*
    *Vendor text at line item level of SRM PO should be passed to
    *u2018Item Textu2019 at R/3 PO line item level.
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = WA_PO_ITEM-guid
                                                         tDid = 'ITXT'.
        IF SY-SUBRC EQ 0.
          W_PO_ITEM_TEXT-PO_NUMBER = WA_PO_ITEM-BE_OBJECT_ID.
          W_PO_ITEM_TEXT-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
          W_PO_ITEM_TEXT-TEXT_ID   = 'F01'.
          W_PO_ITEM_TEXT-TEXT_FORM = '*'.
          W_PO_ITEM_TEXT-TEXT_LINE = WA_LONGTEXT-TDLINE.
          APPEND W_PO_ITEM_TEXT TO CT_BAPI_POITEM_TEXT.
        ENDIF.
    *Internal Note at line item level of SRM PO should be passed to
    *u2018Info record noteu2019 at line item level of R/3 PO
        Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = WA_PO_ITEM-guid
                                                           tDid = 'NOTE'.
        IF SY-SUBRC EQ 0.
          W_PO_ITEM_TEXT-PO_NUMBER = WA_PO_ITEM-BE_OBJECT_ID.
          W_PO_ITEM_TEXT-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
          W_PO_ITEM_TEXT-TEXT_ID   = 'F06'.
          W_PO_ITEM_TEXT-TEXT_FORM = '*'.
          W_PO_ITEM_TEXT-TEXT_LINE = WA_LONGTEXT-TDLINE.
          APPEND W_PO_ITEM_TEXT TO CT_BAPI_POITEM_TEXT.
        ENDIF.
      ENDLOOP.
    *Vendor Text at PO header level should be passed onto R/3 PO header text field.
      Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = IS_HEADER-GUID
                                                       tDid = 'HTXT'.
      IF SY-SUBRC EQ 0.
        WA_Header_text-PO_NUMBER = IS_HEADER-BE_OBJECT_ID.
       WA_Header_text-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
       WA_Header_text-PO_ITEM+4(1)  = '0'.
        WA_Header_text-TEXT_ID   = 'F02'.
        WA_Header_text-TEXT_FORM = '*'.
        WA_Header_text-TEXT_LINE = WA_LONGTEXT-TDLINE.
        APPEND WA_Header_text TO CT_BAPI_POHEADER_TEXT.
      ENDIF.
    *Map the Tracking No
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table CT_BAPI_POITEM into WA_BAPI_ITEMS with key PO_ITEM = WA_PO_ITEM-NUMBER_INT+5(5).
        WA_BAPI_ITEMS-TRACKINGNO = WA_PO_ITEM-BE_TRACKING_NO.
        MODIFY TABLE CT_BAPI_POITEM FROM WA_BAPI_ITEMS TRANSPORTING trackingno.
      ENDLOOP.
    *The user id of the Partner Function u2018Goods recipientu2019 is map to
    *R/3 Goods Recipient field
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table IT_PARTNER into wa_partner with key P_GUID = WA_PO_ITEM-guid
                                                       PARTNER_FCT = v_grfun.
        IF SY-SUBRC EQ 0.
          SELECT SINGLE CHUSR
                 FROM BUT000
                 INTO v_grname
                 WHERE PARTNER_GUID = WA_PARTNER-PARTNER_NO.
          Read table CT_BAPI_POACCOUNT into WA_POACCOUNT with key PO_ITEM = WA_PO_ITEM-NUMBER_INT+5(5).
          WA_POACCOUNT-GR_RCPT = V_GRNAME.
          MODIFY TABLE CT_BAPI_POACCOUNT FROM WA_POACCOUNT TRANSPORTING GR_RCPT.
        ENDIF.
      ENDLOOP.
    endmethod.
    See my code BBP_PO_INBOUND_BADI
    APPEND LINES OF bbp_potextheader TO bapi_potextheader.
    APPEND LINES OF BBP_POTEXTITEM TO BAPI_POTEXTITEM.
    Evem i tried to map these traking no and good recipient fields in the R/ 3 , I have this piece of code in the Back end , But couldnt work for me.
    LOOP AT BBP_POITEM INTO WA_BBP_POITEM.
       Read table BAPI_POITEM into WA_BAPI_POITEM with key PO_ITEM =
              WA_BBP_POITEM-PO_ITEM.
       WA_BBP_POITEM-TRACKINGNO = WA_BBP_POITEM-TRACKINGNO.
      MODIFY table BAPI_POITEM FROM WA_BAPI_POITEM TRANSPORTING trackingno
       Read table BBP_POACCOUNT into wa_BBP_POACCOUNT with key PO_ITEM =
               WA_BBP_POITEM-PO_ITEM.
       wa_BAPI_POACCOUNT-GR_RCPT = wa_BBP_POACCOUNT-GR_RCPT.
       MODIFY table BAPI_POACCOUNT FROM wa_BBP_POACCOUNT TRANSPORTING
    GR_RCPT.
    ENDLOOP.
    Loop at BAPI_POITEM into wa_BAPI_POITEM.
       Read table BAPI_POITEMX into wa_BAPI_POITEMX with key PO_ITEM  =
    wa_BAPI_POITEM-PO_ITEM.
       wa_BAPI_POITEMX-TRACKINGNO = 'X'.
    MODIFY table BAPI_POITEMX FROM wa_BAPI_POITEMX TRANSPORTING TRACKINGNO
    Read table BAPI_POACCOUNTX into wa_BAPI_POACCOUNTX with key PO_ITEM  =
    wa_BAPI_POITEM-PO_ITEM.
       wa_BAPI_POACCOUNTX-GR_RCPT = 'X'.
       MODIFY table BAPI_POACCOUNTX FROM wa_BAPI_POACCOUNTX TRANSPORTING
      GR_RCPT.
    Endloop.

  • How to dynamicly create a field name AND access it

    All,
    I am trying to build a code block that will access what amounts to a table structure inside a table. I have 38 occurances if a set of 3 fields. (Source system had an internal array/occurs clause that was converted for our ODS into individual fields) I am returning a single row as a row type and have addressability to all fields. What I am trying to avoid is coding my logic block 38 times, 1 for each occurance.
    FOR X IN 1 .. 38 LOOP
    V_CAT_CD_X := 'CAT_'||X||'_CD';
    End Loop;
    The following is the display of the correctly built field:
    --> Loop Cat CD: CAT_1_CD Rec count:1 Loop counter:1
    --> Loop Cat CD: CAT_2_CD Rec count:1 Loop counter:2
    --> Loop Cat CD: CAT_3_CD Rec count:1 Loop counter:3
    --> Loop Cat CD: CAT_4_CD Rec count:1 Loop counter:4
    My problem is that my row cursor PP1 is addressable hardcoding PP1.CAT_1_CD or PP1.CAT_2_CD ect, however I am having problems using my created string to access the field.
    What do I need to do to gain accessability via this method?
    I do have the ability to select the column names from the system tables but even then, I am lacking addressability to my ROW type using the selected field name.
    Thanks
    Greg

    Not sure if this is what you are looking for:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_cur SYS_REFCURSOR;
      3  v_rec mytest%rowtype;
      4  cursor c1 is select column_name from all_tab_cols where table_name = 'MYTEST';
      5  v_sql_stmt VARCHAR2(1000) := NULL;
      6  BEGIN
      7  v_sql_stmt := 'SELECT ';
      8  FOR I IN c1 LOOP
      9  v_sql_stmt := v_sql_stmt||I.column_name||',';
    10  end loop;
    11  v_sql_stmt := RTRIM(v_sql_stmt,',');
    12  v_sql_stmt := v_sql_stmt||' FROM mytest';
    13  open my_cur for v_sql_stmt;
    14  LOOP
    15  FETCH my_cur INTO v_rec;
    16  EXIT WHEN my_cur%NOTFOUND;
    17  dbms_output.put_line(v_rec.a);
    18  END LOOP;
    19 close my_cur;
    20* end;
    SQL> /
    1
    2
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Nov 17, 2010 5:29 AM

  • CSAP_BOM_ITEM_MAINTAIN - Problems while clearing custom fields

    Hi, I try to modify some bom items, it works fine so far, but I get into trouble when trying to update previosly filled fields with empty ones.
    First, I check my structure and insert a 'delete field character' into initial fields:
    LOOP AT fieldcat INTO wa_fieldcat.
            IF wa_fieldcat-fieldname EQ 'FLDELETE'.
              CONTINUE.
            ENDIF.
            ASSIGN COMPONENT wa_fieldcat-fieldname OF STRUCTURE bomline TO <field>.
            IF sy-subrc IS INITIAL.
              IF <field> IS INITIAL OR <field> EQ space.
                <field> = '!'.
              ENDIF.
            ELSE.
              MESSAGE 'Error while looping thru bomline structure to update fields' TYPE 'E'.
            ENDIF.
         ENDLOOP.
    Then, I use CSAP_BOM_ITEM_MAINTAIN to update bom
    CALL FUNCTION 'CSAP_BOM_ITEM_MAINTAIN'
        EXPORTING
          i_stpo                   = bomline
    *         FL_DEP_ALE_CONFORM       = ' '
        IMPORTING
          o_stpo                   = bomline_out
          fl_warning               = warning
    *       TABLES
    *         T_DEP_DATA               =
    *         T_DEP_DESCR              =
    *         T_DEP_ORDER              =
    *         T_DEP_SOURCE             =
    *         T_DEP_DOC                =
        EXCEPTIONS
          error                    = 1
          OTHERS                   = 2
    So, this works out fine, but not for my custom fields in the stpo_api02's .INCLUDE structure. While the standard fields are deleted when I fill them with '!', the custom ones just contain '!' afterwards.
    When I dont put '!' into my custom fields and make them initial prior invoking CSAP_BOM_ITEM_MAINTAIN, their contents stay untouched.
    However, real updates, where field contents are changed to some value but initial work flawlessly, on both, the stock and my custom fields.
    Any Idea on this?

    Hi,
      Can you try to read the BOM items before changes and use the same structure in change BAPI by modifying the structure with only the changes. I guess this will support the clearing of the custom fields.
    With Regards,
    Rajesh V.

  • Specify database field's name dynamically in a select statement

    Hi to all!!
    I have the following problem:
    I got a paraneters statement where the user is to choose the month of the year,once i have the month, i need to make a query on a database(select field_name) of a field whose name deppend on the month that the user chose before, is it possible?
    What I need? I think i can do it using field simbols but I've never worked with field simbols and I have no time to learn it now.
    Thanks everybody

    Hi,
    <b>Below code is the Simple one:</b>
    <b>DATA: DYN_FIELD(15)
    SELECT single (DYN_FIELD)
    into corresponding fields of <IT_TABLE>
    from <TABLE> where XXX = YYY.</b>
    This is the complex program, have a look at it ...
    REPORT zdany_dynamic_select.
    * We use some parameters to dynamically control the select, this is not very
    * clever but this is just a test program !!
    PARAMETER : p_tabnam TYPE tabname DEFAULT 'SFLIGHT',
                p_selfl1 TYPE edpline DEFAULT 'CARRID',
                p_selfl2 TYPE edpline DEFAULT 'CONNID',
                p_selfl3 TYPE edpline DEFAULT 'FLDATE',
                p_selfl4 TYPE edpline DEFAULT 'PRICE',
                p_selfl5 TYPE edpline DEFAULT 'CURRENCY',
                p_where1 TYPE edpline DEFAULT 'PRICE > 300',
                p_where2 TYPE edpline DEFAULT 'AND CURRENCY = ''EUR'''.
    FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
                    <ls_outtab> TYPE ANY,
                    <l_fld> TYPE ANY.
    DATA: lt_where    TYPE TABLE OF edpline,
          lt_sel_list TYPE TABLE OF edpline,
          lt_group    TYPE TABLE OF edpline,
          l_having    TYPE string,
          l_wa_name   TYPE string,
          l_sel_list  TYPE edpline,
          dref        TYPE REF TO data,
          itab_type   TYPE REF TO cl_abap_tabledescr,
          struct_type TYPE REF TO cl_abap_structdescr,
          elem_type   TYPE REF TO cl_abap_elemdescr,
          comp_tab    TYPE cl_abap_structdescr=>component_table,
          comp_fld    TYPE cl_abap_structdescr=>component.
    TYPES: f_count TYPE i.
    * Creation of the output table including a non standard field, f_count
    * see ABAP FAQ #14 for more information on this topic
    struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
    elem_type   ?= cl_abap_elemdescr=>describe_by_name( 'F_COUNT' ).
    comp_tab = struct_type->get_components( ).
    * We remove the unnecessary fields
    LOOP AT comp_tab INTO comp_fld.
       IF comp_fld-name <> p_selfl1 AND
          comp_fld-name <> p_selfl2 AND
          comp_fld-name <> p_selfl3 AND
          comp_fld-name <> p_selfl4 AND
          comp_fld-name <> p_selfl5.
             DELETE TABLE comp_tab WITH TABLE KEY name = comp_fld-name.
       ENDIF.
    ENDLOOP.
    comp_fld-name = 'F_COUNT'.
    comp_fld-type = elem_type.
    APPEND comp_fld TO comp_tab.
    struct_type = cl_abap_structdescr=>create( comp_tab ).
    itab_type   = cl_abap_tabledescr=>create( struct_type ).
    l_wa_name = 'l_WA'.
    CREATE DATA dref TYPE HANDLE itab_type.
    ASSIGN dref->* TO <lt_outtab>.
    CREATE DATA dref TYPE HANDLE struct_type.
    ASSIGN dref->* TO <ls_outtab>.
    * Creation of the selection fields and the "group by" clause
    APPEND p_selfl1 TO lt_sel_list.
    APPEND p_selfl1 TO lt_group.
    APPEND p_selfl2 TO lt_sel_list.
    APPEND p_selfl2 TO lt_group.
    APPEND p_selfl3 TO lt_sel_list.
    APPEND p_selfl3 TO lt_group.
    APPEND p_selfl4 TO lt_sel_list.
    APPEND p_selfl4 TO lt_group.
    APPEND p_selfl5 TO lt_sel_list.
    APPEND p_selfl5 TO lt_group.
    APPEND 'COUNT(*) AS F_COUNT' TO lt_sel_list.
    * creation of the "where" clause
    APPEND p_where1 TO lt_where.
    APPEND p_where2 TO lt_where.
    * Creation of the "having" clause
    l_having = 'count(*) >= 1'.
    * THE dynamic select
    SELECT          (lt_sel_list)
           FROM     (p_tabnam)
           INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>
           WHERE    (lt_where)
           GROUP BY (lt_group)
           HAVING   (l_having)
           ORDER BY (lt_group).
    * display of the results
    LOOP AT <lt_outtab> ASSIGNING <ls_outtab>.
       LOOP AT comp_tab INTO comp_fld.
          ASSIGN COMPONENT comp_fld-name OF STRUCTURE <ls_outtab> TO <l_fld>.
          WRITE: <l_fld>.
       ENDLOOP.
       SKIP.
    ENDLOOP.
    Have a look at the link, this link will have lot of examples :-
    http://www.susanto.id.au/papers/DynOpenSQL.asp
    Regards
    Sudheer

Maybe you are looking for

  • Diff B/w ABAP Dictionary and Data Dictionary

    What is the difference between ABAP Dictionary and Data Dictionary........

  • What's H.264?

    What's H.264? Can one make H.264 type FLV's or is it an whole different format?  Can it be imported into flash?

  • IPhone 6 shows needs to cool down

    my brand new iPhone 6, out from box is faulty. it shows it need to be cool down before use.I couldn't  activate the phone. Operating temp 55-60 F. Apple accepted return and it will replace with new one. color gold.

  • Indesign CS6 automatische Seitenzahlen formatieren

    Ich finde es mühsam und zeitraubend, autom. Seitenzahlen auf der Musterseite zu formatieren. Eine ganz einfache Zahl gelingt, aber schwierig wird es, die Zahl etwas zu designen. Frage: Gibt es dafür verwendbare Muster? Gruß Mollius

  • How to supply an end point to powershell cmdlet Rename-Blob

    [cross posted from http://stackoverflow.com/questions/21352295/azure-storage-cmdlet-rename-blob-wants-an-endpoint] I'm attempting to rename a blog to all lower case: Rename-Blob -BlobUrl "https://ttseast.blob.core.windows.net/images/Add.png" -NewName