Sum for Dynamic Fields in a Dynamic Table with Field Symbol

Hi All,
I currently have an report which I am looking to update with some totals.  The information is currently output in an ALV which is fed data from a dynamic table defined with a field symbol.  The modification that needs to be applied is a summation per currency code where each of the fields to be summed is a dynamically named field at runtime.  I am now just looking to see if anyone has any recommendations on how to obtain these totals it would be appreciated.  I have no problem doing the leg work in piecing the solution together but am just stuck on which approach I should be investigating here.  I have looked into several options but do to the fact that the totals are for dynamic fields in a dynamic table and it is a field symbol I am having some difficulties thinking of the easiest approach to obtain these totals.
Below is a simple sample of what the report currently looks like and what we are looking to add.
====================================================================================
As-Is Report:
DETAILED DATA ALV
Company Code  |  Plant  |  2006 Total  |  2007 Total  |  2008 Total |  CURRENCY
0001          |   ABCD  |    1,500     |    1,200     |    1,700    |    USD
0001          |   BCDE   |    2,300     |    4,100     |    3,600    |    GBP
0003          |   DBCA  |    3,200     |    1,600     |    6,200    |    USD
Addition 1:
TOTALS PER CURRENCY
Currency                |  2006 Total  |  2007 Total  |  2008 Total |
USD              |    4,700     |    2,800     |    7,900    |
GBP                       |    2,300     |    4,100     |    3,600    |
Addition 2:
CONVERSIONS TO USD
                                      |  2006 Curr   |  2006 USD    |  2008 Curr   |  2006 USD   |
USD                       |  4,700 USD   |  4,700 USD   |  7,900 USD  |  7,900 USD  |
GBP   (1.5GBP/1 USD)    |  2,300 GBP   |  1,150 USD   |  2,300 GBP  |  1,800 USD  |
====================================================================================
Any recommendations will be appreciated.

Hi,
We cannot use the key word SUM in the loop at assigning statement.
The way i see is
When  you are creating the first dynamic internal table , create one more with  the structure below:
Currency | 2006 Total | 2007 Total | 2008 Total |
Then while populating the data into first itab,also move the contents to the second itab using collect statement.

