Dynamic creation of components

Hi,
I am implementing simple property editor. For each property component can be either inputText, selectOneMenu or checkbox depending on the property type. I've tried to do that using rendered attribute.
      <h:panelGroup style="float:none;">
        <h:dataTable id="opParameters" value="#{jobBean.hermesOperationalParameters}" var="opParameter"
                     rowClasses="tblRow">
          <h:column>
            <h:outputLabel value="#{opParameter.displayName}"/>
          </h:column>
          <h:column>
            <h:selectOneMenu value="#{jobBean.solverTypeStr}"
                             rendered="#{opParameter.name == 'listValues'}">
              <a4j:support id="rerenderSolverParameters" event="onchange" reRender="solverParameters"/>
              <f:selectItems value="#{jobBean.solverTypes}"/>
            </h:selectOneMenu>
            <h:inputText value="#{jobBean.operationalParameters[opParameter.name]}"
                         rendered="#{opParameter.name != 'listValues'}"/>
          </h:column>
          <h:column>
            <ui:decorate template="/templates/tooltip.xhtml">
              <ui:define name="tooltip">
                <h:outputText value="#{opParameter.desc}" escape="false"/>
                <br/>
                <font size="-2"><i><h:outputText value="#{opParameter.name}"/></i></font>
              </ui:define>
            </ui:decorate>
          </h:column>
        </h:dataTable>But all components are still created in the component tree and interfering with each other because components are bound to the same values in the backing bean. The I've tried to use <c:choose> that didn't work for me as well. Finally I decided to bind panelGrid and create all components on the fly.
        <h:panelGrid columns="3" binding="#{jobBean.opParametersPanelGrid}"/>My concern is that too much presentation is being put into backing bean. I would like to keep it in the JSF code. Any suggestions? I use RichFaces, Facelets and JSF RI 1.2. Thanks
Tomas
Edited by: Cvirko on Mar 27, 2008 5:59 PM
Edited by: Cvirko on Mar 27, 2008 6:16 PM

Here is one possible way to create components, though there
might be more elegant solutions.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
import mx.controls.CheckBox;
import mx.controls.Button;
import mx.controls.List;
import mx.collections.ArrayCollection;
private var newList:List = new List();
private var newButton:Button = new Button();
private var newCheckBox:CheckBox = new CheckBox();
[Bindable] private var componentsAC:ArrayCollection = new
ArrayCollection([
{compType:newList, compName:'List'},
{compType:newButton, compName:'Button'},
{compType:newCheckBox, compName:'CheckBox'}]);
private function addComponent(evt:Event):void {
myVBox.addChild(new
evt.currentTarget.selectedItem.compType.constructor);
]]>
</mx:Script>
<mx:List x="10" y="10" height="222"
click="addComponent(event)" dataProvider="{componentsAC}"
labelField="compName"></mx:List>
<mx:VBox x="180" y="10" height="100%" id="myVBox">
</mx:VBox>
</mx:Application>
I hope this helps.
Vygo

