Dynamic column Headers without field symbols

Hi All,
how to create a dynamic column header(Not a Dynamic Column with Hard Coded One) with Internal Tables
(Not with Field Symbols as i can find some programs with field symbols  during search) .
Please Provide an example wih some piece of sample code .
Any Help would be appreciated.
Thanks & regards,
Ravi S.

You will have to use dynamic programming techniques for the same, there is no other way around I can think of.
You will find Rich's Blog quite helpful,
[Dynamic Internal Table|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID1759109750DB10206591421434314571End?blog=/pub/wlg/2071]
If you haven't used field symbols before, just do it this time, they are very helpful for dynamic programming.
Thanks,
Aabhas

Similar Messages

  • Create Dynamic Structure based on Field-Symbol

    Hi Experts!!
    I need to create a structure with dynamic structure included within.
    I have a parameter on sel. screen in which we provide table name.
    PARAMETERS: p_table TYPE tabname.
    FIELD-SYMBOLS: <gt_data> TYPE ANY TABLE.
    CREATE DATA gr_data TYPE TABLE OF (p_table).
    ASSIGN gr_data-* TO <gt_data>.
    Now I need a structure like below:
    TYPES: BEGIN OF type_test,
    struct TYPE <gt_data>, " dynamic structure based on table name entered on sel. screen
    fld1 TYPE c,
    fld2 TYPE n,
    END OF type_test.
    Can somebody suggest how to achieve this?
    Your help is highly appreciated. Thanks a lot

    You can view this thread where our friend Marcin rocks .. Dynamically create a type
    FIELD-SYMBOLS: <gt_data> TYPE ANY TABLE.
    FIELD-SYMBOLS: <gs_wa> TYPE ANY.
    data:wf_ref type ref to data.
    DATA:i_comp TYPE cl_abap_structdescr=>component_table,
         i_tot_comp TYPE cl_abap_structdescr=>component_table.
    CREATE DATA gr_data TYPE TABLE OF (p_table).
    ASSIGN gr_data-* TO <gt_data>.
    create data wf_ref like line of <gt_data>.
    assign wf_ref->* to <gs_wa>.
    *--Getting Compoents from existing type
      lf_struct ?= cl_abap_typedescr=>describe_by_name( '<GS_WA>' ).
      i_comp = lf_struct->get_components( ).
      APPEND LINES OF i_comp TO i_tot_comp.
    The idea is Get all the field details available it to i_tot_comp, then append individual fields manually to
    i_tot_comp as explained in the link and create a dynamic structure and table.

  • Dynamic Work Area and field symbol

    Hi All,
    I'm have a big internal table like this
    data: begin of data occurs 0,
    Field01,
    Field02,
    Field03,
    *bucket 1
    Field04,
    Field05,
    Field06,
    *bucket 2
    Field04,
    Field05,
    Field06,
    *bucket 3
    Field04,
    Field05,
    Field06,
    Field 1, 2 3 will be the same for pernr, first last name.
    Field 4, 5, 6 are the same format but different numbers (or values ) in different buckets.
    Each bucket can be shown (or not) based on the condition of a person, for example if that person live in 2 states, it will show 2 bucket with 2 address info inside each.
    I will run this under get pernr to sort out each person who have many address or not.
    Can I use dynamic work area and field symbol here? if I can, how?
    Really appreciate your help with points...

    You can use the ASSIGN COMPONENT ... and than APPEND the work area to the table.
    Check out this sample program:
    REPORT  ZTEST_NP.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1    TYPE I,
          F2    TYPE I,
          F3    TYPE I,
          END   OF ITAB.
    DATA: WA_ITAB LIKE ITAB.
    DATA: L_CNT TYPE I.
    FIELD-SYMBOLS: <F_FLD> TYPE ANY.
    DO 10 TIMES.    " I want 10 reocrds
      CLEAR L_CNT.
      DO 3 TIMES.   " I have 3 fields
        L_CNT = L_CNT + 1.
        ASSIGN COMPONENT L_CNT OF STRUCTURE WA_ITAB TO <F_FLD>.
        <F_FLD> = L_CNT.
      ENDDO.
      APPEND WA_ITAB TO ITAB.
      CLEAR  ITAB.
    ENDDO.
    LOOP AT ITAB INTO WA_ITAB.
      WRITE: / WA_ITAB-F1,
               WA_ITAB-F2,
               WA_ITAB-F3.
    ENDLOOP.
    Regards,
    Naimesh Patel

  • Creating dynamic internal table(Not field symbol table)

    Hi Experts,
    I am facing problem creating Intarnal table
    I have fieldcatalog, I want create dynamic internal table(Not field symbol table).
    I have written----
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
         it_fieldcatalog           = it_fldcat
          it_fieldcatalog           = me->gt_fieldcat
       i_length_in_byte          =
        IMPORTING
          ep_table                  = lt_new_table
       e_style_fname             =
        EXCEPTIONS
         generate_subpool_dir_full = 1
         OTHERS                    = 2.
        ASSIGN lt_new_table->* TO <gt_dyn_repdata>.
        CREATE DATA ls_new_line LIKE LINE OF <gt_dyn_repdata>.
        ASSIGN ls_new_line->* TO <gs_dyn_repdata>.
    above logic creating dynamic field symbol table.... But I want create normal internal table.
    Thanks,
    Rajasekhar

    Hi
    What do you mean?
    It needs to use the field-symbol, this is the price to pay if it wants a dynamic object
    Max

  • How to move a dynamic variable to a FIELD-SYMBOL

    Hello:
    i would like to ask a favor i have been trying to move a dynamic variable to a FIELD-SYMBOL but, when i compile the programm it send a error message that say 'error with assign'.
    The FS is declared like this
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE, <dyn_wa>.
    and then there is a PERFORM that send a dynamic varible and then this variable is asigned to the <dyn_table> and after of this one variable is created like this CREATE DATA wa_dynamic LIKE LINE OF <dyn_table>.
    and finalilly there is a sentences where i trying to send the wa_dynamic to the <dyn_wa>.
    here is where the error appear.
    if you have any tips for this problem i will appreciate.
    thanks a lot
    Definition of FS
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE, <dyn_wa>.
    PERFORM
    Create dynamic internal table and Assign it to Field Symbol
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = it_dynamic.
      ASSIGN it_dynamic->* TO <dyn_table>.
    Create dynamic work area and assign to FS
    CREATE DATA wa_dynamic LIKE LINE OF <dyn_table>.
    ASSIGN wa_dynamic->* TO <dyn_wa>. "HERE IS THE PROBLEM

    How is wa_dynamic defined?
    data: wa_dynamic type ref to data.
    Regards,
    Rich Heilman

  • How to fill Dynamic work area or field symbol?

    HI All,
    I have created dynamic work area(field symbol) by using following code. Now I want to fill the work area with values which are there in other internal table.
    * Create dynamic internal table/structure
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = it_fieldcat
        importing
          ep_table        = dyn_table.
      assign dyn_table->* to <fs_table>.
    * Create dynamic work area and assign to Field Symbol
      create data dyn_line like line of <fs_table>.
      assign dyn_line->* to <fs_wa>.
    My <FS_WA> contains:
    ROW1
    ROW2
    ROW3
    ROW4 as fields in it without having any data.
    I have other internal table.. where I have FIELDS and Data like following:
    FIELD1  FIELD2   FIELD3
    ID1 ROW1 A1
    ID1 ROW2 A2
    ID1 ROW3 A3
    ID1 ROW4 A4
    ID2 ROW1 B1
    ID2 ROW2 B2
    ID2 ROW3 B3
    ID3 ROW1 C4
    Important thing that I have to share with you is... Source table of my Internal table and Source structure to create my dynamic table are same.
    This dynamic table has fields... with "FIELD2" values.
    Thanks,
    Naveen.I

    Create a dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_fcat
        IMPORTING
          ep_table        = lt_dy_table.
    Create dynamic work area and assign to FS
      ASSIGN lt_dy_table->* TO <fs_dyn_table>.
      CREATE DATA lt_dy_line LIKE LINE OF <fs_dyn_table>.
      ASSIGN lt_dy_line->* TO <fs_dyn_wa>.
    Define WA
      CREATE DATA dref TYPE (iv_struc_name).
      ASSIGN dref->* TO <fs_final>.
    Populate dynamic table from the file
      OPEN DATASET iv_path FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          READ DATASET iv_path INTO ls_str.
          IF sy-subrc <> 0.
            ev_failed = abap_true.
            EXIT.
          ENDIF.
          SPLIT ls_str AT ';' INTO TABLE lt_dyn_tab.  " columns
          LOOP AT lt_dyn_tab INTO ls_dyn_tab.
            READ TABLE lt_struc_fld INTO ls_struc_fld INDEX sy-tabix.
            IF sy-subrc EQ 0.
              MOVE ls_struc_fld-fieldname TO ls_fieldname.
              ASSIGN COMPONENT ls_fieldname OF STRUCTURE <fs_dyn_wa> TO <fs_val>.
              IF sy-subrc = 0.
                <fs_val> = ls_dyn_tab.
              ENDIF.
              ASSIGN COMPONENT ls_fieldname OF STRUCTURE <fs_final> TO <fs_val>.
              IF sy-subrc = 0.
                <fs_val> = ls_dyn_tab.
              ENDIF.
            ENDIF.
          ENDLOOP.
          APPEND <fs_dyn_wa> TO <fs_dyn_table>.
          APPEND <fs_final> TO et_table.
          UNASSIGN: <fs_val>.
        ENDDO.
      ENDIF.
      CLOSE DATASET iv_path.

  • How to pass dynamic name to a field-symbol?

    Hi All,
    I have a requirement like I need to create dynamic internal table with dynamic name. Say like,
    Create a new Table
       CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
         it_fieldcatalog = it_fieldcat_fin[]
        IMPORTING
         ep_table        = new_table.
        IF sy-subrc EQ 0.
    Create a new Line with the same structure of the table.
         ASSIGN new_table->* to <b>(<fs_table>)</b>.
    In the above code, (<fs_table>) is a variable. Actually it is in the loop, so that first time it comes, it has to create an internal table with name as <fs_01>, next time <fs_02> and so on. Hope I am clear.
    Please help me. I am sure that i will mark the helpful answers.

    DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
    FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
    *&      Form  DYNAMIC_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM DYNAMIC_TABLE.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVCFIELDCAT
        IMPORTING
          EP_TABLE        = DREF.
      ASSIGN dref->*  TO <TEMP_TAB>.
    ENDFORM.                    " DYNAMIC_TABLE
    the above is the procedure to create dynamic internal tables.
    now <TEMP_TAB> points to the contents of the table table in DREF.
    field symbol it self is meant for dynamic.
    then y r u using (<fs_table>).
    when everytime the same fieldsymbol is pointing to new contents, y u need new name everytime?
    i mean as the data is not static, so what is the use of naming a field symbol every time?.
    if u want to store the data in an internal table with a name,
    then u can do like below,
    data: tabname type string, i type i.
    concatenate '<fs_' i into tabname.
    "let i be the variable which stores the internal tables count
    "MOVE <temp_tab> to tabname.

  • 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

  • Dynamic internal  tables using field symbols

    Hello,
    Is it possible to create a dynamic table where the no of fields in the internal table can be created dynamically(using field symbols).
    Say sometimes internal tables with 10 fields and depending upon the requirement the fields can be dynamically increased or decreased in runtime.
    Thanks.

    Hi,
    Go through the following code....
    *Data definitions
    *** Tables
    data: lt_data type ref to data.
    data: lt_fieldcatalog type lvc_t_fcat.
    *** Structure
    data: ls_fieldcatalog type lvc_s_fcat.
    *** Data References
    data: new_line type ref to data,
          fs_data type ref to data.
    *** Field Symbols
    field-symbols: <fs_data> type ref to data,
                   <fs_1> type any table,
                   <fs_2>,
                   <fs_3>.
    *Populating the internal table with fieldnames required for our dynamic
    *internal table
    ls_fieldcatalog-fieldname = 'MANDT'.
    append ls_fieldcatalog to lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CARRID'. "Fieldname
    ls_fieldcatalog-inttype = 'C'. "Internal Type C-> Character
    append ls_fieldcatalog to lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CONNID'.
    ls_fieldcatalog-inttype = 'N'.
    append ls_fieldcatalog to lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'FLDATE'.
    ls_fieldcatalog-inttype = 'D'.
    append ls_fieldcatalog to lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'PRICE'.
    ls_fieldcatalog-inttype = 'P'.
    append ls_fieldcatalog to lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CURRENCY'.
    ls_fieldcatalog-inttype = 'C'.
    append ls_fieldcatalog to lt_fieldcatalog.
    *Calling the method CREATE_DYNAMIC_TABLE
    call method cl_alv_table_create=>create_dynamic_table
         exporting
           it_fieldcatalog = lt_fieldcatalog
         importing
           ep_table = fs_data
         exceptions
           generate_subpool_dir_full = 1
           others = 2
    if sy-subrc <> 0.
    endif.
    *Assigning Field-Symbol to our dynamic internal table
    assign lt_data to <fs_data>.
    *Internal Table is ready, now to put data in that table
    *** So <FS_1> now points to our dynamic internal table.
    assign fs_data->* to <fs_1>.
    *** Next step is to create a work area for our dynamic internal table.
    create data new_line like line of <fs_1>.
    *** A field-symbol to access that work area
    assign new_line->*  to <fs_2>.
    *** And to put the data in the internal table
    select
          mandt
          carrid
          connid
          fldate
          price
          currency
                  from sflight
                  into corresponding fields of table <fs_1>.
    *** Access contents of internal table
    loop at <fs_1> assigning <fs_2>.
    do 5 times.
    assign component sy-index of structure <fs_2> to <fs_3>.
    write:  <fs_3>.
    enddo.
    skip 1.
    endloop.
    top-of-page.
    write:/5 'FUJITSU CONSULTING COMPANY' inverse color 6,
           50 sy-datum inverse color 6,
           70 sy-pagno inverse color 6.
    uline.
    <REMOVED BY MODERATOR>
    Vijay C
    Code Formatted by: Alvaro Tejada Galindo on Apr 14, 2008 1:47 PM

  • Adding dynamically columns to array field

    hello..
    I am trying to create a window class with an ArrayField. The number of
    DataField s in the ArrayField s are known at run time.
    I created an nonWindow class (say Row )with an attribute FirstCol of type
    Textdata.
    I created a window class and using the window editor i created a datafield
    with
    name FirstCol which matches with the row class attribute.
    I made datafield into an arrayfield with properties, name = arfield and
    type = array of Row
    I created a datafield and named to TemplateField (used as a template for
    adding
    columns )
    On click of a button,I am able to add any number of DataField at run time
    to the ArrayField by any of the following two ways successfully.
    1) <TemplateField>.Parent = <arfield>;
    2)<arfield>.AddColumn(2,<TemplateField>);
    But i am failing both in adding data pragmatically to the added column and
    retrive data from the newly added field even after the field by the folling
    way
    <arfield>.children[2].Name='Column2';
    U can assume that all fields that are going to be added at run time are used
    to store string data.
    Please inform me if any one knows about this.
    Waiting for responance..
    Ramesh kumar reddy
    [email protected]
    PSI Data Syatems Ltd,
    Bangalore,
    INDIA.

    hello..
    I am trying to create a window class with an ArrayField. The number of
    DataField s in the ArrayField s are known at run time.
    I created an nonWindow class (say Row )with an attribute FirstCol of type
    Textdata.
    I created a window class and using the window editor i created a datafield
    with
    name FirstCol which matches with the row class attribute.
    I made datafield into an arrayfield with properties, name = arfield and
    type = array of Row
    I created a datafield and named to TemplateField (used as a template for
    adding
    columns )
    On click of a button,I am able to add any number of DataField at run time
    to the ArrayField by any of the following two ways successfully.
    1) <TemplateField>.Parent = <arfield>;
    2)<arfield>.AddColumn(2,<TemplateField>);
    But i am failing both in adding data pragmatically to the added column and
    retrive data from the newly added field even after the field by the folling
    way
    <arfield>.children[2].Name='Column2';
    U can assume that all fields that are going to be added at run time are used
    to store string data.
    Please inform me if any one knows about this.
    Waiting for responance..
    Ramesh kumar reddy
    [email protected]
    PSI Data Syatems Ltd,
    Bangalore,
    INDIA.

  • Populate data into the dynamic table ie using field symbols

    Dear All,
    I need to convert the XML data into internal table. I did this using the guidelines in the forum. Using all those i can get my data
    in the format of
    Cname Cvalue
    id          1
    name    XX
    id          2
    name    YY
    But i need the values in the format of int_tab like,
    ID      Name
    1       XX
    2       YY
    I used the below code to create the dynamic table strucure.
    call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
    assign dy_table->* to <itab>.
    * Create dynamic work area and assign to FS
      create data dy_line like line of <itab>.
      assign dy_line->* to <wa>.
    So now my strucure will be like ID Name.
    I strucked in the place of populating the data into this like 1,XX,2,YY into the dynamic table.
    If you come across with this scenario, can anyone suggest me on this.
    Regards,
    Anita Vizhi Arasi B

    Hi Anita,
    Try to understand below given code. It works same as you want. But I used Function module not any method.
    TYPES: BEGIN OF ty_xml,
              raw(255) TYPE x,
             END OF ty_xml.
      DATA: lv_file_name TYPE                   rlgrap-filename,
            lit_hdr      TYPE TABLE OF          ty_hdr,
            ls_hdr       TYPE                   ty_hdr,
            lv_file      TYPE                   string,
            wa_xml       TYPE                   ty_xml,
            lit_xml      TYPE STANDARD TABLE OF ty_xml,
            lv_filename  TYPE                   string ,
            ls_xmldata   TYPE                   xstring ,
            lit_result   TYPE STANDARD TABLE OF smum_xmltb,
            ls_result    TYPE                   smum_xmltb,
            lit_return   TYPE STANDARD TABLE OF bapiret2,
            lv_size      TYPE                   i,
            lv_count     TYPE                   i.
      CONSTANTS: line_size TYPE i VALUE 255.
      REFRESH lit_hdr.
    *~ File selected from Local System
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = syst-repid
          dynpro_number = syst-dynnr
        CHANGING
          file_name     = lv_file_name
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      lv_file = lv_file_name.
    *~ Upload for Data Provider
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = lv_file
          filetype            = 'BIN'
          has_field_separator = ' '
          header_length       = 0
        IMPORTING
          filelength          = lv_size
        TABLES
          data_tab            = lit_xml
        EXCEPTIONS
          OTHERS              = 1.
    *~ Convert from Binary to String
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = lv_size
        IMPORTING
          buffer       = ls_xmldata
        TABLES
          binary_tab   = lit_xml
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
    *~ Parse XML docment into a table structure
      CALL FUNCTION 'SMUM_XML_PARSE'
        EXPORTING
          xml_input = ls_xmldata                  " Buffered data
        TABLES
          xml_table = lit_result                  " final internal table which contain records
          return    = lit_return.
      LOOP AT lit_result INTO ls_result.
        IF ls_result-hier = '3'.
          IF ls_result-type = 'V'.
            CASE ls_result-cname.
              WHEN 'intno'.                       "Internal Number
                ls_hdr-intno = ls_result-cvalue.
              WHEN 'acode'.                       "Article Code
                ls_hdr-matnr = ls_result-cvalue.
              WHEN 'adesc'.                       "Article Description
                ls_hdr-maktx = ls_result-cvalue.
              WHEN 'idesc'.                       "Item Description
                ls_hdr-itmds = ls_result-cvalue.
              WHEN 'sdesc'.                       "Standard Description
                ls_hdr-stdds = ls_result-cvalue.
              WHEN 'at'.                          "Article Type
                ls_hdr-mtart = ls_result-cvalue.
              WHEN 'mc'.                          "Merchandise Category
                ls_hdr-matkl = ls_result-cvalue.
              WHEN 'cp'.                          "Characteristic Profile
                ls_hdr-charp = ls_result-cvalue.
                CONDENSE ls_hdr-charp.
              WHEN 'c1'.
                ls_hdr-col01 = ls_result-cvalue.
              WHEN 'c2'.
                ls_hdr-col02 = ls_result-cvalue.
              WHEN 'c3'.
                ls_hdr-col03 = ls_result-cvalue.
              WHEN 'c4'.
                ls_hdr-col04 = ls_result-cvalue.
              WHEN 'c5'.
                ls_hdr-col05 = ls_result-cvalue.
              WHEN 'c6'.
                ls_hdr-col06 = ls_result-cvalue.
              WHEN 'tc'.                          "Tax Classification
                ls_hdr-taklv = ls_result-cvalue.
              WHEN 's'.                           "Season
                ls_hdr-saiso = ls_result-cvalue.
              WHEN 'sy'.                          "Season Year
                ls_hdr-saisj = ls_result-cvalue.
              WHEN 'fg'.                          "Fashion Grade
                ls_hdr-fashg = ls_result-cvalue.
              WHEN 'rm'.                          "Reference Material
                ls_hdr-rfmat = ls_result-cvalue.
              WHEN 'fcv'.                         "Free Character Value
                ls_hdr-frecv = ls_result-cvalue.
              WHEN 'uom'.                         "Unit of Measure
                ls_hdr-uom = ls_result-cvalue.
              WHEN 'pou'.                         "PO Unit
                ls_hdr-pount = ls_result-cvalue.
              WHEN 'v'.                           "Vendor
                ls_hdr-lifnr = ls_result-cvalue.
              WHEN 'b'.                           "Vendor
                ls_hdr-brand = ls_result-cvalue.
              WHEN 'pg'.                          "Purchasing Group
                ls_hdr-wekgr = ls_result-cvalue.
              WHEN 'rv'.                          "Regular Vendor
                ls_hdr-rlifn = ls_result-cvalue.
              WHEN 'pp'.                          "Pricing Profile
                ls_hdr-sprof = ls_result-cvalue.
              WHEN 'sp'.                          "Sales Price
                ls_hdr-spric = ls_result-cvalue.
              WHEN 'm'.                           "Margin
                ls_hdr-margn = ls_result-cvalue.
              WHEN 'c'.                           "Calculate
                ls_hdr-pcalc = ls_result-cvalue.
              WHEN 'purp'.                        "Purchase Price
                ls_hdr-ppric = ls_result-cvalue.
              WHEN 'a'.                            "Assortment
                ls_hdr-asort = ls_result-cvalue.
              WHEN 'bm'.                           "Batch Management
                ls_hdr-batch = ls_result-cvalue.
              WHEN 'mrl'.                          "Min. Remaining Life
                ls_hdr-minrl = ls_result-cvalue.
              WHEN 'aag'.                          "Account Assignment Group
                ls_hdr-acass = ls_result-cvalue.
              WHEN 'vc'.                           "Valuation Class
                ls_hdr-valcl = ls_result-cvalue.
              WHEN 'eancat'.                       "EAN Category
                ls_hdr-eanct = ls_result-cvalue.
              WHEN 'ean11'.
                ls_hdr-ean11 = ls_result-cvalue.
            ENDCASE.
            AT END OF hier.
              APPEND ls_hdr TO lit_hdr.
            ENDAT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      APPEND LINES OF lit_hdr TO git_hdr.
      DELETE git_hdr  WHERE maktx IS INITIAL            "Article Description
                          AND mtart IS INITIAL          "Article Type
                          AND matkl IS INITIAL          "Merchandise Category
                          AND charp IS INITIAL          "Characteristic Profile
                          AND taklv IS INITIAL          "Tax Classification
                          AND uom   IS INITIAL          "Unit of Measure
                          AND pount IS INITIAL          "PO Unit
                          AND lifnr IS INITIAL          "Vendor
                          AND brand IS INITIAL          "Brand
                          AND wekgr IS INITIAL          "Purchasing Group
                          AND ppric IS INITIAL          "Purchasing Price
                          AND spric IS INITIAL          "Sales Price
                          AND acass IS INITIAL          "A/c Assign. Grp.
                          AND valcl IS INITIAL          "Valuation Class
                          AND saiso IS INITIAL          "Season
                          AND saisj IS INITIAL.         "Season Year
      IF git_hdr[] IS NOT INITIAL.
        CLEAR: lv_count.
        LOOP AT git_hdr INTO ls_hdr.
          lv_count  = lv_count + 1.
          ls_hdr-intno = lv_count.
          MODIFY git_hdr FROM ls_hdr TRANSPORTING intno.
          CLEAR: ls_hdr.
        ENDLOOP.
      ENDIF.
    Code written is part of my program. Try to understand it. I hope it will help you out.
    Regards,
    Narendra

  • Some help needed on dynamic internal tables and field symbols

    Hi,
    I have a dyn internal table <dyn_table_r>.
    One of its fields is kna1-kunnr.
    I have another wa <fs>, with only one field alt_kunnr.
    now i want to modify  the data of <dyn_table_r>-kna1-kunnr from <fs>-alt_kunnr
    How should i do it?
    Regards ,
    Harshit Rungta

    Harshit Rungta:
    You have opened a number of related questions today. I'd like to see the other ones closed before you continue with this one.
    I'll lock this but will re-open it once the others are marked as solved.
    Rob

  • EXTREME Dynamic List of Field Symbols

    Hi All,
    This requirement have created lots of issues fo me and oculd not reach it, hence i am here :
    Internal table 1 with 'a' columns                    Internal Table 2  with 'b' columns
    a1    a2     a3                                                b1      b2      b3
    11     22    150                                               10      20       30
    Note: BOTH ARE FIELD-SYMBOL INTERNAL TABLE of TYPE ANY and HAVE NO STRUCTURE UNTIL RUNTIME
    What I want is a
    - Get a List of How many columns are in FIELD SYMBOL Internal Table 1 at RUNTIME.
    - DYNAMIC MAPPING TABLE that reads the HEADER OF COLUMNS and its DATA maps them in a Internal table at RUNTIME.
    Col1    Col2     Col3    Col4
    a1      11         b1        10
    a2      22         b2        20
    a3      150       b3       30

    Hi,
    - Get a List of How many columns are in FIELD SYMBOL Internal Table 1 at RUNTIME.
    You will have to use RTTS class for that. Something like:
    lo_sdescr ?= cl_abap_typedescr=>describe_by_data_ref( lo_data ). "lo_data containing ref. to your field-symbols
    LOOP AT lo_sdescr->components INTO ls_component.
    ENDLOOP
    - DYNAMIC MAPPING TABLE that reads the HEADER OF COLUMNS and its DATA maps them in a Internal table at RUNTIME.
    I don't see the need of a dynamic itab here, since the number/type of column seems to be fixed...
    If needed, build it up using RTTS as well.
    Kr,
    m.

  • I am stuck in FIELD-SYMBOLS and dynamic tables.

    Hi guys,
                I am trying to create dynamic table. My requirement is as follows--
    I have to display grid layout report in depending on given input.
    In input i have fields for DC and STORE.
    In output i have to display columns depending on number of DC and STORE paased in input.
    For example if in input, i have 2 DCs DC01 and DC02 and in STs i have say 1 input - ST01
    then in outpt grid report there will be 3 columns.
    So my columns to be displayed depends on number of input values given while running it.
    I am trying to use dynamic table.
    My output report contains fields from different table...so i cant use
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE
    instead i m trying to use
    FIELD-SYMBOLS: <DYN_TABLE> LIKE T_ARTMAS  "T_ARTMAS is declared as types : begin of....end of .... .
    but it is giviing an error in following form
    FORM CREATE_DYNAMIC_ITAB.
    Create dynamic internal table and assign to FS
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = IFC
        IMPORTING
          EP_TABLE        = DY_TABLE.
      ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    Create dynamic work area and assign to FS
      CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>........error on this line.
      ASSIGN DY_LINE->* TO <DYN_WA>.
    ENDFORM.                    "create_dynamic_itab
    saying "<DYN_TABLE>" is not an internal table - the "OCCURS n" specification is missing.          
    Kindly help me...
    thx in advance...

    Hi
    .FIELD-SYMBOLS: <DYN_TABLE> LIKE T_ARTMAS "T_ARTMAS is declared as types : begin of....end of .... .
    but it is giviing an error in following form.....
    Just as Sasha wrote, the problem could be you've defined a flat structure and u need a table, but now just a little a question: why do u want to use a dynamic table but your field-symbol is like a certain type?
    That means u know how the table is so u don't need to use a dynamic table, your issue seems not to make sense.
    Max

  • Change column headers dynamically in OBIEE

    hey guys.
    We are working on a BI module for Finance. The data mart captures data for Actuals/Forecasts and Budgets for entire year by months (for example Jan2008 will have Actual/Forecast value and Budget value & similarly for other months of the year) .
    Now while displaying on the dashboard reports the column header for the current month should read as Actual and for coming months it should read as Forecast.
    Any suggestions as to where we can implement this business rule so as to make the column header dynamic.
    Thanks
    OBIEE_user

    Seems like you don't know Venkat yet...
    http://oraclebizint.wordpress.com/2008/01/25/oracle-bi-ee-101332-dynamic-column-headers-using-presentation-variables-sets-and-conditional-formatting/

