Problem in assigning field symbol to a nested internal table

Hi All,
I have searched the forum but could not find a solution to this problem. I have a requirement where I need to define an internal table within an internal table, so I have used pointer within the outer internal table(itab2) which point to the inner table. However, I am facing problem while assigning the pointer.
data: begin of struct1 occurs 0,
        fld3(10) type C,
       end of struct1.
data: begin of itab2 occurs 0,
        fld1(10) type C,
        fld2(10) type C,
        p_inner like ref to struct1,
      end of itab2.
field-symbols <inner_table> type any.
I want to assign "itab2->p_inner->* " to "<inner_table>".
However, the following statement is Not working:
assign itab2->p_inner->* to <inner_table>.
I want to fill the values within fields fld1, fld2 and fld3 and append it in itab2.
The final table should be like:
ITAB2:
fld1    fld2    fld3
aa      bb      cc
                 dd
                 ee
11      22      33
                 44
                 55
I have tried many other ways too but could not suceed, please help.
Thanks,
Vishal.

Thanks Matt,
But how do I append the values within this internal table ??
When I am using the following code:
ls_wa-fld3 = 'A'.
ls_wa-t_in-fld1 = 'B'.
ls_wa-t_in-fld2 = 'C'.
ls_wa-t_in-fld1 = 'D'.
ls_wa-t_in-fld2 = 'E'.
append ls_wa to lt_tab.
Its giving an error that:
The data object "LS_WA" does not have a component called "T_IN-FLD1".
I wanted the values to be appended in the following way in lt_tab:
fld3     fld1     fld2
A     B     C
     D     E
Please help.

