Dynamic length table problem

hi all,
I am developing a adobe form, i need to create a dynamic length table.
I have created the tabled and done the required settings also, but the table doesnt flow to the next page. i am listing he things i did, may be somebody can tell me if i have gone wrong soemwhere otif i missed something.
1. created the table with required columns and row.
2. have set the table row as ""repeat row for each data item"
3. have wrapped the table in to a subform and have set it to flowed.
kindly help me with this.
Help will be appreciated.

Hi Runal,
Everything you're doing seems correct.  Just make sure your subform is not wrapped within another Subform OR Page with Position Layout. 
Please have a look at this document to confirm your steps:
Handling Dynamic Length Tables in Adobe Forms
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0859ad1-53aa-2a10-78ae-99e41c407669
hope this helps,
harman

Similar Messages

  • Dynamic internal table problem in FM - HR_INFOTYPE_OPERATIONS

    Dear All,
    I have a problem when I use a Dynamic internal table in FM - HR_INFOTYPE_OPERTATION..
    Please suggest me on the way to overcome this problem..
    We wanted to have a dynamic Program for Info type operations which can be used for any info types as we are changing only BEGDA and the related actions
    So in my program I have the parameters to accept
    P_BEGDA - 01.10.2007
    P_INFTY - P0008
    P_ACTIO - COPY
    I am able to create a dynamic table based on the parameters P_INFTY and able to read it also using the FM - HR_READ_INFOTYPE
    BUT when I pass the dynamic internal table to a FM - HR_INFOTYPE_OPERTATION I am getting a DUMP
    The DUMP is at the below statement from FM - HR_INFOTYPE_OPERTATION
    ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode
    It gives the below possiblities
    "ASSIGN_BASE_TOO_SHORT" C 
    "SAPLHRMM" or "LHRMMU03"  
    "HR_INFOTYPE_OPERATION"   
    But If I use the below internal table
    Data : g_t_0008 like P0008 occurs 0 with header line.
    And If I use the internal table g_t_0008 instead of dynamic tables then it works. So I strongly feel it's due to not having a header in the dynamic table below see below the sample code on how I am generating a dynamic internal table
    field-symbols: <dyn_table> type standard table.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    to get the srurcute
    perform get_structure using l_f_table.
    perform create_dynamic_itab .
    assign dy_table->* to <dyn_table>.
    perform get_data tables <dyn_table01>
                      using pernr-pernr p_infty.
    below are the forms routine….
    form get_structure using p_table.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    clear : ifc[], dy_table.
    Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    endform.
    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.
    endform.
    *&      Form  get_data
    form get_data  tables   p_table
                   using    p_pernr
                            p_infty.
    clear : p_table, p_table[].
      CALL FUNCTION 'HR_READ_INFOTYPE'
           EXPORTING
                PERNR           = P_PERNR
                INFTY           = p_infty
                BEGDA           = p_datum
                ENDDA           = p_datum
           TABLES
                INFTY_TAB       = p_table
           EXCEPTIONS
                INFTY_NOT_FOUND = 1
                OTHERS          = 2.
      CHECK SY-SUBRC EQ 0.
    IF lines( p_table ) GT 0.
    *write :/'Record exist' , 'IT', p_infty.
    clear p_table.
    PERFORM hr_operation tables  p_table
                         using  g_t_t588d-actio g_t_t588d-INFTY
                                g_t_t588d-SUBTY.
    else.
    PERFORM append_status using g_t_itab-pernr p_infty ' '
                                'Error' 'No records'.
    ENDIF.
    endform.                    " get_data
    form hr_operation  tables    p_table
                       using     p_actio P_INFTY P_SUBTY.
    data: l_f_return    LIKE bapireturn1.
    ASSIGN COMPONENT 'BEGDA' OF STRUCTURE p_table TO <l_field>.
          <l_field> = p_begda.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = P_infty
                number        = G_T_ITAB-PERNR
                subtype       = P_subty
                validityend   = g_f_endda
                validitybegin = P_datum
                record        = P_TABLE
                operation     = p_actio
              IMPORTING
                return        = l_f_return.
    IF sy-subrc NE 0.
    ENDIF.
    ENDFORM.

    try
    using field symbol for a wrk area instead of Field symbol for a table
    loop your inernal table (again a field symbol) assigning to <fs_wrkarea>
    in loop call HR_INFO.._OP..
    reward if helpful

  • Dynamic Internal Table problem

    Hello all,
    I have created a Dynamic ALV using RTTS classes like cl_abap_structdescr,cl_abap_tabledescr and cl_abap_datadescr.
    The number of columns to be displayed is dynamic and i am able to display the same.
    Now i need to perform SUBTOTAL on few of the columns.
    In dynamic table how do i assign those columns as Type 'I' so that i can perform DO_SUM.
    I used the method GET_I of class cl_abap_elemdescr but unable to achive the same.
    Kindly suggest.
    Regards,
    Arun

    I know when I need to create a dynamic alv I use the following (plumbing code removed).
    DATA: it_field_catalog      TYPE lvc_t_fcat.
    DATA: dyn_table             TYPE REF TO data.
    FIELD-SYMBOLS: <dyn_table>         TYPE table.
    create your alv as normal. Or auto create the entries based on the tables, whatever conditions you use to determine the structure of the table at run time.
      ls_fcat-fieldname   = '???'.
      ls_fcat-inttype     = '?' .
      ls_fcat-outputlen   = '?' .
      ls_fcat-coltext     = '?' .
      ls_fcat-seltext     = '?' .
      ls_fcat-f4availabl  = '?'.
      ls_fcat-edit        = '?'.
      ls_fcat-key         = '?'.
      APPEND ls_fcat TO it_field_catalog .
        CALL METHOD cl_alv_table_create=>create_dynamic_table
           EXPORTING it_fieldcatalog = it_field_catalog
           IMPORTING ep_table        = dyn_table
           EXCEPTIONS
                  generate_subpool_dir_full = 1.
       ASSIGN dyn_table->* TO <dyn_table>.
    This field symbol to the table can then be passed in place of the table when calling your alv and performing operations on it.

  • Dynamically checking ID's in a dynamically built table problem ??

    Im creating a table dynamically using JSP and Javascript....
    its a basic loop that goes through 5 iterations...as follows
    what is happening here is it dynamically in the body creates my
    table and when it hits the the row that has i = 1 or i = 3
    it puts out a checkbox on the table....the code between the <%
    and %> is the jsp portion..this runs on a server....I have two strings CheckBox1 and CheckBox3 which get assigned to two different table rows id's ...so for the first row the table gets created with no checkbox strictly text for the second row it has a checkbox and the forth row has one...
    now what I want the code to do...is if the user hits a button on my page...
    I want to call a javascript function that will go thru the rows and determine
    if it has a checkbox and if so....if that checkbox is checked off. The called function obviously will not know the exact id at the time...since this is built dynamically sometimes I will have CheckBox0 containing a checkbox...Ct will all depend on the data...is there a way to check whether a row has an id
    and if so what that id is..and also if it is a checkbox and finally if its checked off ????
    <%! String checkString1 = null;
    String stringInt = null;
    String checkBoxText = "CheckBox";
    int x = 0;%>
    <% for(int i = 0;i < 5; i++)
    {%>
    <%stringInt = (new Integer(i)).toString();
    checkString1 = checkBoxText + stringInt;
    String[] stringnames = new String[2]; %>
    <tr class="checkboxtext" id=chkb1>
    <td width=100 valign="top" nowrap >
    Corporates</td>
    <td width=60 valign="top" >202
    </td>
    <td width=100 valign="top" >111021AC5R</td>
    <td width=190 valign="top" nowrap class="displaytext">
    BRIT TELECOM PLC </td>
    <td width=85 valign="top" align=right>12/15/01
    </td>
    <td width=70 valign="top" align=right>8M</td>
    <td width=70 valign="top" align=right >$105.5000</td>
    <td width=100 valign="top" nowrap align=right>
    12.5000</td>
    <% if(i ==1 | i ==3)
    {%>
    <%stringnames[x] = checkString1;
    System.out.println("your checkstring value is " + checkString1);
    System.out.println("your mmmy value is " + stringnames[x]);
    x = x + 1;
    %>
    <td width=200 valign="top" id=na1 onMouseOver="tryonmouseover(this)"; onMouseOut="nd();">Needs Approval
    </td>
    <td width=20 valign="top" ><Input type="checkbox" value="OFF" Name="check1" id=<%= checkString1 %> onclick="checkboxclickunclick(this)");" onMouseOver="tryonmouseover(this)"; onMouseOut="nd();">
    <%}
    else
    {%>
    <td width=200 valign="top" class="displaytext">Executed
    </td>
    <td width=20 valign="top" class="displaytext">N/A</td>
    <%}%>
    </td>
    </tr>
    <%}%>
    </table>
    further down is this code...
    <td width="33%" align=center ><INPUT TYPE="BUTTON" VALUE="Approve all" id=apprall onclick="window.approveall()" class=actionbutton</td>
    which will call approveall(). This is the function that I want to go
    thru the table rows....and determine if there is a checkbox and whether it was checked off ???? Thanks for any help .....

    I'm not sure myself how to do what you're asking for, but using DOM (Document Object Model) you can gain access to all objects of an HTML document. You should be able to give your table an id and then access all the rows of the table using JavaScript and DOM.
    Or, you could probably just find an easier way to accomplish what you're asking for. Maybe just use the JavaScript onClick event to append your values to the query string, or whatever it is that you're trying to do.

  • Dynamic ALV Internal table Problem

    Hi all,I have successfully built an IT using method 'create_dynamic_table'.But my problems are :
    1)When Iam trying to select the data with multiple tables then it is short dumping.
    2)I tried to oselect the data using one table,after selecting the data if I use FM REUSE_ALV_Grid_Display then it is showing short dump with error 'type conflict when calling FM'.
    I never used field symbols before.PLZ complete my program or give me suffecient feedback.Here is my program :
    DATA : g_tdref TYPE REF TO data,
           g_wdref TYPE REF TO data.
    DATA : dats LIKE vbbe-mbdat,
           t_fieldcat TYPE lvc_t_fcat,
           wa_fieldcat TYPE lvc_s_fcat.
    FIELD-SYMBOLS : <it_dyn> TYPE STANDARD TABLE,
                    <wa_dyn>,
                    <dyn_field>.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_mbdat FOR dats.
    SELECTION-SCREEN END OF BLOCK blk1.
    wa_fieldcat-tabname = 'MSKA'.
    wa_fieldcat-fieldname = 'WERKS'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'MSKA'.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-seltext = 'Material Number'.
    wa_fieldcat-intlen = '18'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'MAKT'.
    wa_fieldcat-fieldname = 'MAKTX'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = 'MBDAT'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = 'OMENG'.
    wa_fieldcat-datatype = 'QUAN'.
    wa_fieldcat-intlen = '10'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    DATA : d TYPE i,
           v(02) TYPE n VALUE '0',
           day(8) TYPE c.
    d = s_mbdat-high - s_mbdat-low + 1.
    DO d TIMES.
      v = v + 1.
      CONCATENATE 'Day' v INTO day.
      wa_fieldcat-tabname = 'VBBE'.
      wa_fieldcat-fieldname = day.
      wa_fieldcat-datatype = 'DATS'.
      wa_fieldcat-seltext = day.
      wa_fieldcat-intlen = '8'.
      APPEND wa_fieldcat TO t_fieldcat.
      CLEAR : wa_fieldcat.
    ENDDO.
    *-----Building Dynamic internal table.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = t_fieldcat
      IMPORTING
        ep_table        = g_tdref.
    ASSIGN g_tdref->* TO <it_dyn>.
    CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
    ASSIGN g_wdref->* TO <wa_dyn>.
    SELECT m~werks m~matnr v~omeng v~mbdat INTO CORRESPONDING FIELDS
    OF TABLE <it_dyn> FROM mska AS m INNER JOIN vbbe AS v
    ON m~posnr = v~posnr WHERE v~mbdat IN s_mbdat.

    *DATA : d TYPE i,
          v(02) TYPE n VALUE '0',
          day(8) TYPE c.
    *d = s_mbdat-high - s_mbdat-low + 1.
    *DO d TIMES.
    v = v + 1.
    CONCATENATE 'Day' v INTO day.
    wa_fieldcat-tabname = 'VBBE'.
    wa_fieldcat-fieldname = day.
    wa_fieldcat-datatype = 'DATS'.
    wa_fieldcat-seltext = day.
    wa_fieldcat-intlen = '8'.
    APPEND wa_fieldcat TO t_fieldcat.
    CLEAR : wa_fieldcat.
    *ENDDO.
    *-----Building Dynamic internal table.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = t_fieldcat
      IMPORTING
        ep_table        = g_tdref.
    ASSIGN g_tdref->* TO <it_dyn>.
    CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
    ASSIGN g_wdref->* TO <wa_dyn>.
    SELECT OMENG FROM VBBE INTO CORRESPONDING FIELDS OF TABLE <IT_DYN> WHERE MBDAT IN S_MBDAT.
    BREAK-POINT.
    YOU WILL GET VALUES IN INTERNAL TABLE.
    TO SOLVE YOUR ISSUE YOU SHOULD USE NUM INSTEAD OF DATS.

  • Dynamic Internal Table synatax Problem

    Hi Experts.
    I am creating the Dynamic Internal table by using the method:cl_alv_table_create=>create_dynamic_table.
    we are using the 4.6 version.
    it is showing an error that 'Statemant cl_alv_table_create=>create_dynamic_table ( is not defined, Please check your spelling.
    but the same thing , working in ecc 6.0.
    Thanks in advance,
    Regards,

    Hello
    Most likely there is just a problem with the writing of the method call:
    DATA:
      lt_fcat    TYPE lvc_t_fcat,
      ldo_itab  TYPE REF TO data.
    "... fill fieldcatalog
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      IMPORTING
        it_fieldcatalog = lt_fcat
      EXPORTING
       ep_table          = ldo_itab.
    This coding should be syntactically correct. Perhaps you just need to add the following statement to your report (at the beginning):
    CLASS cl_alv_table_create DEFINITION LOAD.
    On 4.6c the system is not always able to do this itself. You need to explicitly make the class known.
    Regards
      Uwe

  • Problem with grid display in ALV for dynamic internal tables

    Hi,
    I am using dynamic internal tables in my program. To display it in grid format after populating it, I have used the following class and method. Here Im getting sy-subrc = 0 but, the grid is not getting displayed. Can some one pls help me with this.,
    DATA: W_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: w_tabname TYPE w_tabname.
    CREATE OBJECT W_GRID
    EXPORTING I_PARENT = CL_GUI_CONTAINER=>SCREEN0.
    CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = W_TABNAME
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
       IR_SALV_ADAPTER               =
      CHANGING
        IT_OUTTAB                     = <FS_1>
        IT_FIELDCATALOG               = LT_FIELDCATALOG2
       IT_SORT                       =
       IT_FILTER                     =
      EXCEPTIONS
        INVALID_PARAMETER_COMBINATION = 1
        PROGRAM_ERROR                 = 2
        TOO_MANY_LINES                = 3
        others                        = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Here, <FS_1> is the field symbol of table type and it holds all my data. and LT_FIELDCATALOG2  is the structure of my fieldcatalog
    Thanks and Regards,
    Avinash

    Hi Avinash,
    Either use parameter
    I_STRUCTURE_NAME = W_TABNAME
    or
    IT_FIELDCATALOG = LT_FIELDCATALOG2
    Both are not required.
    At the end of ur program simply use a write statement like below. Your program will work.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Write /.      <----
    Thanks,
    Edited by: Sap Fan on Oct 6, 2009 7:17 AM

  • Problem with dynamic internal table updation

    Hello Folks,
      I created  a dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fieldcat
          IMPORTING
            ep_table                  = i_dyntab
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2.
    ASSIGN i_dyntab->* TO <f_dyntable>.
    and created a work area
    CREATE DATA wg_f_split LIKE LINE OF <f_dyntable>.
        ASSIGN wg_f_split->* TO <f_wg_dyntable>.
    My requirement is that , i have to loop a normal internal table and append those records to the filed symbol internal table.
    READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
          IF sy-subrc EQ 0.
            ASSIGN wg_split to <f_wg_dyntable>.
             APPEND <f_wg_dyntable> to <f_dyntable>.
           endif.
    here i am geeting dump as "MOVE src TO dst" ... i can get the data in the work area FSymbol but cannot append it in Internal table Field Symbol.. Please help..
    <Added code tags>
    Edited by: Suhas Saha on Aug 3, 2011 10:52 AM

    Hello Sandra,
    Thanks for the reply..
    First i tried  appending the normal work area to the fieldsymbol  internal table.
      append wg_split to <f_dyntable>
    This is hiting dump the same dump and so i created a fieldsymbol work area. ( <f_wg_dyntable>.)and tried to append the field symbol internal table with this work area. which is again giving the dump
    APPEND <f_wg_dyntable> to <f_dyntable>. ( Again a Dump)
    Edited by: Charan-SAP on Aug 2, 2011 9:40 PM
    Edited by: Charan-SAP on Aug 2, 2011 9:42 PM

  • Problem in creating dynamic internal table

    Hi Experts,
    I am trying creating a dynamic internal table.
    But I am getting the error 'The field string "LT_GENTAB" contains no fields. 4 LT_GENTAB".
    Can anybody tell me what is the error and how to solve it.
    Thanks,
    Sudheer

    Hi,
    Please find the below code.
    data : wa_fieldcat type slis_fieldcat_alv,
           wa_fieldcat1 type slis_fieldcat_alv,
           wa_fieldcat2 type LVC_S_FCAT,
           it_fieldcat type slis_t_fieldcat_alv,
           it_fieldcat1 type slis_t_fieldcat_alv,
           it_fieldcat2 type LVC_T_FCAT,
           V_LAYOUT TYPE SLIS_LAYOUT_ALV,
           LS_LVC_FIELDCATALOGUE  TYPE LVC_S_FCAT,
           LT_LVC_FIELDCATALOGUE  TYPE LVC_T_FCAT,
           IT_EVENTS TYPE SLIS_T_EVENT,
           WA_EVENTS TYPE SLIS_ALV_EVENT.
    data : L_TABLE    TYPE REF TO DATA.
    FIELD-SYMBOLS :  <IT_TABLE>    TYPE STANDARD TABLE.
    FIELD-SYMBOLS :  <IT_ITEM1>    TYPE STANDARD TABLE.
    v_col = 1.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'PRUEFLOS'.
    wa_fieldcat2-seltext   = 'Inspection Lot'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'WERKS'.
    wa_fieldcat2-seltext   = 'Plant'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'ART'.
    wa_fieldcat2-seltext   = 'Inspection Type'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'HERKUNFT'.
    wa_fieldcat2-seltext   = 'Lot Origin'.
    WA_FIELDCAT1-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'STAT35'.
    wa_fieldcat2-seltext   = 'Usage Decision Made'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'ENSTEHDAT'.
    wa_fieldcat2-seltext   = 'Lot created on'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'ERSTELLER'.
    wa_fieldcat2-seltext   = 'Created by'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'PASTRTERM'.
    wa_fieldcat2-seltext   = 'Insp. Start Date'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'PAENDTERM'.
    wa_fieldcat2-seltext   = 'End of Inspection'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'PLNTY'.
    wa_fieldcat2-seltext   = 'Task List Type'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'AUFNR'.
    wa_fieldcat2-seltext   = 'Order No.'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'KTEXTMAT'.
    wa_fieldcat2-seltext   = 'Object short text'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'KURZTEXT'.
    wa_fieldcat2-seltext   = 'Short Text for Code'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'KATALGART1'.
    wa_fieldcat2-seltext   = 'Catalog Type'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'GRUPPE1'.
    wa_fieldcat2-seltext   = 'Code Group'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'CODE1'.
    wa_fieldcat2-seltext   = 'Code'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    *WA_FIELDCAT2-COL_POS = v_col.
    *WA_FIELDCAT2-FIELDNAME = 'ORIGINAL_INPUT'.
    *WA_FIELDCAT2-SELTEXT_M   = 'Original Value'.
    **WA_FIELDCAT2-OUTPUTLEN   = 20.
    *v_col = v_col + 1.
    *APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    *CLEAR  WA_FIELDCAT2.
    loop at it_qamv1 into wa_qamv1.
      read table it_qasr into wa_qasr with key wa_qamv1-prueflos.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = wa_qamv-kurztext.
    wa_fieldcat2-seltext   = wa_qasr-original_input.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    endloop.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'EQUNR'.
    wa_fieldcat2-seltext   = 'Equipment'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'TPLNR'.
    wa_fieldcat2-seltext   = 'Functional Location'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'TPLMA'.
    wa_fieldcat2-seltext   = 'Superior Funct Loc.'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'STATUS'.
    wa_fieldcat2-seltext   = 'Status'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    WA_FIELDCAT2-COL_POS = v_col.
    WA_FIELDCAT2-FIELDNAME = 'INACT'.
    wa_fieldcat2-seltext   = 'Status Inactive'.
    WA_FIELDCAT2-OUTPUTLEN   = 20.
    v_col = v_col + 1.
    APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
    CLEAR  WA_FIELDCAT2.
    Create internal table dynamic
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVC_FIELDCATALOGUE
        IMPORTING
          EP_TABLE        = L_TABLE.
      ASSIGN L_TABLE->* TO <IT_TABLE>.
    I am getting the error when the method  CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    is executed.
    Please help me
    Thanks,
    Sudheer

  • Dynamic internal table with problem

    Hi,
    I have developed a program to update standard table. I am using dynamic internal table creation concept. But my dynamic internal table is having width only 1200 bytes. But many standard tables have more than that width. Do you have any input create dynamic internal table with more than 1200 bytes width..
    Have a look at the error.
    [http://3.bp.blogspot.com/_O5f8iAlgdNQ/SjYXTBpO92I/AAAAAAAAErI/Fs996_APHbE/s1600-h/error-792463.JPG|http://3.bp.blogspot.com/_O5f8iAlgdNQ/SjYXTBpO92I/AAAAAAAAErI/Fs996_APHbE/s1600-h/error-792463.JPG]
    Expecting reply
    Thanks
    Venkat

    Hi,
    DATA: IT_TABSTRUC     TYPE STANDARD TABLE OF DFIES INITIAL SIZE 0,
            V_REF        TYPE REF TO DATA,
              V_I_AVL_CAT  TYPE TABLE OF LVC_S_FCAT.
    FIELD-SYMBOLS : <F_FS_DATA>   TYPE STANDARD TABLE.
    SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001
    NO INTERVALS.
    PARAMETERS: P_TABNAM TYPE X_TABNAME.
    SELECTION-SCREEN:END OF BLOCK B1.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          TABNAME        = p_tabnam
          LANGU          = SY-LANGU
        TABLES
          DFIES_TAB      = IT_TABSTRUC
        EXCEPTIONS
          NOT_FOUND      = 1
          INTERNAL_ERROR = 2
          OTHERS         = 3.
      LOOP AT IT_TABSTRUC .
        V_LS_AVL_CAT-FIELDNAME = IT_TABSTRUC -FIELDNAME.
        V_LS_AVL_CAT-REF_TABLE = P_TABNAM.
        V_LS_AVL_CAT-REF_FIELD = IT_TABSTRUC -FIELDNAME.
        APPEND V_LS_AVL_CAT TO V_I_AVL_CAT.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = V_I_AVL_CAT
        IMPORTING
          EP_TABLE        = V_REF.
      ASSIGN V_REF->* TO <F_FS_DATA>.
      FREE V_REF.
      SELECT * FROM (P_TABNAM) INTO CORRESPONDING
              FIELDS OF TABLE <F_FS_DATA> .
    Hope this resolves ur probs....

  • Problem disalying alv using dynamic internal table

    Hi All,
        I have 4 radiobutton for each radiobutton there is one internaltable to be displayed in alv.
    My requirement is intead of calling the function module reuse_alv_grid_display everytime for
    each of the internal table I want to create a dynamic internal tble for the function module.
       My question is how to create a dynamic internal table which will hold the fields & data of
    different interna table when diffrent radiobuttons are checked.
       Areciate your time to help.
       Thank you very much.

    Hi follow following logic:
    field-symbols: <i_table> type standard table.
    when rb1 is checked.
    assign itab1 to <i_table>.
    perform alv_disp using <i_table>
    when rb2 is checked.
    assign itab2 to <i_table>.
    perform alv_disp using <i_table>
    when rb3 is checked.
    assign itab3 to <i_table>.
    perform alv_disp using <i_table>
    when rb4 is checked.
    assign itab4 to <i_table>.
    perform alv_disp using <i_table>
    <<<<<<<<<<form alv_disp
    form alv_disp  using p_i_table type standard table.
    perform create fieldcatelog changing i_fc
    call the fm and pass the table p_i_table and i_fc
    <<<<<<<<<< form create fieldcaelog
    here create field catelog ..either by fm reuse_alv_fieldcatelog_merge ...in this just pass the structure name based on the radiobutton
    hope its useful

  • Passing dynamic internal table into ALV

    I have made one ALV report where i had created one button 'GENERATE'.  ON CLICKING THIS BUTTON the data in the ALV report is downloaded to excel file.
    i have used this:-
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = l_title
          default_extension    = 'XLS'
          initial_directory    = 'C:\'
        CHANGING
          filename             = filename
          path                 = path
          fullpath             = fullpath
          user_action          = user_action
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    Check which button is pressed
      IF user_action <> cl_gui_frontend_services=>action_ok.
        EXIT.
      ENDIF.
    Download error data collected from the internal table
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = fullpath
          filetype                = 'ASC'
          write_field_separator   = '#'
         codepage                = '4103'
         write_bom               = c_true
        CHANGING
          data_tab                = gi_final
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          not_supported_by_gui    = 22
          error_no_gui            = 23
          OTHERS                  = 24.
    If selection is successful
      IF sy-subrc EQ 0.
        MESSAGE s004 . " File  created successfully
      ELSE.
        MESSAGE i005 . " File is not created successfully
      ENDIF.
    In the table i have passed the internal table . this is working fine.
    <b>But,
    The problem is if i want to display the data in diferent layout based on selection screen criteria the data downloaded are same as default layout.
    how to pass a dynamic internal table in the
    CALL METHOD cl_gui_frontend_services=>gui_download</b>

    Hi    ,
    here is the Program for  Download  
    REPORT yrs_download_transport_request.
    PARAMETERS:
      p_reqest TYPE trkorr OBLIGATORY,
      p_folder(255) TYPE c LOWER CASE, p_sepr OBLIGATORY.
    DATA:
      folder TYPE string,
      retval LIKE TABLE OF ddshretval WITH HEADER LINE,
      fldvalue LIKE help_info-fldvalue,
      transdir TYPE text255,
      filename(255),
      trfile(20) TYPE c,
      datatab TYPE TABLE OF text8192 WITH HEADER LINE,
      len TYPE i,
      flen TYPE i.
    TYPE-POOLS: sabc, stms, trwbo.
    INITIALIZATION.
      CONCATENATE sy-sysid 'K*' INTO p_reqest.
      IF sy-opsys = 'Windows NT'.
        p_sepr = ''.
      ELSE.
        p_sepr = '/'.
      ENDIF.
    *  CALL FUNCTION 'WSAF_BUILD_SEPARATOR'
    *       IMPORTING
    *            separator                  = p_sepr
    *       EXCEPTIONS
    *            separator_not_maintained   = 1
    *            wrong_call                 = 2
    *            wsaf_config_not_maintained = 3
    *            OTHERS                     = 4.
    *  IF sy-subrc NE 0.
    *    MESSAGE s001(00)
    *      WITH
    *      'Unable to find out the separator symbol for the system.'(011).
    *  ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_reqest.
      DATA:
        tt_system TYPE TABLE OF tmscsys WITH HEADER LINE,
        es_selected_request TYPE trwbo_request_header,
        es_selected_task TYPE trwbo_request_header,
        iv_organizer_type TYPE trwbo_calling_organizer,
        is_selection TYPE trwbo_selection.
      iv_organizer_type = 'W'. is_selection-reqstatus = 'R'.
      CALL FUNCTION 'TR_PRESENT_REQUESTS_SEL_POPUP'
        EXPORTING
          iv_organizer_type   = iv_organizer_type
          is_selection        = is_selection
        IMPORTING
          es_selected_request = es_selected_request
          es_selected_task    = es_selected_task.
      p_reqest = es_selected_request-trkorr.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
      DATA: title TYPE string.
      title = 'Select target folder'(005).
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title    = title
        CHANGING
          selected_folder = folder
        EXCEPTIONS
          cntl_error      = 1
          error_no_gui    = 2
          OTHERS          = 3.
      CALL FUNCTION 'CONTROL_FLUSH'
        EXCEPTIONS
          cntl_system_error = 1
          cntl_error        = 2
          OTHERS            = 3.
      p_folder = folder.
    AT SELECTION-SCREEN ON p_reqest.
      DATA: request_info TYPE stms_wbo_request,
            request_infos TYPE stms_wbo_requests.
      REFRESH request_infos.
      CALL FUNCTION 'TMS_MGR_READ_TRANSPORT_REQUEST'
        EXPORTING
          iv_request                 = p_reqest
          iv_header_only             = 'X'
        IMPORTING
          et_request_infos           = request_infos
        EXCEPTIONS
          read_config_failed         = 1
          table_of_requests_is_empty = 2
          system_not_available       = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR request_info.
      READ TABLE request_infos INTO request_info INDEX 1.
      IF sy-subrc NE 0
      OR request_info-e070-trkorr IS INITIAL.
        MESSAGE e398(00) WITH 'Request'(006) p_reqest 'not found'(007).
      ELSEIF request_info-e070-trstatus NE 'R'.
        MESSAGE e398(00)
        WITH 'You must release request'(008)
             request_info-e070-trkorr
             'before downloading'(009).
      ENDIF.
    START-OF-SELECTION.
      folder = p_folder.
      CONCATENATE p_reqest+3(7) '.' p_reqest(3) INTO trfile.
      CALL FUNCTION 'RSPO_R_SAPGPARAM'
        EXPORTING
          name   = 'DIR_TRANS'
        IMPORTING
          value  = transdir
        EXCEPTIONS
          error  = 0
          OTHERS = 0.
      PERFORM copy_file USING 'cofiles' trfile.
      trfile(1) = 'R'.
      PERFORM copy_file USING 'data' trfile.
      trfile(1) = 'D'.
      PERFORM copy_file USING 'data' trfile.
    * FORM copy_file *
    * --> SUBDIR * * --> FNAME *
    FORM copy_file USING subdir fname.
      DATA:
        auth_filename TYPE authb-filename,
        gui_filename TYPE string.
      CONCATENATE transdir subdir fname
        INTO filename
        SEPARATED BY p_sepr.
      REFRESH datatab.
      CLEAR flen.
      auth_filename = filename.
      CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
        EXPORTING
          activity         = sabc_act_read
          filename         = auth_filename
        EXCEPTIONS
          no_authority     = 1
          activity_unknown = 2
          OTHERS           = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_NEGATIVE.
        WRITE: / 'Read access denied. File'(001),
                  filename.
        FORMAT COLOR OFF. EXIT.
      ENDIF.
      OPEN DATASET filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        FORMAT COLOR COL_TOTAL.
        WRITE: / 'File open error'(010), filename.
        FORMAT COLOR OFF. EXIT.
      ENDIF.
      DO.
        CLEAR len.
        READ DATASET filename INTO datatab LENGTH len.
        flen = flen + len.
        IF len > 0. APPEND datatab. ENDIF.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET filename.
      CONCATENATE p_folder '' fname INTO gui_filename.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          bin_filesize            = flen
          filename                = gui_filename
          filetype                = 'BIN'
        CHANGING
          data_tab                = datatab[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 24.
      IF sy-subrc = 0.
        WRITE: / 'File'(002), filename, 'downloaded. Length'(003), flen.
      ELSE.
        FORMAT COLOR COL_NEGATIVE.
        WRITE: / 'File download error. Filename:'(004), filename.
        FORMAT COLOR OFF.
      ENDIF.
    ENDFORM. "copy_file
    Reward  points if it is usefull....
    Girish

  • Deleting selected record in Dynamic Internal table

    Hi Friends,
    I want to delete selected row from a dynamic internal table. The selected entry should be deleted from Adobe and as well as Webdynpro abap.
    Kindly help me how to solve this problem.
    Thanks in advance.
    Regards,
    Phani.

    Hi Matthias,
    Thanks a lot for responding.
    In my adobe i kept a check box to delete the record. It should delete the selected ones. But right now, its deleting one by one.
    I have coded following script for delete button:
    IT_TIME_SHEET --> is my internal table
    G_ROW_STATUS is the field to track the action performed.
    var tlength = xfa.resolveNodes("IT_TIME_SHEET.DATA[*]").length;
    for ( var i=0; i<tlength; i++
    if(xfa.resolveNode("IT_TIME_SHEET.DATA["i"].FLAG").rawValue ==
    1 )
    IT_TIME_SHEET.DATA.instanceManager.removeInstance(i);
    G_ROW_STATUS.rawValue = "DELETE";
    In the Webdynpro abap following code I wrote:
        row_count = 1.
        FIELD-SYMBOLS <wa> TYPE zshr_time_sheet_time.
        LOOP AT it_time_sheet ASSIGNING <wa>.
          <wa>-srl_no = row_count.
          row_count = row_count + 1.
        ENDLOOP.
        last_row = <wa>-srl_no.
          DELETE it_time_sheet WHERE srl_no EQ last_row.
    Suppose if two records checkboxes are selected I can loop at the internal table IT_TIME_SHEET in webdynpro and delete where checkbox is selected.
    But problem is once user deletes records, adobe is deleting only one record and if i delete two records from webdynpro it looks like something wrong for the user.
    Please help me how to solve this problem.
    Regards,
    Phani.

  • Dynamic ITAB copy problem with field type P

    Hello everyone
    I need to copy the structure of an internal table that is pass by reference into a method.
    Actually everything is fine else than the field type P with decimal is not created properly in the new itab.
    Scenario:
    An internal table is pass by reference to a method. We need to trait the data without modifying the original table. The Idea is to copy the structure and the data of the referenced internal table into an internal table created dymanically in the method.
    Here is what I did and working fine when there are no field of data type "CURR".
    Extract the structure of the reference data.
    Create a dynamic internal table.
    So far so good. Everything seams to work fine. BUT
    when I am trying to copy the data from the reference table to the just created internal table the field with data type "CURR" doesn't work.
    Here is my example:
    FIELD-SYMBOLS: <FS_TABLE> TYPE STANDARD TABLE,
                   <TMP_TABLE> TYPE STANDARD TABLE,
                   <LS_TMP_TABLE> TYPE ANY,
                   <LS_TABLE>     TYPE ANY,
                   <LS_VALUE>     TYPE ANY.
    DATA: lt_data      TYPE STANDARD TABLE OF vbak,
          ls_data      LIKE LINE OF lt_sortfield,
          ref_data     TYPE REF TO data,
          l_structure  TYPE REF TO DATA,
          lv_ltname    TYPE string.               
    select * from vbak UP TO 10 rows INTO CORRESPONDING FIELDS OF TABLE lt_data.
    * --- Assign the reference variable to the table
    * ---- Only use to simulate a parameter that is assign to a reference to a internal table
    unassign <FS_TABLE>.
    lv_ltname = 'lt_data[]'.
    ASSIGN (lv_ltname) to <FS_TABLE>.
    GET REFERENCE OF <FS_TABLE>[] INTO ref_data.
    * --- Assign the reference to the field-symbol
    UNASSIGN <FS_TABLE>.
    ASSIGN ref_data->* TO <FS_TABLE>.
    * --- Create a working area for the reference table to a field-table
    CREATE DATA l_structure LIKE LINE OF <FS_TABLE>.
    ASSIGN l_structure->* TO <LS_TABLE>.
    * --- Retrieve the structure of the field-symbol pointing to the internal table
    DATA: lr_tabledescr   TYPE REF TO cl_abap_tabledescr,   " Internal Table description
          _r_structdescr  TYPE REF TO cl_abap_structdescr.
    lr_tabledescr ?= cl_abap_tabledescr=>describe_by_data( <fs_table> ).
    _r_structdescr ?= lr_tabledescr->get_table_line_type( ).
    * --- Read internal table structure to create dynamic internal table
    data: ls_struc like LINE OF _r_structdescr->components,
          xfc           type lvc_s_fcat,
          ifc           type lvc_t_fcat.
    * --- Why the field (component) NETWR length is now 8 instead of 15?
    LOOP AT _r_structdescr->components into ls_struc.
      clear xfc.
      xfc-fieldname = ls_struc-name .
      xfc-datatype  = ls_struc-type_kind.
      xfc-inttype   = ls_struc-type_kind.
      xfc-intlen    = ls_struc-length.
      xfc-decimals  = ls_struc-decimals.
      append xfc to ifc.
    ENDLOOP.
    DATA:   dy_table      type ref to data,
    * --- Create dynamic internal table
    call method cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = ifc
      IMPORTING
        ep_table        = dy_table.
    * --- assign reference internal table to Field-symbol
    assign dy_table->* to <tmp_table>.
    unassign <ls_tmp_table>.
    DATA: ls_tmp_struc type REF TO DATA.
    CREATE DATA ls_tmp_struc like LINE OF <tmp_table>.
    ASSIGN ls_tmp_struc->* TO <ls_tmp_table>.
    Loop at <fs_table> INTO <LS_TABLE>.
    MOVE-CORRESPONDING <ls_table> TO <ls_tmp_table>.
    APPEND <ls_tmp_table> TO <tmp_table>.
    ENDLOOP.
    * <fs_table>-netwr length is 15
    * <ls_tmp_table>-netwr length is 8
    * ??????????? Why the length is different?
    * ??????????? It should a structure copy and have the
    * ??????????? same length
    I use VBAK as example, and the field NETWR is using data type "NETWR_AK" where it us a data type "CURR" with length 15 and decimal 2.
    When reading the structure, the method get_table_line_type of the class cl_abap_tabledescr return a length of 8 instead of 15.
    Any idea how to get the exact structure of a variable that is refering to a data type?
    Regards
    Daniel

    Hello Everyone
    Thank you for your replies.
    I think I didn't explain myself clearly.
    My goal is to be able to create an exact  structure copy of a "Type ref to data" into a new internal table that is not defined yet.
    Example:
      A method contain a parameter that is a ref to DATA type.
      That parameter is refering to an internal table from the calling program.
      Now I want to create an internal table into the method where this one will be an exact structure copy of the parameter.
      So, lets put some name here.
      parameter: ip_data type ref to data.
      FIELD-SYMBOLS: <FS_REF_DATA> TYPE STANDARD TABLE,
                                    <FS_CP_DATA>  TYPE STANDARD TABLE.
    ASSIGN ip_data->* TO <FS_REF_DATA>.
    " some code to assign the same structure to <FS_CP_DATA> from <FS_REF_DATA>
    " than copy the data from <FS_REF_DATA> to <FS_CP_DATA>.
    <FS_CP_DATA> [ ] = <FS_REF_DATA> [ ].  " This is working if no type P with decimal exist into the structure
    " Than I can play with the data of <FS_CP_DATA> without modifying the data of <FS_REF_DATA>.
    My problem would be solved if I can create dynamically an internal table that has an exact structure copy of the passed parameter.
    Regards
    Daniel

  • Declare dynamic internal table during runtime error

    Hi Gurus,
    I have encounter a problem here. I would like to have several block of alv list output; for each customer open items details. Thus, i need to create dynamic internal table duirng runtime as i do not know how many customers that should be output before user enter from the selection screen field for customer code.
    I tried to search in the forums and found this website [Runtime Declaration of Internal Table;.
    But when i tried to execute it, i have an error. The field symbols that i passed into the call function REUSE_ALV_BLOCK_LIST_APPEND for parameter t_outtab does not match. May i know how do i go about it?
    Or are there any other solutions to display this kind of reports? I ever think of using hierarchy list alv. But it does not match the requirement. I would like to display the total amount for each customer. Can hierarchy list able to do so? Or it can only display as the grand total at the end of the report? I think it would be best to display as alv block output.
    Your help will be much appreciated. <offer removed by moderator>
    Thanks
    Edited by: Thomas Zloch on Oct 22, 2010 11:23 AM

    the problem comes up, when there are fields in the table which represent numbers with decimals (type p). Best is to reference the field directly what comes from SAP. Replace the LOOP At idetails ... ENDLOOP with:
    LOOP AT idetails INTO xdetails.
        CLEAR xfc.
        xfc-fieldname = xfc-ref_field = xdetails-name .
        xfc-ref_table   = p_table.
    *    xfc-datatype = xdetails-type_kind.
    *    xfc-inttype = xdetails-type_kind.
    *    xfc-intlen = xdetails-length.
    *    xfc-decimals = xdetails-decimals.
        APPEND xfc TO ifc.
      ENDLOOP.

Maybe you are looking for

  • I tunes downloads help

    Recently I down loaded a movie from I tunes onto my iPad .    I took another of my iPads , signed out the existing apple i.d. And signed in my apple I.d. Which was used to purchase the movie and downloaded it on my second iPad. It worked but when I s

  • Get pernr statement

    Hi, I just want to know how to debug the get pernr statement or to know what is happening by this statement in the program. Thing is that, I have a scenario where, for a particular employee ID the get pernr statement gets executed with sy-subrc value

  • Forced return, non-breaking hyphens & spaces, suppress hyphenation + XML

    Forced return (linefeed), non-breaking hyphens and spaces, suppress hyphenation. None of these are preserved when exporting from FrameMaker to XML, since they do not seem to be represented by a Unicode code point. My question to you is: How do you de

  • Adobe standard 9 crashes in Office 10 - is their an update?

    When trying to use Adobe Standard 9.1 version  with Office 10 it seems to hang and then crash causing Office 10 to turn off the plug in.  is their an update available?

  • Can RH 11 create this output: just HTML + CSS?

    I have a FrameMaker 12 book comprising 31 FM files, and I have RH 11 as part of TCS5. All are patched up. From my FrameMaker files, I want to create only HTML files that use a single CSS, with the only added baggage being linked graphics. I don't wan