Similar Messages

  • Table with fields containig more thn 300 characters

    Hello Friends,
    i want to create one ZTABLE and intht i want a field tht can store more thn 300 characters.
    i have used string data type for the same but while activating the table its giving me error saying :
    " Table contains more than 3 long string fields"
    Pls suggest...
    Sunny

    hi 
    sunny  ,
                You can create table with field more than 300 characters   but there should be one more field
    which has to be primary key .
    such as
    create table ztest
    in that create field MANDT  type clnt size 3  primary key
    name type String  .
    then change technical settings according to requirement .
    Delivery maintenance 
    delivery class and  Data Browser/Table View M
    according to requirement  .
    Before activating table save technical setting  and then activate .
    Regards
    deepak

  • Dynamic table with field type table

    Hi,
    I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.
    But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".
    How can I declare this in fieldcat?
    The code:
    Creating dynamic table
    DATA: table_agrup TYPE REF TO data,
            line_agrup  TYPE REF TO data.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = t_fieldcat
        IMPORTING
          ep_table                  = table_agrup
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
        ASSIGN table_agrup->* TO .
    Printing ALV
      CALL METHOD obj_grid->set_table_for_first_display
        EXPORTING
          is_variant                    = w_variant
          i_save                        = 'A'
          is_layout                     = w_layout
        CHANGING
          it_outtab                     =
          it_fieldcatalog               = t_fieldcat
          it_sort                       = t_sort
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    Thanks.

    It is not possible with the  METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
    I have tried to do it with the code and I got the dynamic table created after at the end of the program.
    In the code,
    <DYN_TABLE> has same effect as your <table> variable
    <DYN_WA> has same effect as your <HEADER>
    REPORT  ZTEST_NP_DYNAMIC.
    DATA: DY_TABLE TYPE REF TO DATA,
          DY_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    FIELD-SYMBOLS: <FS> TYPE ANY.
    * To generate the Dyanmic table with the COLOR
    DATA: LS_SOURCE TYPE STRING.
    DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
    DATA: L_NAME LIKE SY-REPID.
    DATA: L_MESSAGE(240) TYPE C,
          L_LINE TYPE I,
          L_WORD(72) TYPE C.
    DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
    LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
    APPEND LT_SOURCE.
    * you can add your fields here.....
    LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'I_FS = POINTER.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'ENDFORM. '.
    APPEND LT_SOURCE.
    L_NAME = 'ZTEST_SUBROUTINE_POOL'.
    CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
      GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
               MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
    ENDCATCH.
    IF NOT L_MESSAGE IS INITIAL.
      MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
    ENDIF.
    ASSIGN DY_TABLE TO <FS>.
    PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    * Create dynamic work area and assign to FS
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    Write: 'bye'.
    Regards,
    Naimesh Patel

  • Coding for giving 'find' functionality to a table control field

    hi.
    i want to give find functionality to a table control field.when ever i will select one field & i will enter 'find' icon  one modal screen  comes.when i will  enter one value of that field it will highlight that field in the table control.

    Hi,
    FIND <p> IN [SECTION OFFSET <off> LENGTH <len> OF] <text>
                [IGNORING CASE|RESPECTING CASE]
                [IN BYTE MODE|IN CHARACTER MODE]
                [MATCH OFFSET <o>] [MATCH LENGTH <l>].
    The system searches the field <text> for the pattern <p>. The SECTION OFFSET <off> LENGTH <len> OF addition tells the system to search only from the <off> position in the length <len>. IGNORING CASE or RESPECTING CASE (default) specifies whether the search is to be case-sensitive. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The MATCH OFFSET and MATCH LENGTH additions set the offset of the first occurrence and length of the search string in the fields <p> and <l>.
    Regards,
    Priya.

  • To search for tables with fields

    hey hi!!
    can anybody tell me the name of tables frm dose i can find fields for values of goods rteceived and issued in particular time period and also number of units of goods in that period.
    regards,

    vague...your requirement
    try to search for tables by fields with se16 and table DD03L
    A.

  • Adobe Form - Print page at the end for every record of a Z table with Text

    Hello friends, I am facing a challenging here and I need to develop the following below. Mind you, I don't have much exposure/experience with Adobe Forms
    Scenario: Standard REAL ESTATE Contract Form
    I have a Z table containing RENTAL OBJECTS, in my case 3 records and I want, at the end of the form print one page like below to each record that i have in my Z table.
    "Dear Z-field1 one, regarding your contract for Z-field2, Address Z-field3, blah blah blah"
    In essence, print a page for each one of them at the end, with the text above using the fields from the z table.
    I searched the forum and couldn't find any thing like it.
    If someone can help it would be much appreciated.
    Thanks, Marco

    Hi Marco,
    You must be having the ztable fields in the context or in the data heirarchy of the adobe form.
    Assume that your main form is on the page1.
    Create a table bound to ztable with 3 rows in it and make it invisible on the form.
    Below the form create 3 pages page2, page3 and page4.
    Create a ISR text display and on the initialise event write the code such as:
    this.rawValue = data.page1.Table2.Row1.Cell1.rawValue;
    Create as many ISR texts as you want and initialize it using the above method.
    Page1
    form
    Page2
    Row1 values
    Page3
    Row2 Values
    Page4
    Row3 Values
    Hope this helps.

  • AMDP exporting table with fields from various sources

    I am writing an AMDP that has an output table a list of employees and attributes.  These attributes have various sources with various keys.  If I cannot with any practicality construct this table with a single select statement, which given my search criteria, I probably can't, must I break my output table into multiple output tables that can be created with a single select?
    I declare the structure of output table et_employees in the class as something like
          BEGIN OF ty_employee,
            emp_id(12)    TYPE c,
            emp_name(80)  TYPE c,
            org_unit(8)   TYPE c,
            region(5)     TYPE c,
            country(3)    TYPE c,
            jb_prf_as     TYPE c,
            sol_gr_as     TYPE c,
            snippet(1000) TYPE c,
            score         TYPE integer,
          END  OF ty_employee,
          tt_employes type table of ty_employee.
    As far as I can tell, I cannot do an update et_employees in the method to modify individual fields.  I can only do the select statement.
    I see my choices as
    elaborate select statement that I may or may not be able to construct (haven't thought this through but it may be doable)
    more than one output table
    create multiple local tables and then do a join on them for the output table.
    I am seeing the last one as my best option.
    To throw in an unrelated issue, AMDP procedure cannot seem to cope with a table that begins with a slash, e.g., /MRSS/D_SQP_ESTR.  The USING statement is o.k. but any access in a select or inner join gets an error.

    Hi Deborah,
    let me do some assumptions on your problem and then try to help you:
    Assumption A: You only like to query data from tables, which, I simply assume, are available in the ABAP data dictionary. In this case, I don't think there is a performance gain with AMDPs compared to OpenSQL, so just use OpenSQL and do joins on the relevant tables, leading to exaclty one resultset in the output.
    Assumption B: You need the AMDP because you have a good reason and you like to query data from tables employee_source_a and employee_source_b for your resultset. In case yes, you can e.g. use  "temporary" tables (don't declare them explicitly), e.g. use the construct like:
    lt_employee_source_a =  select ...from employee_source_a ...;
    lt_employee_source_b = select ... from employee _source_b...;
    et_employee = select ... from :lt_employee_source_a ... (inner/left outer) join lt_employee_source_b on...;
    Or you could use the CE_JOIN function if that suits your SQLScript development better.
    To elaborate a query statement for et_employee for without the lt_xxx tables is hard to say from your question - it should be posible if there are no nasty aggregations/calculations which prevent it :-).
    There's no need to use two resultsets in the output in case that's not what you need in the application.
    The option to have several resultsets is rather a feature of DB Procedures, which allow for several resultsets while a view/OpenSQL query can only give you one resultset.
    Conclusion: You answered your question yourself, the last option seems to be the best option :-).
    Concerning the "slash issue": Guessing around I'd propose to use quote the table name like "/MRSS/D_SQP_ESTR"... but just a guess. Could you please post the error message or open a second discussion on the issue?
    Cheers,
      Jasmin

  • How to create an internal table with fields from different sources

    Hi.
    I need to create an internal table where some of the fields are from a database table, and the other fields are user specified. How do i do that?
    Example:
    DB table ZTAB with fields ZTAB-FIELD1, ZTAB-FIELD2.
    I want to create an internal table ITAB with the fields ZTAB-FIELD1, ZTAB-FIELD2 from ZTAB. In addition, I also want to have one more field RECORD_NO, which is not from ZTAB. How do I do it? Could I do something like below?
    DATA BEGIN OF ITAB.
            INCLUDE STRUCTURE ZTAB.
    DATA RECORD_NO TYPE I.
    DATA END OF UPLINE.
    Or, are there more efficient way of doing it? Thanks.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • Where's the metadata for STORE IN clause of a table with partition?

    Hi Experts,
    I created a table with a range-interval partition with STORE IN clause. It's definition:
    CREATE TABLE interval_part (
    person_id NUMBER(5) NOT NULL,
    first_name VARCHAR2(30),
    last_name VARCHAR2(30))
    PARTITION BY RANGE (person_id)
    INTERVAL (100) STORE IN (TSP_1, TSP_2, TSP_3) (
    PARTITION p1 VALUES LESS THAN (101))
    TABLESPACE TSP_1;
    I can not find the metadata for STORE IN clause in ALL_TAB_PARTITIONS, ALL_TABLES. Where is the metadata for the STORE IN clause? How can I find the tablespace list (TSP_1, TSP_2, TSP_3)?
    Thanks,
    David

    DBMS_METADATA.GET_DDL returns the definition of the table. But I just need the value of the tablespace list, for example, TSP_1, TSP_2, TSP_3. Is there any view which stored the value?
    Thanks,
    David

  • Create Internal table with fields coming as query result of multiple tables

    Hi
    I want to create internal table with the fileds which come as a result of a select query from multiple tables

    My code is something like this. I need  the data from various fields of diff tables depending on the excel file. This data is then to be put in a internal table
    *& Report  Z_EXTC
    report  z_extc.
    type-pools : abap.
    parameter: objname(25) type c.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    data: p_table type string.
    data:l_string type string,
         l_filename(200) type c,
         dy_line  type ref to data,
         xfc type lvc_s_fcat,
         ifc type lvc_t_fcat.
    types:begin of itab,
         tabname type dd03l-tabname,
         fieldname type dd03l-fieldname,
         end of itab.
    types:begin of atab,
          tabname type dd03l-tabname,
          cnt type string,
          end of atab.
    field-symbols: <dyn_table> type table,
                   <dyn_table1> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
          dy_table1 type ref to data.
    data: itab1 type itab occurs 0 with header line.
    data atab1 type atab occurs 0 with header line.
    data frstrec type i value 0.
    data lastrec type i value 0.
    l_string = ''.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'C:\excel_files\FIELDS_CC.TXT'
       filetype                      = 'TXT'
       has_field_separator           = 'X'       .
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    *Refresh itab1.
    loop at itab1.
      on change of: itab1-tabname.
        if lastrec = 1.
          move l_string to atab1-cnt.
       move itab1-tabname to atab1-tabname.
          append atab1.
          l_string = ''.
        endif.
        move itab1-tabname to atab1-tabname.
        frstrec = 1.
      endon.
      if frstrec = 1.
        concatenate l_string itab1-fieldname into l_string separated by
    space.
        lastrec = 1.
      endif.
    *write:/ itab1-tabname,40 itab1-fieldname.
    endloop.
    move l_string to atab1-cnt.
    append atab1.
    loop at atab1.
      write:/ atab1-tabname,5 atab1-cnt.
    endloop.

  • Dynamic Internal table with field symbol

    I made the report where the user enters two different tables and two fields that are to be compared.
    Eg. If I enter (MARA & NAME1) and (MARC & NAME2) , I wish to compare all the entries of Mara-name1 against all entries in Marc-name2.
    <u>The code I need to write is:</u>
    DATA:
      gdo_data      TYPE REF TO data.
    DATA:
      gdo_data1      TYPE REF TO data.
    FIELD-SYMBOLS:
      <gt_itab>     TYPE table,
        <wa> LIKE <gt_itab>,                        "<gt_itab>,
      <gs_entry>    TYPE ANY.
    FIELD-SYMBOLS:
      <gt_itab1>     TYPE table,
        <wa1> LIKE <gt_itab>,                        "<gt_itab>,
      <gs_entry1>    TYPE ANY.
    PARAMETERS:
      p_table    TYPE tabname,            "    DEFAULT 'KNA1',
      p_fld      TYPE fieldname.          "  DEFAULT 'KUNNR'.
    PARAMETERS:
      p_table1    TYPE tabname,            "    DEFAULT 'KNA1',
      p_fld1      TYPE fieldname.
    DATA: var TYPE fieldname.
    var = p_fld.
    DATA: var1 TYPE fieldname.
    var1 = p_fld1.
    START-OF-SELECTION.
      CREATE DATA gdo_data TYPE TABLE OF (p_table).
      ASSIGN gdo_data->* TO <gt_itab>.
      CREATE DATA gdo_data1 TYPE TABLE OF (p_table1).
      ASSIGN gdo_data1->* TO <gt_itab1>.
      SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
      SELECT * FROM (p_table1) INTO CORRESPONDING FIELDS OF TABLE <gt_itab1>.
    <b>  LOOP AT <gt_itab> ASSIGNING <gs_entry>.
        READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
             WITH KEY (var1) = <gt_itab>-(var).
        IF sy-subrc EQ 0.
          MESSAGE 'Success' TYPE 'S'.
        ENDIF.
      ENDLOOP.</b>
    END-OF-SELECTION.
    But the portion in bold is creating error: <b><gt_itab> is a table without a header lineand therefore has no component called "".</b>
    please help.

    Hi Amit
    Try like this
    LOOP AT <gt_itab> ASSIGNING <gs_entry>.
    READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
    WITH KEY (var1) = <b><gs_entry></b>-(var).
    IF sy-subrc EQ 0.
    MESSAGE 'Success' TYPE 'S'.
    ENDIF.
    ENDLOOP.
    Regards,
    Atish

  • Dynamically inserting in an internal table with expansion & collapse.

    I have an Internal table wherein I have implemented Expansion and collapse. Now I want to sort this table dynamically everytime a new Child node is added to a Father Node. How do I sort it so that the Child nodes are inserted correctly under their corresponding Father Nodes?
    I tried using Indexing concept , e.g., insert <structure> into <itab> index lv_ind.
    lv_ind = sy-tabix + lines( itab ).
    For the First Father Node, the Child nodes are inserted in the correct position but when the Second Father Node is reached( say in position 12 ), then lv_ind gets a wrong value... The Child node should now be inserted in the 13th position but its inserted in lv_ind = sy-tabix + lines( itab ) = 12 + 12 = 24th position.
    Please let me know how to go about.
    Thanks and regards,
    Sukanya.

    Why can u sort the internal table once insertions are completed.
    SortITAB by Fathernode Childnode.

  • Create values for analogous periods in the same table with DS

    Hi,
    in the course of a pilot we want to create additional columns with data for analogous periods.
    We have values for a month and need to create new columns for values for last month and last year in order to compare.
    Attached youu2019ll find a few sample rows resembling the basic concept of what we have
    Region     Country     Year     Month     Value
    Europe     Spain     2009     1     285
    Europe     Spain     2009     2     129
    Europe     Spain     2009     3     153
    Europe     Spain     2008     1     288
    Europe     Spain     2008     2     284
    Europe     Spain     2008     3     125
    Europe     France     2009     1     135
    Europe     France     2009     2     125
    Europe     France     2009     3     284
    Europe     France     2008     1     208
    Europe     France     2008     2     221
    Europe     France     2008     3     220
    In this case, new columns would be
    LastMonth (125 for Spain month 1 year 2009, since this is the value for month 3 year 2008)
    LastYear (288 for Spain month 1 year 2009, since this is the value for month 1 year 2008).
    Can you help on what function to use in the DS query transformation?
    thanks everybody, and enjoy!

    Hi David,
    Probably the easiest way of resolving this would be to add extra columns which show the projected date each row should be shown on e.g.
    Region     Country     Year     Month     Value     LM_Year     LM_Month     LY_Year     LY_Month
    Europe     France     2008     1     208     2008     2     2009     1
    Europe     France     2008     2     221     2008     3     2009     2
    Europe     France     2008     3     220     2008     4     2009     3
    Europe     France     2009     1     135     2009     2     2010     1
    Europe     France     2009     2     125     2009     3     2010     2
    Europe     France     2009     3     284     2009     4     2010     3
    This would be written to a staging table then used as a source with the original source file to produce the target table. I've illustrated an example of how this could be achieved below:
    Create two dataflows; DF 1 and 2.
    In DF 1 read source, add additional columns to show the date (year, month, etc) this should be projected as. This would need to be done for both the last month and last year. Load staging table.
    In DF 2 Read the source and outer join to the new staging table twice. Use the region, Country, Year, Month, to join and use the new additional projected date columns. Ensure the last month date fields are used on one staging table and last year date fields are used on the next staging table. The value from the two staging tables is then used in the last month and last year value.
    Load into target table.
    To calculate the projected date columns you would probably want to format the source fields into a date then add the required number of months. e.g. to_date('01' || month || year, 'DDMMYYYY') + 12
    Obviously this would need the stage table to be truncated before each load and you would need to assess your load strategy. When doing these calculated fields if you have any retrospective updates on the source then these would then need recalculating, therefore this assumes it's a complete reload each time.
    Edited by: Richard Saltern on Jul 16, 2010 2:01 PM
    Edited by: Richard Saltern on Jul 19, 2010 10:10 AM

  • Uploading excel file into internal table with field length more than 255

    I am trying to upload the data from an excel file through function module 'TEXT_CONVERT_XLS_TO_SAP'.
    I have tested by changing the field type from string, and char2000.
    But it is accepting only 255 chars from the cell content.
    How to get the total content of the field if it is more than 255 char.

    hi,
      you can use any of the following procedures:
    For uploading data from excel to internal table refer standard report  RC1TCG3Z  in se38 :
                                               or
    You can use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' itself. Please check if you have done it this way . But,  this FM can be a little time consuming if the excel has large data, so you can use the FM u2018GUI_UPLOADu2019.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
            EXPORTING
              filename                = p_file1
              i_begin_col          = l_b1
              i_begin_row        = l_c1
             i_end_col               = l_b2
             i_end_row             = l_c2
           TABLES
              intern                  = lt_data
            EXCEPTIONS
             inconsistent_parameters = 1
            upload_ole              = 2
              OTHERS                  = 3.
          IF sy-subrc <> 0.
            MESSAGE e018 DISPLAY LIKE 'i'.
         ENDIF.
    *---Removing the first heading fields from the file.
          IF NOT lt_data[] IS INITIAL.
            LOOP AT lt_data INTO lwa_data WHERE row = '0001'.
              DELETE lt_data.
              CLEAR lwa_data.
            ENDLOOP.
    *---Inserting the data from file the internal table
            LOOP AT lt_data INTO lwa_data.
              CASE lwa_data-col.
                WHEN 1.
                  wa_file_wicopa-serial = lwa_data-value.
                WHEN 2.
                  wa_file_wicopa-blart = lwa_data-value.
                WHEN 3.
                  wa_file_wicopa-bldat = lwa_data-value.
                WHEN 4.
                  wa_file_wicopa-budat = lwa_data-value.
              ENDCASE.
              AT END OF row.
                APPEND wa_file_wicopa TO gt_file_wicopa.
                CLEAR wa_file_wicopa.
              ENDAT.
              CLEAR lwa_data.
            ENDLOOP.
          ENDIF.
        ENDIF.
                                                or
    DATA: it_test TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE.
    DATA :v_start_col TYPE i VALUE '1',
          v_start_row TYPE i VALUE '1',
          v_end_col TYPE i VALUE '256',
          v_end_row TYPE i VALUE '65536',
          v_text TYPE repti.
    * Funtion Module to upload values from excel to the Internal table
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = v_start_col
          i_begin_row             = v_start_row
          i_end_col               = v_end_col
          i_end_row               = v_end_row
        TABLES
          intern                  = it_test
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
                             Or
    You can use FM u201CTEXT_CONVERT_XLS_TO_SAPu201D.
    DATA : i_raw TYPE truxs_t_text_data.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator          = 'X'
          i_tab_raw_data             = i_raw
          i_filename                 = p_path
        TABLES
          i_tab_converted_data       = itab
    EXCEPTIONS
       conversion_failed          = 1
       OTHERS                     = 2
    hope it will help u
    regards
    rahul

  • Transport table entries directly from table with field added from append S

    Hi
        Guys, I have changes one standard table , I mean I use append structure and add a new field in to that . As this is T*  ( text table ) , it also V ( view ) but as I change the field in T* table . I went in to table and maintain entries  directly into table . After that I go to menu and select all the entries and as I want to push it to my test client . I create the entries and then I transport it to test . When I saw the table that entries were missing. Then I saw my existing transport in SE10 & SE09 and I notice it just transport the Keys fields content and its not transporting the new field content which I add as append structure .
    Do you guys have any idea .how to transport those entries?
    Cheers
    Usman

    It’ll behave in the same way , even you give "*" in your transport . Do one thing go to table, double click on your structure and once you’re in structure <b>Go to->Extras->Enhancement category
    And select radio button “1” or ‘2” and try again …</b>                  
    Hope this’ll give you idea!!
    <b>Pl... award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

Maybe you are looking for