Similar Messages

  • Problem after assigning  field-symbol in read statement...

    Hello Experts,
    I want to use a universal field-symbol in reading my internal tables so
    I can avoid declaring multiple work areas. Here is my code:
    FIELD-SYMBOLS: <fs_any> type any.
    READ TABLE lt_orderadm_h INDEX 1 ASSIGNING <fs_any>.
    Now when I try to insert this code:
    IF NOT <fs_any>-object_id IS INITIAL.
    ENDIF.
    It says that <fs_any> has no structure and therefore no component called object_id.
    I think that I need to use assign component for this but I don't know the code.
    Thank you guys and take care!

    Hi
    DATA : WA_ITORDERADM_H LIKE LINE OF IT_ORDERADM_H.
    **Try to assign the work area rather type any**
    FIELD-SYMBOLS: <fs_any> type WA_ITORDERADM_H.
    READ TABLE lt_orderadm_h INDEX 1 ASSIGNING <fs_any>.
    Now when I try to insert this code:
    IF NOT <fs_any>-object_id IS INITIAL.
    ENDIF.
    Check this program
    This works for me
    Simple program.
    TYPES: BEGIN OF NAME,
    NEXTNAME(10),
    FIRSTNAME(10),
    LASTNAME(10),
    END OF NAME.
    FIELD-SYMBOLS <F> TYPE NAME.
    DATA: LINE(30).
    LINE = 'JOHN SMITH SHRI'.
    ASSIGN LINE TO <F> CASTING.
    WRITE: / 'Lastname:', <F>-LASTNAME,
    'Firstname:', <F>-FIRSTNAME,
    'Nextname :', <F>-NEXTNAME
    Award points if helpful
    Thanks
    VENKI

  • Moving field-symbol data to an internal table

    Hi
    I have defined a field-symbol
      field-symbols: <fs_table> type standard table.
      Dynamically, I have populated some records in this <fs_table> & now I would like to copy this data into another internal table. I would like to know the best method to declare/create this internal table & to copy the records from <fs_table> to this internal table.
      Thanks,
      Sanjay

    if you know the structure of the reuslt in the first place, instead of dynamic itab you would have created a normal itab.
    do you want the new itab to be same as <l_table> ?
    then that also needs to be dynamically created.
    the best thing possible in you case is.
    field-symbols: <newtab> type any table.
    if <l_table> is assinged.
    assign <l_table> to <newtab>.
    endif .
    if you tell us why you want to move the <l_table> records to another similar itab, may be could come up with suggestion which dosesnt require you to move the data at all
    Raja

  • Problem related to field-Symbol?

    HI All,
    I am writting the below coding, Please tell me whether the Field Symbol will act as a table or not as I want to append a lot of data to field symbol. Please tell me is there any problem in the code.
    LOOP AT lt_vepoequi_keys into ls_vepoequi_keys.
            READ TABLE lt_vekp ASSIGNING <ls_vekp_str> with key
              matnr = ls_vepoequi_keys-matnr.
            IF sy-subrc = 0.
              <ls_vekp_str>-stoff = ls_vepoequi_keys-stoff.
              <ls_vekp_str>-sonum = ls_vepoequi_keys-sonum.
              <ls_vekp_str>-lagkl = ls_vepoequi_keys-lagkl.
              <ls_vekp_str>-lagkt = ls_vepoequi_keys-lagkt.
    endif.
    endloop.

    Hi Abhinav,
    you have internal table (say it_employee) with fields name,age,senior_category.
    now when you loop this internal table you will need workarea.
    loop at it_employee into wa_employee.
                      if wa_employee-age > 60.
                            wa_employee-senior_category = 'YES'.
                      else.
                              wa_employee-senior_category = 'NO'.
                      endif.
                              modify it_employee from wa_employee. 
                     endloop.
    now one use of Field-symbols is : when internal table is huge and when you loop with workarea and modify internal table each time, it takes time. So if we use Field-symbols performance would increase.
    loop at it_employee assigning into <fs_employee>.
                      if <fs_employee>-age > 60.
                            <fs_employee>-senior_category = 'YES'.
                      else.
                              <fs_employee>-senior_category = 'NO'.
                      endif.
                endloop.
    Now  you see in the above code, i have not used modify statement because when i loop internal table, the field symbol points directly to the memory of internal table.
    So during loop if i assign any value to the field symbol then it directly changes the internal table value, so there wont be any need to use modify statement.
    Hope you are clear with this example....
    Regards
    Sajid

  • Problem reading data from nested internal table.

    Hi,
    Below is my code;
    *********SAP Code********
    TYPES: BEGIN OF v54a0_scdd,
             fknum  LIKE vfkk-fknum,
             change LIKE vfkkd-updkz,
             x      TYPE v54a0_scd,
             y      TYPE v54a0_scd,
             tvtf   LIKE tvtf,
           END OF v54a0_scdd.
    SCD table for dialog
    TYPES: v54a0_scdd_tab TYPE v54a0_scdd OCCURS 1.
    *********SAP Code********
    *Custom declaration*****
    data: wa_freight_costs type v54a0_scdd_tab.
    data: it_freight_costs type v54a0_scdd_tab occurs 0.
    *****Here data is getting appended to it_freight_costs. P_frieght_costs is coming from standard program.
         move p_freight_costs TO wa_FREIGHT_COSTS.
         append wa_freight_costs to it_freight_costs.
         clear wa_freight_costs.
    ***Now the problem is here. I am not able to read the data from the nested internal table x-item.
    if i use <fs_f_costs> to move data from it_freight_costs in the outer loop, i get a syntax error; <i> "the line type of the table it_freight_costs is not compatible with field symbol type <fs_f_costs>" </i>
         FIELD-SYMBOLS: <fs_f_costs> type line of v54a0_scdd_tab.
          LOOP AT it_freight_costs assigning <fs_f_costs>.
              LOOP AT <fs_f_costs>-x-item ASSIGNING <fs_freight_item>.        
                  <b> I want to read <fs_freight_item>-vfkp-netwr.</b> 
             ENDLOOP.
    Can anyone guide me?

    A quick look at how I would do this. Note I haven't checked if this compiles just done a quick brain-dump.
      DATA: lr_f_costs TYPE REF TO v54a0_scdd_tab,
            lr_f_cost TYPE REF TO v54a0_scdd.
      LOOP AT it_freight_costs REFERENCE INTO lr_f_costs.
        LOOP AT lr_f_costs->* REFERENCE INTO lr_f_cost.
        ENDLOOP.
      ENDLOOP.
    As you can see I personally prefer pointers to field symbols - I don't believe there is any performance differences and because of my background in other languages pointers make more sense to me.
    Cheers
    Graham Robbo

  • How to create dynamic nested internal table

    Hi Experts,
    Pleae tell me or give sample code, how to create dynamic nested internal table ?
    I have seen threads saying creation of dynamic internal tables using some table structure only. But now the requirement is to create dynamic nested internal table.
    For example the internal table contains two fields viz., one is field1 of dynamic internal table and other is normal field2 and values as shown below:
    Nested internal table:
    field1                     |     field2 ...
    <table content1>     |     value2..
    <table content1>     |     value2..
    Here the [table content] should also a dynamic internal table.
    Let me know if you need any other info.
    regards
    Saravanan R

    see the complete code..i am currently working in ECC6.0 EHP4. just check which version you are using..
    REPORT  yst_test_000.
    DATA:
          lt_comptab         TYPE cl_abap_structdescr=>component_table,
          ls_comp            LIKE LINE OF lt_comptab,
          lref_newstr        TYPE REF TO cl_abap_structdescr,
          lref_tab_type      TYPE REF TO cl_abap_tabledescr,
          lt_fcat            TYPE lvc_t_fcat,
          ls_fcat            TYPE lvc_s_fcat,
          ls_dd03p           TYPE dd03p,
          lt_data            type ref to data.
    field-symbols: <fs_table> type standard table.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        i_structure_name       = 'SCARR'
      CHANGING
        ct_fieldcat            = lt_fcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT lt_fcat INTO ls_fcat.
      IF ls_fcat-ref_table IS NOT INITIAL.
        CLEAR ls_dd03p.
        CALL FUNCTION 'BUS_DDFIELD_GET'
          EXPORTING
            i_tabnm         = ls_fcat-ref_table
            i_fldnm         = ls_fcat-fieldname
          IMPORTING
            e_dd03p         = ls_dd03p
          EXCEPTIONS
            field_not_found = 1
            OTHERS          = 2.
        IF sy-subrc EQ 0.
          ls_comp-name = ls_fcat-fieldname.
          ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_dd03p-rollname ).
          APPEND ls_comp TO lt_comptab.
          CLEAR ls_comp.
        ENDIF.
      ELSE.
        ls_comp-name = ls_fcat-fieldname.
        ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
        APPEND ls_comp TO lt_comptab.
        CLEAR ls_comp.
      ENDIF.
    ENDLOOP.
    *Now for the Field which you want deep table then you can do like this
    ls_fcat-fieldname  = 'NESTED_TABLE'.
    ls_fcat-inttype    = 'C'.
    ls_fcat-intlen     = '000006'.
    ls_fcat-rollname   = 'SFLIGHT_TAB1'. "For SFLIGHT
    APPEND ls_fcat TO lt_fcat.
    ls_comp-name = ls_fcat-fieldname.
    ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
    APPEND ls_comp TO lt_comptab.
    CLEAR ls_comp.
    lref_newstr = cl_abap_structdescr=>create( lt_comptab ).
    lref_tab_type = cl_abap_tabledescr=>create( lref_newstr ).
    create data lt_data type handle lref_tab_type.
    assign lt_data->* to <fs_table>.
    break-point.
    Edited by: Vijay Babu Dudla on Apr 28, 2009 8:05 AM

  • How to populate field catalogue fields in ALV using  dynamic internal table

    Hi All,
    Please let me know how to populate field catalogue fields in ALV using  dynamic internal table.
    I have created <dyn_table> using code below.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
                     EXPORTING
                       it_fieldcatalog = g_t_ifc
                        it_fieldcatalog = g_t_fieldcat
                     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>.
      ASSIGN dy_line->* TO <dyn_wa>.
    Now this  <dyn_table>  has fields like idoc no.,creation date ,
    segment field 1, segment field 2 etc..Now idoc no.,creation date  are static fields from table EDIDC. And segment field 1, segment field 2 etc are dynamic fields from table EDSAPPL.
    In my  ALV report I am getting the final layout properly but I am unable to move values to corresponding fields in the final layout shown.Please let me know how to populate these fields from different tables.
    I tried this way but its not working.
    SORT g_t_edid4 BY docnum.
      LOOP AT g_t_edidc INTO g_r_edidc.
        READ TABLE g_t_edid4 into g_r_edid4
                         WITH KEY docnum = g_r_edidc-docnum
                                        BINARY SEARCH.
        IF sy-subrc = 0.
          <dyn_wa> =  g_r_edid4-sdata.
         MOVE-CORRESPONDING g_r_edid4 to <dyn_wa>.
       CLEAR g_r_edid4.
        ENDIF.
    MOVE-CORRESPONDING g_r_edidc to <dyn_wa>.
    APPEND <dyn_wa> TO <dyn_table>.

    You have to assign each field to field symbol and then assign the value to that field symbol and asssign that field symbol to workarea field symbol.
    LOOP AT g_t_edidc INTO g_r_edidc.
    READ TABLE g_t_edid4 into g_r_edid4
    WITH KEY docnum = g_r_edidc-docnum
    BINARY SEARCH.
    IF sy-subrc = 0.
    ASSIGN COMPONENT 'SDATA' OF STRUCTURE <DYN_WA> TO <DYN_FLD>.
    <DYN_FLD> = g_r_edid4-sdata.
    " <dyn_wa> = g_r_edid4-sdata.
    " Assign each fields like this.
    " MOVE-CORRESPONDING g_r_edid4 to <dyn_wa>.
    CLEAR g_r_edid4.
    ENDIF.
    " MOVE-CORRESPONDING g_r_edidc to <dyn_wa>.
    APPEND <dyn_wa> TO <dyn_table>.
    Regards,
    Naimesh Patel

  • Delete record from fileld symbol which is an internal table

    Hello experts,
    My requirement is like below.....
    Loop at <fs_table> into <fs_wa>.
    if condtion.
    delete record.
    endif.
    endloop.
    I need to delete the field-symbol (an internal table) record.
    any suggestions .......... <<text removed by moderator>>
    Thnanks in advance.
    Zak.
    Edited by: Matt on Nov 18, 2008 4:48 PM Do not offer to reward

    Hi,
    Simply do this
    TABLES : vbap, ekko, ekpo.
    data : it_vbap type table of vbap.
    field-symbols : <fs> type standard table,
                    <fs_wa> like vbap.
    SELECT-OPTIONS : s_vbeln  FOR vbap-vbeln MODIF ID vbe,
                     s_posnr  FOR vbap-posnr MODIF ID vbe.
    select * from vbap into table it_vbap.
    assign it_vbap to <fs>.
    loop at <fs> assigning <fs_wa>.
    delete <fs>.
    endloop.
    Inside the loop you just need to specify the field symbol that points to the table , so the current line will be deleted. Because while looping, the <fs> points to the content of the current line of table it_vbap.
    regards,
    Advait
    Edited by: Advait Gode on Nov 18, 2008 4:17 PM

  • Nested Internal Table Tables and REUSE_ALV_GRID_DISPLAY

    Can you display entries from a nested internal table in the using the call function 'REUSE_ALV_GRID_DISPLAY'?
    Types and internal tables are below.  I have skimmed the code for the function module below, assume field category built, etc.. The table is in the tables portion of the function module, the nested internal table is inside of int_output defined as data: int_tlines type t_tline occurs 0.
    TYPES:
    BEGIN OF t_tline,
    tdformat type tline-tdformat,
    tdline type tline-tdline,
    END OF t_tline.
    DATA:
    BEGIN OF int_output occurs 0,
      qmnum       TYPE qmnum,
      sys_stat    TYPE j_stext,
      kunum       TYPE qkunum,
      sting       TYPE string,
      numr        TYPE vbeln,
      bstnk       TYPE bstkd,
      vbeln       TYPE kdauf,
      erdat(10)   TYPE c,
      aufnr       TYPE aufnr,
      werks       TYPE werks_d,
      idat2(10)   TYPE c,
      otgrp       TYPE otgrp,
      oteil       TYPE oteil,
      fd_text     TYPE qtxt_code,
      fegrp       TYPE fegrp,
      fecod       TYPE fecod,
      pb_text     TYPE qtxt_code,
      fetxt       TYPE fetxt.
      data: int_tlines type t_tline occurs 0.
      data: QMTXT TYPE QMEL-QMTXT,
      NOTIF_TXT   TYPE STRING,
      bautl       TYPE bautl,
      bautx       TYPE bautx,
    END OF int_output.
    DATA: i_output      LIKE STANDARD TABLE OF int_output,
    w_output      LIKE LINE OF int_output.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
        TABLES
          t_outtab                 = int_output
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.

    Hi
    I dont think this requirement is possible. Even if we pass the data through the nested internal table the FM may not give a dump. The main problem will be with field catalog. How can we build field catalog for the fields inside the nested internal table.
    Field catalog for this FM REUSE_ALV_GRID_DISPLAY should be of type SLIS_FIELDCAT_ALV and this is a standard one.

  • Add field value to the existing internal table.

    how to add a field value to the existing internal table.
    DATA: BEGIN OF ITAB occurs 0,
                 EBELN TYPE EKPO-EBELN,
                 EBELP TYPE EKPO-EBELP,
                 AEDAT TYPE EKPO-AEDAT,
                 amount(10) type c,
               END OF ITAB.
    select * from ekpo
           into corresponding fields of table itab.
    itab-amount = '2400'.
    loop at itab where ebeln eq 70 .
           write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
             endloop.
    here output is not showing the amount field value.
    please tell me how to solve this problem urgent
    thanks in advance.

    Hi Sekhar,
        First let me know wheather you are assigning some value to the amount field externally to all records? if this is wright means check the below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    v_amount = '2400'.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,v_amount.
    endloop.
    or if you want to modify perticular records in itab  then use below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    amount(10) type c,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    loop at itab.
    itab-amount = '2400'.
    modify itab index sy-tabix (or perticular line number).
    endloop.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
    endloop.
    Thanks,
    Suma.

  • What are nested Internal tables

    Hi Guru's,
    I am new to ABAP ...just trying to learn things.Can you please explain me what are nested internal tables and what is the purpose of nested internal table?where can it be used and why a header line is not written in a Nested Internal table...
    Kindly explain it (scenario where nested internal tables are used) with an example it will be helpful.
    Cheers,
    Priyanka

    Hi,
    When storing data in internal tables, you often use one internal table for each database you read.
    Each one contains some or all columns of the relevant database table. It is up to you whether
    you create an internal table with a flat structure for each database table or if you create, for
    example, internal tables with nested structures. If you have several tables, each one with a flat
    structure, you have to work with redundant key fields to link the tables. If, on the other hand, you
    use nested internal tables, you can store the data from the database tables hierarchically.
    Saving and processing very large amounts of data in internal tables has disadvantages. If you
    divide up the data into different internal tables, processing it can be very runtime-intensive, since
    the tables have to be processed individually. Furthermore, it requires a lot of storage space,
    since internal tables are not stored in compressed form. The system may even need to store the
    dataset outside of its working memory. This means that processing it takes even longer.
    An example of nested internal table:
    Assume the following program is linked to the logical database [Page 1163] F1S.
    REPORT DEMO.
    DATA: SUM TYPE I, CNT TYPE I.
    NODES: SPFLI, SFLIGHT, SBOOK.
    DATA: BEGIN OF WA_SBOOK,
    BOOKID TYPE SBOOK-BOOKID,
    SMOKER TYPE SBOOK-SMOKER,
    CLASS TYPE SBOOK-CLASS,
    LUGGWEIGHT TYPE SBOOK-LUGGWEIGHT,
    WUNIT TYPE SBOOK-WUNIT,
    END OF WA_SBOOK.
    DATA: BEGIN OF WA_SFLIGHT,
    FLDATE TYPE SFLIGHT-FLDATE,
    SBOOK LIKE TABLE OF WA_SBOOK,
    END OF WA_SFLIGHT.
    DATA: BEGIN OF WA_SPFLI,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    CITYFROM TYPE SPFLI-CITYFROM,
    CITYTO TYPE SPFLI-CITYTO,
    SFLIGHT LIKE TABLE OF WA_SFLIGHT,
    END OF WA_SPFLI.
    DATA TAB_SPFLI LIKE TABLE OF WA_SPFLI.
    START-OF-SELECTION.
    GET SPFLI.
    REFRESH WA_SPFLI-SFLIGHT.
    GET SFLIGHT.
    REFRESH WA_SFLIGHT-SBOOK.
    GET SBOOK.
    MOVE-CORRESPONDING SBOOK TO WA_SBOOK.
    APPEND WA_SBOOK TO WA_SFLIGHT-SBOOK.
    GET SFLIGHT LATE.
    MOVE-CORRESPONDING SFLIGHT TO WA_SFLIGHT.
    APPEND WA_SFLIGHT TO WA_SPFLI-SFLIGHT.
    GET SPFLI LATE.
    MOVE-CORRESPONDING SPFLI TO WA_SPFLI.
    APPEND WA_SPFLI TO TAB_SPFLI.
    END-OF-SELECTION.
    SORT TAB_SPFLI BY CITYFROM CITYTO CONNID.
    LOOP AT TAB_SPFLI INTO WA_SPFLI.
    SKIP.
    WRITE: / WA_SPFLI-CARRID,
    WA_SPFLI-CONNID,
    'from', (15) WA_SPFLI-CITYFROM,
    'to', (15) WA_SPFLI-CITYTO.
    ULINE.
    SORT WA_SPFLI-SFLIGHT BY FLDATE.
    LOOP AT WA_SPFLI-SFLIGHT INTO WA_SFLIGHT.
    SKIP.
    WRITE: / 'Date:', WA_SFLIGHT-FLDATE.
    WRITE: 20 'Book-ID', 40 'Smoker', 50 'Class'.
    ULINE.
    SORT WA_SFLIGHT-SBOOK BY CLASS SMOKER BOOKID.
    SUM = 0.
    CNT = 0.
    LOOP AT WA_SFLIGHT-SBOOK INTO WA_SBOOK.
    WRITE: / WA_SBOOK-BOOKID UNDER 'Book-ID',
    WA_SBOOK-SMOKER UNDER 'Smoker',
    WA_SBOOK-CLASS UNDER 'Class'.
    SUM = SUM + WA_SBOOK-LUGGWEIGHT.
    CNT = CNT + 1.
    ENDLOOP.
    ULINE.
    WRITE: 'Number of bookings: ', (3) CNT,
    / 'Total luggage weight:',
    (3) SUM, WA_SBOOK-WUNIT.
    ENDLOOP.
    ENDLOOP.
    Thanks.

  • Passing Nested internal table to GUI_DOWNLOAD

    Hi All
    I have got a nested internal table, I want this whole report in excel format, I tried using GUI_DOWNLOAD , it gives error. Does any body have any idea how can I solve this.
    regards
    AJ

    Hi,
    I think nested and deep structure internal tables will not work with gui_download.
    you need to convert before giving it to gui_download
    aRs

  • Nested Internal tables with cl_gui_alv_grid - not displaying records

    Hi,
    I wrote a program using nested internal tables with cl_gui_alv_grid class
    At runtime, when I select dropdown on one of the cells (RESWK - driver to the nested table), it does not bring the related record and display it
    Does cl_gu_alv_grid support nested internal tables?
    Or which class to use
    Appreciate reply at the latest
    Thanks
    Rajeev
    Edited by: Thomas Zloch on Feb 7, 2011 4:11 PM - priority reduced

    Hi Rajeev,
    Maybe checking out this documnetation will answer your question:
    [ALV Grid Control (BC-SRV-ALV)|http://help.sap.com/saphelp_erp2004/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm]
    To my knowledge ALV does not support deep structures.
    Kind regards,
    Robert

  • Problem with slis_t_specialcol_alv Field Symbol Assignment

    I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. I’ve also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>‘CINFO’</b> to contain color information for that particular row. In the code below the dynamic itab is pointed to by field symbol <dyn_table> while the work area for it would be <dyn_wa>.
    Somewhere down the line I attempt to assign the ‘CINFO’ component of the current row of the itab to a field symbol called <fs_cinfo> typed as ‘slist_t_specialcol_alv’ (Same as CINFO).
    I used the code:
    ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    This gives me the runtime error:
    <i>Type conflict in the ASSIGN statement in the program "ZHRR001_TEMMATRIX".
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.    </i>     
    I am unsure why this happens as both the component CINFO and FS <fs_cinfo> are of type slist_t_specialcol_alv.
    For some odd reason though during debugging, I took a look at the <dyn_wa> structure and the component type of CINFO was displayed as “C”???
    Here is the relevant portion of code (creation of dynamic itab and attempting to assign <fs_cinfo>)
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>.
    FIELD-SYMBOLS: <fs_cinfo> TYPE slist_t_specialcol_alv.
    DATA: lw_cinfo TYPE slis_specialcol_alv.
    DATA:          li_fldcat TYPE lvc_t_fcat,
                   lw_fldcat TYPE lvc_s_fcat.
    *Create internal table fields (they will be called Field1, Field2, etc)
    *Last column will be named 'CINFO' to contain row color information
    DO l_alvcolumncount TIMES.
      index = sy-index.
      IF index <> l_alvcolumncount.
        CLEAR lw_fldcat.
        CONCATENATE 'Field' index INTO lw_fldcat-fieldname .
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'STRING'.
    *    lw_fldcat-intlen = 5.
        APPEND lw_fldcat TO li_fldcat .
      ELSE.
        CLEAR lw_fldcat.
        lw_fldcat-fieldname = 'CINFO'.
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'slis_t_specialcol_alv'.
        APPEND lw_fldcat TO li_fldcat.
      ENDIF.
    ENDDO.
    * Create dynamic internal table and assign to FS
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = li_fldcat
      IMPORTING
        ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
    *Create dynamic work area and assign to FS
    CREATE DATA new_line LIKE LINE OF <dyn_table>.
    ASSIGN new_line->* TO <dyn_wa>.
      ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    * Color this cell
      lw_cinfo-fieldname = fieldname.
      lw_cinfo-color-col = 6.
      APPEND lw_cinfo TO <fs_cinfo>.
    Message was edited by: Sow Yong Wong

    Hello Sow
    There is a big problem in the program: you are mixing types used for FM-based ALV (SLIS_...) and ABAP-OO based ALV (LVC_...).
    For ABAP-OO based row colouring you have to define your itab like this:
    TYPES: ty_s_outtab.
      INCLUDE TYPE kna1. " just an example
    TYPES: rowcolor(4)  TYPE c.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab TYPE STANDARD TABLE of ty_s_outtab
                       WITH DEFAULT KEY.
    In the layout (LVC_S_LAYO) you have to set <b>ls_layout-info_fname = 'ROWCOLOR'</b>.
    ROWCOLOR has to be filled according to <b>Cxyz</b> whereas
    - x = color
    - y = inverse on/off
    - z = intensified on/off
    For documentation please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference to ALV Grid Control</a>
    Regards
      Uwe

  • Regarding problem with assigning field to Field symbols

    Hi All,
    We are migrating(recreating) the program which was in 4.7 to ECC 6.0.
    In 4.7 they are using the below code for assigning the field to fieldsymbol from work area as shown below.
    ASSIGN wa_kostl_kstar-wkg001+offset TO <von>
    wa_kostl_kstar is a work area and wkg001 is the fourth field and wkg011 is 13th field and it is taking this filed into field symbol <Von>.
    In Ecc 6.0 th same code is not being accepted and throwing syntax error.
    So they had changed the code in ECC 6.0 to
    ASSIGN wa_kostl_kstar-wkg001+(offset) TO <von>
    And there was no syntax error and while testing it goes to dump.
    I had tested in 4.7 and its working fine taking the value of  13 th field to <von>,and like wise there are some other assign statements after,like this.
    So any one please let me know what to do in this case.
    Regards,
    MADHAVA.

    Hi,
    Hope below example can give you an idea on handling your case:
    TYPES: BEGIN OF t_sal_ord,
             vbeln TYPE vbeln_va,
             posnr TYPE posnr_va,
             auart TYPE auart,
             vkorg TYPE vkorg,
             matnr TYPE matnr,
           END OF t_sal_ord.
    DATA: wa_mara TYPE mara.
    DATA: wa_sal_ord TYPE t_sal_ord.
    FIELD-SYMBOLS: <fs_matkl>,
                   <fs_vkorg>.
    ASSIGN COMPONENT 'MATKL' OF STRUCTURE wa_mara TO <fs_matkl>.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    ASSIGN COMPONENT 'VKORG' OF STRUCTURE wa_sal_ord TO <fs_vkorg>.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    Kind Regards
    Eswar

Maybe you are looking for

  • Bapi or function module for Tcode F-54

    Hi, I need Bapi or Function moudle for tcode F-54. I am developing interfaces. I have to clear the the advance amount against an invoice. Regards, Dhanunjaya Reddy.

  • Back to Snow Leopard -- how?

    Having worked with OS X Lion now for about a day, I have to say I'm encountering too many issues. (A selection: Safari won't allow me to start with my Homepage and then have new tabs open with the Same Page for some reason (I'm not sure what exactly

  • Finding Application Module name in read-only view object classes

    Hi all, I have a fairly basic question about finding application module name when we are coding in ViewObject java classes. I want to know how can I obtain <<application module>> NAME that our current view object is contained in it at run-time. I thi

  • Table control bdc for mb1a

    Hi All, Can anyone tell me is table control BDC possible for MB1A tcode Thanks in advance.

  • Header record in document flow table VBFA

    Hello experts: I would like to have header entries (item number as "000000") for every document in document flow table VBFA. How to get it done? We have copy control from sales document to delivery document and from delivery to billing. All items are