Dynamic Smartform - Matrix structure

Hi All
i have a requirement to create a table dynamically in a matrix format. i am new to smartforms
scenario is something like
1) My internal table structure
*Article   Store     Quantity*
1a         S303         2
2a         S304            3
3a          S305         2
4a          S306         4
5a         S307         5
1b         S303         2
2b         S304         3
3b         S305         2
4b         S306         4
5b         S307         5
i want my smartform to be like
*Article     S303         S304     S305         S306     S307*
1a              2          3               2           4                5
1b              2          3               2           4            5
suggest me how can i achieve this.thanks in advance.
Internal table structure may vary time to time
Regards
Chaitanya.A

Article   Store     Quantity
1a         S303         2
2a         S304         3
3a          S305         2
4a          S306         4
5a         S307         5
1b         S303         2
2b         S304         3
3b         S305         2
4b         S306         4
5b         S307         5
for this same internal table you have one more filed like char1.
new internal table is
Article   Store     Quantity   char1
1a         S303         2           a
2a         S304         3           a
3a          S305         2            a
4a          S306         4            a
5a         S307         5            a
1b         S303         2             b
2b         S304         3            b
3b         S305         2             b
4b         S306         4          b
5b         S307         5           b
here you can take 2 varibles like
data: var1 type char 250,
        var2 type char250,
        lv_n(3)   type n.
lv_n = 20
loop at newitab into wa_itab.
concatenate ' 10 char space'  wa_itab-store  into var1+lv_n(20).
concatenate ' 10 char space'  wa_itab-Quantity into var2+lv_n(20). .
at end of char1.
append var1 to final  interbal table
append var2 to final  interbal table
clear lv_n.
lv_n = 20.
endat.
lv_n = lv_n + 20.
endloop.

