Dynamic Structure in Interface and Forms

Hallo experts,
I am creating XML from the printreport. In print Report I am creating with RTTI a Structure and a Tabletype at runtime. Is it possible to give this type in Adobe Interface as type at runtime.
The problem is that the XML looks like this.
<PARVW>AG</PARVW>
  <KUNNR>0001000047</KUNNR>
The costomer wants to show like this
<PARVW_AG>AG</PARVW_AG>
  <KUNNR_AG>0001000047</KUNNR_AG>
I have created a sturcture at runtime but I am not able to move it to form and interface.
Can somebody help me in this issue.
Thanks.
Kind regards
Waseem rana

Hallo experts,
I am creating XML from the printreport. In print Report I am creating with RTTI a Structure and a Tabletype at runtime. Is it possible to give this type in Adobe Interface as type at runtime.
The problem is that the XML looks like this.
<PARVW>AG</PARVW>
  <KUNNR>0001000047</KUNNR>
The costomer wants to show like this
<PARVW_AG>AG</PARVW_AG>
  <KUNNR_AG>0001000047</KUNNR_AG>
I have created a sturcture at runtime but I am not able to move it to form and interface.
Can somebody help me in this issue.
Thanks.
Kind regards
Waseem rana

Similar Messages

  • Question on Dynamic Query Data Source and Form Folders in Oracle Forms 6i

    Hi there -
    I have one interesting requirement in Oracle Forms.
    This is what I wanted to do.
    1. Have a LOV and Go button on Form.
    2. From LOV, I will select a pre-defined custom table and click Go.
    3. Based on the selected custom table, I have to populate the Block (Tabular Format).
    4. User should be able to do update, delete, insert on this block.
    5. User should be able to use the Oracle Form folders functionality (select only necessary column and save views etc. Std folder functionality).
    6. If user selects a different custom table name in the LOV on top, I need to refresh the data from the block based on this new table. Remaining functionality should be as it is (steps 3 to 5).
    You can see here, I am going to have dynamic query data source (Table Name as well as column mapping) on the block. I do not know before hand how many columns the user selected table has!
    This is what I have planned for this so far but I have some major questions before I can move on with this design:
    1. I am going to create a table structure with fixed number of column in form (40 cols assuming that the custom table will not have more that 40 cols). (Kind of limitation but it's okay as of now).
    2. Dynamically populate the block based on the table name selected by the user from LOV. Dynamically change the table column names based on the table selected etc.
    3. Perform insert, update, delete using PL/SQL package.
    So far it looks okay.
    Now my real question is,
    Can user still be able to user "Folders" functionality here? I have never done this kind of development before and I doubt the dynamic column naming, dynamic column data source will really work for "folders"!
    Also, I am not really sure whether user will be able to save these "folder" queries?
    Okay so form experts, can you ppl suggest me if this is really going to work? Are there any better ways to do this?
    Initially I tried to do this in OA Framework but I got stuck at because as per OAF developer guide "I cannot user OAF personalization for dynamic items, regions etc".
    For more info on that thread see this link...
    Re: setUserCustomizable issue!
    Thanks in advance for the help.

    Any suggestion anyone?

  • Any one used the interface /RPM/IF_PFS_ITEM and form /RPM/FORM_PFS_ITEM

    Hi Friends,
    Any one used the above interface and form
    Regards,
    sasidhar

    Hi Karen,
    It seems to me that because the decision point happens before the tabular form is rendered (via the tree right?) you don't really need a "On Change" DA.
    I think you either need find the hms field c030, which could be hidden or visible, as depending on that value go hide or show the hms_info field.
    You'll want to do this either on Page Load or After Refresh or both, it depends on how the tabular form gets refreshed.
    Your DA On Load would be
    Event: Page Load
    Action: Javscript Code
    The code:
    $(".hms").each(function(index) {
      if ($v(this) == 'N') {
      var rowTR = $x_UpTill(this, 'TR');
      $(rowTR).find(".hms_info").hide();
    This code will find ALL your hms fields. if the field has a N then we go up to the TR, find the hms_info and hide it.
    If your page refreshes on every row and the Y/N values don't change after the page loads then you're done!
    What do you think?
    Thanks
    -Jorge
    PS.  This is odd... I thought I was replying to the previous thread.  Weird.
    Message was edited by: jrimblas

  • Create Adobe Form using Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    I need the step to step guide where you create the adobe form using the Design Time for Processes and Forms. Anyone have any idea?
    Edited by: Siong Chao on Jan 3, 2011 4:54 AM
    Edited by: Siong Chao on Jan 3, 2011 5:00 AM

    Hi,
    I couldn't get to your query..
    What do you mean by step by step procedure for a design time & process for forms.
    if you are a beginner and looking for basic examples to implement adobe forms there are lot of them in SDN, please search them.
    let me know if your query was a very specific one.
    Cheers,
    Sai

  • Entering custom backend service in Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    However I cannot seem to insert my custom backend service in the Design Time for Processes and Forms workbench (t-code:hrasr_dt).
    Currently, I am just using SAP_PA for my backend service which is unable to load the ename into my form. The code in my custom class will not be triggered if I did not use my custom back end service in the Design Time for Processes and Forms.
    Whenever I tried using my custom back end service, I will encounter the assertion_failed dump.
    Anyone have any idea?
    Edited by: Siong Chao on Dec 22, 2010 6:35 AM

    Hi Siong Chao,
    The filter name you have used in the BADI for your generic service requires to be defined in the Create / Edit Generic Service - Definition.( You can see this on selecting the Back-end services node under Form Scenario definition while using HRASR_DT transaction code)
    Once you do that, you can import the fields defined in the Generic service BADI - using the same procedure used in standard SAP backend sevices.
    Hope this clarifies. Please let me know if you have any further questions.
    Best Regards
    G Raj

  • 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.
     

  • Issue in Dynamic Structure and Component Program

    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 would need some expertise in coding the OO part of the program.
    Any inputs will be apprciated:
    <removed 6845 lines of code (forum software cut off at this point, there was more!) - did you actually expect anyone to read that? Also, please use code tags (the "<>" icon on the toolbar)>
    Edited by: Mike Pokraka on Aug 3, 2008 6:15 PM

    Hi,
    The program works fine fo creating inbound idocs. It is the dynamic structure population that seems to be the problem mentioned earlier: Here is the code:
    *& Report  /FACTGLB/GTDMI_VARTAB_IDOCS02                               *
    PROGRAM DESCRIPTION: Variant Table and Content Upload Interface.
              DEVELOPER: Aveek Ghose
          CREATION DATE: 2008-04-18
             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-04-18
             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.
    TYPES: end of TY_CONTENT.
    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
             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
             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.
    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_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_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_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 *
    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_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,
          itab_data TYPE standard table of TY_CONTENT.
    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.
    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 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.
      IF SY-SUBRC <> 0.
        MESSAGE e241.
      ENDIF.
    At Selection Screen Output
    AT SELECTION-SCREEN OUTPUT.
    IF rb_apsrv = 'X'.
       LOOP AT SCREEN.
         IF SCREEN-GROUP1 = c_mod.
           SCREEN-INPUT = 0.
         ENDIF.
         IF SCREEN-GROUP1 = c_md2.
           SCREEN-INPUT = 0.
         ENDIF.
         IF SCREEN-GROUP1 = c_md3.
           SCREEN-INPUT = 0.
         ENDIF.
         MODIFY SCREEN.
       ENDLOOP.
    endif.
    IF rb_apsrv = 'X'.
      LOOP AT SCREEN.
        IF SCREEN-GROUP1 = c_md1.
          SCREEN-INPUT = 0.
        ENDIF.
        IF SCREEN-GROUP1 = c_md2.
          SCREEN-INPUT = 0.
        ENDIF.
        IF SCREEN-GROUP1 = c_md3.
          SCREEN-INPUT = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    endif.
    START-OF-SELECTION
    START-OF-SELECTION.
    *Subroutines for start of selection event
      PERFORM sub_start_selection.
      IF rb_apsrv = 'X'.
        PERFORM sub_upload_data_app.
        MESSAGE i256.
        LEAVE LIST-PROCESSING.
        EXIT.
      ELSE.
        PERFORM sub_upload_data.
      ENDIF.
    PERFORM sub_upload_data.
    Get characteristic details
      PERFORM sub_get_cabn.
    Get value for characteristics
      PERFORM sub_get_cawn.
      perform sub_convert_transaction.
    END-OF-SELECTION.
    END OF SELECTION
    *MOD-012
    Final message
      perform sub_final_message_idoc.
    Display errorneous variant tables.
      perform sub_display_variant.
    Display lines with incorrect data
      perform sub_display_errorlines.
    *Subroutines for end of selection event
      PERFORM sub_end_selection.
      perform sub_clear_source_tables.
    *MOD-012
    *&  Include           /FACTGLB/GTDMI_VARTAB_FORMS02                    *
    *&  Include           /FACTGLB/GTDMI_VARTAB_FORMS02                    *

  • Deff. b/w form interface and globel definition

    what is the defference bt form interface and globel definition

    Hi,
    Form Interface is where you get your internal tables, variables and all necessary information from the driver program. You specify the required data here.
    Pls note that if you need to pass internal tables from the driver program to the SF then you need to create a structure with the similar fields in your internal table and give a reference to the same here in Form interface.
    The import and export are nothing but same like a Function module, for variable to be passed from the driver program add them in the import tab. Export you can just let it remain as it is.
    In the tables tab add the tables what you require from the driver program.
    Global definitions are nothing but where you declare variables, work areas required to be used further in you program.
    To do coding in SF, you need to add program lines. This you can do by creating any window and then on the left hand tree of the main window, right click and then you can find the options to create various things like table, window, program lines, command et.al.
    Hope this helps you to build a brief idea about Smartforms.
    There will be various links in sap help, blogs and also in this forum where you can find loadsa information!!
    chk out the following links as well:
    here is a link which will teach you step by step
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    More links
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    Step by Step creation of Smartforms
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    FAQs
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    also see
    http://www.****************/InterviewQ/interviewQ.htm
    http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
    http://www.techinterviews.com/?p=198
    http://www.techinterviews.com/?p=326
    http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.geekinterview.com/Interview-Questions/SAP-R-3/ABAP
    http://sap.ittoolbox.com/documents/popular-q-and-a/abap-sample-interview-questions-3240
    http://www.sap-img.com/abap/abap-interview-question.htm
    http://www.allinterview.com/Interview-Questions/ABAP.html
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    Regards,
    Satish

  • How to pass values in dynamic structure and then dynamic table

    Hi,
    we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
    I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic  table type is any its not allowing an index operation like modify etc etc.
    Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure  and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.

    Hi Friends,
    This is the piece of code.After creating dynamic work area and dynamic table what i should do?
    TYPES: BEGIN OF STR,
    ID TYPE I,
    NAME(30) TYPE C,
    END OF STR.
    data: v_lines type i.
    STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
    STR_COMP = STR_TYPE->GET_COMPONENTS( ).
    APPEND LINES OF STR_COMP TO COMP_TAB.
    COMP-NAME = 'NAME1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING(  ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
    P_LINE_TYPE = NEW_STR
    P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
    P_UNIQUE = ABAP_FALSE ).
    CREATE DATA DREF TYPE HANDLE NEW_TAB.
    CREATE DATA DREF1 TYPE HANDLE NEW_str.

  • Dynamic navigation, on HCM Process and Forms "Web Dynpro FORM"

    Hi,
    I'm trying to solve an issue regarding dynamic navigation, on a enhacement done at the Web Dynpro ABAP QISR_UI component for HCM Process and Forms.
    I'm hiding the Adobe Form, and doing "do_dynamic_navigation" for a dynamic generated view container present at the VIEWSHOWFORM on the QISR_UI component.
    The code works great, i.e.: the Adobe Form remains hidden and the custom form, using Web Dynpro appears.
    I'm also using the HRASR00_PROCESS_EXECUTE_1 component to execute a Portal IView (Floorplan based component).
    When the process is started, and the folowing actions are executed:
    1- Select Employee
    2- Select Process
    3- Edit form
    4- Press back (for example if the wrong process is selected)
    5- Select the Process
    6- Edit form again
    There is a NULL exception, the "embedding_vca" (below) is NULL
    SAPLWDR_RUNTIME_REPOSITORY
    METHOD: IF_WD_RR_VIEW_USAGE~GET_EMB_VIEW_CNT_ASSIGNMENT (LCL_VIEW_USA
    * method IF_WD_RR_VIEW_USAGE~GET_EMB_VIEW_CNT_ASSIGNMENT
      method if_wd_rr_view_usage~get_emb_view_cnt_assignment.
        result = me->view_usage->embedding_vca->get_api( ).
      endmethod.
    "IF_WD_RR_VIEW_USAGE~GET_VIEW_CONTAINER_ASSIGNMENT
    Can you guys give me an hand?
    Regards

    Hello,
    Basically what I did was replacing the Adobe Form, by a Web Dynpro component that contains its own form, and associated logic.
    Tecnically the steps to acomplish the task were:
    1º Development of a component for showing a form. ( I suggest you to start with just a "hello world" or something very basic )
    2º Enhance the QISR_UI component (VIEWSHOWFORM view, on the modify view method), something like
    if form scenario = XXXXX then
    hide the adobe form;
    create a custom view container (the problem I had above), and create an instance of the component created on step 1
    end if
    3º Access the context that the original form returns (you can check the context debugging the VIEWSHORFORM view )
    4º Pass the context to the component created..
    I can't provide further details on this, I'm sorry...
    I do not suggest doing this, this was a requirement so I had to do it... But this requires a lot of workarrounds, and lots of small changes in standard code related with process and forms... It's not, also, a "clean" solution
    Regards,
    Joã

  • HCM Process and Forms Dynamic Actions

    Hi
    We are implementing HCM process and forms and presume that dynamic actions will have to be recreated as rules.
    Can anyone give any guidance in this area as some of our dynamic actions are quite complex.
    Many thanks
    Ian

    Hi,
    For HR forms please follow the following link
    HCM Processes and Forms (www.service.sap.com/erp:  - SAP ERP Human Capital Management -> Workforce Process Management -> HCM Processes and Forms -> Media Library)
    https://websmp205.sap-ag.de/~form/sapnet?_SHORTKEY=00200797470000081848&
    A dynamic action has the following components.
    Infotype Number (INFTY): specifies the infotype for which you want the dynamic action triggered
    Subtype (SUBTY): narrows the focus to a specific subtype
    Field Name (FIELDN): starts your action when a maintenance function is performed on a particular field
    Function (FC): specifies the various maintenance operations to which your dynamic action would respond. They are 02 (change); 04 (create); 06 (create and change); 08 (delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only applicable in maintenance operations, not in display functions.
    Sequence Number (NO): refers to a sequential number.
    Step (A): specifies a particular type of action. No dynamic action is executed if the function character has a value other than one of the following:
                 P: Plausibility checks, which allow you to check certain conditions.          
                 I: Calls an infotype for processing
                 W: Called after the I statement and used to assign values to screen fields while creating or copying another infotype record through the I statement 
                  F: Calls a FORM routine (subroutines in ABAP) during your action. The routine may reside in or out the module pool MPNNNN00.
                 V: Lets you treat collectively a number of fields for which you want to define a common dynamic action
                  M: Sends SAP Office mail
    Variable function part: The variable function part along with the step indicator forms the core part of your action. It specifies the processing details when the dynamic action is triggered. For example: 
    Requirement: When the postal code or the city of an employeeu2019s permanent residence is changed in infotype 0006, an email should be sent to the administrator.
    INFTY    SUBTY    FIELDN    FC          NO.    STEP       VARIABLE FUNCTION
    0006           1             ORT01      06             001           V               PSTLZ            
    0006           1             PSTLZ      06             002           M               M0001
    The V statement on line 001 is used to link the two fields to the M statement. The statements relevant to field PSTLZ are also applicable to the ORT01 field.
    When a record is created or changed in infotype 0006 of permanent address, an email is sent using the feature M0001. Information such as the recipient address, subject, and content of the mail is derived from M0001.
    Warm REgards,
    Kapil

  • Dynamic Parallel Approval for HCM Process and Forms

    Hi everyone,
    I have a scenario where I need to use the "Dynamic Parallel Approval" (or to keep it simple, initially I tried using the "Parallel Approval" wizard)for a workflow used in the HCM Process and Forms.
    The standard task for approval in process and forms is TS17900101. I have mentioned a multiline container in the Miscellaneous tab of this task. However,I was unable to use this task in the wizard. There are no results attahced to this task unlike any other standard approval task (like TS30200147). I need to use the task TS17900101 in the workflow assigned to process and forms, but not sure how to handle this scenario (parallel approval).
    If this is not the right way of doing it, Is there any workaround for "Parallel Approval" in HCM Process and Forms.
    Could anybody throw some light around this area.
    Thanks for your help.
    - MM

    Thanks Anuj. But I believe, the container element that I add in the miscellaneous tab does not necessarily have to be used in the agent assignment. The multiline container is just to instantiate the workitem 'n' number of times. Correct me if I am wrong.
    My concern is that I was unable to use this approval task (TS17900101) in the workflow wizard for dynamic paralle/parallel approval.
    Arghadip - Thanks for your suggestion. I have seen some your nice contributions in the WF forum.
    I actually tried using the 'Blocks'. But this is what I ran into. When I send multiple approval requests (say 3), if one person has approved it and the second has rejected it,I need to take out the workitem from the third person's list (because it has been rejected by someone in the group). I am not sure if this is possible using Blocks. And in my case the third person is still having the workitem, but gets a dump/error when he tries to open it.
    Also, if any one has rejected the request, I do not have to wait for the rest to take any action on the workitem and proceed further. But I guess in 'Blocks' it will not let you go out unless every workitem has been processed.
    To summarize,here's what I need - I need to come out of the block for two conditions. One, if everyone has approved, comeout of the block with an apprval flag. Two, if anyone has rejected (even if some have not processed their workitem), delete the workitems from others inbox and come out of the block with a rejection flag.
    So, any kind of input or suggestions on how this could be handled would be highly appreciated.
    Thanks
    MM

  • What does mean You can include static and dynamic tables into a Smart Form?

    Hi guys,
    If you check the official documentation for Smart forms in the Internet you will read that the initial pharagraphs of the text tell you "Tables - You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed". The link is the following: http://help.sap.com/saphelp_nw04/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    I was wondering if this means that I can use field symbols with dynamical number of columns to print a smart form. Because it would be great since the customer wanted a dynamical report depending on the week day it was (If Monday, there was only 12 columns, but if Friday, it will be 52 columns (1 column more for every day elapsed in the current week)). I had to create 5 different forms, but I think using field symbols I had spent less effort. Do you know if it is really possible? If not, then what does mean "You can include static and dynamic tables into a Smart Form"?
    Thank you in advance

    Hi ,
    The concept of static and dynamic tables in smartforms, means you can use template- ( static table as no of rows and columns is fixed). Also you can use table- dynamic as the no of rows will depend on your line items.
    Hope this will help you to close this thread.
    Also, try to find this answer in posted forums. Creating a new forum everytime just increases the network traffic. So please try to avoid it.
    Regards,
    Vinit

  • Need documents for interfaces and extensions and forms...

    hai friends,,
    i need to assist my functional team..for creation of functonal design for reports , interfaces and extensions and forms...
    can aby body send me the documents  or post here??
    Thanks in advance...
    regards
    anand

    Hello,
    try these:
    Universe Design on RDBMS:
    http://help.sap.com/businessobject/product_guides/boexir31/en/xi31_designer_en.pdf
    Universe Design on OLAP:
    http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_sap_olap_universes_en.pdf
    WebI:
    http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_web_intelligence_java_report_panel_en.pdf
    http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_web_intelligence_formulas_functions_calculations_en.pdf
    Regards
    -Seb.

  • 2125 WLC Dynamic interfaces and their physical interface

    I'm trying to broadcast multiple SSIDs per AP. I would like the new second SSID to be on a different VLAN. I have been reading this article http://www.cisco.com/en/US/tech/tk722/tk809/technologies_configuration_example09186a00805e7a24.shtml#dyn-interface and it looks like you create a trunk port on the switch that the WLC is connected to, which makes sense to me. A friend however told me to use a seperate physical interface on the WLC and assign the dynamic interface to it and connect it to the desired VLAN, instead of using the interface that is currently in production. I liked this idea because I would have downtime trying to reconfigure the port as a trunk that's in production.
    So I guess my question is, if I use a secondary port on the WLC to connect to a different network than what the AP is on how will communication work? When the AP sends data to the WLC will everything be encapsulated in CAPWAP? How about the primary link connecting the WLC to the primary production network? Will this data to and from the WLC on the switch retain it's CAPWP encapsulation? Now that I'm thinking about it I guess it would have to since the WLC is what decapsulates the CAPWAP data and not the switch...
    I would just like some advice on if I'm doing this correctly. Thanks a lot!  -Mark

    We generally recomment one trunk port to be configured for different VLAN (for management and AP inetreface) but we can use other ethernet port also on WLC for any differnt VLAN config.
    For all your port related queries please find the attach link with the diagramme.:-
    http://www.cisco.com/en/US/docs/wireless/controller/7.0/configuration/guide/c70mint.html
    Q. How does a WLC switch packets?
        A. All the client (802.11) packets are encapsulated in a LWAPP packet by the LAP and sent to the WLC. WLC descapsulates the LWAPP packet and acts based on the destination IP address in the 802.11 packet. If the destination is one of the wireless clients associated to the WLC, it encapsulates the packet again with the LWAPP and sends it to the LAP of the client, where it is decapsulated and sent to the wireless client. If the destination is on the wired side of the network, it removes the 802.11 header, adds the Ethernet header, and forwards the packet to the connected switch, from where it is sent to the wired client. When a packet comes from the wired side, WLC removes the Ethernet header, adds the 802.11 header, encapsulates it with LWAPP, and sends it to the LAP, where it is decapsulated, and the 802.11 packet is delivered to the wireless client. For more information about this, refer to the LWAPP Fundamentals section of the document Deploying Cisco 440X Series Wireless LAN Controllers.
    Q. What are the various options available to access the WLC?
        A. This is the list of options available to access the WLC:
            GUI access with HTTP or HTTPS
            CLI access with Telnet, SSH, or console access
            Access through service port
        For more information on how to enable these modes, refer to the Using the Web-Browser and CLI Interfaces section of the document Cisco Wireless LAN Controller Configuration Guide, Release 5.1. Usually, the management interface IP address is used for GUI and CLI access. Wireless clients can access the WLC only when the optionEnable Controller Management to be accessible from Wireless Clients is checked. In order to enable this option, click the Management menu of the WLC, and click Mgmt via Wireless on the left-hand side. WLC can also be accessed with one of its dynamic interface IP addresses. Use the config network mgmt-via-dynamic-interface command to enable this feature. Wired computers can have only CLI access with the dynamic interface of the WLC. Wireless clients have both CLI and GUI access with the dynamic interface.

Maybe you are looking for

  • Organizing pages using sub-folders?

    Hi, I suspect that this might be a common question, but was unable to find it in previous posts. Anyway, what I'd like to do is to arrange the pages within in my site by creating folders. At the moment, I have a rapidly growing number of pages in my

  • Best Debugging Enviroment for WL 4.5.1

    We are comparing Cafe 3.1 Enterprise and JBuilder 3 Enterprise. Which makes the better debugger (and development environment for that matter)? I had assumed that Cafe would since BEA owns it now, but version 4 isn't due until the summer and I wasn't

  • How can I transfer my videos to ATV?

    I have been streaming videos and playing synced videos fine on my ATV but I was wondering how I can put videos on my ATV and be able to delete them off my HD on my iMac. Last time I tried and deleted it off my iMac it just resynced and put it back on

  • Question? How to make one swf initialize another swf?

    On my website i would like to have my main swf which has a button that links to a contact form. This main swf is in its own div and i want to have another div with a contact form swf file that i created. So i want the first swf's contact button to lo

  • A4 BAD Protocol Error: "Specified set of flags is not valid"

    Hi there I try to implement a copying procedure for mails. The application should copy all messages (with flags and all that stuff) from one mail account to another one. As mail server are used an Exchange 2003 Server and a Zimbra server (version 5).