Creation of dynamic tables in data dictionary.

Hi Techies,
Can you help me how to create physical dynamic table in Abap dictionary.
In the selection screen, if i give Mara or Marc it should be create a dynamic table (zaa_mara) or (zaa_marc) with the similar structure.
Thanks.

1) Parameters : P_TABLE --- Enter Table name.(Say mara/Marc)
2) Get the DataElements of Mara/Marc tables from DD03L.
Select RollName From DD03L INTO ITAB Where TABNAME = P_TABLE.
3) Do a Recording in SHDB Tcode for se38 to create table.
4) Use BDC to Created DBtableTABLE.
Call Transaction 'SE38' Using T_bdctable.
Regards,
Gurpreet

Similar Messages

  • Differrences between structure and table in data dictionary in ABAP?

    What is the differrences between structure and table in data dictionary in ABAP?
    are they same?

    Tables :
    1. The place where the data is stored so that you can retrieve at any time.
    2. There can be more than one record stored
    Structures :
    1. The data / info stays only during the runtime of the application and will not get stored at all during the run time ....
    2. Only one record can be stored at the runtime .....
    A structure forms the skeleton of the table.
    A structure comprises components i.e., fields. Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth
    Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) data types and lengths.
    When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP Dictionary. The table definition is translated from the ABAP Dictionary to a definition of the particular database.

  • Is there any table in data dictionary has all clients and their email ids?

    Is there any table in data dictionary has all clients and their email ids?

    Hello,
    KNVK-ADRNP_2
    use this to pass to the bapi BAPI_BUPA_ADDRESS_GETDETAIL. this is function module & will return the address details in diff itabs..
    You can also try the Table ADR6 field SMTP_ADDR where ADDRNUMBER = KNVK-ADRNP_2.
    *************Reward points,if found useful

  • What is the step by step process to create a table in data dictionary?

    hi,
    What is the step by step process to create a table in data dictionary?
    regards.

    sorry, question resolved.

  • Dynamic Table -  same data repeating in all rows

    Hi Satya,
          I am creating the PDF form using WebDynpro java application, and the form should be stored in local disk. The user should be able to fill and save the data in the table at any time.
    Note : The table used in PDF form is a dynamic table, an empty row will be added, when ADD button is clicked, the row will be deleted when DELETE button is clicked.
    The javascript code udes are,
    For adding a row,
    xfa.form.PDFDataSource.Subform1.Table1.Row1.instanceManager.addInstance(1);
    For deleting a row,
    Subform1.Table1.Row1.instanceManager.removeInstance(this.parent.index);
    I have done the data binding to the fields of the table. I am able to save the data in local disk.
    The problem is, when I click ADD button, a new row is created but with the same data in previous row. even if I create 10 rows, all have same data. If I try to change any data any where in the table, it reflects in all the rows.
    Can you give me a solution?
    Regards,
    Prabhakar.

    Thanks. Actually yesterday night I could not do the thorough testing so just waiting for your confirmation.
    Actually if you open my PDF in Adobe Life Cycle Designer and check the data binding you will get the answer.
    Special care should be taken in designing the context for table attribute.
    The attribute type singletone also plays a important role. I have this doubt from the beginning when you have reported this problem for the first time but finally you marked it as solved so i thought there might be some other issues but again when you reported that again i did some analysis.
    Now coming to final solution :
    For designing a table in adobe interactive form you have consider following
    You have to design the view context upto three level, I am explaining you the properties
    PDFDataSource (Parent Level1) -  Cardinality 1:1 - Signetone -True - This is assigned to datasource
    TableList (Parent Level2) - Cardinality (1:1) -  Signetone -True
    TableWrapper(Parent Level3) - Cardinality (0:n) -  Signetone -True
    TableData (Parent Level4) - Cardinality (0:1) -  Signetone - false (This is the main point)
    Then under TableData value node, you have to put all your table attributes. 
    This Value Node name can be anything but hierarchy should be same as I have mentioned above.
    Please try out these steps and get back to me if you have any doubt.
    Cheers
    Satya

  • Dynamic tables with data driven visibility of columns (XML).

    Hi
    I am trying to make a template in LiveCycle Designer (XDP) with a dynamic table, and with dynamic visibility of columns.
    I want the column visibility to be driven by the xml input.
    (There is no user input.)
    I want the columns to visible in the table only if one or more of the rows has a data cell with value in a spesific column. If not the entire column should dissappear from the generated pdf.
    If that is not possible, my alternative is so set a value in th XML file to hide a tables column. But how?
    I have no problems of making dynamic tables, that is solved.
    I only want to hide unused columns in a table, defined in the xml source file.
    Can anyone help?
    Borge

    Hi,
    The link is not working..
    Please provide a valid link.

  • Dynamic Tables and Data Service

    hi :)
    i have a dynamic table (with add/delete row) buttons,
    one of the fields in each row, needs to populate the rest of the fields with first/last/address information.
    i understand how the data service works for a single fields, is there a way to do this by adding/deleting rows?
    how can i bind them? and how do i ensure that the proper row is populating?
    Thanks!

    To get the instance of the subform that you are working on you can use this.parent.index. Now when addressing the field the occurance number is on the container subform and not on the field itself. So if you had a Page1 - Subform1 - Row - Object you would use Page1.Subform1.Row[instancenumber].object.rawValue
    The only issue is the the [] are illegal in javascript so you can use the syntax:
    xfa.resolveNode("Page1.Subform1.Row[" + this.parent.index + "]").object.rawValue
    Make sense?

  • Can we create global internal table in data dictionary

    help me
    i want to know whether we can create global internal tables in data dictionary

    Hi Swathi,
    The whole concept of internal table is to manipulate the data at runtime.
    This replaces the concept of two dimentional array in other languages.
    The power of internal tables is it gets lakhs of records at runtime. I mean it can accomodate lots of records at runtime.
    So you can create a table type in DDIC and use it to declare your internal table.
    Yes, You can create global internal tables for function modules.
    By declaring the internal table in top include you can use this internal table all the function modules of that function group. So if one function module is filling the data another can use it as it is stored globally.
    Hope this answers your curiosity.
    Award points if useful else getback.
    Aleem.

  • Creation of Dynamic Table

    Hello All,
           I want to Create Dynamic Header of the Table and according to the Header have to filter the data. Kindly give me the
    Suggestion how shd i resolve the  problem.
    Ex. Run time I will create the Heder as 4%, 5%, 12.5% and filter the amount as per %, the No of columns will be depend on the type of INvoice.

    Hi,
    Check this sample code
    DEFINE dy_fields.
      clear gs_fields.
      gs_fields-fieldname = &1.
      gs_fields-datatype  = &2.
      gs_fields-intlen    = &3.
      gs_fields-coltext   = &4.
      gs_fields-quantity  = '3'.
      append gs_fields to git_fields.
    END-OF-DEFINITION. "add_field
    DEFINE add_field.
      gs_fcat-tabname    = &1.
      gs_fcat-fieldname  = &2.
      gs_fcat-ref_field  = &3.
      gs_fcat-ref_table  = &4.
      gs_fcat-inttype    = &5.
      gs_fcat-coltext    = &6.
      gs_fcat-col_pos    = &7.
      gs_fcat-quantity   = '3'.
      gs_fcat-col_opt    = 'X'.
      append gs_fcat to git_fcat.
    END-OF-DEFINITION. "add_field
    form form_fieldcatalog .
      dy_fields 'MATNR' 'CHAR' '18' 'Material'(015).
      dy_fields 'KTEXTMAT' 'CHAR' '40' 'Material Description'(003).
      dy_fields 'PRUEFLOS' 'NUMC' '12' 'Inspection Lot Number'(004).
      dy_fields 'ENSTEHDAT' 'DATS' '8' 'Date of Inspection'(005).
      dy_fields 'ARBPL' 'CHAR' '8' 'Blast Fur. No.'(006).
      dy_fields 'USERC1' 'CHAR' '18' 'Plnt No'(007).
      dy_fields 'USERC2' 'CHAR' '10' 'Shift'(008).
      dy_fields 'USERN1' 'NUMC' '10' 'Sample'(009).
    LOOP AT git_qamv ASSIGNING <fs_qamv>.
    TRANSLATE <fs_qamv>-kurztext TO UPPER CASE.
    ENDLOOP.
    refresh git_qamv_temp.
    git_qamv_temp[] = git_qamv[].
    sort git_qamv_temp by kurztext.
    v_count = 8.
    sort git_output by prueflos.
    delete ADJACENT DUPLICATES FROM git_qamv_temp comparing kurztext.
    LOOP AT git_qamv_temp into gs_qamv.
      v_count = v_count + 1.
      read table git_output ASSIGNING <fs_output> with key PRUEFLOS = gs_qamv-PRUEFLOS BINARY SEARCH.
      IF sy-subrc = 0.
           dy_fields gs_qamv-merknr 'QUAN' '25' gs_qamv-kurztext.
       add_field 'GIT_FINAL' gs_qamv-merknr '' '' 'C' gs_qamv-kurztext v_count.
      ENDIF.
    ENDLOOP.
    data v_cnt(4) type n.
    clear v_cnt.
    LOOP AT git_fcat ASSIGNING <fs_fcat>.
    v_cnt = v_cnt + 10.
    <fs_fcat>-fieldname = v_cnt.
    READ TABLE git_fields ASSIGNING <fs_fields> WITH key coltext = <fs_fcat>-coltext.
    if sy-subrc = 0.
      move <fs_fcat>-fieldname to <fs_fields>-fieldname.
      ENDIF.
    ENDLOOP.
    clear v_cnt.
    sort GIT_QAMV by PRUEFLOS MERKNR.
    LOOP AT GIT_QASR ASSIGNING <FS_QASR>.
      READ TABLE GIT_QAMV ASSIGNING <fs_qamv> WITH KEY PRUEFLOS = <FS_QASR>-PRUEFLOS
                                                     MERKNR   = <FS_QASR>-MERKNR BINARY SEARCH.
      IF SY-SUBRC = 0.
        MOVE <FS_QAMV>-KURZTEXT TO <FS_QASR>-PRUEFBEMKT.
        ENDIF.
    ENDLOOP.
    *-> create dynamic internal table and assign to fs
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = git_fields
        IMPORTING
          ep_table        = git_dy_final.
    *-> Assigning The Referencing Pointer To The Field Symbol
      ASSIGN git_dy_final->* TO <git_dy_final>.
    Creating Dynamic Work Area And Assigning It To The Field Symbol.
      CREATE DATA gs_dy_final LIKE LINE OF <git_dy_final>.
      ASSIGN gs_dy_final->* TO <gs_dy_final>.
    Regards
    Ansari

  • How do I configure a dynamic table with Data-Drop Down selections to store separate values?

    I am attempting to use LiveCycle to create an Order Form that uses an ODBC to a SQL database. When a user makes a selection, a separate column in the table references the "Item #" associated in the SQL table, and generates a corresponding barcode.
    My problem is that when I select an Item from the drop down list, all the items in the table change. What am I missing here to separate the rows as different line items? I tried adding a [*] to the end of the connection string, and that allows me to select different options but does not generate the "Item #" or "Barcode" field.
    The screenshot below shows the basic form. When I select any of the data drop downs, all of the Items change.
    I used the auto generated script for the "Add Row +" button shown below. Is this my issue? Or do I need to alter the way I'm setting up the Data Binding in for my Data Drop Down?
    this.resolveNode('Table1._Row1').addInstance(1);
    if (xfa.host.version <8) {
      xfa.form.recalculate(1); }

    package pruebadedates;
    import java.sql.*;
    * @author J?s?
    public class ClaseDeDates {
        /** Creates a new instance of ClaseDeDates */
         * @param args the command line arguments
        public static void main(String[] args) {
            java.sql.Date aDate[] = null;       
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con = DriverManager.getConnection("jdbc:mysql://localhost/pruebafechas", "root", "picardias");
                    if(!con.isClosed()){
                    stmt = con.createStatement();
                    stmt.executeQuery ("SELECT dates FROM datestable");
                    rs = stmt.getResultSet();
                        while (rs.next())
                        aDate[] = rs.getDate("dates");
            catch(Exception e)
               System.out.println(e);
            //System.out.println(aDate);     
    }Hi, There is my code and the errors that I get are:
    found : java.sql.Date
    required: java.sql.Date[]
    aDate = rs.getDate("dates");
    Actually I have No idea as How to get a Result set into an ArrayList or Collection. Please tell me how to do this Dynamically. I have like 25 records in that Database table, but they will grow, so I would really appreciate to know the code to do this. I suspect my problem is in the bolded part of my code.
    Thank you very much Sir.

  • NEED HELP... Creating dynamic table from data file...

    Hi
    I'm writing an application for data visualization. The user can press the "open file" button and a FileChooser window will come up where the user can select any data file. I would like to take that data file and display it as a table with rows and columns. The user needs to be able to select the coliumns to create a graph. I have tried many ways to create a table, but nothing seems to work! Can anyone help me?! I just want to read from the data file and create a spreadsheet type table... I won't know how many rows and columns I'll need in advance, so the table needs to be dynamic!
    If you have ANY tips, I'd REALLY appreciated.....

    Thank you for your help. I tried to use some of the code in the examples... I'm really new at this, so I'm not sure how to set it up. I added the code, but when I open a file, nothing happens. Here's the code I have so far...
    package awt;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.text.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    * @author
    public class Main {
    public static void main(String[] args) {
    JFrame frame = new ScatterPlotApp();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.show();
    class ScatterPlotApp extends JFrame implements ActionListener{
    private JButton openButton, exitButton, scatButton, refreshButton;
    private JMenuBar menuBar;
    private JMenuItem openItem, exitItem;
    private JFileChooser chooser;
    private JMenu fileMenu;
    private JTextPane pane;
    private JTable table;
    private DefaultTableModel model;
    private JScrollPane scrollPane;
    private Container contentPane;
    /** Creates a new instance of ScatterPlotApp */
    public ScatterPlotApp() {
    setTitle("Data Visualizer");
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension d = tk.getScreenSize();
    int width = 867;
    int height = 800;
    setBounds((d.width - width)/2, (d.height - height)/2, width, height);
    contentPane = getContentPane();
    JPanel panel = new JPanel();
    //pane = new JTextPane();
    panel.setLayout(new FlowLayout(FlowLayout.CENTER));
    contentPane.add(panel, BorderLayout.SOUTH);
    //contentPane.add(pane, BorderLayout.NORTH);
    scatButton = new JButton("Create ScatterPlot");
    scatButton.addActionListener(this);
    openButton= new JButton ("Open File");
    openButton.addActionListener(this);
    exitButton = new JButton ("Exit");
    exitButton.addActionListener(this);
    refreshButton = new JButton ("Reload Data");
    refreshButton.addActionListener(this);
    panel.add(openButton);
    panel.add(scatButton);
    panel.add(refreshButton);
    panel.add(exitButton);
    fileMenu = new JMenu("File");
    openItem = fileMenu.add(new JMenuItem ("Open", 'O'));
    openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK));
    openItem.addActionListener(this);
    exitItem = fileMenu.add(new JMenuItem ("Exit", 'X'));
    exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK));
    exitItem.addActionListener(this);
    JMenuBar menuBar = new JMenuBar();
    fileMenu.setMnemonic('F');
    menuBar.add(fileMenu);
    setJMenuBar(menuBar);
    public void actionPerformed(ActionEvent e){
    Vector columnNames = new Vector();
         Vector data = new Vector();
    try{
    Object source = e.getSource();
    if (source == openButton || e.getActionCommand().equals("Open")){
    chooser = new JFileChooser(".");
    int status =chooser.showOpenDialog(this);
    if (status ==JFileChooser.APPROVE_OPTION)
    File file = chooser.getSelectedFile();
    FileInputStream fin = new FileInputStream(file);
    BufferedReader br = new BufferedReader(new InputStreamReader(fin));
    String line;
    //StringBuffer bf = new StringBuffer();
    StringTokenizer st1 = new StringTokenizer(br.readLine(), ";");
                   while( st1.hasMoreTokens() )
                        columnNames.addElement(st1.nextToken());
                   // extract data
                   while ((line = br.readLine()) != null)
                        StringTokenizer st2 = new StringTokenizer(line, ";");
                        Vector row = new Vector();
                        while(st2.hasMoreTokens())
                             row.addElement(st2.nextToken());
                        data.addElement( row );
                   br.close();
    model = new DefaultTableModel(data, columnNames);
              table = new JTable(model);
    scrollPane = new JScrollPane( table );
    getContentPane().add( scrollPane, BorderLayout.NORTH );
    while((line=br.readLine())!=null)
    bf.append(line+"\n");
    pane.setText(bf.toString());
    //pane.setText(bf.toString());
    else if (source == scatButton){
    else if (source == exitButton || e.getActionCommand().equals("Exit")){
    System.exit(0);
    else if (source == refreshButton){
    catch (Exception ex){
    ex.printStackTrace();
    }

  • Dynamic Forms (Data Dictionary) using CFForm (??)

    Hi,
    The basic plan is to build the forms in my application
    dynamically using a data dictionary rather than basing them upon
    static tables and having statically coded forms to match. This
    would allow me to offer the ability for an administrator to add new
    fields if required (client 'requirements' are hard to pin down and
    may therefore change).
    I'm developing using CF8 (hoping it will be released real
    soon..;-).). Application will be structured using Fusebox 5.
    I've tried building up the form elements (<cfinput>
    & etc) off in CFC, returning the layout result code in a
    content variable, and its not working.
    I have some other approaches to try, but this one would be
    preferable.
    Has anyone else tried this - and do you have any advice to
    offer (or am I just crazy trying it because there is no way its
    going to work ?)
    Thanks
    Bryn50

    This approach works well using standard html forms and html
    form controls such as <input> and <select> etc.
    I'm wanting to use CFFORM (for the first time in a long time)
    for the functionality on offer (such as flash forms).
    As I saw elsewhere, I have not used this in a verrry long
    time because generally I've found it inflexible and the validation
    on offer is a tiny subset of what is generally needed. I'm kinda
    hoping to be able to overcome that this time around by adding my
    own javascript validation when necessary.
    I have some ideas for approaches that might work, but they
    don't seem like very good ones to me:
    1/. might be to try using standard html form controls inside
    a cfform. Can I still have it display using flash ?
    2/. might be to have all of the logic that selects the
    appropriate cfform control for a given field in the same file as
    the cfform, however that seems so unelegant and also it defies the
    MVC/fusebox 5 approach I'm also wanting to use.
    Thanks for your help...
    Cheers,

  • Dynamic table data isn't transfered to the context, with webdynpro for java

    Hi,
    I'm using LifeCycle designer 7.1 and Adobe reader 7.0.5.
    I'm trying to make a dynamic table in a PDF form, that will be related to a table in the context.
    I've designed the context like it says here: Dynamic Table -  same data repeating in all rows
    I made a dynamic table and related the cells on the row to the context, by dragging the variables from the DataView into them.
    The table is related to TableList, the row to TableWrapper[], and the cells are related like this: TableData[].ItemName
    And there's a button which adds a row to the table.
    And for some reason, that's not working; When hitting the Submit to SAP button, it doesn't appear as though the data was transferred to the WebDynpro context.
    Can anyone help me with it please..?
    By the way - I tried using the SAP standard subform controls, the 'Insert Remove Move' control.
    When trying it through the PDF preview, it doesn't work - whatever I click displays an error message, and when it runs from the browser - It automatically searches for an update for Adove Reader (I use 7.0.5).
    Is it supposed to work only with version 8 of the Adobe Reader?

    Well, I reinstalled ACF, and now the Submit button works, and the Insert Remove Move buttons work as well.
    But the table context still doesn't work.
    I had put some values in the context, in DoInit, and they appeared in the table in the form, but when I changed them in the form it didn't affect the context at all.
    There's a simple attribute value related to a text field, which IS affected when changed in the form, and the Submit button is clicked. Only the table doesn't work.
    How can I make it work?
    Thanks,
    Udi Dekel

  • NWDS DATA DICTIONARY TABLE ISSUE

    Hi,
    I created a table in Data Dictionary. I created a new archive and deployed the SDA files successfully, but could cannot see the table in the Oracle Database. It says "Table or view does not exists".  What could be the error? How can i see the table in database?
    Regards,
    Divya

    answered

  • DYNAMIC TABLE FUNCTION

    Hi Expert
    I want to build a function that receive a dynamic table , how i do it and how i call this function
    thanks and regardes

    hi,
    check this:
    REPORT zmodtab NO STANDARD PAGE HEADING.
    TYPE-POOLS: rsds.
    DATA: is_x030l  TYPE x030l,
          it_dfies  TYPE TABLE OF dfies,
          is_dfies  TYPE dfies,
          it_fdiff  TYPE TABLE OF field_dif,
          is_fdiff  TYPE field_dif.
    DATA: w_selid   TYPE rsdynsel-selid,
          it_tables TYPE TABLE OF rsdstabs,
          is_tables TYPE rsdstabs,
          it_fields TYPE TABLE OF rsdsfields,
          it_expr   TYPE rsds_texpr,
          it_ranges TYPE rsds_trange,
          it_where  TYPE rsds_twhere,
          is_where  TYPE rsds_where,
          w_active  TYPE i.
    DATA: it_content TYPE REF TO data,
          it_modif   TYPE REF TO data,
          it_fcat    TYPE lvc_t_fcat.
    DATA: w_okcode   TYPE sy-ucomm.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
                   <ntab> TYPE STANDARD TABLE.
    Macros
    DEFINE table_error.
      message e398(00) with 'Table' p_table &1.
    END-OF-DEFINITION.
    DEFINE fixed_val.
      is_fdiff-fieldname = is_dfies-fieldname.
      is_fdiff-fixed_val = &1.
      is_fdiff-no_input  = 'X'.
      append is_fdiff to it_fdiff.
    END-OF-DEFINITION.
    Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME.
    PARAMETERS: p_table TYPE tabname OBLIGATORY                    "table
                                     MEMORY ID dtb
                                     MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: BEGIN OF LINE,
                      PUSHBUTTON 33(20) selopt USER-COMMAND sel,
                      COMMENT    55(15) selcnt,
                      END OF LINE.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_rows  TYPE i.                                    "rows
    SELECTION-SCREEN: END OF BLOCK b01,
                      SKIP,
                      BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_displ TYPE c AS CHECKBOX.                        "display
    SELECTION-SCREEN: END OF BLOCK b02.
    Initialization
    INITIALIZATION.
      MOVE '@4G@ Filter records' TO selopt.
    PBO
    AT SELECTION-SCREEN OUTPUT.
      IF w_active IS INITIAL.
        CLEAR: selcnt.
      ELSE.
        WRITE w_active TO selcnt LEFT-JUSTIFIED.
      ENDIF.
    PAI
    AT SELECTION-SCREEN.
      IF p_table NE is_x030l-tabname.
        CALL FUNCTION 'DDIF_NAMETAB_GET'
             EXPORTING
                  tabname   = p_table
             IMPORTING
                  x030l_wa  = is_x030l
             TABLES
                  dfies_tab = it_dfies
             EXCEPTIONS
                  OTHERS    = 1.
        IF is_x030l IS INITIAL.
          table_error 'does not exist or is not active'.
        ELSEIF is_x030l-tabtype NE 'T'.
          table_error 'is not selectable'.
        ELSEIF is_x030l-align NE 0.
          table_error 'has alignment - cannot continue'.
        ENDIF.
      Default values for system fields
        REFRESH: it_fdiff.
        is_fdiff-tabname = p_table.
        LOOP AT it_dfies INTO is_dfies.
          IF is_dfies-datatype = 'CLNT'.
            fixed_val sy-mandt.
          ELSEIF is_dfies-rollname = 'ERDAT'
              OR is_dfies-rollname = 'ERSDA'
              OR is_dfies-rollname = 'AEDAT'
              OR is_dfies-rollname = 'LAEDA'.
            fixed_val sy-datum.
          ELSEIF is_dfies-rollname = 'ERTIM'
              OR is_dfies-rollname = 'AETIM'.
            fixed_val sy-uzeit.
          ELSEIF is_dfies-rollname = 'ERNAM'
              OR is_dfies-rollname = 'AENAM'.
            fixed_val sy-uname.
          ENDIF.
        ENDLOOP.
      Prepare free selection on table
        REFRESH it_tables.
        is_tables-prim_tab = p_table.
        APPEND is_tables TO it_tables.
        CLEAR: w_selid.
      ENDIF.
      IF sy-ucomm = 'SEL'.
        IF w_selid IS INITIAL.
        Init free selection dialog
          CALL FUNCTION 'FREE_SELECTIONS_INIT'
               EXPORTING
                    expressions  = it_expr
               IMPORTING
                    selection_id = w_selid
                    expressions  = it_expr
               TABLES
                    tables_tab   = it_tables
               EXCEPTIONS
                    OTHERS       = 1.
        ENDIF.
      Display free selection dialog
        CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
             EXPORTING
                  selection_id            = w_selid
                  title                   = 'Selection'
                  status                  = 1
                  as_window               = 'X'
             IMPORTING
                  expressions             = it_expr
                  field_ranges            = it_ranges
                  number_of_active_fields = w_active
             TABLES
                  fields_tab              = it_fields
             EXCEPTIONS
                  OTHERS                  = 1.
      ENDIF.
    Start of processing
    START-OF-SELECTION.
      PERFORM f_create_table USING p_table.
      PERFORM f_select_table.
      PERFORM f_display_table.
          FORM f_create_table                                           *
    FORM f_create_table USING in_tabname.
      FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = in_tabname
           CHANGING
                ct_fieldcat      = it_fcat
           EXCEPTIONS
                OTHERS           = 1.
      IF sy-subrc = 0.
      Complete field catalog
        LOOP AT it_fcat ASSIGNING <fcat>.
          <fcat>-tabname = in_tabname.
        ENDLOOP.
        CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
             CHANGING
                  ct_fieldcat = it_fcat
             EXCEPTIONS
                  OTHERS      = 1.
      ELSE.
        WRITE: 'Error building field catalog'.
        STOP.
      ENDIF.
    Create dynamic table for data
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    Create dynamic table for modif
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_modif.
      IF sy-subrc = 0.
        ASSIGN it_modif->* TO <ntab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    ENDFORM.
          FORM f_select_table                                           *
    FORM f_select_table.
      IF w_active = 0.
        SELECT * FROM (p_table)
                 INTO CORRESPONDING FIELDS OF TABLE <itab>
                UP TO p_rows ROWS.
      ELSE.
      Selection with parameters
        CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'
             EXPORTING
                  field_ranges  = it_ranges
             IMPORTING
                  where_clauses = it_where.
        READ TABLE it_where INTO is_where WITH KEY tablename = p_table.
        SELECT * FROM (p_table)
                 INTO CORRESPONDING FIELDS OF TABLE <itab>
                UP TO p_rows ROWS
                WHERE (is_where-where_tab).
      ENDIF.
      IF sy-dbcnt = 0.
        WRITE: 'No record selected'.
        STOP.
      ENDIF.
    ENDFORM.
          FORM f_display_table                                          *
    FORM f_display_table.
      DATA: l_answer TYPE c,
            l_eflag  TYPE c.
      CLEAR: w_okcode.
      REFRESH: <ntab>.
    Display table contents
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
           EXPORTING
                header       = p_table
                tabname      = p_table
                display_only = p_displ
                endless      = 'X'
                no_button    = space
           IMPORTING
                okcode       = w_okcode
           TABLES
                nametab      = it_dfies
                table        = <itab>
                fielddif     = it_fdiff
                modif_table  = <ntab>
           EXCEPTIONS
                OTHERS       = 1.
      IF sy-subrc = 0.
        IF p_displ IS INITIAL AND w_okcode = 'SAVE'.
        Confirm update
          CALL FUNCTION 'POPUP_TO_CONFIRM'
               EXPORTING
                    titlebar              = p_table
                    text_question         = 'Do you want to update table ?'
                    default_button        = '2'
                    display_cancel_button = ' '
               IMPORTING
                    answer                = l_answer
               EXCEPTIONS
                    OTHERS                = 1.
          IF l_answer = '1'.
          Apply modifications
            IF NOT <ntab>[] IS INITIAL.
              PERFORM f_add_system USING space.
              MODIFY (p_table) FROM TABLE <ntab>.
              IF sy-subrc NE 0.
                l_eflag = 'X'.
              ENDIF.
            ENDIF.
          Apply deletions
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                   TABLES
                        deleted_data = <ntab>
                   EXCEPTIONS
                        OTHERS       = 1.
              IF NOT <ntab>[] IS INITIAL.
                DELETE (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
          Apply creations
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                   TABLES
                        new_data = <ntab>
                   EXCEPTIONS
                        OTHERS   = 1.
              IF NOT <ntab>[] IS INITIAL.
                PERFORM f_add_system USING 'X'.
                INSERT (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
            IF l_eflag IS INITIAL.
              COMMIT WORK.
              MESSAGE s261(53).
            ELSE.
              MESSAGE s075(3i).
              PERFORM f_select_table.
            ENDIF.
          ENDIF.
        Display table again
          PERFORM f_display_table.
        ENDIF.
      ENDIF.
    ENDFORM.
          FORM f_add_system                                             *
    FORM f_add_system USING new TYPE c.
      FIELD-SYMBOLS: <irec> TYPE ANY,
                     <upd>  TYPE ANY.
      LOOP AT it_fdiff INTO is_fdiff.
        READ TABLE it_dfies INTO is_dfies
                        WITH KEY fieldname = is_fdiff-fieldname.
        LOOP AT <ntab> ASSIGNING <irec>.
          ASSIGN COMPONENT is_fdiff-fieldname OF STRUCTURE <irec> TO <upd>.
          IF is_dfies-datatype = 'CLNT'.
            <upd> = sy-mandt.
          ELSE.
            CASE is_dfies-rollname.
              WHEN 'AENAM'.
                <upd> = sy-uname.
              WHEN 'AEDAT' OR 'LAEDA'.
                <upd> = sy-datum.
              WHEN 'AETIM'.
                <upd> = sy-uzeit.
              WHEN OTHERS.
            ENDCASE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    this link will also help:
    http://www.sap-img.com/ab030.htm
    Edited by: AD on Dec 2, 2008 12:26 PM

Maybe you are looking for