Similar Messages

  • BPC 10.0 NW - Matrix structured security

    Hej Gurus,
    I have been searching the internet for information about the possibility of doing matrix structured security in BPC 10.0 NW.
    I have found that it is possible to do in 7.5 using a BADI, and I know that it is standard in BPC 10.1. However, I have not found a conclusive proof of it being possible in BPC 10.0 NW, can somebody please confirm og decline the possiblity of using security structured security.
    If it is possible, how can we acheive it?
    Best regards,
    Mikkel Kristensen

    Hi Gersh,
    It seems to be a hidden feature within BPC 10.1.  For example it is not mentioned in the security guide.
    What is needed is some sort of how to guide for this.  In fact there are no how to guides for BPC 10.1 at all!!  Something I find surprising as the product has been GA for several months.
    You said that it is delivered and works in 10.1.  Can you please explain how to activate and implement it.
    Regards,
    Mark

  • Dynamic internal table structure

    pl. give the solution to create dynamically internal table structure with respective of different table.

    Hi and welcome to the SDN,
    this topic is more related to abap, but anyway:
    data: l_tabname(30) type c value 'MARA',
          ref_data type ref to data.
    field-symbols: <fs_tab> type table.
    create data ref_data type standard table of (l_tabname).
    assign ref_data->* to <fs_tab>.
    Now <fs_tab> is a internal table with structure of table mara.
    Hope this helps!
    regards
    Siggi

  • Matrix Structures

    I have created a matrix in two dimensions. Functional and Administrative. I have created relationship between a position and two superior positions. For the first superior position, I used 002 and for the second superior positions I used 004 relationship. (I hope 002 cannot be used twice for the same position.)
    I tried to generate the matrix structure. The dot was black only in 002 relationship. It should be black in 004 also, but it is not black.
    Points assured!
    Thanks,
    Nivedita

    Hi
    Why do you want to use the relation 004 for. Can you just explain the scenario.
    As in Matrix structures scenario you have explained i think u want to give one person reporting to two different managers am i Right?
    If it is so please use the dotted line relationship for the second position reporting than using the relation 004.
    Ge back if problem exists.
    R K

  • Matrix structure with MSS

    Hi , good Afternoon.
    Is posible user matrix structure (Matrix Organizations) with MSS?
    Regards

    Hi Juan,
    That's possible, but you have to follow OADP config (to include the custom relationship from your matrix org), then make accesible to MSS apps.
    You can enhance a group of org. views (by adding your custom relationships) to avoid do changes to MSS apps; for example for appraisal documents you have the 'MSS_HAP_STATUS' group, with the following views;
    MSS_HAP_EE_DIR
    MSS_HAP_EE_ORG1
    MSS_HAP_EE_ORG2
    MSS_HAP_EE_SRCH
    you can add a (previous created) custom view;
    ZEE_FROM_MATRIX
    Or create a new group, then depending on the app, you have to do some changes (for FPM apps like Employee Information -> maintain the FPM, in another, just change iView properties).
    Check for OADP config in the SDN Community, there is a lot of threads that can help you to build your custom solution.
    you can start in SAP Help: http://help.sap.com/saphelp_erp2004/helpdata/en/7f/bb834014d26f1de10000000a1550b0/content.htm
    KR!

  • SSRS - Expression to color column value dynamically in Matrix

    Hi ,
    I have a matrix which looks like :
    The <<Expr>> value can be 1 /0 /"-" .
    The Expr value is being calculated dynamically.
    The data set query I am using has a column called due_days.
    In the color expression of the <<Exp>> box I am using the expression as :
    =IIf(Fields!Due_Days.Value>14  and Fields!Notes_Count.Value>0,"Blue",(Iif(Sum(Fields!Notes_Count.Value)=0 ,"Red","Black")))
    My requirement is if the Due_Days column value is >14 then I need to highlight the value as blue else black and if value is 0 then red. When I use the above query it is just highlighting the color blue for 1st column only. Eg: 4th row . Due days for month
    of Oct and Nov is > 14 but it shows blue only for month of oct.
    How can i resolve the issue?

    In select query i have 5 columns:
    Due days(Which is difference between 2 dates) ,
    Notes count (Which is just a count of notes  entered or not having value 0/1  and value '-' if another column CRD is greater than the matrix month and year.)Eg: below date 11/12/2014 is greater than Oct 2014 hence Oct 2014 should have "-"
    Month Name , Year , Month Nbr (last 6 months which I cross joined with the table to get counts for each month)
    The matrix has year and last 6 month  as column groups
    Color coding should be if notes count is 0 then red  ,if notes count is 1 and due_days> 14 then blue else black . When i try to use expression for color as i mentioned above, it colors only 1st colum.eg:  2nd row
    Nov 2014 is blue but for jan 2014 also it should show blue as due days>14 .
    Is there any way i can do that ??
    Eg: data set returns value as :
    Due Days        CRD                              Month         
    Month_Nbr    Year   Notes _Count
    5             2014-11-28 00:00:00.000    December          12         2014       
    0
    5               2014-11-28 00:00:00.000    February           2         2015        
    0
    5             2014-11-28 00:00:00.000    January              1           2015      
    0
    5            2014-11-28 00:00:00.000    November          11          2014       1
    5            2014-11-28 00:00:00.000    October              10          2014        0
    5            2014-11-28 00:00:00.000    September          9           2014         0
    Matrix is of the form :
                  YEAR
                  MONTH
    CRD        Notes_count

  • Dynamic Creation of Structures

    Hey experts,
    I have a question concerning working with dynamic structures.
    I create a work area according to a dynamic table, which is created at runtime.
    How many columns it is going to have is also dynamic.
    The columns names are saved in another table.
    So if I create a workarea as a line of this table, how do I adress it?
    wa_checkboxes-*variable where name of the field is saved* = 'X'.
        APPEND wa_checkboxes TO it_final.
    Unfortunately this doesnt work
    Thanks in advance for your help!

    OK, basically all of you were right
    I just append X to flag from which system the table lines are comming, for further use.
    This is how you can use dynamically created structures.
    dest_in contains external destinations, calling_sys is the current system (everything is contained in a function module).
    Thanks to everybody!
    FIELD-SYMBOLS: <wa_dest_table> TYPE any.
      DATA dest_table_buffer TYPE REF TO data.
      CREATE DATA dest_table_buffer LIKE LINE OF dest_table.
      ASSIGN dest_table_buffer->* TO <wa_dest_table>.
      FIELD-SYMBOLS <fs_val> TYPE any.
      DATA fs_val_buffer TYPE c.
      ASSIGN fs_val_buffer TO <fs_val>.
      DATA rowcount TYPE i.
      rowcount = lines( <dyn_tab_fm> ).
      DO rowcount TIMES.
        IF dest_in = ''.
          ASSIGN COMPONENT calling_sys OF STRUCTURE <wa_dest_table> TO <fs_val>.
          <fs_val> = 'X'.
          APPEND <wa_dest_table> TO dest_table.
        ELSE.
          ASSIGN COMPONENT dest_in OF STRUCTURE <wa_dest_table> TO <fs_val>.
          <fs_val> = 'X'.
          APPEND <wa_dest_table> TO dest_table.
          endif.
        ENDDO.

  • Dynamic Combination of structure in Query

    I have a characteristic structure cross with a key figure structure
    characteristic structure
    C1 - A
    C1 - B
    C1 - C
    key figure structure
    KF1
    KF2
    KF3
    Report layout
                A                     B                    C
    xxx      KF1 KF2 KF3    KF1 KF2 KF3  KF1 KF2 KF3
    Can the structure made to be dynamic according to input variable?
    Points will be awarded for helpful answers. Thanks.

    That means I need to build a query for each combination, say
    Report 1
                A                       B
    XXX      KF1   KF2   KF3  KF1   KF2   KF3 
    Report 2
                B                       C
    XXX      KF1   KF2   KF3  KF1   KF2   KF3
    Report 3
                A                       D
    XXX      KF1   KF2   KF3  KF1   KF2   KF3
    Do I need to build 3 queries?
    Or it there any way I build query
                A          B         C        D
    XXX      KF1....   KF1...   KF1...  KF1...
    and then hide a group of columns on demand in report?

  • Dynamic Table - Deep Structure

    Hi Gurus,
    this is my first posting, so be patient!
    I want to create a deep structure dynamic table via method
    cl_alv_table_create=>create_dynamic_table, is this possible? Are there tricks to make it happen?
    Background: i wanna create an alv with dynamic fieldcatalalog, in this case i want to colour special fields, which is done by lvc_s_layo-?csp_fieldname? in combination with a field in my internal table which is typed ?lvc_t_scol?. Is this possible under 6.2.43
    thanxs for your replies
    juergen
    - ?i dont actually know by rote the correct fieldnames of lvc_xxxxx?

    Hi Jurgen, I took on the challenge.  This program provides a dynamic table with the ability to set the colors of the cells.
    Create the structure ZCDF_CELL_COLOR in the dictionary as described in the program.
    Create screen 100 as empty, with next screen set to 0, and the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE initialization.
    PROCESS AFTER INPUT.
    REPORT  zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring
    DATA:
      r_dyn_table      TYPE REF TO data,
      r_wa_dyn_table   TYPE REF TO data,
      r_dock_ctnr      TYPE REF TO cl_gui_docking_container,
      r_alv_grid       TYPE REF TO cl_gui_alv_grid,
      t_fieldcat1      TYPE lvc_t_fcat, "with cell color
      t_fieldcat2      TYPE lvc_t_fcat, "without cell color
      wa_fieldcat      LIKE LINE OF t_fieldcat1,
      wa_cellcolors    TYPE LINE OF lvc_t_scol,
      wa_is_layout     TYPE lvc_s_layo.
    FIELD-SYMBOLS:
      <t_dyn_table>    TYPE STANDARD TABLE,
      <wa_dyn_table>   TYPE ANY,
      <t_cellcolors>   TYPE lvc_t_scol,
      <w_field>        TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
      wa_fieldcat-fieldname = 'FIELD1'.
      wa_fieldcat-inttype   = 'C'.
      wa_fieldcat-outputlen = '10'.
      wa_fieldcat-coltext   = 'My Field 1'.
      wa_fieldcat-seltext   = wa_fieldcat-coltext.
      APPEND wa_fieldcat TO t_fieldcat1.
      wa_fieldcat-fieldname = 'FIELD2'.
      wa_fieldcat-inttype   = 'C'.
      wa_fieldcat-outputlen = '10'.
      wa_fieldcat-coltext   = 'My Field 2'.
      wa_fieldcat-seltext   = wa_fieldcat-coltext.
      APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table,
    *  save fieldcatalog to pass
    *  to ALV call.
      t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    *  ZCDF_CELL_COLOR is a structure in the
    *   dictionary with one
    *   field called T_CELL_COLOR of type LVC_T_SCOL.
      wa_fieldcat-fieldname = 'T_CELLCOLORS'.
      wa_fieldcat-ref_field = 'T_CELL_COLOR'.
      wa_fieldcat-ref_table = 'ZCDF_CELL_COLOR'.
      APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = t_fieldcat1
        IMPORTING
          ep_table                  = r_dyn_table
        EXCEPTIONS
          generate_subpool_dir_full = 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.
    * Get access to new table using field symbol.
      ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
      CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
      ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere.  Field names are
    *  known at this point because field catalog is already
    *  built.  Read field names from the field catalog or use
    *  COMPONENT <number> in a DO loop to access the fields. 
    *  A simpler hard coded approach is used here.
      ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'ABC'.
      ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'XYZ'.
      APPEND <wa_dyn_table> TO <t_dyn_table>.
      ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'TUV'.
      ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'DEF'.
      APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. 
    *  In this example, a test on
    *  FIELD2 is used to decide on color.
      LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
        ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
          TO <w_field>.
        ASSIGN COMPONENT 'T_CELLCOLORS'
          OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
        CLEAR wa_cellcolors.
        wa_cellcolors-fname     = 'FIELD2'.
        IF <w_field> = 'DEF'.
          wa_cellcolors-color-col = '7'.
        ELSE.
          wa_cellcolors-color-col = '5'.
        ENDIF.
        APPEND wa_cellcolors TO <t_cellcolors>.
        MODIFY <t_dyn_table> FROM <wa_dyn_table>.
      ENDLOOP.
      CALL SCREEN 100.
    *  MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
      IF r_dock_ctnr IS INITIAL.
        CREATE OBJECT r_dock_ctnr
               EXPORTING
                  side  =  
                    cl_gui_docking_container=>dock_at_left
                  ratio = '90'.
        CREATE OBJECT r_alv_grid
               EXPORTING i_parent = r_dock_ctnr.
    *   Set ALV controls.
        wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    *   Display.
        CALL METHOD r_alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = wa_is_layout
          CHANGING
            it_outtab       = <t_dyn_table>
            it_fieldcatalog = t_fieldcat2.
      ELSE.     "grids already prepared
    *   Refresh display.
        CALL METHOD r_alv_grid->refresh_table_display
          EXPORTING
            i_soft_refresh = ' '
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
      ENDIF.
    ENDMODULE.                 " initialization  OUTPUT

  • Dynamic creation of structure

    hi friends ,
    i want to do code that user will enter the name of the table on selection screen as input and the the program will create dynamically a structure of that table and an internal table.
    pls help me out .

    Hey here is the code... I just tried and it's working fine..
    type-pools: slis.
    parameters:
      p_table type dfies-tabname.
    DATA:
      T_FIELDCAT TYPE LVC_T_FCAT ,
      fs_fcat type line of LVC_T_FCAT ,
      T_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    data: NEW_table type  ref to data.
    data: new_line  type ref to data.
    FIELD-SYMBOLS: <l_table> TYPE table,
                   <l_line>  TYPE ANY,
                   <l_field> TYPE ANY.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      I_BUFFER_ACTIVE              = I_BUFFER_ACTIVE
       I_STRUCTURE_NAME             = p_table
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           = I_BYPASSING_BUFFER
      I_INTERNAL_TABNAME           = p_table
      CHANGING
        ct_fieldcat                  = t_fieldcat
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
    if sy-subrc eq 0.
    endif.
      call method cl_alv_table_create=>create_dynamic_table
         exporting
           it_fieldcatalog = T_FIELDCAT[]
          importing
            ep_table        = NEW_table .
    ASSIGN new_table->* TO <l_table>.
    CREATE DATA new_line LIKE LINE OF <l_table>.
    ASSIGN new_line->* TO <l_line>.
    ASSIGN COMPONENT 'MATNR' OF STRUCTURE <l_line> TO <l_field>.
    <L_FIELD> = '12345'.
    ASSIGN COMPONENT 'WERKS' OF STRUCTURE <l_line> TO <l_field>.
    <L_FIELD> = '1000'.
    APPEND <L_LINE> TO <L_TABLE>.
    ASSIGN COMPONENT 'MATNR' OF STRUCTURE <l_line> TO <l_field>.
    <L_FIELD> = '52349'.
    ASSIGN COMPONENT 'WERKS' OF STRUCTURE <l_line> TO <l_field>.
    <L_FIELD> = '2000'.
    APPEND <L_LINE> TO <L_TABLE>.
    *LOOP AT <L_TABLE> INTO <L_LINE>.
    *WRITE: / <L_LINE>.
    *ENDLOOP.
    LOOP AT T_FIELDCAT into fs_fcat.
    T_FCAT-FIELDNAME = fs_fcat-FIELDNAME.
    T_FCAT-REF_TABNAME = fs_fCAT-REF_TABLE.
    APPEND T_FCAT.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = T_FCAT[]
      TABLES
        t_outtab                          = <l_table>
    EXCEPTIONS
       PROGRAM_ERROR                     = 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.

  • ALV dynamic with deep structure

    Hi All,
    I need to program an ALV Report with a deep structure based on a outbound proxy  structure, so I should pass to ALV function or ALV Method a dynamic table and a dynamic structure.
    I tried to do it but I got a dump using this function module REUSE_ALV_GRID_DISPLAY with these parameters: STRUCTURE_NAME and T_OUTTAB.
    Please, some suggestions about this.
    Thanks in advance.
    Alexis.

    Hi Vasanth
    this is my example:
    DATA: tl_proxy TYPE TABLE OF zpidt_operacion.
    DATA: sl_proxy TYPE zpidt_operacion.
    sl_proxy-dt_operacion-dt_cab_operacion-vkorg = '0001'.
    APPEND sl_proxy TO tl_proxy.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        i_structure_name   = 'ZPIDT_OPERACION'
      TABLES
        t_outtab           = tl_proxy
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    Please, could you tell me how I have to do it.
    Thanks,
    Alexis.

  • Error generating test frame - smartform -flat structure

    When i run the smartform,its giving an error message saying "Error generating test frame".When i run through driver program it gives dump saying "zmbook must be flat structure".
    Now the problem is in smartform -> form interface -> tables it_test like zmbook
    its saying zmbook must be flat structure.
    here zmbook is transparent table.but says use flat structure.
    i tried it through structure also but says use flat structure.
    i tried it through table type of tructure also but says use flat structure.
    can anyone help me out
    regards sajid

    Hi shaik,
    Create the table type for zmbook in se11 and include this table  type in the form interface.
    Goto se11 : datatype-->yy_book
                      select table type
    In the line type : Zmbook.
    Goto smartforms and in the form interface include this yy_book.
    Regards,
    Sravanthi

  • Dynamic Type creation: structure

    Hey,
    I made a dynamic table and now I want to loop this table.
    But I can't seem to make a structure to use in the loop.
    I get the error 'data object has no structure'.
    This is what I already have.
    data: linetype   type ref to cl_abap_structdescr,
            tabletype  type ref to cl_abap_tabledescr,
            lt_comp    type cl_abap_structdescr=>component_table,
            lr_table type ref to data,
            lr_line type ref to data.
    field-symbols: <lt_data> type table,
                         <ls_data> type any.
    ...first I fill lt_comp ...
    linetype = cl_abap_structdescr=>create( lt_comp ).
    tabletype = cl_abap_tabledescr=>create( p_line_type = linetype p_table_kind = 'S' ).
    create data lr_table type handle tabletype.
    assign lr_table->* to <lt_data> casting type handle tabletype.
    create data lr_line like line of <lt_data>.
    assign lr_line->* to <ls_data> casting type handle linetype.
    ... filling the table <lt_data> ....
    loop at lt_data assigning <ls_data>.
      ... when I try to access a field of <ls_data>, I get the error '<ls_data> is no structure'.
    endloop.

    Hello Steven
    If you are going for dynamic programming then you have to use "the full monty" meaning field-symbols for:
    - itab
    - structure    AND
    - fields
    FIELD-SYMBOLS:
      <ld_fld>    TYPE any.
      LOOP AT <lt_data> ASSIGNING <ls_data>.
        UNASSIGN <ld_fld>.
        ASSIGN COMPONENT '<name of field  OR sy-index>' OF STRUCTURE <ls_data>
                                                                                    TO <ld_fld>.
       IF ( <ld_fld> IS ASSIGNED ).
    "   do something...
       ENDIF.
      ENDLOOP.
    Regards,
        Uwe

  • Dynamic smartform window

    Can we define dynamic size  window in smartform
    window could be any window ( not only main window).

    Hi Savita,
    Welcome.
    It is not posiible to have dynamic updations on windows as the field to size them are strictly numerical and does not accept variables.
    But if you want you can have same windows in more than one page with different sizes. But for main window once the width is defined it will remain constant for all windows only you can alter the height.
    Regards,
    Amit

  • Dynamically get the structure of an itab

    Hi all,
       How to get the structure of an Itab dynamically.
    Regards,
    bala

    u mean to say that the itab table structure has to be dynamic. ???
    u can refer the followig code.
    REPORT  ZDINUCOPY_DATA_FROM_CLIENTS  .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    PARAMETERS : P_CLIENT LIKE T000-MANDT OBLIGATORY,
                 P_TABLE(10) OBLIGATORY,
                 P_TARGET(10).
    SELECTION-SCREEN COMMENT 45(65) TEXT-001 FOR FIELD P_TARGET.
    SELECTION-SCREEN SKIP 1 .
    PARAMETERS : P_DEL AS CHECKBOX.
    PARAMETERS : P_INS AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA: GP_TABLE TYPE REF TO DATA                            .
    FIELD-SYMBOLS: <GT_TABLE> TYPE TABLE                       .
    FIELD-SYMBOLS: <GS_TABLE>                                  .
    DATA : I_STRUCTURE_NAME LIKE DD02L-TABNAME,
           CT_FIELDCAT TYPE LVC_T_FCAT.
    AT SELECTION-SCREEN.
    IF P_TABLE(1) NE 'Z' AND
       P_TABLE(1) NE 'Y'.
       MESSAGE E000(00) WITH 'Enter a customer table'.
    ENDIF.
    IF P_TARGET IS INITIAL.
      P_TARGET = P_TABLE.
    ENDIF.
    START-OF-SELECTION.
    I_STRUCTURE_NAME = P_TABLE.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        I_STRUCTURE_NAME             = I_STRUCTURE_NAME
        I_CLIENT_NEVER_DISPLAY       = 'X'
       CHANGING
         CT_FIELDCAT                  = CT_FIELDCAT[]
      EXCEPTIONS
        INCONSISTENT_INTERFACE       = 1
        PROGRAM_ERROR                = 2
        OTHERS                       = 3 .
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
        IT_FIELDCATALOG           = CT_FIELDCAT
      IMPORTING
        EP_TABLE                  = GP_TABLE
      EXCEPTIONS
        GENERATE_SUBPOOL_DIR_FULL = 1
        OTHERS                    = 2.
    ASSIGN GP_TABLE->* TO <GT_TABLE>.
    BREAK-POINT.

Maybe you are looking for