Variable name for Internal table

Hi Folks,
For a report i am passing a parameter. This parameter name is then used to read data using "IMPORT from database" statement from cluster.
Now I need to copy this data into another internal table. How do I do that? e.g. what would be the syntax?
Thanks...
Munish

Hi Rainer,
Thanks for replying!
I was passing a parameter (no-display) to a report from another report.
I am using field-symbol and it solved the problem.
Regards,
Munish

Similar Messages

  • System Variable For Internal table count

    Can anybody tell me what the system variable for internal table count?
    I just wants to know how many recoreds are there in my internal table ?
    Regards,
    pandu.

    Hi ,
    DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].
    If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.
    using variable
    SY-TFILL
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM

  • Why using workarea for internal table is better in performance

    Please tell me
    why using workarea for internal table is better in performance

    Hi Vineet ,
      Why would we choose to use an internal table without a header line when it is easier to code one  with a header line?
    it has following reason.
    1)Separate Internal Table Work Area:
         The work area (staging area) defined for the internal table   is not limited to use with just one internal table.
    take ex-
    Suppose you want two internal tables for EMPLOYEE – one to contain all records and one to contain only those records where country = ‘USA’.  You could create both of these internal tables without header lines and use only one work area to load data into both of them. You would append all records from the work area into the first internal table.  You would conditionally append the ‘USA’ records from the same work area into the second internal table.
    2)  Performance Issues:  Using an internal table without a header line is more efficient than one  with a header line
    3) Nested Internal Tables:  If you want to include an internal table within a structure or another   internal table, you must use one without a header line.
    If this one is helpful ,then rewards me
    Regards
    Shambhu

  • Aggregate functions for internal table.

    Hi Gurus,
    I'm just wondering whether we can use aggregate functions for internal table. I wanted to know the max value for a particular column in my internal table. How can I achieve this easily and quickly.
    Thanks,
    David.

    sort the table on which you want the maximum value and read it. Please find below example code.
    TYPES : BEGIN OF ty_mvke,
            matnr TYPE mvke-matnr,
            vkorg TYPE mvke-vkorg,
            vtweg TYPE mvke-vtweg,
           AUMNG type mvke-AUMNG,
            END OF ty_mvke.
    DATA : wa_mvke TYPE ty_mvke,
           it_mvke TYPE STANDARD TABLE OF ty_mvke.
    data : temp_AUMNG type AUMNG.
    START-OF-SELECTION.
      SELECT matnr vkorg vtweg AUMNG FROM mvke INTO
            table it_mvke.
    sort it_mvke by AUMNG.
    read TABLE it_mvke into wa_mvke INDEX 1.
    if sy-subrc = 0.
    move wa_mvke-AUMNG to temp_AUMNG.
    write : temp_AUMNG.
    endif.
    Thanks,
    Sreekala.

  • Extract schema/metadata - names for all tables and attributes

    Hi, I am quite new to Oracle DB (only been doing dev mostly with sqlserver before). Is there a way to extract schema (names for all tables and attributes) for 10g and 11g in application code (either java or .net) or pl/sql?
    Thank you,
    -Tony

    There are built in views that start with DBA_, ALL_, and USER_. All means all the user can see, user means all the user has, and dba means everything, which generally means the same as the others plus an owner. So you can desc user_tables to see what-all that view has, then select columns from the view with ordinary sql. See the doc set for all the views available, interesting ones are ...views, ...objects, ...tab_cols and so forth.
    There are also built in procedures for getting metadata, google for details.
    Many tools have easy GUI's for this too. EM has ways on the administration screen to get to various objects, and then you can show the ddl. Maybe sqldeveloper has something too.

  • M:N Relation and plural name for associative Table

    Hi,
    I'm using DM 3.1.4
    In my logical model, 2 entities and an M:N relation. I define a name for this relation
    Entity Student
    Entity Stage
    Relation Registration
    I create a glossary with plural form for these three names (entities name and relation name) :
    Student --> STUDENTS
    Stage --> STAGES
    Registration --> REGISTRATIONS
    When I generate relationnal model with "apply name translation" option, my two tables are named correctly with the plural name, but the associative table is named with the relation name (registration), not with the plural form (REGISTRATIONS)
    Is this a bug ? Is there another way to automatically define plural name for an associative table ?
    Thanks
    Fabrice.
    Edited by: FabriceC on 22 mars 2013 14:03

    Hi Fabrice,
    thanks for reporting the problem. I logged a bug for that.
    There is no another way for setting a plural name for intersection table. If you switch to 3.3 then you can set the name manually and lock it so it cannot be changed further.
    Philip

  • CRM Table name for International versions in BP (address)

    hi can any one tell me the table name for the where the internation nation versions are stored in which table -
    above field will be in BP - Address

    Hi Raj,
    The international address version is stored in table ADRC. You need to mention the appropriate value of field 'Nation' to retrieve the international version. The default address has nation = space. International version has nation = 'I'. Chinese / Kanji version has nation = 'K'...
    You can query ADRC using address number + nation. You can get address number for the BP from table BUT020.
    Hope this solves your issue.
    Cheers,
    Rishu.

  • Table name for Internal order group and Profit center group

    Hello Friends,
    Could any one provide me the table for Internal order group and Profit center group.
    We are developing new customized report and user requested internal order group and Profit center group in the selection criteria.
    I have checked for this tables but found only these fields in structures.
    Thanks in advance,
    Ravi Kiran.

    Or use FM [G_SET_TREE_IMPORT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=g_set_tree_import] to read the hierarchy/Group. (Read FM and FG documentation, you can also add break-point and call some S_ALRxxx transaction which use this FM for the objects you need).
    Regards,
    Raymond

  • Data allocation for internal table rows Dynamically

    Hi Friends
    I have requirement like below:
    I have one internal table with 400 amounts columns, I will get the value from another program
    that indicates to which column I have to add the values. I dont want to write the case statement
    because I need to write 400 WHEN statements.
    Is there any alternative way dynamically I can choose the internal table column and assign the value which
    I am getting from external program.
    Please help on this as soon as possible.
    Points will be rewarded
    Thanks
    Praveen

    Hi Praveen,
    you may use the ASSIGN COMPONENT ... OF STRUCTURE ... statement.
    It allows to assign the field by name or by sequence.
    Assume you columns have names like amount_001 to amount_999 and are fields of structure ls_amounts. The do as decribed here roughly:
    data:
      lv_fieldseq type NUMC_3,
      lv_fieldname type fieldname,
      lv_amount type (???).
    fieldsymbols:
      <amount> type any.
    * fetch amount and field sequence from external data into  lv_amount and lv_fieldseq
    concatenate 'AMOUNT_' lv_fieldseq into lv_fieldname.
    * <amount> is something like a pointer
    assign component (lv_fieldname) of structure ls_amounts to <amount>.
    add lv_amount  to <amount>. 
    if you are sure you have the correct position of the amount field in the structure stored in variable lv_position, you may use
    assign component lv_position of structure ls_amounts to <amount>.
    I prefer the ASSIGN (fieldname) for reasons of more transparency and less danger in case of structural changes.
    Regards,
    Clemens
    Regards,
    Clemens

  • How to parse XML for internal table

    hi guys, I would like to know how to parse xml for an internal table. I explain myself.
    Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the item level. When I received back the pdf completed by mail, I need to parse the xml and get the po qty that has been entered.
    This is how I do to get header data from my form
    lr_ixml_node = lr_ixml_document->find_from_name( name = ''EBELN ).
    lv_ebeln = lr_ixml_node->get_value( ).
    How do we do to get the table body??
    Should I used the same method (find_from_name) and passing the depth parameter inside a do/enddo?
    thanks
    Alexandre Giguere

    Alexandre,
    Here is an example. Suppose your internal table is called 'ITEMS'.
    lr_node = lr_document->find_from_name('ITEMS').
    lv_num_of_children = lr_node->num_children( ).
    lr_nodechild = lr_node->get_first_child( ).
    do lv_num_of_children times.
        lv_num_of_attributes = lr_nodechild->num_children( ).
        lr_childchild = lr_nodechild->get_first_child( ).
       do lv_num_of_attributes times.
          lv_value = lr_childchild->get_value( ).
          case sy-index.
             when 1.
               wa_item-field1 = lv_value
             when 2.
               wa_item-field2 = lv_value.
          endcase.
          lr_childchild = lr_childchild->get_next( ).
       enddo.
       append wa_item to lt_item.
       lr_nodechild = lr_nodechild->get_next( ).
    enddo.

  • Need Selection variable name for "System Year - 1"

    Hi All,
    I have Fiscal Year field in the selection screen of a custom program. The value of this field comes from system variable.
    I need to create a variant where this fiscal year should have the value "Current year - 1".
    This has to be done using Selection Variable. Currently there is no such variable in the F4 help (TVARV table).
    Please tell me if there is a way to get such a selection variable...

    Hi Tolga,
    The selection screen parameter is defined as:
    parameters: p_gjahr        type gjahr obligatory memory id gjr,
    I cannot use the FM in the AT SELECTION SCREEN ON VALUE-REQUEST.
    When you create a variant for the program.. click button "Variant Attributes" - Here the checkbox for Selection variable is ticked for this field. Now click "Selection Variables". here we can provide the variable name which comes from TVARV table.
    I need this Selection variable. I am not allowed to do any program changes.

  • XML transformation for internal table

    Hi Experts,
    Here is the sample transformation code which is generated for a transformation I had created.
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
      <tt:root name="ROOT" type="?"/>
      <tt:root name="ZPAYLOAD" type="ddic:ZPAYDATA"/>
      <tt:template>
       <payload-data>
        <record>
         <rec-data>
          <tt:loop ref=".ZPAYLOAD">
            <DATA tt:value-ref = 'DATA'/>
          </tt:loop>
         </rec-data>
        </record>
        </payload-data>
      </tt:template>
    </tt:transform>
    Here I am passing an internal table with only one field which has three lines say 'Line1', 'Line2',' Line3' to the multi-line structure 'DATA' in the transformation.
    when I receive the XML structure from transformation, It looks as like below.
    <payload-data>
    <record>
    <rec-data>
    <DATA>Line1</DATA>
    <DATA>Line2</DATA>
    <DATA>Line3</DATA>
    </payload-data>
    </record>
    </rec-data>
    However I want the XML structure like
    <payload-data>
    <record>
    <rec-data>
    <DATA>
    Line1
    Line2
    Line3
    </DATA>
    </payload-data>
    </record>
    </rec-data>
    Is it possible to receive the XML structure like above in the XML transformation?
    It would be great, if you can provide the solution at the earliest.
    Thanks in Advance.
    Regards
    K Arasu

    Hi kaushik,
    have you found a solution to this problem? I have the same requirement.
    Best regards
    Gregor

  • Extended Program check for internal table

    TYPES:BEGIN OF TY_FINAL,
            VBELN TYPE VBAP-VBELN,
            VBELV TYPE VBAP-VBELV,
            POSNV TYPE VBAP-POSNV,
            WERKS TYPE VBAP-WERKS,
            ZZ_MODEL_NO TYPE VBAP-ZZ_MODEL_NO,
            VKORG TYPE VBAK-VKORG,
            TEXT(70) TYPE C,
          END OF TY_FINAL.
    Declaration of Variables                                            *
    DATA: IT_VBAK  TYPE STANDARD TABLE OF TY_VBAK ,
          IT_VBAP  TYPE STANDARD TABLE OF TY_VBAP ,
          IT_FINAL TYPE STANDARD TABLE OF TY_FINAL WITH HEADER LINE.
    DATA: W_VBAK         TYPE TY_VBAK            ,
          W_VBAP         TYPE TY_VBAP            ,
          W_FINAL        TYPE TY_FINAL           ,
          W_LAYOUT       TYPE SLIS_LAYOUT_ALV    ,
          W_VARIANT_SAVE TYPE C                  ,
          W_REPID        TYPE  SY-REPID          .
    In the above code i have declared IT_FINAL TYPE STANDARD TABLE OF TY_FINAL WITH HEADER LINE. in extended program check iam getting error as( Tables with headers are no longer supported in the OO context.
    can any one plz suggest me to avoid this error.
    Thanks in Advance.
    Moderator message - Duplicate post locked
    Edited by: Rob Burbank on May 19, 2009 9:12 AM

    Hi,
    DATA: IT_VBAK TYPE STANDARD TABLE OF TY_VBAK ,
    IT_VBAP TYPE STANDARD TABLE OF TY_VBAP ,
    " If you declare the internal table with header line in OO context it wll give you error. As OO wil not
    " support the header line concept. Declare Internal table without header line and create the work area
    " for the internal table
    IT_FINAL TYPE STANDARD TABLE OF TY_FINAL. "  WITH HEADER LINE.
    DATA: W_VBAK TYPE TY_VBAK ,
    W_VBAP TYPE TY_VBAP ,
    W_FINAL TYPE TY_FINAL ,                    " Use this work area
    W_LAYOUT TYPE SLIS_LAYOUT_ALV ,
    W_VARIANT_SAVE TYPE C ,
    W_REPID TYPE SY-REPID

  • Difference between Field symbols and work area for Internal tables

    Hi,
    In ECC versions we all know that we need to declare the internal tables without headerline, and for handling the internal tables we need to use exclusive work areas.
    Currently i have an issue that we have been asked to use field symbols instead of work areas...can any one help me how to use the field symbols and also let me know how it will improve the performance of the program..
    Thanks and Regards,
    Kathir

    Hi
    DATA: WA TYPE ITAB.
    LOOP AT ITAB INTO WA.
    IF WA-FIELD = .....
    ENDIF.
    ENDLOOP.[(code]
    FIELD-SYMBOLS <WA> TYPE ANY.
    LOOP AT ITAB ASSIGNING <WA>.
    ENDLOOP.
    Now the problem is you can't know the name of the fields of the table at runtime, so you can't write:
    IF <WA>-FIELD = .....
    ENDIF.
    Anyway you can create a field-symbols strcturated like the table:
    [code]FIELD-SYMBOLS <WA> TYPE ITAB.
    LOOP AT ITAB ASSIGNING <WA>.
      IF <WA>-FIELD = .....
      ENDIF.
    ENDLOOP.
    I don't know which are the differences for the performance between to use a field-symbol and to use a structure as work-area.
    The differnce between the field-symbols and work-area is the field-symbol is assigned directly to the record, so u don't need to do a MODIFY statament to change something:
    LOOP AT ITAB INTO WA.
      WA-FIELD =
      MODIFY ITAB FROM WA.
    ENDLOOP.
    LOOP AT ITAB ASSIGNING <WA>.
      <WA>-FIELD =
    ENDLOOP.
    These two pieces of abap code do the same action, so probably the field-symbol improve the performance because it do an access directly to the record without to use an external structure as workarea.
    Max

  • Sy-tabix for internal table in smartform

    Hi friends,
    How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
    For every record the value of sy-tabix is showing 1 !!
    Advance Thanks
    Aadarsh

    Hi Aadarsh,
    Give ur sy-tabix at the end of the loop.
    loop at itab.
    //table node populations.
    endloop.
    give a seperate loop for this.
    loop at itab.
    sy-tabix.
    endloop
    get the total no and print it after the table.
    If u r using do loop then give sy-index.
    Hope tihs helps u,
    Regards,
    Nagarajan.
    Message was edited by: Nagarajan Kumarappan

Maybe you are looking for