Passing internal tabel values to a variable

Hi experts,
                I wanna pass the values of an internal table eg itab to a variable of character type of lenth 1000. the values in itab are of different types.
plz suggest me how solve this.
regards,
alson.

Hi..,
use the field-symbols....
(This code is for an itab which contains more than one field... )
<b>
data:
  w_line(1000),
  w_field(40) type c.
table to hold all the records resulted from concatenating fields....
data
  t_file like standard table
           of w_line
      initial size 0.
field-symbols <fs>.
loop at itab into wa_itab.
  do.
    assign component sy-index of structure wa_itab to <fs>.
    if sy-subrc ne 0.
      exit.
    endif.
    w_field = <fs>.
    condense w_field no-gaps.
    if sy-index eq 1.
      w_line = w_field.
    else.
      concatenate w_line ' ' w_field into w_line.
    endif.                             " If sy-index eq 1.
  enddo.                               " Do.
  append w_line to t_file.
endloop.               
</b>
if u have itab onli with one field
then...
<b>data:
  w_line(1000),
  w_field(40) type c.
loop at itab.
w_field = itab-field.
concatenate w_line w_field into w_line.
endloop.</b>
reward if it helps u..
sai ramesh

Similar Messages

  • How to Pass dashboard prompt value to RPD variable??

    Hi Experts,
    I am creating RPD variable with below query in initialization block
    SELECT extract(month from Max(report_date))  from xyz_date_dim where report_id=14 and year=:YEAR
    I am having YEAR prompt in dashboard..from this RPD variable i want to get MAX(month) from selected year in dashboard.Here my problem is unable to pass selected YEAR to RPD Initialization block.
    I read some threads we can pass user selected values to session variables. If possible can any one help me how to pass variable to achieve my requirement.
    can any one help me in this....
    Thanks,
    KSS.

    So you want to pick a month in a dashboard prompt and have the answers report filter for that month, and return results for that month, month -1, month -2 etc etc.
    If so try the following, lets assume your measure is simply called 'count'
    in the BMM you have measure 'count' with aggregation set.
    Create a new measure in the BMM called 'count MAGO' or whatever you want (this will be month -1)
    in the logical forumula for that column, use the AGO function, syntax would be AGO(count measure,<time dimension.Month>, -1) - this function is found under the 'Time Series Functions' category.
    repeat steps to create 'count 2MAGO' and use -2 in the AGO function to take off 2 months.
    Repeat for however many Mth Ago's you want.
    Then in answers, simply use is prompted on your month fied to filter the report for the relative month, select your 'count', 'count MAGO', 'Count 2MAGO' etc, the measure will be calculated for prior months relative to your filtered month.
    Sorted?

  • How to pass  internal table values to parameter

    hi,
             how to pass  internal table values to parameter in selection screen.if is it possible means please sent codeings.
    thanks.
      stalin.

    hi,
    tables : mara.
    data :  begin of itab_mara occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              end of itab_mara.
    selection-screen : begin of block blk1 with frame title text-001.
    parameters : p_matnr like mara-matnr.
    selection-screen : end of block blk1.
    select matnr ernam from mara into corresponding fields of itab_mara
                                                                    where matnr = p_matnr.
    loop at itab_mara.
    write :/ itab_mara-matnr,
               itab_mara-ernam.
    endloop.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Pls help...How to pass a executed value to a variable?

    hi everyone im new here..
    ok im having prob in passing the executed value of a string into a variable for me to manupulate the value. sample codes as below :
    declare @Str varchar(500)
    declare @Str1 varchar(50)
    declare @Int varchar(50)
    declare @Str2 varchar(50)
    set @Str1 = 'where ET.isVerified = 1'
    set @Str = 'select sum(ET.Sundries+ET.Entertainment+ET.BalReimbursement+ET.Fee+ET.TrainerCharges+ET.SeminarPack+ET.Food+ET.Accomodation+ET.Flight) from ExpensesTransactions ET ' + @Str1
    EXEC(@Str)
    Answer : 16935.00
    so now i want to pass the output(Answer) into a variable so that i can insert the value into a table. anyone can help me in this thing . thank you so much..
    regards
    -nash-

    hi Jurek
    thanx for ur help dude, i change as what u said but i got this error msg "Incorrect syntax near '@Answer'"
    declare @Str varchar(500)
    declare @Str1 varchar(50)
    declare @Int varchar(50)
    declare @Str2 varchar(50)
    declare @Answer varchar(50)
    set @Str1 = 'where ET.isVerified = 1'
    set @Str = ' BEGIN select sum(....) INTO @Answer From ExpensesTransactions ET ' + @Str1 + ' END;'
    EXEC(@Str)
    print @Answer
    but then i change the script abit to 'Begin select....' + @Answer + ' From ..' + @Str1 + 'END;'...this time i got no error msg but there is no value in variable @Answer...
    thanx everyone
    - nash -

  • 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 store internal table value in single variable

    hi gurus,
    i have 3 value in int table , so want to store the value of int table into single variable of type string.
    how it is possible

    hmmm, your requirement is kinda weird and you could have given us a bit more info, but well lets start.
    Why is your requirement weird?
    Well an internal table kinda is a variable itself, or rather a set of variables which together make up for a line type of your table.
    So you have a value you already have in a variable and now want to store it in anotherone? Seems weird.
    What type is your internal table?
    Do you have those three values in one record or in  three records which only hold one value each?
    Which of your values do you want to store in another variable?
    Anyway, make a F1 on the "READ TABLE" statement, this should definiteley help you.
    The "LOOP AT WHERE" statement could as well help if there should occur probrlem using READ TABLE.
    /edit DAMn i was posting this while you gave us more info.
    So still the question stays if you got your three values in one record or in three records.
    DATA: lv_variabl_containing_all      type char100.
    loop at itab into wa.
      concatenate lv_variabl_containing_all wa-value into lv_variabl_containing_all seperated by space.
    endloop.
    after the loop you now got all your values in lv_variabl_containing_all.
    That is for the case you got three records.
    other case would be
    Read table itab into wa index 1.
    concatenate wa-value1 wa-value2 wa-value3 into lv_variabl_containing_all.
    Edited by: Florian Kemmer on Apr 16, 2010 12:59 PM

  • Passing internal table data to a variable

    Dear experts,
    i am having below code
      ASSIGN (w_dyn_tbl_fld) TO <fs_dyn_fld_data>.
          IF sy-subrc <> 0.                                   
            CLEAR <fs_dyn_fld_data>.                  
          ENDIF.                                      
    and this is in loop of an internal table having 30 records at 28 record im having  value REGUH-VBLNR in (w_dyn_tbl_fld) and
    <fs_dyn_fld_data> is having the value as 2000022827 and here in assigning is getting failed
    and hence it is clearing  <fs_dyn_fld_data> data.
    which should nt happen
    dont know why it is happening.
    i have internal table it_reguh which is having value as it_reguh-vblnr.
    i need to declare one work area and than from this internal table i have to pass this value to an work area.
    kindly suggest how to proceed
    thank u
    regards
    ravikumar

    dear keshav,,
    see the below code
        LOOP AT it_flds_maps_tbl INTO wa_flds_maps_tbl
                                 WHERE ( recty = 'I'  ). "I STRUC TABLES
        POPULATE A VARIABLE WITH TABLENAME-FIELDNAME. >>>
          CONCATENATE wa_flds_maps_tbl-tabname
                      wa_flds_maps_tbl-fieldname
                      INTO w_dyn_tbl_fld
                      SEPARATED BY w_seperator.
        USE THE VARIABLE TO ASSIGN A REFRENCE TO THE ACTUAL TABLE-FIELD
        FOR RETRIEVEING THE DATA USING A FILED SYMBOL. >>>
          ASSIGN (w_dyn_tbl_fld) TO <fs_dyn_fld_data>.
          IF sy-subrc <> 0.                                     "BS1+
            CLEAR <fs_dyn_fld_data>.                            "BS1+
          ENDIF.                                                "BS1+
          CLEAR w_clspace.
        QUERY THE TYPE OF FIELD
          CLEAR w_type.
          DESCRIBE FIELD <fs_dyn_fld_data> TYPE w_type.
          CASE w_type.
    ABSOLUTE VALUE AND THOUSAND SEPARATORS SUPRESSED
            WHEN 'P' OR 'I' OR 'F'.
              WRITE <fs_dyn_fld_data> TO w_clspace
                NO-SIGN NO-GROUPING LEFT-JUSTIFIED.
              IF <fs_dyn_fld_data> < 0.
                CONCATENATE '-' w_clspace INTO w_clspace.
              ENDIF.
    INTERNAL REPESENTATION IS PASSED
            WHEN 'D'.
              MOVE  <fs_dyn_fld_data> TO w_clspace .
            WHEN OTHERS.
    *IF CONVERSION ENTRIES ARE MAINTAINED THEN CONSIDER THESE
              IF wa_flds_maps_tbl-conv_exists = 'X'.
                READ TABLE it_flds_conv_tbl INTO wa_flds_conv_tbl
                WITH KEY tabname = wa_flds_maps_tbl-tabname
                     fieldname = wa_flds_maps_tbl-fieldname
                     oldvalue  = <fs_dyn_fld_data>.
                IF sy-subrc EQ 0.
                  WRITE wa_flds_conv_tbl-newvalue TO w_clspace.
                ENDIF.
              ELSE.
                WRITE <fs_dyn_fld_data> TO w_clspace.
              ENDIF.
          ENDCASE.
    INCLUDE PREFIX AND SUFFIX
          IF NOT w_clspace IS INITIAL.
            CONCATENATE wa_flds_maps_tbm-prefix w_clspace
      wa_flds_maps_tbm-suffix INTO w_clspace SEPARATED BY space.
          ENDIF.
    *REMOVE # FROM RECORD
          REPLACE '#' INTO  w_clspace WITH ''.
          SHIFT w_clspace LEFT DELETING LEADING space.
        CONSTRUCT A STRING WHICH WOULD CONTAIN THE DATA EXTRACTED BY THE
        FIELD SYMBOL AND DELIMIT EACH DATA EXTRACT BY A DELIMITER. >>>
          w_offset = STRLEN( w_i_record ).
          w_len    = STRLEN( w_clspace ).
          WRITE w_clspace TO w_i_record+w_offset(w_len).
    IF DELIMITER IS REQUIRED AFTER THE FIELD
          IF wa_flds_maps_tbl-delrq EQ 'X'.
            CONCATENATE w_i_record c_delimiter INTO w_i_record.
          ELSE.
            CONCATENATE w_i_record '^' INTO w_i_record.
          ENDIF.
    *... GET RID OF THE SOFT SPACE FOR EMPTY FIELD
          REPLACE '^' INTO w_i_record WITH ''.
          REPLACE '|^' INTO w_i_record WITH '|' .
          REPLACE '^|' INTO w_i_record WITH '|'.
          REPLACE ' |' INTO w_i_record WITH '|'.       "MAY NOT BE REQD???
       ENDLOOP. " ENDLOOP FOR I STRUC CONSTRUCTION.
    in assining w_dyn_tbl_fld       to      fs_dyn_fld_data
    it is getting failed due to miss assigning
    so i just want to know whether i can create a variable of type any
    and i pass this fs_dyn_fld_data to that variablke or not
    and whether this variable value can be  used in where condition(vblnr = reguh-vblnr) or not in loop of the below code
       LOOP AT it_regup INTO regup
                         WHERE ( laufd = reguh-laufd )
                         AND   ( laufi = reguh-laufi )
                         AND   ( xvorl = reguh-xvorl )
                         AND   ( zbukr = reguh-zbukr )
                         AND   ( lifnr = reguh-lifnr )
                         AND   ( kunnr = reguh-kunnr )
                         AND   ( empfg = l_w_empfg )   " BY RMK
                         AND   ( vblnr = reguh-vblnr ).

  • How to pass the prompt value to repository variable in obiee 11.1.1.7

    Hi All,
    I am given a tabular report to build in OBIEE 11.1.1.7 version using insurance data.
    I have to show different types of claim names and their corresponding count in the table. One of the calculations require me to use the total no of claims(i.e sum of all the claims).
    Example:
    Total No of claims: 600
    Total No of Auto Claim: 60
    I have to create a table on Auto Claim like:
                   claim types       count
                        X                    10
                        Y                    20
                        Z                    30
    I was calculating total no of claims by using dynamic repository variable as it was a constant value. Example: repository_variable1: select count(claim ID) from Insurance; In report I was just using value of (repository_variable1)
    Now client has asked us to give date prompt so the total no of claims (assumed as 600) will change with respect to period. I can calculate total no of claims with respect to different claim type (as shown in the table above) with respect to period filter in the report.
    The problem I am facing now is, I need the count of all the claims on a partucular period too. Repository variable is giving always calculating the count as 600. But the count should change with respect to period selected. How to get this value?
    Can I create a presentation variable in the prompt and pass this value as an argument for repository variable?
    Please help. I am in urgent need of the solution.
    Thank you.

    Hi Srini,
    I tried creating it as metric. But the problem is my pivot table is on Auto Claims.
    Let me try to make myself a bit more clear.
    Total No of claims in fact table: 600
    Total No of Auto Claims in fact table: 60
                    claim types(auto claims)       count        Calculation
                        X                                        10             10/600
                        Y                                        20             20/600
                        Z                                        30             30/600
    So I need to access total no of claims to calculate. I cant use a metric as the count will take group by with respect to auto claim type and give value only for X claim.

  • Passing field symbol value to a variable

    Hi All,
    I have a value in Field Symbol declared as   <FS-STATUS> TYPE STANDARD TABLE.
    I want to use the value  <fs-status> -low  in  a case statement.
    For this i think i have to pass the <fs-status> -low  into a variable and then use in case statement.
    Can anyone explain how to pass values in field symbol to variable? Or if this is not possible is there any other solution.
    Thanks in advance.

    Hi ,
    I have give some code sample ; just check ..
    DATA: BEGIN OF line,
             col1(1) TYPE c,
             col2(1) TYPE c VALUE 'X',
           END OF line.
    FIELD-SYMBOLS <fs> LIKE line.
    ASSIGN line TO <fs>.
    MOVE <fs>-col2 TO <fs>-col1.
    WRITE: <fs>-col1, <fs>-col2.
    Or u can check this link :
         http://www.erpgenie.com/abaptips/content/view/401/62/

  • Pass bind value to a variable

    How possible is it to pass a bind value to a variable?
    <cfselect id="addo" name="addo"
    bind="cfc:asproxy.getRList()"display="ListName" value="ListID"
    BindOnLoad="true" />
    The above bind value in addo then passed to the below, making
    available to the whole page as "valueaddo"
    <cfset valueaddo =#addo#>

    Thank you Bitaites.
    I tried to add a new action in the page definitions --> bindings --> insert inside binding create new action --> and then choose the data collection --> select an Action as "ExecuteWithParams" --> in the Value field I put the value e.g. 'APPROVER'.
    Is something I did wrong? Because it seems not work... =(
    Can you explain a little bit about how to do it?
    Thanks a lot!!

  • How to pass a form value  as a url parameter??

    I have following form and I want to pass the selected value of the drop down choice in as one of the parameter in the URL. How can I do that ??
    something like proposalid that I have done in the url, I want to pass the selected value of the variable doc_id, when I click the Link button
    <form name = "link" method="POST" enctype="multipart/form-data" action="<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/add_doc.jsp">
    <table>
         <tr> <td class="tableContent"> Doc Identifier: </td>
    <td class="tableContent"> <SELECT name="doc_id">
    <%
         Vector v = iddata.getDocumentIdList(tabName);
         //out.println(v);
         if (v != null && v.size() > 0) {
              for (int i = 0; i < v.size(); i++) {
              Hashtable hash = (Hashtable) v.elementAt(i);
    %>
    <OPTION selected name="id " value="<%=(String)hash.get("DOCUMENT_ID")%>"> <%=(String)hash.get("DOCUMENT_NAME")%></OPTION>
    <% } } else {%>
         <OPTION selected name="id " value="test"> No DocIDs</OPTION>
    <%}%>
    <tr> <td colspan = "2">
         <table border="1" width="200">
              <tr> <td> <input type="text" name="link_file" size="30" value=""/></td><td> <INPUT TYPE=button VALUE="Link..." onClick="window.open('<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/link.jsp?proposalid=<%=proposalID>','mywindow','toolbar=no,location=no,directories=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20');"></td> </tr>
              <tr> <td colspan = "2">
                   To Create Links: <br>
                   * Select Doc Identifier
                   * Click on Link...to select file within eFile. <br>
                   * Click Add to create the Link <br>
              </td> </tr>
         </table>
         </tr>

    if - in your form declaration - you change your method to GET from POST, it will append the form data onto the URL string instead of putting it in the request header. For instance, if you have a form with an input called THE_INPUT, and you submit to a servlet (or script of some kind or whatever) when the value of that text box is "foo", the URL will be:
    http://www.yourdomain.com/yourservlet?THE_INPUT=foo
    But, if you use the POST method, the URL will just be:
    http://www.yourdomain.com/yourservlet
    Is that what you meant?

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • Not able to get the value of ODI Variable when i pass thru Option

    Hi,
    I have ODI variable called prev_etl_run_date which will hold the last successful etl run date. I want to use the value of this variable in one of my KM step.
    But i don’t want to use directly in my KM. So I passed the variable name thru KM Option.
    I intend to use the variable’s value in the KM step, as shown below:
    <%=odiRef.getOption("MY_OPTION_1")%>
    Here I am expecting the value of the variable, but here I am only getting the variable name only.
    Is there any substitution method available in ODI KM , please help me to solve this issue.
    Thanks
    nidhi

    ODI options are not intended for run time parameters. They are like design choices or debugging flags or parameters that can be specified in code template. Previous ETL run time stamp is hardly a design choice.
    On the other hand, it is really a bad practice to put a variable inside KM directly. That creates a dependency that you can easily avoid by putting a filter using that variable in the interface.

  • HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE

    HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE.
    DATA : BEGIN OF ITAB OCCURS 0,
               FIELD1(2) TYPC C DEFAULT   '12',
               FIELD2     TYPE C ,
               END OF ITAB1.
    IT'S GIVING ERROR MESSAGE.
    PLZ LOOK INTO THIS AND GIVE ME CORRECT SOLUTION.
    THANKS
    SURI

    DATA : BEGIN OF ITAB OCCURS 0,
    FIELD1(2) TYPC C,
    FIELD2 TYPE C ,
    END OF ITAB1.
    itab-field1 = '12'.
    itab-field2 = 'A'.
    append itab.
    clear itab-field2.
    itab-field1 = '12'.
    itab-field2 = 'B'.
    append itab.
    clear itab-field2.
    Now everytime u'll have the value for field1 = '12'.
    Regards
    Vasu

  • Passing value to bind variable of another table from one table

    hi,
    I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
    My main problem is what code has to be written to pass value to bind variable and where it should be written.
    Please give me a detailed explaination as soon as possible.
    Thank you.

    Sorry, didnot add this. The table is multi select table.

Maybe you are looking for

  • Trouble with Nokia Software updater software

    Hi I have trouble with my Nokia software updater. It "freezes" in detecting your phone picture. Everytime there is a new version of NSU and first time I run it after installing/upgrading it works fine. But when I run it one more time it freezes. Anyb

  • 4 days and still 4500 songs to upload!

    I subscribed to iTunes Match last week after 4 days it's still going through the initial setup stage. It goes through the first two steps ago but it's stuck on the third step where it uploads songs. Originally I had about 6000 songs to upload but it

  • JPEGs show up green.

    I have some JPEGs that I am using in a video, and three of them just show up as a solid green color in the viewer and canvas. However, the Icon in the timeline displays the JPEG image correctly. Any thoughts?

  • Combine two large documents fails

    I have two large PDF files with multiple embedded videos. One is 1GB and the other is 2.12GB. When I try to combine them and save, the save fails with a message: "The Document could not be saved. The file is too big." This has happened in two compute

  • Redundant Supervisors in a Dual-Core Catalyst 6500 network

    Read the PDF doc called: Designing a Campus Network for High Availability. http://www.cisco.com/application/pdf/en/us/guest/netsol/ns432/c649/cdccont_0900aecd801a8a2d.pdf It essentially recommends that dual supervisors only be used in SPOF points - n