Maybe you are looking for

  • Free of charge pricing

    Hi, S.O net value is zero for Free material by using R100 condition type client need selling price value to be posted in Sales revenue account and R100 value in Discount account but system not generating accounting doc. Error : For zero net value acc

  • Problem for ResourceBundle calling from jsp file

    Hi, I am using WebLogic 5.1 in Solaris 8           I use java.util.resourceBundle to get the information from a .properties           file           I put the properties file in /opt/weblogic/myserver/serverclasses           When I call the propertie

  • IE Settings for EP 7.0 (netweaver 2004s)

    Hi, Is there a separate guide for IE settings (IE Version 6.0 and above) that need to be made for the portal to run without any errors on the client side? (EP 7.0) Thanks and Regards, Antony.

  • Can I install Appleworks 5.0 on OS X 10.5.8?

    I have the original OS 8.5 system software cd from my old blueberry iMac, from which I am transferring Appleworks 5.0.3 files to my newer MacBook Pro. Can I install the Appleworks 5.0 application from my original OS 8.5 system software cd onto my Mac

  • [solved] No sound and AMD-Vi: Event logged

    Hello, Today I started to migrate my HTPC from openElec to Arch Linux since several things started to annoy me. For now, I have made a fresh install and installed XBMC but I can't get audio. It is a AMD setup and has an Asus Xonar XD PCIe card instal