BDC table structure

hi
Write the BDC table structure

Hi,
goto se11 give bdcdata in table radio button and see
PROGRAM     BDC_PROG     CHAR     40     0     BDC module pool
DYNPRO     BDC_DYNR     NUMC     4     0     BDC Screen number
DYNBEGIN     BDC_START     CHAR     1     0     BDC screen start
FNAM     FNAM_____4     CHAR     132     0     Field name
FVAL     BDC_FVAL     CHAR     132     0     BDC field value
program --- progam name
dynpro  screen number
dynbegin screen begin or not
fnam   field name
fval     field value.
thanks & regards,
venkatesh

Similar Messages

  • What are the fields in BDC table

    hi
    what are the fields in BDC table. what is the last entry

    hi,
    BDC table structure
    FIELD                     TYPE                            DESCRIPTION
    Program                CHAR (8)                      Program name of transaction.
    DynPro                   CHAR (4)                      Screen number of transaction.
    DynBegin               CHAR (1)                      Indicator for new screen.
    Fnam                     CHAR (35)                     Name of database field from screen.
    Fval                       CHAR (80)                     Value to submit to field.
    Hope this is helpful, Do reward.

  • Load table structure definition from Sql server and mirroring

    Hi, we have to replicate some tables from sql server
    into SAP dictionary.
    Is there a tool/transaction for import the table structure
    from a DBRMS like sql/oracle ?
    Adn is there some third part solution for replicate data
    from/to sql server and Sap ?
    Thanks in advance.
    Riccardo Galli.

    Hi,
    Dont know if there are any tools for this but onething is sure you will need to create the table thru SE11.
    I had done something similar, created a BDC to create table and it works.
    Provide the BDC with list of fields, datatype, len, key fields and the BDC will create the table.
    You will need to activate the table once its created, for some reason sap put the table in "partial active" status after creation .
    Good luck.
    Ravi

  • BI 7 : Command to export a table structure of SAP R/3 into a script/text ?

    Hi All.
    Greetings.
    Am New to SAP R/3 system.  And request help.
    We are trying to pull data from SAP R/3 thro Bussiness Objects Data Services into Oracle.
    For now : we create a target oracle table looking at the table structure of SAP R/3 from SE 11.
    In BODS, We then do the query transformation, and use the oracle target table created by us manually.
    This works absolutely fine.
    We would like to know the command by which we could export the table structure of any existing table
    in SAP R/3 into a script / or to text file,
    which we could use to create the same table structure in oracle.
    Rather than manually typing some 200 field names for each tables.
    Can anyone advise on this.
    Thanks
    Indu

    Hello,
    The problem is caused due to the spaces in your directories
    C:\SAP Dumps\Core Release SR1 Export_CD1_51019634/DB/ADA/DBSIZE.XML
    Replace the spaces with underscores and restart the installation from from scratch.
    Cheers
    Bert

  • Fields in a BDC table

    hai gurus....
    What are the fields in a BDC table???
    Thanks
    Pavan

    hi,
    i hope this answer will helps you..........,
    the BDCDATA table contains fields are...
    <b>BDCDATA-PROGRAM</b>-----> this field describes the module pool program name which we are used for vaidating and updating the data.
    <b>BDCDATA-DYNPRO</b>----
    > this field describes the currently active screen.
    <b>BDCDATA-DYNBEGIN</b>-------> this field describes the default or initial screen.
    <b>BDCDATA-FNAM</b>----
    > this field describes the field name which we are used in validations.
    <b>BDCDATA-FVAL</b>----
    > this field describes the field value which we are used in validations.
    by using the above table we perfome the mapping logic in BDC for validating and updating the legacy system data.
    regards,
    Ashok Reddy
    Message was edited by:
            Ashok Reddy

  • BDC table control using Excel sheet upload

    Hi All,
    I am working BDC table control.I want to upload the From excel sheet.I am using the FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload the the data into my internal table.The data is populating in the internal table.
    Now i have problem tat how to populate this excel sheet data to the Bdc table control.
    Can nybody help me out.\[removed by moderator\]
    Thanks,
    Swapna.
    Edited by: Jan Stallkamp on Jul 25, 2008 10:57 AM

    after fetching data from EXCEL sheet, each column data (in excel sheet) will be uploaded to individual record into your internal table along with row number and column number, loop through that internal table and collect all your excel data into record format.pls refer the below code.
    data:
         i_excel    type alsmex_tabline occurs 0 with header line,
         l_row      type i value 1.
    data:
         begin of x_data occurs 0,
                kunnr     like RF02L-KUNNR,
                klimk(17) type c,
                CTLPC     like knkk-CTLPC,
          end  of x_data,
          begin of x_data1 occurs 0,
                data(106),
          end   of x_data1.
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
         filename                      = p_fname
         i_begin_col                   = 1
         i_begin_row                   = 1
         i_end_col                     = no.of columns in your excel file
         i_end_row                     = no.of rows in your file
       tables
         intern                        = i_excel.
    if sy-subrc = 0.
       loop at i_excel.
         if l_row <> i_excel-row.
            append x_data.
            clear x_data.
         endif.
         case i_excel-col.
            when 1.
              x_data-kunnr = i_excel-value.
            when 2.
              x_data-klimk = i_excel-value.
            when 3.
              x_data-CTLPC = i_excel-value.
         endcase.
         l_row = i_excel-row.
         clear i_excel.
         at last.
            append x_data.
         endat.
       endloop.
    endif.
    then loop through the internal table X_DATA, pass the data to your table control like.
    tbl_control-field1(1) = x_data-field1.
    tbl_control-field2(1) = x_data-field2.
    tbl_control-fieldn(1) = x_data-fieldn.
    Regards,
    Sreeram.

  • Load Data from a table on one server's database, to the same table structure in multiple server databases

    Hi,
    I have a situation where i have to load data from one server/database table to multiple servers/databases.
    Example:
    I need to load data from dbo.TABLE_A  (on Server: Server_A & Database: Database_A)  to the same table on the list of server databases like
    Server: Server_B , Database: Database_B
    Server: Server_C , Database: Database_C
    Server: Server_D , Database: Database_D
    Server: Server_E , Database: Database_E
    Server: Server_F , Database: Database_F
    Server: Server_G , Database: Database_G
    Server: Server_H , Database: Database_H
    so on and so forth on 250 such server database combinations.
    The table structure is the same on all the servers.
    If i make the source or destination dynamic, it throws an error while mapping ?
    I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
    Please suggest on how to load data from one source to multiple server/databases.
    Thank you.

    I just need to transfer one table's data. its like i have to use a query to pick data for
    the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
    to append the new records.

  • Bdc table control.

    Dear forums friends,
    i have a problem in bdc table control.I send my report below,
    please check it and tell me what is the problem,why this report not excute.
    please tell me quickly.
    regard
    Rasmi.
    REPORT ztable_control
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    *include bdcrecx1.
    *start-of-selection.
    *perform open_group.
    DATA: it_exload LIKE alsmex_tabline  OCCURS 0 WITH HEADER LINE.
    DATA : str1 TYPE string,
           var1(2) TYPE n.
           var1 = 0.
    DATA: BEGIN OF itab OCCURS 0,
          cldte(8) TYPE n,
          ocrsn(4) TYPE n,
          END OF itab.
    DATA: var3 TYPE dats,
          var6 TYPE integer.
      itab-cldte = var3.
    itab2-cldte = var3.
      itab-ocrsn = var6.
    itab2-ocrsn = var6.
    DATA: BEGIN OF itab1 OCCURS 0,
          cldte(8) TYPE n,
          ocrsn(4) TYPE n,
          pernr(1) TYPE n,
          taxcd LIKE pinct-taxcd,
          betrg(1) TYPE n,
          voudt(10) TYPE c,
          vouam(2) TYPE n,
      END OF itab1.
    DATA var(1) TYPE c.
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    PARAMETER: file_fi LIKE rlgrap-filename OBLIGATORY,
               w_begin TYPE   i OBLIGATORY,
               w_end   TYPE   i OBLIGATORY,
               rad1    RADIOBUTTON GROUP gp1,
               rad2    RADIOBUTTON GROUP gp1 DEFAULT 'X',
               rad3    RADIOBUTTON GROUP gp1 .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_fi.
      PERFORM sub_browse_file.
                         START-OF-SELECTION                      *
    START-OF-SELECTION.
      PERFORM mode_selection.
      PERFORM sub_data_load.
      PERFORM sub_data_transform.
      PERFORM sub_post_data.
                           BROWS FILE                             *
    FORM sub_browse_file .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = file_fi.
    ENDFORM.                                      "sub_browse_file
                             DATA LOAD                             *
    FORM sub_data_load.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = file_fi
          i_begin_col = '0001'
          i_begin_row = w_begin
          i_end_col   = '0007'
          i_end_row   = w_end
        TABLES
          intern      = it_exload.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                                           "sub_data_load
                          DATA TRANSFORM                           *
    FORM sub_data_transform .
      LOOP AT it_exload.
        CASE it_exload-col.
          WHEN '0001'.
            itab-cldte = it_exload-value.
            itab1-cldte = it_exload-value.
          WHEN '0002'.
            itab-ocrsn = it_exload-value.
            itab1-ocrsn = it_exload-value.
          WHEN '0003'.
            itab1-pernr = it_exload-value.
          WHEN '0004'.
            itab1-taxcd = it_exload-value.
          WHEN '0005'.
            itab1-betrg = it_exload-value.
          WHEN '0006'.
            itab1-voudt = it_exload-value.
          WHEN '0007'.
            itab1-vouam = it_exload-value.
        ENDCASE.
        AT END OF row.
          APPEND itab.
          CLEAR itab.
          APPEND itab1.
          CLEAR itab1.
          IF itab-cldte = '  '.
            itab1-cldte = '  '.
            itab-ocrsn  = '  '.
            itab1-ocrsn = '  '.
            WRITE : / var3.
            WRITE : / var6.
          ENDIF.
        ENDAT.
      ENDLOOP.
    *SORT itab by cldte.
    *delete ADJACENT DUPLICATES FROM itab2.
    ENDFORM.                                            "sub_data_transform
                            Form  sub_post_data                         *
    FORM sub_post_data .
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'HINCREMP' '3000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'WA_CLAIMS-VOUAM(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=PROC'.
        PERFORM bdc_field       USING 'RPCCLMIN-CLDTE'
                                      itab-cldte .        "'01.02.2009'.
        PERFORM bdc_field       USING 'RPCCLMIN-OCRSN'
                                      itab-ocrsn.               " '0002'.
        LOOP AT itab1 WHERE cldte = itab1-cldte  AND ocrsn = itab-ocrsn.
          CONCATENATE 'wa_claims-pernr(' var1 ')' INTO str1.
          PERFORM bdc_field    USING str1
                                      itab1-pernr.              "'001'
          CONCATENATE 'WA_CLAIMS-TAXCD (' var1')' INTO str1.
          PERFORM bdc_field  USING  str1
                                      itab1-taxcd.                 "'SCHA'.
          CONCATENATE 'WA_CLAIMS-BETRG(' var1')' INTO str1.
          PERFORM bdc_field  USING str1
                                      itab1-betrg.              "'1'.
          CONCATENATE 'WA_CLAIMS-VOUDT(' var1 ')' INTO str1.
          PERFORM bdc_field   USING str1
                                      itab1-voudt.                    "'02.02.2009'.
          CONCATENATE 'WA_CLAIMS-VOUAM(' var1')' INTO str1.
          PERFORM bdc_field    USING str1
                                      itab1-vouam.              "'50'.
          var1 = var1 + 1.
         Endif.
        ENDLOOP.                                                "'50'.
        PERFORM bdc_dynpro      USING 'HINCREMP' '4000'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM bdc_dynpro      USING 'HINCREMP' '3000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RPCCLMIN-CLDTE'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM bdc_field       USING 'RPCCLMIN-CLDTE'
                                     '01.02.2009'.
        PERFORM bdc_field       USING 'RPCCLMIN-OCRSN'
                                    '0002'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
    *perform bdc_transaction using 'PC00_M40_REMP'.
        CALL TRANSACTION 'PC00_M40_REMP' USING bdcdata MESSAGES INTO messtab MODE var.
        "UPDATE 'S'
        "MODE var.
    Endloop.
    Endform.
                                START NEW SCREEN                               *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                                                          "BDC_DYNPRO
                               INSERT FILE                                     *
    FORM bdc_field USING fnam fval.
      IF fval <> space.
        CLEAR bdcdata.
        bdcdata-fnam = fnam.
        bdcdata-fval = fval.
        APPEND bdcdata.
      ENDIF.
    ENDFORM.                                                          "BDC_FIELD
                                MODE-SELECTION                                 *
    FORM mode_selection .
      IF rad1 = 'X'.
        var = 'P'.
      ELSEIF rad2 = 'X'.
        var = 'E'.
      ELSEIF rad3 = 'X'.
        var = 'A'.
      ENDIF.
    ENDFORM.                                                  " mode_selecti

    Hi,
    Check this ...
    REPORT ztable_control
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    *include bdcrecx1.
    *start-of-selection.
    *perform open_group.
    DATA: it_exload LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA : str1 TYPE string,
    var1(2) TYPE n.
    var1 = 1.               " Change here and check
    DATA: BEGIN OF itab OCCURS 0,
    cldte(8) TYPE n,
    ocrsn(4) TYPE n,
    END OF itab.
    DATA: var3 TYPE dats,
    var6 TYPE integer.
    itab-cldte = var3.
    itab2-cldte = var3.
    itab-ocrsn = var6.
    itab2-ocrsn = var6.
    DATA: BEGIN OF itab1 OCCURS 0,
    cldte(8) TYPE n,
    ocrsn(4) TYPE n,
    pernr(1) TYPE n,
    taxcd LIKE pinct-taxcd,
    betrg(1) TYPE n,
    voudt(10) TYPE c,
    vouam(2) TYPE n,
    END OF itab1.
    DATA var(1) TYPE c.
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    PARAMETER: file_fi LIKE rlgrap-filename OBLIGATORY,
    w_begin TYPE i OBLIGATORY,
    w_end TYPE i OBLIGATORY,
    rad1 RADIOBUTTON GROUP gp1,
    rad2 RADIOBUTTON GROUP gp1 DEFAULT 'X',
    rad3 RADIOBUTTON GROUP gp1 .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_fi.
    PERFORM sub_browse_file.
    START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM mode_selection.
    PERFORM sub_data_load.
    PERFORM sub_data_transform.
    PERFORM sub_post_data.
    BROWS FILE *
    FORM sub_browse_file .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    field_name = ' '
    IMPORTING
    file_name = file_fi.
    ENDFORM. "sub_browse_file
    DATA LOAD *
    FORM sub_data_load.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = file_fi
    i_begin_col = '0001'
    i_begin_row = w_begin
    i_end_col = '0007'
    i_end_row = w_end
    TABLES
    intern = it_exload.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. "sub_data_load
    DATA TRANSFORM *
    FORM sub_data_transform .
    LOOP AT it_exload.
    CASE it_exload-col.
    WHEN '0001'.
    itab-cldte = it_exload-value.
    itab1-cldte = it_exload-value.
    WHEN '0002'.
    itab-ocrsn = it_exload-value.
    itab1-ocrsn = it_exload-value.
    WHEN '0003'.
    itab1-pernr = it_exload-value.
    WHEN '0004'.
    itab1-taxcd = it_exload-value.
    WHEN '0005'.
    itab1-betrg = it_exload-value.
    WHEN '0006'.
    itab1-voudt = it_exload-value.
    WHEN '0007'.
    itab1-vouam = it_exload-value.
    ENDCASE.
    AT END OF row.
    APPEND itab.
    CLEAR itab.
    APPEND itab1.
    CLEAR itab1.
    IF itab-cldte = ' '.
    itab1-cldte = ' '.
    itab-ocrsn = ' '.
    itab1-ocrsn = ' '.
    WRITE : / var3.
    WRITE : / var6.
    ENDIF.
    ENDAT.
    ENDLOOP.
    *SORT itab by cldte.
    *delete ADJACENT DUPLICATES FROM itab2.
    ENDFORM. "sub_data_transform
    Form sub_post_data *
    FORM sub_post_data .
    LOOP AT itab.
    PERFORM bdc_dynpro USING 'HINCREMP' '3000'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'WA_CLAIMS-VOUAM(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=PROC'.
    PERFORM bdc_field USING 'RPCCLMIN-CLDTE'
    itab-cldte . "'01.02.2009'.
    PERFORM bdc_field USING 'RPCCLMIN-OCRSN'
    itab-ocrsn. " '0002'.
    LOOP AT itab1 WHERE cldte = itab1-cldte AND ocrsn = itab-ocrsn.
    CONCATENATE 'wa_claims-pernr(' var1 ')' INTO str1.
    PERFORM bdc_field USING str1
    itab1-pernr. "'001'
    CONCATENATE 'WA_CLAIMS-TAXCD (' var1')' INTO str1.
    PERFORM bdc_field USING str1
    itab1-taxcd. "'SCHA'.
    CONCATENATE 'WA_CLAIMS-BETRG(' var1')' INTO str1.
    PERFORM bdc_field USING str1
    itab1-betrg. "'1'.
    CONCATENATE 'WA_CLAIMS-VOUDT(' var1 ')' INTO str1.
    PERFORM bdc_field USING str1
    itab1-voudt. "'02.02.2009'.
    CONCATENATE 'WA_CLAIMS-VOUAM(' var1')' INTO str1.
    PERFORM bdc_field USING str1
    itab1-vouam. "'50'.
    var1 = var1 + 1.
    Endif.
    ENDLOOP. "'50'.
    PERFORM bdc_dynpro USING 'HINCREMP' '4000'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=BACK'.
    PERFORM bdc_dynpro USING 'HINCREMP' '3000'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RPCCLMIN-CLDTE'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=BACK'.
    PERFORM bdc_field USING 'RPCCLMIN-CLDTE'
    '01.02.2009'.
    PERFORM bdc_field USING 'RPCCLMIN-OCRSN'
    '0002'.
    PERFORM bdc_dynpro USING 'SAPLSPO1' '0100'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=YES'.
    *perform bdc_transaction using 'PC00_M40_REMP'.
    CALL TRANSACTION 'PC00_M40_REMP' USING bdcdata MESSAGES INTO messtab MODE var.
    "UPDATE 'S'
    "MODE var.
    Endloop.
    Endform.

  • TIPS(18) : CREATING SCRIPTS TO RECREATE A TABLE STRUCTURE

    제품 : SQL*PLUS
    작성날짜 : 1996-11-12
    TIPS(18) : Creating Scripts to Recreate a Table Structure
    =========================================================
    The script creates scripts that can be used to recreate a table structure.
    For example, this script can be used when a table has become fragmented or to
    get a defintion that can be run on another database.
    CREATES SCRIPT TO RECREATE A TABLE-STRUCTURE
    INCL. STORAGE, CONSTRAINTS, TRIGGERS ETC.
    This script creates scripts to recreate a table structure.
    Use the script to reorganise a table that has become fragmented,
    to get a definition that can be run on another database/schema or
    as a basis for altering the table structure (eg. drop a column!).
    IMPORTANT: Running the script is safe as it only creates two new scripts and
    does not do anything to your database! To get anything done you have to run the
    scripts created.
    The created scripts does the following:
    1. save the content of the table
    2. drop any foreign key constraints referencing the table
    3. drop the table
    4. creates the table with an Initial storage parameter that
    will accomodate the entire content of the table. The Next
    parameter is 25% of the initial.
    The storage parameters are picked from the following list:
    64K, 128K, 256K, 512K, multiples of 1M.
    5. create table and column comments
    6. fill the table with the original content
    7. create all the indexes incl storage parameters as above.
    8. add primary, unique key and check constraints.
    9. add foreign key constraints for the table and for referencing
    tables.
    10.Create the table's triggers.
    11.Compile any depending objects (cascading).
    12.Grant table and column privileges.
    13.Create synonyms.
    This script must be run as the owner of the table.
    If your table contains a LONG-column, use the COPY
    command in SQL*Plus to store/restore the data.
    USAGE
    from SQL*Plus:
    start reorgtb
    This will create the scripts REORGS1.SQL and REORGS2.SQL
    REORGS1.SQL contains code to save the current content of the table.
    REORGS2.SQL contains code to rebuild the table structure.
    undef tab;
    set echo off
    column a1 new_val stor
    column b1 new_val nxt
    select
    decode(sign(1024-sum(bytes)/1024),-1,to_char((round(sum(bytes)/(1024*1
    024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
    decode(sign(512-sum(bytes)/1024), -1,'1M',
    decode(sign(256-sum(bytes)/1024), -1,'512K',
    decode(sign(128-sum(bytes)/1024), -1,'256K',
    decode(sign(64-sum(bytes)/1024) , -1,'128K',
    '64K'
    a1,
    decode(sign(1024-sum(bytes)/4096),-1,to_char((round(sum(bytes)/(4096*1
    024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
    decode(sign(512-sum(bytes)/4096), -1,'1M',
    decode(sign(256-sum(bytes)/4096), -1,'512K',
    decode(sign(128-sum(bytes)/4096), -1,'256K',
    decode(sign(64-sum(bytes)/4096) , -1,'128K',
    '64K'
    b1
    from user_extents
    where segment_name=upper('&1');
    set pages 0 feed off verify off lines 150
    col c1 format a80
    spool reorgs1.sql
    PROMPT drop table bk_&1
    prompt /
    PROMPT create table bk_&1 storage (initial &stor) as select * from &1
    prompt /
    spool off
    spool reorgs2.sql
    PROMPT spool reorgs2
    select 'alter table '||table_name||' drop constraint
    '||constraint_name||';'
    from user_constraints where r_constraint_name
    in (select constraint_name from user_constraints where
    table_name=upper('&1')
    and constraint_type in ('P','U'));
    PROMPT drop table &1
    prompt /
    prompt create table &1
    select decode(column_id,1,'(',',')
    ||rpad(column_name,40)
    ||decode(data_type,'DATE' ,'DATE '
    ,'LONG' ,'LONG '
    ,'LONG RAW','LONG RAW '
    ,'RAW' ,'RAW '
    ,'CHAR' ,'CHAR '
    ,'VARCHAR' ,'VARCHAR '
    ,'VARCHAR2','VARCHAR2 '
    ,'NUMBER' ,'NUMBER '
    ,'unknown')
    ||rpad(
    decode(data_type,'DATE' ,null
    ,'LONG' ,null
    ,'LONG RAW',null
    ,'RAW' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'CHAR' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'VARCHAR' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'VARCHAR2',decode(data_length,null,null
    ,'('||data_length||')')
    ,'NUMBER' ,decode(data_precision,null,' '
    ,'('||data_precision||
    decode(data_scale,null,null
    ,','||data_scale)||')')
    ,'unknown'),8,' ')
    ||decode(nullable,'Y','NULL','NOT NULL') c1
    from user_tab_columns
    where table_name = upper('&1')
    order by column_id
    prompt )
    select 'pctfree '||t.pct_free c1
    ,'pctused '||t.pct_used c1
    ,'initrans '||t.ini_trans c1
    ,'maxtrans '||t.max_trans c1
    ,'tablespace '||s.tablespace_name c1
    ,'storage (initial '||'&stor' c1
    ,' next '||'&stor' c1
    ,' minextents '||t.min_extents c1
    ,' maxextents '||t.max_extents c1
    ,' pctincrease '||t.pct_increase||')' c1
    from user_Segments s, user_tables t
    where s.segment_name = upper('&1') and
    t.table_name = upper('&1')
    and s.segment_type = 'TABLE'
    prompt /
    select 'comment on table &1 is '''||comments||''';' c1 from
    user_tab_comments
    where table_name=upper('&1');
    select 'comment on column &1..'||column_name||
    ' is '''||comments||''';' c1 from user_col_comments
    where table_name=upper('&1');
    prompt insert into &1 select * from bk_&1
    prompt /
    set serveroutput on
    declare
    cursor c1 is select index_name,decode(uniqueness,'UNIQUE','UNIQUE')
    unq
    from user_indexes where
    table_name = upper('&1');
    indname varchar2(50);
    cursor c2 is select
    decode(column_position,1,'(',',')||rpad(column_name,40) cl
    from user_ind_columns where table_name = upper('&1') and
    index_name = indname
    order by column_position;
    l1 varchar2(100);
    l2 varchar2(100);
    l3 varchar2(100);
    l4 varchar2(100);
    l5 varchar2(100);
    l6 varchar2(100);
    l7 varchar2(100);
    l8 varchar2(100);
    l9 varchar2(100);
    begin
    dbms_output.enable(100000);
    for c in c1 loop
    dbms_output.put_line('create '||c.unq||' index '||c.index_name||' on
    &1');
    indname := c.index_name;
    for q in c2 loop
    dbms_output.put_line(q.cl);
    end loop;
    dbms_output.put_line(')');
    select 'pctfree '||i.pct_free ,
    'initrans '||i.ini_trans ,
    'maxtrans '||i.max_trans ,
    'tablespace '||i.tablespace_name ,
    'storage (initial '||
    decode(sign(1024-sum(e.bytes)/1024),-1,
    to_char((round(sum(e.bytes)/(1024*1024))+1))||'M',
    decode(sign(512-sum(e.bytes)/1024), -1,'1M',
    decode(sign(256-sum(e.bytes)/1024), -1,'512K',
    decode(sign(128-sum(e.bytes)/1024), -1,'256K',
    decode(sign(64-sum(e.bytes)/1024) , -1,'128K',
    '64K'))))) ,
    ' next '||
    decode(sign(1024-sum(e.bytes)/4096),-1,
    to_char((round(sum(e.bytes)/(4096*1024))+1))||'M',
    decode(sign(512-sum(e.bytes)/4096), -1,'1M',
    decode(sign(256-sum(e.bytes)/4096), -1,'512K',
    decode(sign(128-sum(e.bytes)/4096), -1,'256K',
    decode(sign(64-sum(e.bytes)/4096) , -1,'128K',
    '64K'))))) ,
    ' minextents '||s.min_extents ,
    ' maxextents '||s.max_extents ,
    ' pctincrease '||s.pct_increase||')'
    into l1,l2,l3,l4,l5,l6,l7,l8,l9
    from user_extents e,user_segments s, user_indexes i
    where s.segment_name = c.index_name
    and s.segment_type = 'INDEX'
    and i.index_name = c.index_name
    and e.segment_name=s.segment_name
    group by s.min_extents,s.max_extents,s.pct_increase,
    i.pct_free,i.ini_trans,i.max_trans,i.tablespace_name ;
    dbms_output.put_line(l1);
    dbms_output.put_line(l2);
    dbms_output.put_line(l3);
    dbms_output.put_line(l4);
    dbms_output.put_line(l5);
    dbms_output.put_line(l6);
    dbms_output.put_line(l7);
    dbms_output.put_line(l8);
    dbms_output.put_line(l9);
    dbms_output.put_line('/');
    end loop;
    end;
    declare
    cursor c1 is
    select constraint_name, decode(constraint_type,'U',' UNIQUE',' PRIMARY
    KEY') typ,
    decode(status,'DISABLED','DISABLE',' ') status from user_constraints
    where table_name = upper('&1')
    and constraint_type in ('U','P');
    cname varchar2(100);
    cursor c2 is
    select decode(position,1,'(',',')||rpad(column_name,40) coln
    from user_cons_columns
    where table_name = upper('&1')
    and constraint_name = cname
    order by position;
    begin
    for q1 in c1 loop
    cname := q1.constraint_name;
    dbms_output.put_line('alter table &1');
    dbms_output.put_line('add constraint '||cname||q1.typ);
    for q2 in c2 loop
    dbms_output.put_line(q2.coln);
    end loop;
    dbms_output.put_line(')' ||q1.status);
    dbms_output.put_line('/');
    end loop;
    end;
    declare
    cursor c1 is
    select c.constraint_name,c.r_constraint_name cname2,
    c.table_name table1, r.table_name table2,
    decode(c.status,'DISABLED','DISABLE',' ') status,
    decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
    delete_rule
    from user_constraints c,
    user_constraints r
    where c.constraint_type='R' and
    c.r_constraint_name = r.constraint_name and
    c.table_name = upper('&1')
    union
    select c.constraint_name,c.r_constraint_name cname2,
    c.table_name table1, r.table_name table2,
    decode(c.status,'DISABLED','DISABLE',' ') status,
    decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
    delete_rule
    from user_constraints c,
    user_constraints r
    where c.constraint_type='R' and
    c.r_constraint_name = r.constraint_name and
    r.table_name = upper('&1');
    cname varchar2(50);
    cname2 varchar2(50);
    cursor c2 is
    select decode(position,1,'(',',')||rpad(column_name,40) colname
    from user_cons_columns
    where constraint_name = cname
    order by position;
    cursor c3 is
    select decode(position,1,'(',',')||rpad(column_name,40) refcol
    from user_cons_columns
    where constraint_name = cname2
    order by position;
    begin
    dbms_output.enable(100000);
    for q1 in c1 loop
    cname := q1.constraint_name;
    cname2 := q1.cname2;
    dbms_output.put_line('alter table '||q1.table1||' add constraint ');
    dbms_output.put_line(cname||' foreign key');
    for q2 in c2 loop
    dbms_output.put_line(q2.colname);
    end loop;
    dbms_output.put_line(') references '||q1.table2);
    for q3 in c3 loop
    dbms_output.put_line(q3.refcol);
    end loop;
    dbms_output.put_line(') '||q1.delete_rule||q1.status);
    dbms_output.put_line('/');
    end loop;
    end;
    col c1 format a79 word_wrap
    set long 32000
    set arraysize 1
    select 'create or replace trigger ' c1,
    description c1,
    'WHEN ('||when_clause||')' c1,
    trigger_body ,
    '/' c1
    from user_triggers
    where table_name = upper('&1') and when_clause is not null
    select 'create or replace trigger ' c1,
    description c1,
    trigger_body ,
    '/' c1
    from user_triggers
    where table_name = upper('&1') and when_clause is null
    select 'alter trigger '||trigger_name||decode(status,'DISABLED','
    DISABLE',' ENABLE')
    from user_Triggers where table_name='&1';
    set serveroutput on
    declare
    cursor c1 is
    select 'alter table
    '||'&1'||decode(substr(constraint_name,1,4),'SYS_',' ',
    ' add constraint ') a1,
    decode(substr(constraint_name,1,4),'SYS_','
    ',constraint_name)||' check (' a2,
    search_condition a3,
    ') '||decode(status,'DISABLED','DISABLE','') a4,
    '/' a5
    from user_constraints
    where table_name = upper('&1') and
    constraint_type='C';
    b1 varchar2(100);
    b2 varchar2(100);
    b3 varchar2(32000);
    b4 varchar2(100);
    b5 varchar2(100);
    fl number;
    begin
    open c1;
    loop
    fetch c1 into b1,b2,b3,b4,b5;
    exit when c1%NOTFOUND;
    select count(*) into fl from user_tab_columns where table_name =
    upper('&1') and
    upper(column_name)||' IS NOT NULL' = upper(b3);
    if fl = 0 then
    dbms_output.put_line(b1);
    dbms_output.put_line(b2);
    dbms_output.put_line(b3);
    dbms_output.put_line(b4);
    dbms_output.put_line(b5);
    end if;
    end loop;
    end;
    create or replace procedure dumzxcvreorg_dep(nam varchar2,typ
    varchar2) as
    cursor cur is
    select type,decode(type,'PACKAGE BODY','PACKAGE',type) type1,
    name from user_dependencies
    where referenced_name=upper(nam) and referenced_type=upper(typ);
    begin
    dbms_output.enable(500000);
    for c in cur loop
    dbms_output.put_line('alter '||c.type1||' '||c.name||' compile;');
    dumzxcvreorg_dep(c.name,c.type);
    end loop;
    end;
    exec dumzxcvreorg_dep('&1','TABLE');
    drop procedure dumzxcvreorg_Dep;
    select 'grant '||privilege||' on '||table_name||' to '||grantee||
    decode(grantable,'YES',' with grant option;',';') from
    user_tab_privs where table_name = upper('&1');
    select 'grant '||privilege||' ('||column_name||') on &1 to
    '||grantee||
    decode(grantable,'YES',' with grant option;',';')
    from user_col_privs where grantor=user and
    table_name=upper('&1')
    order by grantee, privilege;
    select 'create synonym '||synonym_name||' for
    '||table_owner||'.'||table_name||';'
    from user_synonyms where table_name=upper('&1');
    PROMPT REM
    PROMPT REM YOU MAY HAVE TO LOG ON AS SYSTEM TO BE
    PROMPT REM ABLE TO CREATE ANY OF THE PUBLIC SYNONYMS!
    PROMPT REM
    select 'create public synonym '||synonym_name||' for
    '||table_owner||'.'||table_name||';'
    from all_synonyms where owner='PUBLIC' and table_name=upper('&1') and
    table_owner=user;
    prompt spool off
    spool off
    set echo on feed on verify on
    The scripts REORGS1.SQL and REORGS2.SQL have been
    created. Alter these script as necesarry.
    To recreate the table-structure, first run REORGS1.SQL.
    This script saves the content of your table in a table
    called bk_.
    If this script runs successfully run REORGS2.SQL.
    The result is spooled to REORGTB.LST.
    Check this file before dropping the bk_ table.
    */

    Please do NOT cross-postings: create a deep structure for dynamic internal table
    Regards
      Uwe

  • Vendor-Customer balances in group currency-table/structure/function module?

    Hi All,
    Which table/structure/function module can be used to get balances for vendors and customers in group currency? We just wnat to extract balances in group currency so FBL1N and FBL5N are not options. Is there any SAP report which can provide these balances for both vendors and customers?
    Thanks and regards,
    Pinky

    Hi Pinky,
    I came across one report S_ALR_87012079 - Transaction Figures: Account Balance, Program RFSRRCUA, which extracts Account Balances of Vendor. Once the report is executed, you can do Currency Translation from one currency to different currencies. In the output screen, in the Top Menu, select 'Settings -> Currency' and you can convert to another currency. I am not sure, if this helps you. If this helps, kindly update your comments here.
    Thank you.
    Suresh Jayanthi.

  • How to copy paste a table structure from word document into Text Field [field format Rich Text]

    In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
    Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
    Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
    Is there anyway to copy paste table structure as it is from word document into Text Field?

    Hi,
    I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
    Niall

  • Insert multiple text files to multiple tables that have different table structures

    Hi All,
    I have a small problem. I have lots of text files in a folder location. Say for an example Company.txt, Code.txt. I need to insert all these files to tables similar to the file structure. Company file to Company table and Code file to Code table. The catch
    is that all these table structures differ one to another.
    How can i do this using SSIS? I guess using a for each loop with some data flow task would be a start.
    Can some body give me a step by step example on how i can achieve this.
    Thanks
    LM

    It is very complicated to accomplish the above requirement using the standard Data Flow Task. You have to essentially setup a separate task for each table layout. If you can use third-party solutions, check the commercial CozyRoc
    Data Flow Task Plus. It is an extension of the standard Data Flow Task, with ability to do dynamic data flows at runtime. You can load all your tables and layouts with only one Data Flow Task. The other benefit is the solution doesn't require programming.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Table structure and constraints in HTML table

    This script creates a html file (Structure.html) that contains structure of a specific table.
    When the following script is executed in sql * plus, it asks for the table name for which
    structure information is needed. after entering the table name, it writes the table structure
    into structure.html file.
    SET LINESIZE 150
    SET PAGESIZE 150
    SET FEEDBACK OFF
    SET VERIFY OFF
    COLUMN "COLUMN NAME" FORMAT A50
    COLUMN "DATA TYPE" FORMAT A15
    COLUMN "IS NULL" FORMAT A15
    COLUMN CONSTRAINTS FORMAT A15
    PROMPT Enter table name:
    ACCEPT TABNAME
    SET MARK HTML ON
    SPOOL STRUCTURE.html
    PROMPT &TABNAME
    -- Query ---
    SELECT TRIM(A.COLUMN_NAME) AS "COLUMN NAME",
    TRIM(DATA_TYPE||'('||DECODE(A.DATA_LENGTH,22,A.DATA_PRECISION||','||A.DATA_SCALE,
    A.DATA_LENGTH) || ')') AS "DATA TYPE",
    TRIM(DECODE(A.NULLABLE,'Y',' ','NOT NULL')) AS "IS NULL",
    TRIM(DECODE(C.CONSTRAINT_TYPE,'P','PRIMARY KEY','R','FOREIGN KEY('||D.TABLE_NAME||')','U','UNIQUE', 'C','CHECK')) AS CONSTRAINTS,
    TRIM(C.CONSTRAINT_NAME) AS "CONSTRAINT NAME",
    C.SEARCH_CONDITION AS "CHECK CONDITION",
    A.DATA_DEFAULT AS "DEFAULT VALUE"
    FROM USER_TAB_COLS A,
    USER_CONS_COLUMNS B,
    USER_CONSTRAINTS C,
    USER_CONS_COLUMNS D
    WHERE
    A.TABLE_NAME = '&TABNAME' AND
    A.TABLE_NAME = B.TABLE_NAME(+) AND
    A.COLUMN_NAME = B.COLUMN_NAME(+) AND
    B.CONSTRAINT_NAME = C.CONSTRAINT_NAME(+) AND
    C.R_CONSTRAINT_NAME = D.CONSTRAINT_NAME(+);
    SPOOL OFF
    SET MARK HTML OFF

    Hi,
    For Head Count you can use 0HR_PA_0 datasource and the other Employee details like start date and end date you can get them from employee master data and FTE can be calculated from the Emloyee Master Data and Head count data.
    Hope this helps...
    Thanks,

  • Flex 3: Update SQLite Table Structure?

    I don't have any issues with creating my table when it doesn't exist but I have a quesion about updating the table structure.  For instance I want to add two new fields if they don't exist.
    Does anyone have an example of updating table structure?  Process flow would have to first check for table, if it doesn't exits then create it. If it does exist then check it has all the correct fields.  If it doesn't then update table structure. 
    Is there a built in way to do this with SQLite?
    Here is my current code...
    private function getRecords():void
    var sqlQuery:String = "CREATE TABLE IF NOT EXISTS Roster (" +
                            "selected TEXT DEFAULT 'false' NOT NULL,"+
                            "name    TEXT        NOT NULL," +
                            "time     TEXT        NOT NULL," +
                            "gender     TEXT        NOT NULL" +
    dbStatement = new SQLStatement();
    dbStatement.itemClass = Roster;
    dbStatement.sqlConnection = exampleDB;
    dbStatement.text = sqlQuery;
    dbStatement.addEventListener(SQLEvent.RESULT, onDBStatementSelectResult);
    dbStatement.execute();
    sqlQuery= "select * from Roster";
    dbStatement.text = sqlQuery;
    dbStatement.addEventListener(SQLEvent.RESULT, onDBStatementSelectResult);
    dbStatement.execute();
    I want to add in two new fields is possible without asking user to delete the table first.
                            "wins TEXT DEFAULT '0' NOT NULL," +
                            "loses TEXT DEFAULT '0' NOT NULL" +
    Thanks in advance.

    Looks like you need a single column to identify the type of user (M,C or A) Much better this scenario described here
    http://vyaskn.tripod.com/row_level_security_in_sql_server_databases.htm
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to create screen resolution in bdc table control

    hi gurus
    can anyone suggest me
    how to create screen resolution in bdc table control
    thanks&regards
    mark.

    Hi ,
    Using CTU_PARAMS table for screen resolution .
    For this sample code.
    This is for Transation  FB60.
    report ZZFB60
           no standard page heading line-size 255.
    tables t100.
    PARAMETERS : p_file1  like  rlgrap-filename,
                 p_doctyp like  RF05A-BUSCS,
                 p_invdat like  INVFO-BLDAT,
                 p_posdat like  INVFO-BUDAT.
    CONSTANTS  :  C_TRANS_FB60(4) VALUE 'FB60'.
    *Parameter string for runtime of CALL TRANSACTION
    data : l_option type ctu_params,
           l_subrc type sysubrc.
    DATA :  l_mstring(150).
    data      accnt type char17.
    data       : day   type char2,
                 month type char2,
                 year  type char4,
                 date1 type char10,
                 date2 type char10.
    data      :  cnt(2) TYPE n,
                 cnt1 type i,
                 fld(25) TYPE c.
    data : begin of excel occurs 0,
            fieldname(255) type c,
           end of excel.
    DATA:BEGIN OF it_mess OCCURS 0,
             msgtyp(5),
             lms(200),
              msgv1(50),
         END OF it_mess.
    data: begin of t_record occurs 0,
             BUKRS(004),
            ACCNT(017),
            XBLNR(016),
            WRBTR1(016),
            WAERS(005),
            SECCO(004) ,
            SGTXT(050),
            HKONT(010),
            WRBTR2(017),
            MWSKZ(002),
            GSBER(004),
            KOSTL(010),
         end of t_record.
    *Internal Table for Header Data
    DATA :  BEGIN OF t_head OCCURS 0,
            BUKRS(004),      "Company Code
            ACCNT(017),      "Account or Vendor
            XBLNR(016),      "Reference
            WRBTR1(017),     "Amount in document currency
            WAERS(005),      "Currency
            SECCO(004),      "Section Code
            SGTXT(050),      "Text
            END OF t_head.
    *Internal table for Item Data
    DATA :  BEGIN OF t_item OCCURS 0,
            ACCNT(017),      "Account
            HKONT(010),     "GL Account
            WRBTR2(017),    "Line item Amount in document currency
            MWSKZ(002),     "Tax Code
            GSBER(004),     " Business Area
            KOSTL(010),     "Cost centre
            END OF t_item.
    DATA: IT_BDCDATA      LIKE  BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_BDC_MESSAGES LIKE  BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    *include bdcrecx1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      PERFORM  file_selection.
      PERFORM  data_upload.
      PERFORM  table_control.
    start-of-selection.
    l_option-defsize = 'X'.
    l_option-dismode = 'A'.
    l_option-updmode = 'S'.
    day = p_invdat+6(2).
    month = p_invdat+4(2).
    year =  p_invdat+0(4).
    concatenate day month year into date1 SEPARATED BY '.'.
    day = p_posdat+6(2).
    month = p_posdat+4(2).
    year =  p_posdat+0(4).
    concatenate day month year into date2 SEPARATED BY '.'.
    *perform open_group.
    loop at t_head.
    CLEAR    IT_BDCDATA.
    REFRESH  IT_BDCDATA.
    perform bdc_dynpro      using   'SAPLACHD'         '1000'.
    perform bdc_field       using   'BDC_OKCODE'        '=ENTR'.
    perform bdc_field       using   'BKPF-BUKRS'        t_head-bukrs.
    perform bdc_dynpro      using   'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    perform bdc_field       using   'RF05A-BUSCS'       p_doctyp.
    perform bdc_field       using   'INVFO-ACCNT'       t_head-accnt.
    perform bdc_field       using   'INVFO-BLDAT'       date1.
    perform bdc_field       using   'INVFO-BUDAT'       date2.
    perform bdc_field       using   'INVFO-XBLNR'       t_head-xblnr.
    perform bdc_field       using   'INVFO-WRBTR'       t_head-wrbtr1.
    perform bdc_field       using   'INVFO-WAERS'       t_head-waers.
    perform bdc_field       using   'INVFO-SECCO'       t_head-secco.
    perform bdc_field       using   'INVFO-SGTXT'       t_head-sgtxt.
    cnt = 1.
    cnt1 = 1.
    loop at t_item where accnt = t_head-accnt.
    *if cnt > 4.
    *cnt = 4.
    *endif.
    if cnt1 gt 1.
    CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    perform bdc_field      using   fld                   'X'.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    endif.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    CONCATENATE 'ACGL_ITEM-HKONT(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-hkont.
    CONCATENATE 'ACGL_ITEM-WRBTR(' cnt ')' INTO fld.
    perform bdc_field  using       fld                t_item-wrbtr2.
    CONCATENATE 'ACGL_ITEM-MWSKZ(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-mwskz.
    CONCATENATE 'ACGL_ITEM-GSBER(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-gsber.
    CONCATENATE 'ACGL_ITEM-KOSTL(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-kostl.
    perform bdc_field      using  'BDC_CURSOR'  fld.
    *CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    *perform bdc_field      using   fld                   'X'.
    cnt1 = cnt1 + 1.
    *cnt = cnt + 1.
    *if cnt > 1.
    *perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    *perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    **perform bdc_field       using 'BDC_OKCODE'        '=0006'.
    *endif.
    endloop.
    perform bdc_dynpro      using 'SAPMF05A' '1100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BS'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    *perform bdc_transaction using 'FB60'.
    CALL TRANSACTION C_TRANS_FB60 USING IT_BDCDATA  options from l_option
                                 MESSAGES INTO IT_BDC_MESSAGES.
    perform error.
    perform errordownload.
    endloop.
    *perform close_group.
    *Form  data_upload
    FORM data_upload .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME              =  p_file1
       FILETYPE              = 'DAT'
      TABLES
        DATA_TAB             =  t_record.
    ENDFORM.                    " data_upload
    *Form  file_selection
    FORM file_selection .
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  =  syst-cprog
          dynpro_number =  syst-dynnr
          field_name    = 'p_file1'
        IMPORTING
          file_name     =  p_file1.
    ENDFORM.                    " file_selection
    Form  BDC_DYNPRO
    FORM BDC_DYNPRO using program dynpro.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM = PROGRAM.
      IT_BDCDATA-DYNPRO = DYNPRO.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND  IT_BDCDATA.
    endform.
    *Form  BDC_FIELD
    FORM  bdc_field using fnam fval.
      CLEAR  IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL = FVAL.
      APPEND  IT_BDCDATA.
    ENDFORM.
    Table Control
    FORM table_control .
      LOOP AT t_record.
        ON CHANGE OF t_record-accnt.
          MOVE-CORRESPONDING t_record TO t_head.
          APPEND t_head.
        ENDON.
      loop at t_head.
             t_item-accnt   =  t_head-accnt.
             t_item-hkont   =  t_record-hkont.
             t_item-wrbtr2  =  t_record-wrbtr2 .
             t_item-mwskz   =  t_record-mwskz .
             t_item-gsber   =  t_record-gsber .
             t_item-kostl   =  t_record-kostl.
        APPEND t_item.
    endloop.
         If t_record-level = 'H'.
             t_head-bukrs   =  t_record-text1.
             t_head-accnt   =  t_record-text2.
             t_head-xblnr   =  t_record-text3.
             t_head-wrbtr1  =  t_record-text4.
             t_head-waers   =  t_record-text5.
             t_head-secco   =  t_record-text6.
             t_head-sgtxt   =  t_record-text7.
          APPEND t_head.
         else.
            t_item-accnt   =  t_head-accnt.
            t_item-hkont   =  t_record-text1.
            t_item-wrbtr2  =  t_record-text2.
            t_item-mwskz   =  t_record-text3.
            t_item-gsber   =  t_record-text4.
            t_item-kostl   =  t_record-text5.
         APPEND t_item.
         endif.
      ENDLOOP.
    ENDFORM.
    FORM error .
      LOOP AT IT_BDC_MESSAGES.
        IF IT_BDC_MESSAGES-msgtyp = 'E'.
       SELECT single  * FROM t100  WHERE
                                    sprsl = it_BDC_MESSAGES-msgspra
                                    AND   arbgb = IT_BDC_MESSAGES-msgid
                                    AND   msgnr = IT_BDC_MESSAGES-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ELSE.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    form errordownload.
    *down the internal table to excel file.
    call function 'EXCEL_OLE_STANDARD_DAT'
               EXPORTING
                    file_name                 = 'c:/Error.xls'
               TABLES
                    data_tab                  = it_mess
                    fieldnames                = excel
               EXCEPTIONS
                    file_not_exist            = 1
                    filename_expected         = 2
                    communication_error       = 3
                    ole_object_method_error   = 4
                    ole_object_property_error = 5
                    invalid_filename          = 6
                    invalid_pivot_fields      = 7
                    download_problem          = 8
                    others                    = 9.
    endform.
    Reward if useful
    Regards,
    Narasimha
    Edited by: narasimha marella on May 13, 2008 12:12 PM

Maybe you are looking for

  • How to permanently delete an audio track on my iPhone 4?

    Hi all, First off, a little background: my ISP is French Free, and they have this very cozy feature that lets you know via email when someone leaves a message on your home line voicemail; that way, you get your voicemail anytime you want, not just wh

  • How to alter the display names of grouped items in a document library?

    Very odd issue I want to sort items in a document library by the value in a field, that is no problem. The issue is I want them display NOT in alphabetical order for example I have a list that is grouped into 3 groups (Cases, Forms and Support). When

  • Problem in join statement

    Hi, I have the following join cond on ekko, ekpo, ekkn tables.   SELECT m~ebeln m~procstat m~rlwrt m~frgke m~bukrs          c~ebelp c~txz01 c~knttp c~netwr          c1~nplnr c1~kostl c1~anln1 c1~sakto c1~prctr c1~aufnr c1~imkey c1~ps_psp_pnr c1~zekkn

  • Does N96 have a 3D gaming chip?

    I currently own an n95 8GB and I am very impressed with the capabilities of the 3D graphics chip accelerator. I am weighing my options on whether to upgrade to the much anticipated N96, but have been given conflicting info on whether the n96 has a 3D

  • Using the Composite/Component AV cable for slideshows

    iPad 32G WiFi Hi, I plan to use the Composite or Component AV cable for slideshows in the Photo app. There is a setting (TV Out) for Videos in Settings, I will set it to PAL when I run the slideshows in Asia later this week. Question: Once set, will