Similar Messages

  • Dynamic creation of TabStrip

    Hi,
    I want to create a tabstrip dynamically.The tabstrip should have 3 tabs, and in each of the tabs i want to put some UI elements like a label, input field, dropdown, tables.........etc.
    Im able to create the tabstrip and add tabs to it dynamically.
    I've even created the UI elements which i wanted to put in the tabs.............But im not able to proceed as i dont know how to add the UI elements to the tabs.......
    Can anyone tell me how to add UI elements to a tab in a tabstrip?
    Regards,
    Padmalatha.K
    Points will be rewarded.

    Hi,
    Following code will help you to understand the dynamic creation and adding them
    //Tabstrip
           IWDTabStrip tabStrip = view.createElement(IWDTabStrip.class);
           //Tab
           IWDTab tab = view.createElement(IWDTab.class);
           //Input Field
           IWDInputField inputField = view.createElement(IWDInputField.class);
           //Adding inputfield to tab
           tab.setContent(inputField);
           //Adding tab to tabstrip
           tabStrip.addTab(tab);
    //Finally add this tabstip to either your root container or some other container.
    Regards
    Ayyapparaj

  • Dynamic creation of ComponentUsage

    Hi people,
    I want to reuse a view (ViewA) in different views (ViewB, ViewC, ViewD).ViewA has a quite complex logic, so it is necessary to outsource this view.  Not only the logic, but also the count of UIElements and contextelements is quite large, for this I don't want to implement this part redundant in the views A, C and D.
    I have to use ViewA in a table in  the TablePopin UIElement. Every line of the table should have its own instance of ViewA. Is that possible?
    My idea is it, to put the view in an own component. For every tableline I need an instance of the componentUsage. My problem is now, that I'm not able to create at runtime a ComponentUsage and at designtime I don't know how many instances I need. Is it possible in webdynpro to create dynamic instances of ComponentUsage?
    If you know an other way, that prevents me from implementing the view and its logic more times, please tell me!
    Thanks in  advance,
    Thomas Morandell

    Hi Thomas,
    just for clarification. Principally it is possible in Web Dynpro to dynamically create new component usages of the same type like an existing, statically declared one. This means after having defined a component usage of type ISomeComp (component interface definition) you can dynamically create new component usages which all point to the same component interface definition ISomeComp:
    wdThis.wdGetISomeCompUsage().createComponentUsageOfSameType();
    But this dynamic creation approach implies, that you must also embed the component interface view of this component usage to the view composition dynamically; and this is (unfortunately) quite cumbersome and complicated based on the existing Web Dynpro Java API (it is not yet optimized for a simple dynamic view composition modification.
    Additionally, like Valery pointed out, the dynamic creation of new component usages is not compatible with table popins.
    Regards, Bertram

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Dynamic creation of business graphics.

    Hi,
    i have a piece of code which dynamically create a business graphics. If i use the same node data and create BG in statically.. i am able to view the graph. In case of dynamic creation , i am getting graphical rendering error. Have i missed something here..
    The piece of code i had used is..
         IWDBusinessGraphics bg = (IWDBusinessGraphics)view.createElement(IWDBusinessGraphics.class,null);
              IWDCategory c = (IWDCategory)view.createElement(IWDCategory.class,null);
         //     c.setDescription("tableutility");      
              c.bindDescription(wdContext.getNodeInfo().getAttribute(IPrivateSDNUtilityView.IContextElement.TEST));                                                                               
    bg.setCategory(c);
              bg.setDimension(WDBusinessGraphicsDimension.PSEUDO_THREE);
              IWDSimpleSeries ss = (IWDSimpleSeries)view.createElement(IWDSimpleSeries.class,null);
              ss.bindValue(wdContext.nodeDepartments().getNodeInfo().getAttribute(IPrivateSDNUtilityView.IDepartmentsElement.NO_OF_PEOPLE));
              ss.setLabel("Simple Series");
              ss.setLabel("No of People");
              bg.addSeries(ss);
              bg.setChartType(WDBusinessGraphicsType.COLUMNS);
              bg.bindSeriesSource(wdContext.nodeDepartments().getNodeInfo());
              bg.setIgsUrl("http://<hostname>:40080");
    Please help.
    Regards
    Bharathwaj

    Please got through following link
    <a href="/people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities:///people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities

  • Dynamic Creation of Buttons and Actions HELP

    Hi there,
    I have got a problem (or maybe even two) with the dynamic Creation of buttons. The code below creates the buttons.
    My main problem is, that the parameter created for the button's action isn't propagated to the assigned event handler. I get a null, though the name of the parameter in the event handler and the name of the parameter added to the action are the same.
    Could it also be that I'm always using the same action? I.e. does wdThis.wdGetAddElementAction() always return the same action instance? If yes, how can I create individual actions for each button?
    Any help is appreciated!
    Cheers,
    Heiko
    "    for(int i=rootContainer.getChildren().length; i<wdContext.nodeFeature().size();i++)
                   IPrivateVCT_Feature.IFeatureElement featureElement = wdContext.nodeFeature().getFeatureElementAt(i);
                   IWDTray featureTray = (IWDTray) view.createElement(IWDTray.class, featureElement.getName());
                   IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, featureElement.getName()+"_Header");
                   header.setText(featureElement.getName());
                   featureTray.setHeader(header);
                   featureTray.setExpanded(false);
                   rootContainer.addChild(featureTray);
                   IWDButton button = (IWDButton) view.createElement(IWDButton.class, featureElement.getName()+"_Button_AddElement");
                   IWDAction actionAddElement = wdThis.wdGetAddElementAction();
                   actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
                   button.setOnAction(actionAddElement);
                   button.setText("Add Element");
                   featureTray.addChild(button);

    Hi Heiko,
    You have done everything correctly....except for 1 line
    in the code...
    Replace the following line in your code:
    actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
    Replace the above line with this code:
    button.mappingOfOnAction().addParameter("featureIndex",i);
    Actually in your code, you are not associating the parameter with the button...
    Note that addParameter(...) comes with two signatures: addParameter(String param, String value) and addParameter(String param, int value). You can use any of them based on yuor need.
    Hope it helps,
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Dynamic Creation Form

    Hi friends,
    Is there a way to create dynamic creation forms in ADF,in jdev 10.3.3?
    By this I mean--I need to populate a table in my DB and on my page I have an add button,
    now at each click of add button,a new creation form should be displayed on the page one below the other.
    finally there would be a Save button that would save all my entries to the table.
    I searched a lot for the same...Please do help if anybody has any ideas..
    Thnks in Advance..c ya
    kavitha
    Edited by: user6403440 on May 5, 2009 2:22 AM

    Hi,
    well, the easiest would be to create an updateable table and add new rows. If you need a form then you can use af:forEach or af:iterator with the table binding to render input form elements (more like a custom table rendering). However, its quite a bit of development that is required for this.
    Frank

  • Dynamic Creation of Entity Objects (ADF Business Components)

    Hi All,
    We have a requirement to create Entity Objects for the dynamically generated tables in our application and at the same time bind them to different views.
    Our product create multiple tables at runtime with some sort of naming convention, and we couldn't find a way in JDeveloper to generate entity objects for the tables created dynamically.
    Please provide some pointers if you have experienced or worked on similar requirement.
    Thanks,
    Nikhilesh

    Thanks for the help Sudipto.
    The link which you have shared, describes the creation of an entity object and then modify the operations like Delete Update and Insert etc to be performed on the entity object by creating IMPL classes and implementing certain interfaces.
    But I need to create Entity objects dynamically. My application creates new tables for some functionality at the run time and I have to create Entity objects for those new tables as soon as the new tables are created.
    I was just wondering if, there is any API available for creating the entity object from Java code instead of invoking the wizard in the Jdeveloper.

  • Dynamic creation of UI components

    Hi All,
    I have to generate <h:inputText > dynamically when i click on a link, in the bean i am creating few UI components under a panel grid and returning , but the grid is not rendering on the page ,here is my code
    <h:panelGrid columns="2" binding="#{dynamic.formElements}">
    <h:outputText value="dynamicGrid"></h:outputText>
    </h:panelGrid>
    public HtmlPanelGrid getFormElements() {
              HtmlPanelGrid grid = new HtmlPanelGrid();
              List<UIComponent> children = grid.getChildren();
              HtmlOutputText t1 = new HtmlOutputText();
              t1.setValue("Gender:");
              children.add(t1);
              HtmlPanelGroup group = new HtmlPanelGroup();
              List<UIComponent> c = group.getChildren();
              HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
              menu.setId("i01");
              menu.setRequired(true);
              c.add(menu);
              // populate the drop down list
              HtmlOutputText t2 = new HtmlOutputText();
              t2.setValue(" ");
              c.add(t2);
              children.add(group);
              grid.setRendered(true);
              return grid;
    Thanks in advance, pls reply soon its urgent

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Creation  of components in dinamic way. Problem with threads....?

    hi,
    I am trying to add components (JTextFields) to a JPanel in dynamic way.
    I would like that the user decides the number of the components, to
    be created, for executing a function by clicking a button.
    But clicking on the button, the elaboration doesn't produce the creation
    of the JTextFields.
    Debugging the code I saw that the same function works well
    when it is called from the normal data flow of the elaboration
    instead that it is called from inside a listener.
    It is hard for me to understand the reason why this
    happens, as well I could think that this problem could happen
    because the execution of different threads.
    But I am not able to manage those kind of situations....
    I would like to have a little help
    thank you
    regards
    tonyMrsangelo.
    To reproduce the problem I post some code where the function (setComponentInThePanel())
    is called from the constructor of the class and from the listener of a JButton.
    package labels;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    import javax.swing.SpinnerNumberModel;
    public class LabelsDialogMain extends JFrame {
        PanelCanvas jPanCanvas = new PanelCanvas();
        PanelDesign jPanDesign = new PanelDesign();
        PanelCommands jPanCommands = new PanelCommands(jPanDesign);
        /** Creates new form MainLabelsDialog */
        public LabelsDialogMain() {
            java.awt.GridBagConstraints gridBagConstraints;
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new java.awt.GridBagLayout());
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanCanvas, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 3;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanDesign, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 2;
            gridBagConstraints.gridwidth = 4;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanCommands, gridBagConstraints);
            pack();
         * @param args the command line arguments
        public static void main(String args[]) {
             LabelsDialogMain mld = new LabelsDialogMain();
             mld.setVisible(true);
    class PanelCanvas extends JPanel {
        public PanelCanvas() {
            Dimension d = new Dimension(400,200);
            setPreferredSize(d);
            setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Canvas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
    } // class PanelCanvas
    class PanelDesign extends JPanel {
        JTextField textField [];
        public PanelDesign() {
            Dimension d = new Dimension(400,200);
            setPreferredSize(d);
            setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Design", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
        void setComponentInThePanel(int dim ){
             textField = new  JTextField[dim];
             for (int i = 0; i < dim; i++){
                 textField[i] = new  JTextField("----- " + i);
                 add(textField);
    System.out.println("executed the nmbr: " + i);
    repaint();
    } // setComponentInThePanel()
    } // class PanelDesign
    class PanelCommands extends JPanel {
    PanelDesign panelDesign;
    private javax.swing.JLabel jLblRowNmbr;
    private javax.swing.JSpinner jSpinner;
    JButton dummyButton = new JButton("button");
    public PanelCommands(PanelDesign pnlDesign) {
    panelDesign = pnlDesign;
    Dimension d = new Dimension(800,200);
    setPreferredSize(d);
    setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Cmmands", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
    jLblRowNmbr = new javax.swing.JLabel();
    jSpinner = new JSpinner();
    jLblRowNmbr = new JLabel();
    add(jLblRowNmbr);
    add(jSpinner);
    add(dummyButton);
    jSpinner.setModel(new javax.swing.SpinnerNumberModel(Short.valueOf((short)1), Short.valueOf((short)1), null, Short.valueOf((short)1)));
    final SpinnerNumberModel sm = (SpinnerNumberModel) this.jSpinner.getModel();
    jLblRowNmbr.setText("N. of the rows");
    // panelDesign.setComponentInThePanel(4); "take out the comment of this row to get the creation of JTextFields"
    dummyButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Number amp = sm.getNumber();
    int ampInt = amp.intValue();
    panelDesign.setComponentInThePanel(ampInt);
    // panelDesign.setComponentInThePanel(4);
    JOptionPane.showMessageDialog(jSpinner, "spinner = " + ampInt);
    } // class PanelCommands

    When you add/remove components to a panel when the GUI has already been created then you need to use:
    panel.revalidate();
    panel.repaint();

  • Dynamic Creation of Data Tables and Fields

    Hello all. I am currently working with a system that contains a bunch of windows. These windows are divided into two groups that represent their presentation style: Columns (such as a table) and Free (such as in a form). I created two tables in database to describe each and every window. These tables describe the type of presentation style, the fields of each window (title of the field, size of the field, position in window, and many more...)
    I did this to make the creation of the windows more effective. In this way that I have, I only have to make one window to display all the thousands of windows that I have in my database because the values of presentation are taken from the description in the tables.
    I was able to do this through TextFields and JTables in Swing. But now I run into JSC. Is this possible with JSC? Say in case the presentation style of the window is Column, can I tell the data table to go read the description of the window that needs to be opened to obtain the amount of columns, the column names, the size of each column... then create the tables and present the values?
    Or say the presentation style is Free... I need to go find how many fields need to be created and their positions in the form, and then the titles of each field. Any ideas how this can be performed?
    Thank you.
    Franklin Angulo

    >
    I was able to do this through TextFields and JTables
    in Swing. But now I run into JSC. Is this possible
    with JSC? Say in case the presentation style of the
    window is Column, can I tell the data table to go
    read the description of the window that needs to be
    opened to obtain the amount of columns, the column
    names, the size of each column... then create the
    tables and present the values?
    Or say the presentation style is Free... I need to go
    find how many fields need to be created and their
    positions in the form, and then the titles of each
    field. Any ideas how this can be performed?
    Creator won't help you with the graphical design, but it's definitely possible to dynamically compose the set of components that are children of a particular component. Doing so leverages the basic component APIs of JSF (javax.faces.component.UIComponent), so you'll want to grab yourself a copy of the JSF Javadocs (or use Creator's lookup facilities as you type your code) to understand what's possible.
    The most important detail is that all components have a getChildren() method that returns a java.util.List of the child components for that component (as well as a getParent() to get the parent component). Any manipulation you do on this returned list is reflected in the structure of the overal component tree.
    As a simple example, assume you want to add an input text component as a child of the form. You'd do something like this:
    HtmlInputText input = new HtmlInputText();
    input.setXxx(..); // Set properties as needed
    form1.getChildren().add(input); // add new childCraig McClanahan

  • Dynamic Structure and Components Issue

    Hi,
    I have a requirement of creating an inbound idoc program and populating dynamic structures. The program for the dynamic structure creation is as follows: ( I have been referencing Heilmans Blog ): The part for the inbound idoc creation works fine. The data will come in a flat file with Table name and 15 characterstcis. The table name is known at runtime. I need to create the dynamic table, find out the components and then populate the custom table with the dynamically created structures.
    Custom table: 4 components
    Internal table from file: 15 components with value.
    There could be more than one table in the flat file and not all components or char in the flat file is mapped to the table.
    I have been able to code the part where the components in the structure and the file components are in the same order. The problem is if the components in the structure and the file components are not in the same order. I would appreciate some inputs in this issue.
    The part that has to be worked out is:
    IF NOT L_TABNAME IS INITIAL.
        perform get_structure.
        perform create_dynamic_itab.
        perform get_data.
      ENDIF.
    *& Report  /FACTGLB/GTDMI_VARTAB_IDOCS02                               *
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-07-02
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    REPORT  ZGTDMI_VARTAB_IDOCS_DYNAMIC
            NO STANDARD PAGE HEADING
            LINE-SIZE   150
            LINE-COUNT  55
            MESSAGE-ID  zfactglb.
    **Include for Global Data Declaration
    *INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
    **Include for Selection Screen
    *INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
    **Include for Sub Routines
    *INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-07-02
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    TYPE POOLS
    *Type declaration for ALV display
    TYPE-POOLS : slis.
    Include .
    type-pools: col,                                            "#EC *
                icon,                                           "#EC *
                sym,                                            "#EC *
                abap.                                           "#EC *
    Target structure definitions
    tables:
      E1CUVTM,                                                  "#EC *
      E1DATEM,                                                  "#EC *
      E1CUV1M,                                                  "#EC *
      edp21,                                                    "#EC *
      edi_dc40,                                                 "#EC *
      edi_dd40,                                                 "#EC *
      edi_ds40.                                                 "#EC *
    GLOBAL TYPES
    TYPES : BEGIN OF ty_vartab.
            include structure E1CUVTM.
    TYPES:  END OF ty_vartab.
    TYPES : BEGIN OF ty_vartabdate.
            INCLUDE STRUCTURE E1DATEM.
    TYPES : END OF ty_vartabdate.
    *Structure for data retreived
    TYPES : BEGIN OF ty_vardetails.
            INCLUDE STRUCTURE E1CUV1M.
    TYPES : END OF ty_vardetails.
    *Structure for data retreived from table tabinput.
    TYPES : BEGIN OF ty_tabinput,
              lines type string,
            END OF ty_tabinput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_dsninput,                               "#EC *
              LINE(101) type c,
            END OF ty_dsninput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_newinput,                               "#EC *
              LINE(101) type c,
              flag(1) type c,
            END OF ty_newinput.
    *Structure for keeping the values of all the custom tables
    TYPES : BEGIN OF ty_custom_tabs,
              matnr   TYPE matnr,    "Material Number
              werks   TYPE werks_d,  "Plant
              lgort   TYPE lgort_d,  "Storage Location
              qunty   TYPE P DECIMALS 2, "Standard Order Quantity
              det_loc TYPE CHAR6, "Detail Location
              class   TYPE CHAR2,   "Class
              rate    TYPE P DECIMALS 2,    "Rate
            END OF ty_custom_tabs.
    *Type declared for the internal table and work area which will store
    *fields for error log
    TYPES : BEGIN OF ty_error_log,
              matnr TYPE matnr,       "Material Number
              mtart TYPE mtart,       "Material Type
              sel_data TYPE char10,   "No of selectyed data
            END OF ty_error_log.
    *Structure for keeping the output data
    TYPES : BEGIN OF ty_final,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
            END OF ty_final.
    TYPES: begin of TY_CONTENTHD,
              VTNAM(018) type C,
              FLAG(001) type C,
      end of TY_CONTENTHD.
    TYPES: begin of TY_CONTENT,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
              Z_VARCOND TYPE VARCOND.
    TYPES: end of TY_CONTENT.
    TYPES: begin of TY_CONTENTTAB,
              VTNAM(018) type C,
              COMP1(30) TYPE C,
              CHAR1(030) type C,
              COMP2(30) TYPE C,
              CHAR2(030) type C,
              COMP3(30) TYPE C,
              CHAR3(030) type C,
              COMP4(30) TYPE C,
              CHAR4(030) type C,
              COMP5(30) TYPE C,
              CHAR5(030) type C,
              COMP6(30) TYPE C,
              CHAR6(030) type C,
              COMP7(30) TYPE C,
              CHAR7(030) type C,
              COMP8(30) TYPE C,
              CHAR8(030) type C,
              COMP9(30) TYPE C,
              CHAR9(030) type C,
              COMP10(30) TYPE C,
              CHAR10(030) type C,
              COMP11(30) TYPE C,
              CHAR11(030) type C,
              COMP12(30) TYPE C,
              CHAR12(030) type C,
              COMP13(30) TYPE C,
              CHAR13(030) type C,
              COMP14(30) TYPE C,
              CHAR14(030) type C,
              COMP15(30) TYPE C,
              CHAR15(030) type C,
              FLAG(001) type C.
    TYPES: end of TY_CONTENTTAB.
    TYPES: BEGIN OF TY_E1CUVTM,
              MSGFN       TYPE MSGFN,
              VAR_TAB       TYPE APITABL,
              STATUS       TYPE RCUTBST,
              VTGROUP       TYPE RCUTBGR,
              AUTHSTRUC       TYPE RCUTBBE,
              AUTHENTRY       TYPE RCUFNBI,
              FLDELETE       TYPE FLLKENZ,
              DBTABNAME       TYPE TABNAME16,
              DBCONACTIVE TYPE DBCON_ACTI,
              PRESDEC       TYPE VTDCT,
           END OF TY_E1CUVTM.
    TYPES: BEGIN OF TY_E1CUV1M,
              MSGFN     TYPE MSGFN,
              VTLINENO     TYPE VTLINENO,
              VTCHARACT     TYPE ATNAM,
              ATWRT     TYPE ATWRT,
              ATFLV     TYPE ATFLV,
              ATAWE     TYPE MSEHI,
              ATFLB     TYPE ATFLB,
              ATAW1     TYPE MSEHI,
              ATCOD     TYPE ATCOD,
              ATTLV     TYPE ATTLV,
              ATTLB     TYPE ATTLB,
              ATPRZ     TYPE ATPRZ,
              ATINC     TYPE ATINC,
              VTLINENO5     TYPE VTLINENO5,
           END OF TY_E1CUV1M.
    TYPES: BEGIN OF TY_E1DATEM,
              MSGFN       TYPE MSGFN,
              KEY_DATE       TYPE SYDATUM,
              AENNR       TYPE AENNR,
              EFFECTIVITY TYPE      CC_MTEFF,
           END OF TY_E1DATEM.
    TYPES: BEGIN OF ty_vtnam,
             vtint TYPE vtint,  " Internal number of variant table
             vtnam TYPE vtnam,  " Name of variant table
             dbtab_name type tabname16, "Custom table Name
             error  TYPE char1,  " Indicates error in data format
             reas   TYPE char50, " Reason for failure
           END OF ty_vtnam.
    Get data type for characteristic
    TYPES: BEGIN OF ty_cabn,
            atinn  TYPE atinn,       "Internal characteristic
            atnam  TYPE atnam,       "Characteristic Name
            atfor  TYPE atfor,       "Data type of characteristic
            atson  TYPE atson,       "Indicator: Additional Values
            atprt  TYPE atprt,       "Check table
            atprr  TYPE atprr,       "Name of Check Report Program
            atprf  TYPE atprf,       "Function Module for Checking Values
            anzdz  TYPE anzdz,       "Number of Decimal Places
            check  TYPE char1,       "Indicates check required or not
           END OF ty_cabn.
    Get field names of variant table
    TYPES: BEGIN OF ty_cuvtab_fld,
             vtint TYPE vtint,   " Internal number of variant table
             atinn TYPE atinn,   " Internal characteristic
             vtpos TYPE vtpos,   " Item number of characteristic in variant
    *mod-012
            DBFLD type NAME_FELD,
    *mod-012
             exist TYPE char1,   " X Indictaes characteristic is part of fil
           END OF ty_cuvtab_fld.
    Store all data in internal table
    TYPES: BEGIN OF ty_file,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              flag   TYPE char1,
              error  TYPE char50,
           END OF ty_file.
    To check for duplicates
    TYPES: BEGIN OF ty_dupl,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              slnid  TYPE  slnid,
            END OF ty_dupl.
    Get previously loaded characteristic values for internal table (CHAR)
    TYPES: BEGIN OF ty_cuvtab_valc,
            vtint  TYPE  vtint,   " Internal number of variant table
            slnid  TYPE  slnid,   " Key for value combination in variant tab
            atinn  TYPE  atinn,   " Internal characteristic
            valc   TYPE  atwrt,   " Characteristic Value
          END OF ty_cuvtab_valc.
    Get previously loaded characteristic values for internal table (NUM)
    TYPES: BEGIN OF ty_cuvtab_valn,
            vtint  TYPE  vtint,      " Internal number of variant table
            slnid  TYPE  slnid,      " Key for value combination in variant tab
            atinn  TYPE  atinn,      " Internal characteristic
            val_from  TYPE  atflv,   " Internal floating point from
           END OF ty_cuvtab_valn.
    Store column positions of characteristics
    TYPES: BEGIN OF ty_col_pos,
             vtint  TYPE vtint,   " Internal number of variant table
             vtnam  TYPE vtnam,   " Variant table name
             atinn  TYPE atinn,   "Internal characteristic
             atnam  TYPE atnam,   "Characteristic Name
             field  TYPE fieldname,   "Field name
             req    TYPE char1,       " Required or not
             vtpos  TYPE vtpos,       " Item number of characteristics
             DBFLD type NAME_FELD,    " Field Name of Custom table.
           END OF ty_col_pos.
    Store valid values for characteristics
    TYPES: BEGIN OF ty_cawn,
              atinn TYPE atinn,   " Internal characteristic
              atzhl TYPE atzhl,   " Int counter
              atwrt TYPE atwrt,   " Characteristic Value
              atflv TYPE atflv,   " Internal floating point from
              lkenz TYPE lkenz,   " Deletion indicator
          END OF ty_cawn.
    Store error messages for individual lines
    TYPES: BEGIN OF ty_error,
             vtnam  TYPE vtnam,       " Variant table name
             fname  TYPE fieldname,   " Fieldname
             atnam  TYPE atnam,       " Characteristic name
             atwrt  TYPE atwrt,       " Characteristic value
             row    TYPE char5,       " Row id
          END OF ty_error.
    Begin TPR# 4618
    To store unique number for variant
    TYPES: BEGIN OF ty_vnt_ma,
            vtnam     TYPE vtnam,
            unique_no TYPE ZGTDM_UNQN,
            no_chr    TYPE ZGTDM_NO_CHR,
          END OF ty_vnt_ma.
    TYPES: BEGIN OF ty_dbtab,
            vtint     TYPE vtint,
            vtnam     TYPE vtnam,
            DBTAB_NAME TYPE TABNAME16,
          END OF ty_dbtab.
    To find out concatenated number for
    TYPES: BEGIN OF ty_split,
            f1 TYPE char6,
          END OF ty_split.
    TYPES: BEGIN OF ty_charval,
            char TYPE char30,
          END OF ty_charval.
    TYPES: BEGIN OF TY_DATA,
           name TYPE string,
           value(15) type c,
          END OF TY_DATA.
    DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA.
    TYPES:
      TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
      TUMLS_MESSTYPETXT type EDI_TEXT60,
      TUMLS_MESSCODE type EDIPMESCOD.
    TYPES:
      TUMLS_TABNAME TYPE TABNAME,                               "#EC *
      TUMLS_SEGMENT TYPE TABNAME.                               "#EC *
    TYPES:
      TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
    TYPES:
      BEGIN OF type_errorline,
         msgty type SYMSGTY,
         id type SYMSGID,
         msgno type symsgno,
         par1 type symsgv,
         par2 type symsgv,
         par3 type symsgv,
         par4 type symsgv,
      END OF type_errorline.
    TYPES:
      type_errortab TYPE SORTED TABLE
                    OF type_errorline
                    WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
    DATA:
        LV_INDEX TYPE SY-INDEX,
        LV_INDEX2 TYPE SYINDEX,
        LV_TABLE1 TYPE REF TO DATA,
        LV_TABLE2 TYPE REF TO DATA,
        LV_TABLE3 TYPE REF TO DATA,
        LV_TABLE4 TYPE REF TO DATA,
        LV_LINE1  TYPE REF TO DATA,
        LV_LINE2  TYPE REF TO DATA,
        LV_LINE3  TYPE REF TO DATA,
        LV_LINE4  TYPE REF TO DATA,
        LV_OFFSET1 TYPE SYTABIX,
        ST_IS_LAYOUT_ALV TYPE SLIS_LAYOUT_ALV,
        L_IT_FCATLOG_ALV TYPE SLIS_T_FIELDCAT_ALV,
        L_IT_FLDCAT TYPE LVC_T_FCAT.
    GLOBAL INTERNAL TABLES
    DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
    DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
    DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
    DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
    DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    GLOBAL WORK AREAS
    **Internal Table for the structure TY_T001L
    DATA : wa_vartab TYPE ty_vartab.                            "#EC *
    DATA : wa_vartabdate TYPE ty_vartabdate.                    "#EC *
    DATA : wa_vardetails TYPE ty_vardetails.                    "#EC *
    DATA : wa_tabinput TYPE ty_tabinput.                        "#EC *
    DATA : wa_dsninput TYPE ty_dsninput.                        "#EC *
    DATA : wa_newinput TYPE ty_newinput.                        "#EC *
    DATA : wa_gnewinput TYPE ty_newinput.                       "#EC *
    DATA : wa_ginput_data TYPE ty_newinput.                     "#EC *
    DATA : wa_final TYPE ty_final.                              "#EC *
    DATA : wa_content TYPE ty_content.                          "#EC *
    DATA : wa_contenthd TYPE ty_contenthd.                      "#EC *
    DATA : wa_contentheader type ty_contenthd.                  "#EC *
    DATA : wa_contenttab TYPE ty_content.                       "#EC *
    DATA : wa_content1 TYPE ty_content.                         "#EC *
    DATA : wa_contenthd1 TYPE ty_contenthd.                     "#EC *
    DATA : wa_contentheader1 type ty_contenthd.                 "#EC *
    DATA : wa_contenttab1 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab2 TYPE ty_content.                      "#EC *'
    DATA : wa_contenttab3 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab4 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab5 TYPE ty_contentTAB.                   "#EC *
    DATA : wa_E1CUVTM TYPE E1CUVTM.                             "#EC *
    DATA : wa_E1CUV1M TYPE E1CUV1M.                             "#EC *
    DATA : wa_E1DATEM TYPE E1DATEM.                             "#EC *
    DATA : wa_error_tab TYPE solisti1.                          "#EC *
    INTERNAL TABLES AND WORK AREAS FOR BDC
    *Internal Table to store the data to display the error message
    DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    *Internal Table to store the data to display the error message
    DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    **Work area to store the data to display the error message
    DATA : wa_errormsg TYPE solisti1.                           "#EC *
    **Internal table which will store data for the error log
    DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
    GLOBAL VARIABLES
    DATA:  G_FILE TYPE string.                                  "#EC *
    DATA : g_ctr_input_recs(5) type c.                          "#EC *
    DATA:  g_ctr_output_recs(5) type p.                         "#EC *
    data : g_msg(100) type c.                                   "#EC *
    data:  g_struct_file TYPE string.                           "#EC *
    data:  g_login type FILEINTERN.                             "#EC *
    data:  g_phyin type string.                                 "#EC *
    DATA:  g_lprnt type RSPOPSHORT.                             "#EC *
    DATA:  g_FNAME1 TYPE STRING.                                "#EC *
    DATA : g_repid TYPE repid,                                  "#EC *
           g_exit(1) TYPE C,                                    "#EC *
           gx_variant  type disvariant.                         "#EC *
    DATA : g_lines    TYPE i .                                  "#EC *
    data : g_save(1) type c.                                    "#EC *
    DATA : g_splid     TYPE rspoid .                            "#EC *
    data:  p_login type FILEINTERN.                             "#EC *
    data:  p_phyin type string.                                 "#EC *
    DATA:
      go_table         TYPE REF TO cl_salv_table,
      go_sdescr        TYPE REF TO cl_abap_structdescr,
      go_tdescr        TYPE REF TO cl_abap_tabledescr,
      gdo_data         TYPE REF TO data,
      gdo_handle       TYPE REF TO data,
      gs_comp          TYPE abap_componentdescr,
      gt_components    TYPE abap_component_tab.
    FIELD-SYMBOLS:
           TYPE table.
    GLOBAL CONSTANTS
    CONSTANTS c_msgar   TYPE rslgarea   VALUE 'F8'.             "#EC *
    CONSTANTS c_msgid   TYPE rslgsubid  VALUE 'E'.              "#EC *
    CONSTANTS c_urgnc   TYPE char04     VALUE 'HIGH'.           "#EC *
    CONSTANTS C_X(1)       TYPE C          VALUE 'X'.           "#EC *
    CONSTANTS C_Y(1)       TYPE C          VALUE 'Y'.           "#EC *
    CONSTANTS C_Z(1)       TYPE C          VALUE 'Z'.           "#EC *
    CONSTANTS C_E(1)       TYPE C          VALUE 'E'.           "#EC *
    CONSTANTS C_SAP(3)     TYPE C          VALUE 'SAP'.         "#EC *
    CONSTANTS C_MOD(3)     TYPE C          VALUE 'MOD'.         "#EC *
    CONSTANTS C_MD1(3)     TYPE C          VALUE 'MD1'.         "#EC *
    CONSTANTS C_MD2(3)     TYPE C          VALUE 'MD2'.         "#EC *
    CONSTANTS C_MD3(3)     TYPE C          VALUE 'MD3'.         "#EC *
    CONSTANTS C_MD4(3)     TYPE C          VALUE 'MD4'.         "#EC *
    CONSTANTS C_MD5(3)     TYPE C          VALUE 'MD5'.         "#EC *
    constants:   c_000001(6)  type c value '000001',            "#EC *
                 c_e1cuv1m(7) type c value 'E1CUV1M',           "#EC *
                 c_02(2)  type c value '02',                    "#EC *
                 c_009(3)   type c value '009',                 "#EC *
                 c_0001(4) type c value '0001'.                 "#EC *
    constants:  c_e1datem(7) type c value 'E1DATEM'.            "#EC *
    constants:  c_e1cuvtm(7) type c value 'E1CUVTM'.            "#EC *
    GLOBAL INTERNAL TABLES FOR ALV DISPLAY
    *Internal tables for ALV Field cat
    DATA :
    i_fieldcat_ov  TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_ov1 TYPE lvc_t_fcat,                             "#EC *
    i_events       TYPE slis_t_event.                           "#EC *
    GLOBAL WORK AREAS FOR ALV DISPLAY
    *Work area for ALV Field layout
    DATA : wa_layout TYPE slis_layout_alv.                      "#EC *
    *Work area for Field Cat. Table
    DATA : wa_fieldcat TYPE slis_fieldcat_alv.                  "#EC *
    GLOBAL VARIABLES FOR ALV DISPLAY
    DATA : g_event  TYPE slis_t_event.                          "#EC *
    DATA : g_top_of_page TYPE slis_t_listheader.                "#EC *
    DATA : g_ok_code     TYPE char4.                            "#EC *
    DATA : g_variant     type disvariant.                       "#EC *
    GLOBAL CONSTANTS FOR ALV DISPLAY
    BAL handling
    data: iv_log_handle type BALLOGHNDL.                        "#EC *
    data: is_log_header type bal_s_log.                         "#EC *
    data: iv_object     type bal_s_log-object    value 'CAPI'.  "#EC *
    data: iv_subobject  type bal_s_log-subobject value 'CAPI_LOG'."#EC *
    data: iv_tcode      type bal_s_log-altcode   value 'SE38'.  "#EC *
    *MOD-005
    RANGES:
        R_MESTYP FOR EDIDC-MESTYP,                              "#EC *
        R_CREDAT FOR EDIDC-CREDAT,                                  "#EC *
        R_CRETIM FOR EDIDC-CRETIM,                              "#EC *
        R_SNDPRT FOR EDIDC-SNDPRT,                              "#EC *
        R_SNDPRN FOR EDIDC-SNDPRN.                              "#EC *
    DATA:
        L_MESSTYPE TYPE TUMLS_MESSTYPE.                         "#EC *
    *MOD-005
    data:        p_sndprn TYPE EDI_SNDPRN,                      "#EC *
                 p_sndprt TYPE EDI_SNDPRT,                      "#EC *
                 p_sndpor TYPE EDI_SNDPOR.                      "#EC *
    data:        p_rcvprn TYPE EDI_RCVPRN,                      "#EC *
                 p_rcvprt TYPE EDI_RCVPRT,                      "#EC *
                 p_rcvpor TYPE EDI_RCVPOR.                      "#EC *
    data:
      init_E1CUVTM type E1CUVTM,                                "#EC *
      prev_E1CUVTM type E1CUVTM,                                "#EC *
      init_E1DATEM type E1DATEM,                                "#EC *
      prev_E1DATEM type E1DATEM,                                "#EC *
      init_E1CUV1M type E1CUV1M,                                "#EC *
      prev_E1CUV1M type E1CUV1M.                                "#EC *
    Source structure definitions
    data:
      begin of LSMW_TAB_CONTENT,                                "#EC *
        VTNAM(018) type C,
        CHAR1(030) type C,
        CHAR2(030) type C,
        CHAR3(030) type C,
        CHAR4(030) type C,
        CHAR5(030) type C,
        CHAR6(030) type C,
        CHAR7(030) type C,
        CHAR8(030) type C,
        CHAR9(030) type C,
        CHAR10(030) type C,
        CHAR11(030) type C,
        CHAR12(030) type C,
        CHAR13(030) type C,
        CHAR14(030) type C,
        CHAR15(030) type C,
        FLAG(001) type C,
      end of LSMW_TAB_CONTENT.
    Counters
    data:
      g_cnt_VAR_TAB  type i,                                    "#EC *
      g_cnt_TAB_CONTENT  type i.                                "#EC *
    Counter ct_xxxxxxxxxx: number of transferred records
    data:
      ct_edi_dc40 type i,                                       "#EC *
      cs_edi_dc40 type i,                                       "#EC *
      ct_E1CUVTM  type i,                                       "#EC *
      cs_E1CUVTM  type i,                                       "#EC *
      ct_E1DATEM  type i,                                       "#EC *
      cs_E1DATEM  type i,                                       "#EC *
      ct_E1CUV1M  type i,                                       "#EC *
      cs_E1CUV1M  type i.                                       "#EC *
    Global data definitions and data declarations
    DATA: wa_cabn TYPE ty_cabn,
          wa_cawn TYPE ty_cawn,
          wa_file TYPE ty_file,
          wa_vtnam TYPE ty_vtnam,
          wa_cuvtab_fld TYPE ty_cuvtab_fld,
          wa_cuvtab_valn TYPE ty_cuvtab_valn,
          wa_cuvtab_valc TYPE ty_cuvtab_valc,
          wa_col_pos     TYPE ty_col_pos,
          wa_error       TYPE ty_error,
          wa_dupl        TYPE ty_dupl,
          wa_dupl_file   TYPE ty_dupl.
    DATA: wa_vnt_ma TYPE ty_vnt_ma,
          wa_split  TYPE ty_split.
    DATA: wa_charval TYPE ty_charval.                           "#EC *
    Internal table
    DATA: i_cabn        TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_temp   TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_atinn  TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_file        TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_file_tmp    TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_vtnam       TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab      TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab_fld  TYPE STANDARD TABLE OF ty_cuvtab_fld,   "#EC *
          i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn,  "#EC *
          i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc,  "#EC *
          i_col_pos     TYPE STANDARD TABLE OF ty_col_pos,      "#EC *
          i_cawn        TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_n      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_c      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_i      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cuv_error   TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_dupl        TYPE STANDARD TABLE OF ty_dupl,         "#EC *
          i_dbtab       TYPE STANDARD TABLE OF ty_dbtab.        "#EC *
    DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma,            "#EC *
          i_split  TYPE STANDARD TABLE OF ty_split.             "#EC *
    DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl.           "#EC *
    DATA: i_charval TYPE STANDARD TABLE OF ty_charval.          "#EC *
    Constants
    CONSTANTS: c_char TYPE atfor VALUE 'CHAR',                  "#EC *
               c_date TYPE atfor VALUE 'DATE',                  "#EC *
               c_time TYPE atfor VALUE 'TIME',                  "#EC *
               c_varcond TYPE atnam VALUE 'Z_VARCOND'.          "#EC *
    Field Symbols
    FIELD-SYMBOLS:  TYPE ANY.
    Variables
    DATA: g_raw(500)  TYPE c,                                   "#EC *
          g_invalid   TYPE char1,                               "#EC *
          g_error     TYPE char1,                               "#EC *
          g_message   TYPE char50,                              "#EC *
          g_slnid_c    TYPE slnid,                              "#EC *
          g_slnid_n    TYPE slnid,                              "#EC *
          g_row        TYPE char5.                              "#EC *
    DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
          g_split_var TYPE i.                                   "#EC *
    Types: begin of ty_charname,
             name type atnam,
           end of ty_charname.
    data: wa_charname type ty_charname,                         "#EC *
          i_charname type standard table of ty_charname.        "#EC *
    data: cnt_i type i,                                         "#EC *
          g_tabix type char10.                                  "#EC *
    Types: begin of ty_itab_zedidc40.
            include structure edi_dc40.
    TYPES:       end of ty_itab_zedidc40.
    Types: begin of ty_itab_zedidd40.
            include structure edi_dd40.
    TYPES: end of ty_itab_zedidd40.
    DATA: itab_zedidc40 type standard table of
                      ty_itab_zedidc40 initial size 0.          "#EC *
    DATA: itab_zedidd40 type standard table of
                      ty_itab_zedidd40 initial size 0.          "#EC *
    DATA: wa_itab_zedidc40 type ty_itab_zedidc40.
    DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
    *MOD-009
    data: itab_ze1cuvtm type e1cuvtm,                           "#EC *
          itab_ze1datem type e1datem,                           "#EC *
          itab_ze1cuv1m type e1cuv1m.                           "#EC *
    data: wdocnum(16) type n value 0.                           "#EC *
    data: wsegnum(6)  type n value 0.                           "#EC *
    data: witemno(10) type n value 0.                           "#EC *
    data: witemno_new(10)  type n value 0.                      "#EC *
    data: witemno_gst(10)  type n value 0.                      "#EC *
    data: witemno_qst(10)  type n value 0.                      "#EC *
    TYPES: BEGIN OF ty_input_data1,                             "#EC *
              line(560) type c,
              flag(1) type c,
           END OF ty_input_data1.
    DATA: i_input_data type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: i_input_data1 type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: wa_input_data type ty_input_data1.                    "#EC *
    DATA: g_cnt_input_recs type i.                              "#EC *
    DATA: g_flg_error type c.                                   "#EC *
    DATA: l_lines type i.                                       "#EC *
    DATA: l_lines_varcond type i.                               "#EC *
    DATA: l_lines1 type i.                                      "#EC *
    DATA: l_tabix type i.                                       "#EC *
    DATA: wa_input_data1 type ty_input_data1.                   "#EC *
    DATA: FILE TYPE STRING.
    Fields that are made available to the user:
    DATA:
      g_cnt_records_read TYPE i,                                "#EC *
      g_cnt_records_transferred TYPE i,                         "#EC *
      g_cnt_transactions_read TYPE i,                           "#EC *
      g_cnt_transactions_transferred TYPE i,                    "#EC *
      g_cnt_idocs_package TYPE i.                               "#EC *
    data: v_log_handle type balloghndl.                         "#EC *
    DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
    DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
    DATA: wa_curr_edi_dc40 TYPE edi_dc40.                       "#EC *
    DATA: wa_curr_edi_dd40 TYPE edi_dd40.                       "#EC *
    internal table for error messages during conversion
    DATA: g_error_tab TYPE type_errortab,                       "#EC *
          wa_errortab TYPE type_errorline.                      "#EC *
    DATA:  g_edidd_segnam type EDI4SEGNAM,                      "#EC *
           g_edidd_hlevel type EDI4HLEVEC.                      "#EC *
    DATA: g_segnum(6) TYPE n.
    DATA: g_objecttype(2) type C.
    DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
    DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
    DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
          it_fldcat TYPE lvc_t_fcat.
    field-symbols: .
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    data: l_wa_data TYPE TY_CONTENT,
          l_tabname TYPE tabname,
          itab_data TYPE standard table of TY_CONTENT.
    DATA:   l_len_slnid TYPE i,                                 "#EC NEEDED
            l_len_varcond TYPE i,                               "#EC NEEDED
            l_temp_slnid TYPE i,                                "#EC NEEDED
            l_temp_slnc TYPE char5,                             "#EC NEEDED
            l_temp_varcond TYPE varcond,                        "#EC NEEDED
            l_sub_var      TYPE i,                              "#EC NEEDED
            l_val_split TYPE char10.                            "#EC NEEDED
    DATA: l_invalid.                                          "#EC NEEDED
    DECLARATION FOR SELECTION SCREEN
    *selection-screen skip 1.
    *For all the input field entries
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    *Parameter for Input File Name:
    PARAMETERS:   p_inpt   TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
    PARAMETERS:   p_inpt1  TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
    SELECTION-SCREEN END OF BLOCK bl1.
    IDoc creation
    selection-screen begin of block idocpars
                     with frame title text-006.
    parameters:
       p_trfcpt as checkbox default C_X MODIF ID MD3,
       p_packge(5) type n default 1 MODIF ID MD3.
    selection-screen end of block idocpars.
    SELECTION-SCREEN BEGIN OF BLOCK bl5 WITH FRAME TITLE text-038.
    Radio Buttons :
    parameters:
      rb_idocp RADIOBUTTON GROUP RB3 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD6,
      rb_custt RADIOBUTTON GROUP RB3 MODIF ID MD6.
    SELECTION-SCREEN END OF BLOCK bl5.
    SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
    Radio Buttons :
    parameters:
      rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD4,
      rb_convt RADIOBUTTON GROUP RB1 MODIF ID MD4,
      rb_idoc RADIOBUTTON  GROUP RB1 MODIF ID MD4,
      rb_proc RADIOBUTTON  GROUP RB1 MODIF ID MD4.
    SELECTION-SCREEN END OF BLOCK bl3.
    SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-037.
    Radio Buttons :
    parameters:
      rb_appct RADIOBUTTON GROUP RB2 DEFAULT 'X' USER-COMMAND UCOM MODIF ID MD5,
      rb_conct RADIOBUTTON GROUP RB2 MODIF ID MD5,
      rb_cust RADIOBUTTON  GROUP RB2 MODIF ID MD5.
    SELECTION-SCREEN END OF BLOCK bl4.
    INITIALIZATION
    INITIALIZATION.
    Check selection-screen entries *
    *AT SELECTION-SCREEN.
    PERFORM sub_get_physical_file USING p_fpath p_fname.
    PERFORM sub_get_physical_file1 USING p_fpath1 p_fname1.
    AT SELECTION SCREEN
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    PERFORM sub_get_file. " CHANGING p_fname.         "#EC *
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname1.
    PERFORM sub_get_file1. " CHANGING p_fname1.       "#EC *
    AT SELECTI

    Hi,
      I now have a requirement for the following:
    Duplicate VARCOND if I  Use small letters and capital letters. Sequential number also duplicated.
    Here is the code and would appreciate if someone could shed some light on the issue.
    *& Report  ZVARTABDYNFINAL
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    REPORT  ZVARTABDYNFINAL NO STANDARD PAGE HEADING
            LINE-SIZE   150
            LINE-COUNT  55
            MESSAGE-ID  /factglb/gta_custdev.
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    *&  Include           /FACTGLB/GTDMI_VARTAB_TOP
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    TYPE POOLS
    TYPE POOLS
    TYPE POOLS
    *Type declaration for ALV display
    TYPE-POOLS : slis.
    Include <icon>.
    type-pools: col,                                            "#EC *
                icon,                                           "#EC *
                sym,                                            "#EC *
                abap.                                           "#EC *
    Target structure definitions
    tables:
      E1CUVTM,                                                  "#EC *
      E1DATEM,                                                  "#EC *
      E1CUV1M,                                                  "#EC *
      edp21,                                                    "#EC *
      edi_dc40,                                                 "#EC *
      edi_dd40,                                                 "#EC *
      edi_ds40.                                                 "#EC *
    GLOBAL TYPES
    TYPES : BEGIN OF ty_vartab.
            include structure E1CUVTM.
    TYPES:  END OF ty_vartab.
    TYPES : BEGIN OF ty_vartabdate.
            INCLUDE STRUCTURE E1DATEM.
    TYPES : END OF ty_vartabdate.
    *Structure for data retreived
    TYPES : BEGIN OF ty_vardetails.
            INCLUDE STRUCTURE E1CUV1M.
    TYPES : END OF ty_vardetails.
    *Structure for data retreived from table tabinput.
    TYPES : BEGIN OF ty_tabinput,
              lines type string,
            END OF ty_tabinput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_dsninput,                               "#EC *
              LINE(101) type c,
            END OF ty_dsninput.
    *Structure for data retreived from Table dsn_input.
    TYPES : BEGIN OF ty_newinput,                               "#EC *
              LINE(101) type c,
              flag(1) type c,
            END OF ty_newinput.
    *Structure for keeping the values of all the custom tables
    TYPES : BEGIN OF ty_custom_tabs,
              matnr   TYPE matnr,    "Material Number
              werks   TYPE werks_d,  "Plant
              lgort   TYPE lgort_d,  "Storage Location
              qunty   TYPE P DECIMALS 2, "Standard Order Quantity
              det_loc TYPE CHAR6, "Detail Location
              class   TYPE CHAR2,   "Class
              rate    TYPE P DECIMALS 2,    "Rate
            END OF ty_custom_tabs.
    *Type declared for the internal table and work area which will store
    *fields for error log
    TYPES : BEGIN OF ty_error_log,
              matnr TYPE matnr,       "Material Number
              mtart TYPE mtart,       "Material Type
              sel_data TYPE char10,   "No of selectyed data
            END OF ty_error_log.
    *Structure for keeping the output data
    TYPES : BEGIN OF ty_final,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
            END OF ty_final.
    TYPES: begin of TY_CONTENTHD,
              VTNAM(018) type C,
              FLAG(001) type C,
      end of TY_CONTENTHD.
    TYPES: begin of TY_CONTENT,
              VTNAM(018) type C,
              CHAR1(030) type C,
              CHAR2(030) type C,
              CHAR3(030) type C,
              CHAR4(030) type C,
              CHAR5(030) type C,
              CHAR6(030) type C,
              CHAR7(030) type C,
              CHAR8(030) type C,
              CHAR9(030) type C,
              CHAR10(030) type C,
              CHAR11(030) type C,
              CHAR12(030) type C,
              CHAR13(030) type C,
              CHAR14(030) type C,
              CHAR15(030) type C,
              FLAG(001) type C,
              Z_VARCOND type VARCOND.
    TYPES: end of TY_CONTENT.
    TYPES: begin of TY_CONTENTTAB,
              VTNAM(018) type C,
              COMP1(30) TYPE C,
              CHAR1(030) type C,
              COMP2(30) TYPE C,
              CHAR2(030) type C,
              COMP3(30) TYPE C,
              CHAR3(030) type C,
              COMP4(30) TYPE C,
              CHAR4(030) type C,
              COMP5(30) TYPE C,
              CHAR5(030) type C,
              COMP6(30) TYPE C,
              CHAR6(030) type C,
              COMP7(30) TYPE C,
              CHAR7(030) type C,
              COMP8(30) TYPE C,
              CHAR8(030) type C,
              COMP9(30) TYPE C,
              CHAR9(030) type C,
              COMP10(30) TYPE C,
              CHAR10(030) type C,
              COMP11(30) TYPE C,
              CHAR11(030) type C,
              COMP12(30) TYPE C,
              CHAR12(030) type C,
              COMP13(30) TYPE C,
              CHAR13(030) type C,
              COMP14(30) TYPE C,
              CHAR14(030) type C,
              COMP15(30) TYPE C,
              CHAR15(030) type C,
              FLAG(001) type C.
    TYPES: end of TY_CONTENTTAB.
    TYPES: BEGIN OF TY_E1CUVTM,
              MSGFN       TYPE MSGFN,
              VAR_TAB       TYPE APITABL,
              STATUS       TYPE RCUTBST,
              VTGROUP       TYPE RCUTBGR,
              AUTHSTRUC       TYPE RCUTBBE,
              AUTHENTRY       TYPE RCUFNBI,
              FLDELETE       TYPE FLLKENZ,
              DBTABNAME       TYPE TABNAME16,
              DBCONACTIVE TYPE DBCON_ACTI,
              PRESDEC       TYPE VTDCT,
           END OF TY_E1CUVTM.
    TYPES: BEGIN OF TY_E1CUV1M,
              MSGFN     TYPE MSGFN,
              VTLINENO     TYPE VTLINENO,
              VTCHARACT     TYPE ATNAM,
              ATWRT     TYPE ATWRT,
              ATFLV     TYPE ATFLV,
              ATAWE     TYPE MSEHI,
              ATFLB     TYPE ATFLB,
              ATAW1     TYPE MSEHI,
              ATCOD     TYPE ATCOD,
              ATTLV     TYPE ATTLV,
              ATTLB     TYPE ATTLB,
              ATPRZ     TYPE ATPRZ,
              ATINC     TYPE ATINC,
              VTLINENO5     TYPE VTLINENO5,
           END OF TY_E1CUV1M.
    TYPES: BEGIN OF TY_E1DATEM,
              MSGFN       TYPE MSGFN,
              KEY_DATE       TYPE SYDATUM,
              AENNR       TYPE AENNR,
              EFFECTIVITY TYPE      CC_MTEFF,
           END OF TY_E1DATEM.
    TYPES: BEGIN OF ty_vtnam,
             vtint TYPE vtint,  " Internal number of variant table
             vtnam TYPE vtnam,  " Name of variant table
             dbtab_name type tabname16, "Custom table Name
             error  TYPE char1,  " Indicates error in data format
             reas   TYPE char50, " Reason for failure
           END OF ty_vtnam.
    Get data type for characteristic
    TYPES: BEGIN OF ty_cabn,
            atinn  TYPE atinn,       "Internal characteristic
            atnam  TYPE atnam,       "Characteristic Name
            atfor  TYPE atfor,       "Data type of characteristic
            atson  TYPE atson,       "Indicator: Additional Values
            atprt  TYPE atprt,       "Check table
            atprr  TYPE atprr,       "Name of Check Report Program
            atprf  TYPE atprf,       "Function Module for Checking Values
            anzdz  TYPE anzdz,       "Number of Decimal Places
            check  TYPE char1,       "Indicates check required or not
           END OF ty_cabn.
    Get field names of variant table
    TYPES: BEGIN OF ty_cuvtab_fld,
             vtint TYPE vtint,   " Internal number of variant table
             atinn TYPE atinn,   " Internal characteristic
             vtpos TYPE vtpos,   " Item number of characteristic in variant
    *mod-012
             DBFLD type NAME_FELD,
    *mod-012
             exist TYPE char1,   " X Indictaes characteristic is part of fil
           END OF ty_cuvtab_fld.
    Store all data in internal table
    TYPES: BEGIN OF ty_file,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              flag   TYPE char1,
              error  TYPE char50,
           END OF ty_file.
    To check for duplicates
    TYPES: BEGIN OF ty_dupl,
              vtnam TYPE vtnam,
              char1 TYPE atwrt,
              char2 TYPE atwrt,
              char3 TYPE atwrt,
              char4 TYPE atwrt,
              char5 TYPE atwrt,
              char6 TYPE atwrt,
              char7 TYPE atwrt,
              char8 TYPE atwrt,
              char9 TYPE atwrt,
              char10 TYPE atwrt,
              char11 TYPE atwrt,
              char12 TYPE atwrt,
              char13 TYPE atwrt,
              char14 TYPE atwrt,
              char15 TYPE atwrt,
              slnid  TYPE  slnid,
            END OF ty_dupl.
    Get previously loaded characteristic values for internal table (CHAR)
    TYPES: BEGIN OF ty_cuvtab_valc,
            vtint  TYPE  vtint,   " Internal number of variant table
            slnid  TYPE  slnid,   " Key for value combination in variant tab
            atinn  TYPE  atinn,   " Internal characteristic
            valc   TYPE  atwrt,   " Characteristic Value
          END OF ty_cuvtab_valc.
    Get previously loaded characteristic values for internal table (NUM)
    TYPES: BEGIN OF ty_cuvtab_valn,
            vtint  TYPE  vtint,      " Internal number of variant table
            slnid  TYPE  slnid,      " Key for value combination in variant tab
            atinn  TYPE  atinn,      " Internal characteristic
            val_from  TYPE  atflv,   " Internal floating point from
           END OF ty_cuvtab_valn.
    Store column positions of characteristics
    TYPES: BEGIN OF ty_col_pos,
             vtint  TYPE vtint,   " Internal number of variant table
             vtnam  TYPE vtnam,   " Variant table name
             atinn  TYPE atinn,   "Internal characteristic
             atnam  TYPE atnam,   "Characteristic Name
             field  TYPE fieldname,   "Field name
             req    TYPE char1,       " Required or not
             vtpos  TYPE vtpos,       " Item number of characteristics
           END OF ty_col_pos.
    Store valid values for characteristics
    TYPES: BEGIN OF ty_cawn,
              atinn TYPE atinn,   " Internal characteristic
              atzhl TYPE atzhl,   " Int counter
              atwrt TYPE atwrt,   " Characteristic Value
              atflv TYPE atflv,   " Internal floating point from
              lkenz TYPE lkenz,   " Deletion indicator
          END OF ty_cawn.
    Store error messages for individual lines
    TYPES: BEGIN OF ty_error,
             vtnam  TYPE vtnam,       " Variant table name
             fname  TYPE fieldname,   " Fieldname
             atnam  TYPE atnam,       " Characteristic name
             atwrt  TYPE atwrt,       " Characteristic value
             row    TYPE char5,       " Row id
          END OF ty_error.
    Begin TPR# 4618
    To store unique number for variant
    TYPES: BEGIN OF ty_vnt_ma,
            vtnam     TYPE vtnam,
            unique_no TYPE ZGTDM_UNQN,
            no_chr    TYPE ZGTDM_NO_CHR,
          END OF ty_vnt_ma.
    TYPES: BEGIN OF ty_dbtab,
            vtint     TYPE vtint,
            vtnam     TYPE vtnam,
            DBTAB_NAME TYPE TABNAME16,
          END OF ty_dbtab.
    To find out concatenated number for
    TYPES: BEGIN OF ty_split,
            f1 TYPE char6,
          END OF ty_split.
    TYPES: BEGIN OF ty_charval,
            char TYPE char30,
          END OF ty_charval.
    TYPES: BEGIN OF TY_DATA,
           name TYPE string,
           value(15) type c,
          END OF TY_DATA.
    DATA: I_DATATAB TYPE STANDARD TABLE OF TY_DATA. "#EC NEEDED
    TYPES:
      TUMLS_MESSTYPE type /SAPDMC/LS_MESSTYPE,
      TUMLS_MESSTYPETXT type EDI_TEXT60,
      TUMLS_MESSCODE type EDIPMESCOD.
    TYPES:
      TUMLS_TABNAME TYPE TABNAME,                               "#EC *
      TUMLS_SEGMENT TYPE TABNAME.                               "#EC *
    TYPES:
      TUMLS_PATHFILE TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILENAME TYPE /SAPDMC/LS_FILENAME,
      TUMLS_FILETEXT TYPE /SAPDMC/LS_FILETEXT.
    TYPES:
      BEGIN OF type_errorline,
         msgty type SYMSGTY,
         id type SYMSGID,
         msgno type symsgno,
         par1 type symsgv,
         par2 type symsgv,
         par3 type symsgv,
         par4 type symsgv,
      END OF type_errorline.
    TYPES:
      type_errortab TYPE SORTED TABLE
                    OF type_errorline
                    WITH NON-UNIQUE KEY id msgno par1 par2 par3 par4.
    DATA:
         LV_LINE2  TYPE REF TO DATA.
    GLOBAL INTERNAL TABLES
    DATA : i_newinput TYPE STANDARD TABLE OF ty_newinput INITIAL SIZE 0."#EC *
    DATA : i_contentheader1 TYPE STANDARD TABLE OF ty_contenthd INITIAL SIZE 0."#EC *
    DATA : i_contenttab1 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab2 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab3 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab4 TYPE STANDARD TABLE OF ty_content INITIAL SIZE 0."#EC *
    DATA : i_contenttab5 TYPE STANDARD TABLE OF ty_contenttab INITIAL SIZE 0."#EC *
    DATA : i_E1CUV1M TYPE STANDARD TABLE OF E1CUV1M INITIAL SIZE 0."#EC *
    DATA : i_errortab TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    GLOBAL WORK AREAS
    **Internal Table for the structure TY_T001L
    DATA : wa_vartab TYPE ty_vartab.                            "#EC *
    DATA : wa_vartabdate TYPE ty_vartabdate.                    "#EC *
    DATA : wa_vardetails TYPE ty_vardetails.                    "#EC *
    DATA : wa_tabinput TYPE ty_tabinput.                        "#EC *
    DATA : wa_dsninput TYPE ty_dsninput.                        "#EC *
    DATA : wa_newinput TYPE ty_newinput.                        "#EC *
    DATA : wa_gnewinput TYPE ty_newinput.                       "#EC *
    DATA : wa_ginput_data TYPE ty_newinput.                     "#EC *
    DATA : wa_final TYPE ty_final.                              "#EC *
    DATA : wa_content TYPE ty_content.                          "#EC *
    DATA : wa_contenthd TYPE ty_contenthd.                      "#EC *
    DATA : wa_contentheader type ty_contenthd.                  "#EC *
    DATA : wa_contenttab TYPE ty_content.                       "#EC *
    DATA : wa_content1 TYPE ty_content.                         "#EC *
    DATA : wa_contenthd1 TYPE ty_contenthd.                     "#EC *
    DATA : wa_contentheader1 type ty_contenthd.                 "#EC *
    DATA : wa_contenttab1 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab2 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab3 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab4 TYPE ty_content.                      "#EC *
    DATA : wa_contenttab5 TYPE ty_contentTAB.                   "#EC *
    DATA : wa_E1CUVTM TYPE E1CUVTM.                             "#EC *
    DATA : wa_E1CUV1M TYPE E1CUV1M.                             "#EC *
    DATA : wa_E1DATEM TYPE E1DATEM.                             "#EC *
    DATA : wa_error_tab TYPE solisti1.                          "#EC *
    INTERNAL TABLES AND WORK AREAS FOR BDC
    *Internal Table to store the data to display the error message
    DATA : i_errormsg TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    *Internal Table to store the data to display the error message
    DATA : i_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    DATA : itab_error TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0."#EC *
    **Work area to store the data to display the error message
    DATA : wa_errormsg TYPE solisti1.                           "#EC *
    **Internal table which will store data for the error log
    DATA:i_error_log TYPE STANDARD TABLE OF ty_error_log INITIAL SIZE 0."#EC *
    GLOBAL VARIABLES
    DATA:  G_FILE TYPE string.                                  "#EC *
    DATA : g_ctr_input_recs(5) type c.                          "#EC *
    DATA:  g_ctr_output_recs(5) type p.                         "#EC *
    data : g_msg(100) type c.                                   "#EC *
    data:  g_struct_file TYPE string.                           "#EC *
    data:  g_login type FILEINTERN.                             "#EC *
    data:  g_phyin type string.                                 "#EC *
    DATA:  g_lprnt type RSPOPSHORT.                             "#EC *
    DATA:  g_FNAME1 TYPE STRING.                                "#EC *
    DATA : g_repid TYPE repid,                                  "#EC *
           g_exit(1) TYPE C,                                    "#EC *
           gx_variant  type disvariant.                         "#EC *
    DATA : g_lines    TYPE i .                                  "#EC *
    data : g_save(1) type c.                                    "#EC *
    DATA : g_splid     TYPE rspoid .                            "#EC *
    data:  p_login type FILEINTERN.                             "#EC *
    data:  p_phyin type string.                                 "#EC *
    GLOBAL CONSTANTS
    CONSTANTS c_msgar   TYPE rslgarea   VALUE 'F8'.             "#EC *
    CONSTANTS c_msgid   TYPE rslgsubid  VALUE 'E'.              "#EC *
    CONSTANTS c_urgnc   TYPE char04     VALUE 'HIGH'.           "#EC *
    CONSTANTS C_X(1)       TYPE C          VALUE 'X'.           "#EC *
    CONSTANTS C_Y(1)       TYPE C          VALUE 'Y'.           "#EC *
    CONSTANTS C_Z(1)       TYPE C          VALUE 'Z'.           "#EC *
    CONSTANTS C_E(1)       TYPE C          VALUE 'E'.           "#EC *
    CONSTANTS C_SAP(3)     TYPE C          VALUE 'SAP'.         "#EC *
    CONSTANTS C_MOD(3)     TYPE C          VALUE 'MOD'.         "#EC *
    CONSTANTS C_MD1(3)     TYPE C          VALUE 'MD1'.         "#EC *
    CONSTANTS C_MD2(3)     TYPE C          VALUE 'MD2'.         "#EC *
    CONSTANTS C_MD3(3)     TYPE C          VALUE 'MD3'.         "#EC *
    CONSTANTS C_MD4(3)     TYPE C          VALUE 'MD4'.         "#EC *
    CONSTANTS C_MD5(3)     TYPE C          VALUE 'MD5'.         "#EC *
    constants:   c_000001(6)  type c value '000001',            "#EC *
                 c_e1cuv1m(7) type c value 'E1CUV1M',           "#EC *
                 c_02(2)  type c value '02',                    "#EC *
                 c_009(3)   type c value '009',                 "#EC *
                 c_0001(4) type c value '0001'.                 "#EC *
    constants:  c_e1datem(7) type c value 'E1DATEM'.            "#EC *
    constants:  c_e1cuvtm(7) type c value 'E1CUVTM'.            "#EC *
    GLOBAL INTERNAL TABLES FOR ALV DISPLAY
    *Internal tables for ALV Field cat
    DATA :
    i_fieldcat_ov  TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_dtl TYPE STANDARD TABLE OF slis_fieldcat_alv INITIAL SIZE 0,"#EC *
    i_fieldcat_ov1 TYPE lvc_t_fcat,                             "#EC *
    i_events       TYPE slis_t_event.                           "#EC *
    GLOBAL WORK AREAS FOR ALV DISPLAY
    *Work area for ALV Field layout
    DATA : wa_layout TYPE slis_layout_alv.                      "#EC *
    *Work area for Field Cat. Table
    DATA : wa_fieldcat TYPE slis_fieldcat_alv.                  "#EC *
    GLOBAL VARIABLES FOR ALV DISPLAY
    DATA : g_event  TYPE slis_t_event.                          "#EC *
    DATA : g_top_of_page TYPE slis_t_listheader.                "#EC *
    DATA : g_ok_code     TYPE char4.                            "#EC *
    DATA : g_variant     type disvariant.                       "#EC *
    GLOBAL CONSTANTS FOR ALV DISPLAY
    BAL handling
    data: iv_log_handle type BALLOGHNDL.                        "#EC *
    data: is_log_header type bal_s_log.                         "#EC *
    data: iv_object     type bal_s_log-object    value 'CAPI'.  "#EC *
    data: iv_subobject  type bal_s_log-subobject value 'CAPI_LOG'."#EC *
    data: iv_tcode      type bal_s_log-altcode   value 'SE38'.  "#EC *
    *MOD-005
    RANGES:
        R_MESTYP FOR EDIDC-MESTYP,                              "#EC *
        R_CREDAT FOR EDIDC-CREDAT,                                  "#EC *
        R_CRETIM FOR EDIDC-CRETIM,                              "#EC *
        R_SNDPRT FOR EDIDC-SNDPRT,                              "#EC *
        R_SNDPRN FOR EDIDC-SNDPRN.                              "#EC *
    DATA:
        L_MESSTYPE TYPE TUMLS_MESSTYPE.                         "#EC *
    *MOD-005
    data:        p_sndprn TYPE EDI_SNDPRN,                      "#EC *
                 p_sndprt TYPE EDI_SNDPRT,                      "#EC *
                 p_sndpor TYPE EDI_SNDPOR.                      "#EC *
    data:        p_rcvprn TYPE EDI_RCVPRN,                      "#EC *
                 p_rcvprt TYPE EDI_RCVPRT,                      "#EC *
                 p_rcvpor TYPE EDI_RCVPOR.                      "#EC *
    data:
      init_E1CUVTM type E1CUVTM,                                "#EC *
      prev_E1CUVTM type E1CUVTM,                                "#EC *
      init_E1DATEM type E1DATEM,                                "#EC *
      prev_E1DATEM type E1DATEM,                                "#EC *
      init_E1CUV1M type E1CUV1M,                                "#EC *
      prev_E1CUV1M type E1CUV1M.                                "#EC *
    Source structure definitions
    data:
      begin of LSMW_TAB_CONTENT,                                "#EC *
        VTNAM(018) type C,
        CHAR1(030) type C,
        CHAR2(030) type C,
        CHAR3(030) type C,
        CHAR4(030) type C,
        CHAR5(030) type C,
        CHAR6(030) type C,
        CHAR7(030) type C,
        CHAR8(030) type C,
        CHAR9(030) type C,
        CHAR10(030) type C,
        CHAR11(030) type C,
        CHAR12(030) type C,
        CHAR13(030) type C,
        CHAR14(030) type C,
        CHAR15(030) type C,
        FLAG(001) type C,
      end of LSMW_TAB_CONTENT.
    Counters
    data:
      g_cnt_VAR_TAB  type i,                                    "#EC *
      g_cnt_TAB_CONTENT  type i.                                "#EC *
    Counter ct_xxxxxxxxxx: number of transferred records
    data:
      ct_edi_dc40 type i,                                       "#EC *
      cs_edi_dc40 type i,                                       "#EC *
      ct_E1CUVTM  type i,                                       "#EC *
      cs_E1CUVTM  type i,                                       "#EC *
      ct_E1DATEM  type i,                                       "#EC *
      cs_E1DATEM  type i,                                       "#EC *
      ct_E1CUV1M  type i,                                       "#EC *
      cs_E1CUV1M  type i.                                       "#EC *
    Global data definitions and data declarations
    DATA: wa_cabn TYPE ty_cabn,
          wa_cawn TYPE ty_cawn,
          wa_file TYPE ty_file,
          wa_vtnam TYPE ty_vtnam,
          wa_cuvtab_fld TYPE ty_cuvtab_fld,
          wa_cuvtab_valn TYPE ty_cuvtab_valn,
          wa_cuvtab_valc TYPE ty_cuvtab_valc,
          wa_col_pos     TYPE ty_col_pos,
          wa_error       TYPE ty_error,
          wa_dupl        TYPE ty_dupl,
          wa_dupl_file   TYPE ty_dupl.
    DATA: wa_vnt_ma TYPE ty_vnt_ma,
          wa_split  TYPE ty_split.
    DATA: wa_charval TYPE ty_charval.                           "#EC *
    Internal table
    DATA: i_cabn        TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_temp   TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_cabn_atinn  TYPE STANDARD TABLE OF ty_cabn,         "#EC *
          i_file        TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_file_tmp    TYPE STANDARD TABLE OF ty_file,         "#EC *
          i_vtnam       TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab      TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_cuvtab_fld  TYPE STANDARD TABLE OF ty_cuvtab_fld,   "#EC *
          i_cuvtab_valn TYPE STANDARD TABLE OF ty_cuvtab_valn,  "#EC *
          i_cuvtab_valc TYPE STANDARD TABLE OF ty_cuvtab_valc,  "#EC *
          i_col_pos     TYPE STANDARD TABLE OF ty_col_pos,      "#EC *
          i_cawn        TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_n      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_c      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cawn_i      TYPE STANDARD TABLE OF ty_cawn,         "#EC *
          i_cuv_error   TYPE STANDARD TABLE OF ty_vtnam,        "#EC *
          i_dupl        TYPE STANDARD TABLE OF ty_dupl,         "#EC *
          i_dbtab       TYPE STANDARD TABLE OF ty_dbtab.        "#EC *
    DATA: i_vnt_ma TYPE STANDARD TABLE OF ty_vnt_ma,            "#EC *
          i_split  TYPE STANDARD TABLE OF ty_split.             "#EC *
    DATA: i_dupl_file TYPE STANDARD TABLE OF ty_dupl.           "#EC *
    DATA: i_charval TYPE STANDARD TABLE OF ty_charval.          "#EC *
    Constants
    CONSTANTS: c_char TYPE atfor VALUE 'CHAR',                  "#EC *
               c_date TYPE atfor VALUE 'DATE',                  "#EC *
               c_time TYPE atfor VALUE 'TIME',                  "#EC *
               c_varcond TYPE atnam VALUE 'Z_VARCOND'.          "#EC *
    Field Symbols
    FIELD-SYMBOLS: <fs_vtnam>      TYPE ty_vtnam,               "#EC *
                   <fs_cabn>       TYPE ty_cabn,                "#EC *
                   <fs_cuvtab_fld> TYPE ty_cuvtab_fld,          "#EC *
                   <fs_dupl>       TYPE ty_dupl.                "#EC *
    FIELD-SYMBOLS: <FS_DYN_WA> TYPE ANY.
    Variables
    DATA: g_raw(500)  TYPE c,                                   "#EC *
          g_invalid   TYPE char1,                               "#EC *
          g_error     TYPE char1,                               "#EC *
          g_message   TYPE char50,                              "#EC *
          g_slnid_c    TYPE slnid,                              "#EC *
          g_slnid_n    TYPE slnid,                              "#EC *
          g_row        TYPE char5.                              "#EC *
    DATA: g_varcond TYPE varcond, "Variant condition "#EC NEEDED
          g_split_var TYPE i,                                  "#EC *
          g_split_var1 type i.                                 "#EC *
    Types: begin of ty_charname,
             name type atnam,
           end of ty_charname.
    data: wa_charname type ty_charname,                         "#EC *
          i_charname type standard table of ty_charname.        "#EC *
    data: cnt_i type i,                                         "#EC *
          g_tabix type char10.                                  "#EC *
    Types: begin of ty_itab_zedidc40.
            include structure edi_dc40.
    TYPES:       end of ty_itab_zedidc40.
    Types: begin of ty_itab_zedidd40.
            include structure edi_dd40.
    TYPES: end of ty_itab_zedidd40.
    DATA: itab_zedidc40 type standard table of
                      ty_itab_zedidc40 initial size 0.          "#EC *
    DATA: itab_zedidd40 type standard table of
                      ty_itab_zedidd40 initial size 0.          "#EC *
    DATA: wa_itab_zedidc40 type ty_itab_zedidc40.               "#EC NEEDED
    DATA: wa_itab_zedidd40 type ty_itab_zedidd40.
    *MOD-009
    data: itab_ze1cuvtm type e1cuvtm,                           "#EC *
          itab_ze1datem type e1datem,                           "#EC *
          itab_ze1cuv1m type e1cuv1m.                           "#EC *
    data: wdocnum(16) type n value 0.                           "#EC *
    data: wsegnum(6)  type n value 0.                           "#EC *
    data: witemno(10) type n value 0.                           "#EC *
    data: witemno_new(10)  type n value 0.                      "#EC *
    data: witemno_gst(10)  type n value 0.                      "#EC *
    data: witemno_qst(10)  type n value 0.                      "#EC *
    TYPES: BEGIN OF ty_input_data1,                             "#EC *
              line(560) type c,
              flag(1) type c,
           END OF ty_input_data1.
    DATA: i_input_data type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: i_input_data1 type standard table of
                      ty_input_data1 initial size 0. "with header line.
    DATA: wa_input_data type ty_input_data1.                    "#EC *
    DATA: g_cnt_input_recs type i.                              "#EC *
    DATA: g_flg_error type c.                                   "#EC *
    DATA: l_lines type i.                                       "#EC *
    DATA: l_lines1 type i.                                      "#EC *
    DATA: l_tabix type i.                                       "#EC *
    DATA: wa_input_data1 type ty_input_data1.                   "#EC *
    DATA: FILE TYPE STRING.
    Fields that are made available to the user:
    DATA:
      g_cnt_records_read TYPE i,                                "#EC *
      g_cnt_records_transferred TYPE i,                         "#EC *
      g_cnt_transactions_read TYPE i,                           "#EC *
      g_cnt_transactions_transferred TYPE i,                    "#EC *
      g_cnt_idocs_package TYPE i.                               "#EC *
    data: v_log_handle type balloghndl.                         "#EC *
    DATA: gt_curr_edi_dc40 TYPE STANDARD TABLE OF edi_dc40 initial size 0."#EC *
    DATA: gt_curr_edi_dd40 TYPE STANDARD TABLE OF edi_dd40 initial size 0."#EC *
    DATA: wa_curr_edi_dc40 TYPE edi_dc40.                       "#EC *
    DATA: wa_curr_edi_dd40 TYPE edi_dd40.                       "#EC *
    internal table for error messages during conversion
    DATA: g_error_tab TYPE type_errortab,                       "#EC *
          wa_errortab TYPE type_errorline.                      "#EC *
    DATA:  g_edidd_segnam type EDI4SEGNAM,                      "#EC *
           g_edidd_hlevel type EDI4HLEVEC.                      "#EC *
    DATA: g_segnum(6) TYPE n.
    DATA: g_objecttype(2) type C.
    DATA: P_FNAME(128) TYPE C VALUE '/usr/sap/trans/vartabheader'. " MODIF ID MD1 OBLIGATORY.
    DATA: P_FNAME1(128) TYPE C VALUE '/usr/sap/trans/vartabcontent'. " MODIF ID MD1 OBLIGATORY.
    field-symbols: <dyn_table> type standard table,
                   <dyn_table1> type standard table,
                   <dyn_wa>,
                   <dyn_wa1> TYPE ANY.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    data: l_tabname TYPE tabname.
    DATA: l_len_slnid TYPE i,                                 "#EC NEEDED
            l_len_varcond TYPE i,                               "#EC NEEDED
            l_temp_slnid TYPE i,                                "#EC NEEDED
            l_temp_slnc TYPE char5,                             "#EC NEEDED
            l_temp_varcond TYPE varcond,                        "#EC NEEDED
            l_sub_var      TYPE i,                              "#EC NEEDED
            l_val_split TYPE char10.                            "#EC NEEDED
    DATA: l_invalid.                                          "#EC NEEDED
    *Include for Global Data Declaration
    *INCLUDE ZGTDMI_VARTAB_TOPDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_TOP02.
    *Include for Selection Screen
    *INCLUDE ZGTDMI_VARTAB_SELDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_SEL02.
    *Include for Sub Routines
    *INCLUDE ZGTDMI_VARTAB_FORMSDYN.
    *INCLUDE /FACTGLB/GTDMI_VARTAB_FORMS02.
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL02                      *
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL
    *&  Include           /FACTGLB/GTDMI_VARTAB_SEL
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-08-25
             RDD NUMBER: DCDD027
    TRANSPORT NUMBER(S): RD2K902769
    *-- REVISION HISTORY -
              DEVELOPER:
           DATE APPLIED: YYYY-MM-DD
             SCR NUMBER: <Scope Change Request ID>
             RDD NUMBER: <Toolset Object ID>
    TRANSPORT NUMBER(S):
            DESCRIPTION:
    DECLARATION FOR SELECTION SCREEN
    *selection-screen skip 1.
    *For all the input field entries
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    *Parameter for Input File Name:
    PARAMETERS:   p_inpt   TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File Variant table
    PARAMETERS:   p_inpt1  TYPE RLGRAP-FILENAME MODIF ID MOD . " Presentation server File variant Content
    SELECTION-SCREEN END OF BLOCK bl1.
    IDoc creation
    selection-screen begin of block idocpars
                     with frame title text-006.
    parameters:
       p_trfcpt as checkbox default C_X MODIF ID MD3,
       p_packge(5) type n default 1 MODIF ID MD3.
    selection-screen end of block idocpars.
    SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-032.
    Radio Buttons :
    parameters:
      rb_apsrv RADIOBUTTON GROUP RB1 DEFAULT 'X' USER-COMMAND UCOM,
      rb_convt RADIOBUTTON GROUP RB1,
      rb_idoc RADIOBUTTON GROUP RB1.
    rb_proc RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF BLOCK bl3.
    INITIALIZATION
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC        = C_X
        CHANGING
          FILE_NAME     = P_INPT
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC <> 0.
        MESSAGE e241.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INPT1.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC        = C_X
        CHANGING
          FILE_NAME     = P_INPT1
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
     

  • Dynamic creation strategy ?

    Hello, my users will create numerous textArea components.
    As each of these is created I will add them to an array.
    Each of these array elements needs to have an eventListener which call a global startDrag function.
    What is the best strategy to dynamically create/name these textArea components as the users start requesting their creation ?
    ie. they will not all be created at once, so I cant use a loop to generate them.
    thanks kindly for any advice

    Hi,
       If you want to create all TextArea comps at once you can do something like this.Or you can create each new textArea when you want to show it to the user.
                var prefix:String='myPrefix'
                var temp:TextArea;
                var totaltextareaComps:int=10
                for(var i:int=0;i<totaltextareaComps;i++){
                    temp=new TextArea()
                    this.addChild(temp)
                    //set further properties of textArea component here according to your needs
                    myArray.push(temp)
                    //replace this with  name of your parent container.
                    temp.name=prefix+this.getChildIndex(temp)

  • Anyway to have JDeveloper dynamically load BC4J components in memory?

    We are dealing with a large BC4J based application that contains large amount of application modules. So far, 300 application modules and total 4000 BC4J objects have been created. The size of the application still keeps growing daily... may up to twenty times than what we are having right now.
    While the application size growing, some unusual problem comes out. The biggest problem is that it makes JDeveloper very sluggish. It takes 15 minutes to just open JDeveloper and may need a few minutes to open the application module editor. (FYI: in our team, most developers have 1G memory and 1.8G CPU or up.) This is probably still OK for right now, but it will become a big problem later when the project size grows.
    When we analysis the project structure, we know that most of time, developer does not need to load all the application modules. For example, we have a core package that contains about 30 application modules. This core package needs to be shared and should be loaded. But, the other nine packages contain about 30 application modules each do not need to be loaded into memory at the same time in most cases. Since BC4J is XML based, we could not find a way to just partially load those application modules, especially when there’s cross references between them.
    When we check the project.jpr file, looks like all BC4J objects are referenced there. We have 40K lines in our project.jpr file now. When open JDeveloper, we believe JDeveloper will try to load all referenced BC4J XML content into memory. This consumes 500M memory and makes the overall performance very sluggish. The situation may become even worse when the project size keeps growing. For example, we cannot have 5000M (5G) memory in a development machine for 3000 application modules.
    We do know that by checking out the "ScanSource Paths to Determins Project Contents" in the Input Paths of Project Settings, we can short the JDeveloper’s open time, but this will not give BC4J relationship information and some other useful information… Not a practical solution.
    So, any idea to make JDeveloper dynamically loaded BC4J based on need?
    We’ve tried a few ways. One is to partition the application into different project and import the core one into the other projects. Only open the project in workspace when need. But this is not officially documented by Oracle and we are not sure whether it is possible/correct or not. Another thought is to remove the NOT-CURRENTLY-USED package from the project. But JDeveloper only support file level remove.
    Any help on this dilemma will be highly appreciated.
    Thanks,
    Charles

    The package is the unit of loading in the IDE for ADF business components.
    To edit components, they must belong to the project.
    To refer to components in a read-only way, they can be imported. This allows other editable or read-only components to refer to them without allowing the imported components to be edited.
    Both editable and imported components need to be loaded in memory to use them, so you can save memory at design time by creating projects that leave out as many packages as possible.
    Is there a way we can get your existing project in house to study its design time performance?

Maybe you are looking for

  • Bad customer service and warranty question.

    I called a couple days ago to see if could get my lcd bezel fixed, since it just started to crack and the bottom (basically the back of the lid when it's close)  for no reason at all. if i dropped it or did something to break it, i wouldn;t even both

  • Authentication against users in a table

    I am somewhat familiar with JAZN authentication but here is what I need to do and would GREATLY appreciate as much details as you can provide: Say, I have a table USERS(USER_ID, NAME, ...) and several other tables in the DB. Let's say I have another

  • Blink feed no longer working...

    Blink feed just quit working.  Just says no content.  When I go into settings Facebook is no longer offered.  I tried just setting to gallery, that doesn't come up either.  I've tried resetting everything I can think of and I can't seem to make anyth

  • Query regarding screen exits

    Hi ppl, I am looking for a screen exit for tcode MSC3n. Using SMOD, I found the following enhancements: BATCHCHK MBCFC010 SAPLCHVW SAPLMHD1 SAPLV01D SAPLV01P SAPLV01Z SAPLV1ZE SAPLV1ZN But, all these have function exits. There was no screen exit spec

  • ImmutableArrayList default for Map Long, Collection String

    Hi, There are a few topics out there about the com.tangosol.util.ImmutableArrayList default, but the actual fix still seems a bit unclear to me. In my example there is a Map with each entry containing a Collection of Strings (i.e. Map<Long, Collectio