No dataset message??

The page that is having a problem is located at :
www.salleboise.com/camps.cfm
I don't see any errors myself, can anyone tell me where the
problem is?????
Thanks!

That did it, thanks....
"kinblas" <[email protected]> wrote in
message
news:f3q2d3$oe3$[email protected]..
> You have a stray '/' in your JS above your dsCamp
constructor:
>
> /
> var dsCamp = new Spry.Data.XMLDataSet("events.xml",
"camps/camp");
>
> It's causing a syntax error in the browser. Remove it
and should work.
>
> --== Kin ==--
>

Similar Messages

  • Short dump in transfer dataset  help me out

    hi to all experts,
      my requirement is to extract some records from z table.insert some records and download it in a text file and upload into the program and bring the file into application server using open dataset close and transfer dataset .here is my code. its giving a short dump in transfer dataset
    message in short dump is transfer f to fname.
              f cannot be non-char like field
    REPORT  ZB14HAI_DATATRANSFER1                   .
    DATA : IT_emp LIKE TABLE OF ZB14hai_EMP with header line,
           WA_emp LIKE LINE OF IT_emp.
    SELECT * FROM ZB14hai_EMP INTO TABLE IT_emp.
    WA_emp-EMPNO   = '10'.
    WA_emp-EMPNAME   = 'FAHEEM'.
    WA_EMP-EMPSAL  = '34567'.
    WA_EMP-EMPJD   = '19122000'.
    WA_EMP-DEPTNO  = '20'.
    INSERT WA_EMP INTO IT_EMP INDEX  9.
    WA_EMP-EMPNO   = '11'.
    wa_emp-empname   = 'VAHID'.
    WA_EMP-EMPSAL  = '45678'.
    WA_EMP-EMPJD   = '19122000'.
    WA_EMP-DEPTNO  = '20'.
    INSERT WA_EMP INTO IT_EMP INDEX 10.
    WA_EMP-EMPNO   = '12'.
    wa_emp-empname   = 'AHMED'.
    WA_EMP-EMPSAL  = '90000'.
    WA_EMP-EMPJD   = '19122000'.
    WA_EMP-DEPTNO  = '30'.
    INSERT WA_EMP INTO IT_EMP INDEX 11.
    WA_EMP-EMPNO   = '13'.
    wa_emp-empname   = 'SRINIVAS'.
    WA_EMP-EMPSAL  = '45678'.
    WA_EMP-EMPJD   = '19122000'.
    WA_EMP-DEPTNO  = '30'.
    INSERT WA_EMP INTO IT_EMP INDEX 12.
    WA_EMP-EMPNO   = '14'.
    wa_emp-empname   = 'KRISHNA'.
    WA_EMP-EMPSAL  = '432123'.
    WA_EMP-EMPJD   = '19122000'.
    WA_EMP-DEPTNO  = '40'.
    INSERT WA_EMP INTO IT_EMP INDEX 13.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                  =
         FILENAME                      = 'C:\FAHEEM\EMPLOYEE.TXT'
       FILETYPE                      = 'ASC'
       APPEND                        = ' '
         WRITE_FIELD_SEPARATOR         = 'X'
       HEADER                        = '00'
       TRUNC_TRAILING_BLANKS         = 'X'
       WRITE_LF                      = 'X'
       COL_SELECT                    = 'X'
       COL_SELECT_MASK               = ' '
       DAT_MODE                      = ' '
    IMPORTING
       FILELENGTH                    =
       TABLES
         DATA_TAB                      = IT_EMP
      EXCEPTIONS
        FILE_WRITE_ERROR              = 1
        NO_BATCH                      = 2
        GUI_REFUSE_FILETRANSFER       = 3
        INVALID_TYPE                  = 4
        NO_AUTHORITY                  = 5
        UNKNOWN_ERROR                 = 6
        HEADER_NOT_ALLOWED            = 7
        SEPARATOR_NOT_ALLOWED         = 8
        FILESIZE_NOT_ALLOWED          = 9
        HEADER_TOO_LONG               = 10
        DP_ERROR_CREATE               = 11
        DP_ERROR_SEND                 = 12
        DP_ERROR_WRITE                = 13
        UNKNOWN_DP_ERROR              = 14
        ACCESS_DENIED                 = 15
        DP_OUT_OF_MEMORY              = 16
        DISK_FULL                     = 17
        DP_TIMEOUT                    = 18
        FILE_NOT_FOUND                = 19
        DATAPROVIDER_EXCEPTION        = 20
        CONTROL_FLUSH_ERROR           = 21
        OTHERS                        = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    message i000(zhnc) with 'downloaded successful'.
    ENDIF.
    clear it_emp.
    clear wa_emp.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = 'C:\FAHEEM\EMPLOYEE.TXT'
       FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
       HEADER_LENGTH                 = 0
         READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
    IMPORTING
       FILELENGTH                    =
       HEADER                        =
       TABLES
         DATA_TAB                      = IT_EMP
      EXCEPTIONS
        FILE_OPEN_ERROR               = 1
        FILE_READ_ERROR               = 2
        NO_BATCH                      = 3
        GUI_REFUSE_FILETRANSFER       = 4
        INVALID_TYPE                  = 5
        NO_AUTHORITY                  = 6
        UNKNOWN_ERROR                 = 7
        BAD_DATA_FORMAT               = 8
        HEADER_NOT_ALLOWED            = 9
        SEPARATOR_NOT_ALLOWED         = 10
        HEADER_TOO_LONG               = 11
        UNKNOWN_DP_ERROR              = 12
        ACCESS_DENIED                 = 13
        DP_OUT_OF_MEMORY              = 14
        DISK_FULL                     = 15
        DP_TIMEOUT                    = 16
        OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    MESSAGE I000(ZHNC) WITH 'UPLOAD SUCCESSFUL'.
    ENDIF.
    DATA : FNAME(90) VALUE 'j:/ hai.txt'.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT .
    IF SY-SUBRC = 0.
      WRITE : / 'FILE OPENED  FOR OUT PUT'.
    ELSE.
      WRITE : /'FILE NOT OPENED'.
    ENDIF.
    LOOP AT IT_emp into wa_emp.
      TRANSFER it_emp TO FNAME.
    ENDLOOP.
    CLOSE DATASET FNAME.
    IF SY-SUBRC = 0.
      WRITE : / 'FILE CLOSED'.
    ELSE.
      WRITE : /'FILE NOT CLOSED'.
    ENDIF.

    Hi,
    to open a data set, you need to have the path for the application server file, to see the application server files. goto AL11 transaction code, there you will find the directories then inside it you will find sub directories then you will find the file names, there you need to open the file using the open datasets ..
    you have written DATA : FNAME(90) VALUE 'j:/ hai.txt'. , but this is not a application server file name, just goto AL11 then you will find the file names and give the correct path
    Regards
    Sudheer

  • Download PDF File from Archiv to SAP Application Server

    Hi,
    I need to download the PDF file from an NAST-Dataset (how is stored from the message via SAP ArchivLink) to the SAP Application Server.
    1) At first i read the Archiv-Link data via function module WFMC_GET_ARCHIVE_OBJECT_TYPE
    2) Then i get the Connection-Infos via function module ARCHIV_GET_CONNECTIONS_INT
    3) Now i read the file from archiv as table via function module ARCHIVOBJECT_GET_BYTES
    4) Save to the SAP Appl.Server via:
       - OPEN DATASET ld_dpfad FOR OUTPUT IN BINARY MODE
       - LOOP and TRANSFER lf_archivobject TO ld_dpfad.
       - CLOSE DATASET ld_dpfad.
    In the dialog of NAST-Dataset (Messages) i can open the PDF-File without any errors (display originals). But after the filetransfer to the SAP Appl.Server i get the following errors during the file opening dialog from Adobe Acrobat Reader:
    - the embedded font u201CArialu201D cant to be extract
    - not enough data for the picture
    The reader can display the PDF-File but only without the picture (Logo) and with alternative font.
    The same transfer from archiv and sending as an attachement to the BOR-Object via function module SO_DOCUMENT_INSERT_API1 works very fine and without any errors.
    Can any one please help me to solve this Issue?
    Thanks in Advance,
    Thomas

    Hello Keith,
    Many thanks for your answer.
    In the past i didnu2019t need the BINARCHIVOBJECT-Parameter and so i overlook this option.
    Now, the File looks a little bit different, but only in the STREAM-section.
    During the Fileopen-Dialog i get only one message now - "not enough data for image" and the image will not displayed. The rest seems to be correct.
    The relevant coding is now:
      ld_doc_typ = pf_connections-reserve.
      CALL FUNCTION 'ARCHIVOBJECT_GET_BYTES'
        EXPORTING
          archiv_id                = pf_connections-archiv_id
          archiv_doc_id            = pf_connections-arc_doc_id
          document_type            = ld_doc_typ
          length                   = ld_length1
          offset                   = ld_offset
        IMPORTING
          binlength                = ld_length                        
          offset                   = ld_offset
        TABLES
          binarchivobject          = lt_binarchivobj                  
        EXCEPTIONS
          error_archiv             = 1
          error_communicationtable = 2
          error_kernel             = 3
          OTHERS                   = 4.
    Zieldatei zum Schreiben öffnen
        OPEN DATASET ld_dpfad FOR OUTPUT IN BINARY MODE.
    Inhalte in Zieldatei schreiben
      LOOP AT lt_binarchivobj INTO lf_binarchivobj.
        TRANSFER lf_binarchivobj TO ld_dpfad NO END OF LINE.          
      ENDLOOP.
    Zieldatei schließen
      CLOSE DATASET ld_dpfad.
    Where is the error for the image data?
    Ciao Thomas
    Push up by: Thomas Engler on May 3, 2010 4:54 PM

  • Using Schema-defined Types to represent an XML Document in WSDL??

    I've read through a few documents on the web about creating web service methods that take XML as a parameter. Currently our web service defines that XML as a string type.
    However, I've been working on trying to define them as Schema types so that my Java or .Net service will create objects for the various XML types. I've run my WSDL through .Net and it seems to generate my DataSet, Record, and Field types just fine. However, I can't get wscompile to generate the interface and objects in the same way. Currently it creates the method that takes a SOAPElement type. Not an object of type DataSet. Below is the interface I'm seeing generated:
    // This class was generated by the JAXRPC SI, do not edit.
    // Contents subject to change without notice.
    // JAX-RPC Standard Implementation (1.1.2_01, build R40)
    // Generated source version: 1.1.2
    package com.webservice.client.java;
    public interface IQServiceIF extends java.rmi.Remote {
    public com.webservice.client.java.RunTransactionDataflowWithXmlDataResponse runTransactionDataflowWithXmlData(javax.xml.soap.SOAPElement parameters) throws
    java.rmi.RemoteException;
    The following is my Ant task for wscompile:
    <target name="generate-client-stubs" description="Generate Client-Side Stubs" unless="build_web_service_stubs">
    <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"/>
    <wscompile
    gen="true"
    base="build/classes"
    classpath="src"
    verbose="true"
    features="wsi"
    config="config/config.xml"
    sourceBase="build/src">
    </wscompile>
    </target>
    Below is the WSDL file I've created. I'm using the WSDL-To-Java methodology to create this service.
    I've been struggling with tihs for some time now and can't seem to get it to work. I'm not seeing anything different than what I'm seeing in your sample articles at this point.
    Thanks much!
    Ryan
    <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://test.com/wsdl" xmlns:ns2="http://test.com/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="IQService" targetNamespace="http://test.com/wsdl">
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://firstlogic.com/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://test.com/types">
    <complexType name="FieldType" mixed="true">
              <attribute name="name" type="string" use="required"/>
    </complexType>
    <complexType name="RecordType" mixed="true">
              <sequence maxOccurs="unbounded">
                   <element name="Field" type="tns:FieldType"/>
              </sequence>
         </complexType>
    <complexType name="DataSetType">
              <sequence maxOccurs="unbounded">
                   <element name="Record" type="tns:RecordType"/>
              </sequence>
    </complexType>
    <complexType name="runTransactionDataflowWithXmlDataResponse">
    <sequence>
    <element name="runTransactionDataflowWithXmlDataResult" type="string" nillable="true"/></sequence></complexType>
    <element name="DataSet" type="tns:DataSetType"/>
    <element name="runTransactionDataflowWithXmlDataResponse" type="tns:runTransactionDataflowWithXmlDataResponse"/>
    </schema></types>
    <message name="IQServiceIF_runTransactionDataflowWithXmlData">
    <part name="parameters" element="ns2:DataSet"/></message>
    <message name="IQServiceIF_runTransactionDataflowWithXmlDataResponse">
    <part name="result" element="ns2:runTransactionDataflowWithXmlDataResponse"/></message>
    <portType name="IQServiceIF">
    <operation name="runTransactionDataflowWithXmlData">
    <input message="tns:IQServiceIF_runTransactionDataflowWithXmlData"/>
    <output message="tns:IQServiceIF_runTransactionDataflowWithXmlDataResponse"/></operation>
    </portType>
    <binding name="IQServiceIFBinding" type="tns:IQServiceIF">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="runTransactionDataflowWithXmlData">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/></input>
    <output>
    <soap:body use="literal"/></output></operation>
    </binding>
    <service name="IQService">
    <port name="IQServiceIFPort" binding="tns:IQServiceIFBinding">
    <soap:address location="http://localhost:8085/IQService/IQService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/></port></service></definitions>

    i assume by the lack of response this cannot be done then :(

  • Adding new segment in IDOC

    Hi,
           i have a requirement where based on a condition i need to add a new segment dynamically in Inbound IDOC.
    I have written the code in the user exit of the inbound FM. Its adding new segments and process it perfectly.
    But when i see the IDOC in we02 or we19, i am not able to see the newly added segment.
    Will the newly added segment in FM appear in the We02?
    PS: i have changed the idoc_control-maxsegnum.
    Regards,
    Niyaz

    Hi Niyaz,
    Check out the below program ....Similar to your requirement
    IDoc creation from inbound file
    REPORT ZS7BM000006 message-id ZS7.
    */ Program Name: Creation of DESADV & INVOIC IDocs from file E021
    */ Description : This program reads in external file E021 containing
    *                shipping and invoice data from internal vendors and
    *                creates one DESADV and one INVOIC IDoc per invoice.
    */ Transaction : n/a - run from job Z_ccc_S7B_Annnnn, where
    *                'ccc' = 3-digit client and 'nnnnn' = zero-filled
    *                sequence number matching the scheduled job for E020.
    tables:  lfa1,
             lfm1,
             ekpo,
             eine,
             e1edk01,
             e1edk02,
             e1edk07,
             e1edk08,
             e1edk06,
             e1edk03,
             e1edka1,
             e1edka2,
             e1edp07,
             e1edp09,
             e1edp19,
             e1edp01,
             e1edp02,
             e1edp26,
             e1edp04,
             e1eds01,
             e1eds02,
             zst7f_ty_vendors.
    parameters:  p_path like PATH-PATHEXTERN
                       default '/ftp/atac/in/'.
    data:  INFILE LIKE PATH-PATHEXTERN,
           back_path(7) type c value 'backup/',
           offset like sy-fdpos,
           p07_ctr like sy-index,
           invoice_total type p decimals 3,
           d_seg_num like sy-index,
           i_seg_num like sy-index.
    data:  OUTFILE LIKE PATH-PATHEXTERN,
           today(8)     type c.
    data:  begin of uty_vendors occurs 10,
              lifnr like lfa1-lifnr,
              waers like lfm1-waers,
              name_abbr like zst7f_ty_vendors-name_abbr,
              ship_days like zst7f_ty_vendors-ship_days,
           end of uty_vendors.
    data:  iZSS7B21 like ZSS7B21.
    data:  desadvdata like edi_dd occurs 5 with header line.
    data:  invoicdata like edi_dd occurs 5 with header line.
    data:  dedidc like edi_dc occurs 1 with header line.
    data:  iedidc like edi_dc occurs 1 with header line.
    data:  begin of ie021 occurs 10,
            lifnr            like lfa1-lifnr,
            ship_days        like zst7f_ty_vendors-ship_days,
            invoice_no       like e1edk08-vbeln,
            stat             like e1edk01-action,
            po_number(10)    type n,
            po_lineno(5)     type n,
            slip_number      like e1edp09-vbeln,
            shipto_id        like e1edka1-partn,
            vendor_id        like e1edka1-partn,
            endcust_name     like e1edka1-name1,
            cust_partno      like e1edp09-kdmat,  "char 35
            vendor_partno    like e1edp09-matnr,  "char 35
            invoice_qty      like e1edp09-lfimg,
            qty_uom          like e1edp01-menee,
            unit_price       like e1edp01-vprei,
            price_uom        like e1edp01-pmene,
            price_qty        like e1edp01-peinh,
            line_amount      like e1edp26-betrg,
            currency         like e1edk01-curcy,
            etd              like e1edk06-datum, "ship date
            eta              like e1edk06-datum, "delivery date
            ship_id          like e1edk08-traid,
            ship_method      like e1edk08-traty,
            create_date      like e1edk03-datum,
            plant            like ekpo-werks,
           end of ie021.
    data: save_po like ie021-po_number,
          save_line like ie021-po_lineno,
          save_stat like ie021-stat,
          save_invoice like ie021-invoice_no.
    constants: hun_thou type p decimals 5 value '100000',
               thou type p decimals 3 value '1000'.
    *&      DEFINITION:  append_idoc_rec
    *       add a data record to the IDoc internal table
    define append_idoc_rec.
    &1-tabnam = &1-segnam.
    &2_seg_num = &2_seg_num + 1.
    &1-segnum = &2_seg_num.
    shift &1-segnum left deleting leading space.
    append &1.
    clear &1.
    end-of-definition.       " append_idoc_rec
    * MAIN PROCESSING LOOP
    START-OF-SELECTION.
    today = sy-datum.
    * find all internal vendors
    select a~lifnr
           b~waers
           c~name_abbr  c~ship_days
       into corresponding fields of table uty_vendors
         from lfa1 as a
              inner join lfm1 as b
                 on a~lifnr = b~lifnr
              inner join zst7f_ty_vendors as c
                 on a~lifnr = c~lifnr
         where a~ktokk = 'ZZTY' and
               b~ekorg = '7100' and
               c~ship_code = ' '.
    perform init_desadv.
    perform init_invoic.
    concatenate 'SAP' sy-sysid(3) into: iedidc-sndpor, dedidc-sndpor.
    loop at uty_vendors.
      clear ie021. refresh ie021.
      if not uty_vendors-name_abbr is initial.
    * datafiles are received with naming convention:
    * E020_<customer name abbreviation>_UTY
        concatenate p_path 'E021_' uty_vendors-name_abbr '_UTY'
            into infile.
        if not sy-subrc is initial.  "pathname too long
    * Filename too long: &
          message i016 with infile.
          continue.
        endif.
        condense infile.
        OPEN DATASET INFILE FOR INPUT IN TEXT MODE.
        if not sy-subrc is initial.
    *'Cannot open dataset & on &'
          message i013 with infile sy-datum.
          continue.
        else.
          concatenate p_path back_path 'E021_'
              uty_vendors-name_abbr '_UTY' today
                    into outfile.
          if not sy-subrc is initial.  "pathname too long
    * Filename too long: &
            message i016 with outfile.
            continue.
          endif.
          condense outfile.
          OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE.
    * if the datestamped file cannot be created, do not process the
    * input file, because the input file is deleted after processing,
    * and there would be no record of the data.
          if not sy-subrc is initial.
    *'ERROR opening file & for output'
            close dataset infile.
            message i033 with outfile.
            continue.  "process next vendor's file
          endif.
          do.
            read dataset infile into izss7b21.
            case sy-subrc.
              when 0.
                transfer izss7b21 to outfile.
                if izss7b21-datacode = 'T'. "trailer rec
                  perform process_one_vendor using infile.
                  exit.  "process next vendor's file
                endif.
                check: izss7b21-datacode = 'A'. "data rec
                case izss7b21-status.
                  when ' '.  "new
                    ie021-stat = '000'.
                  when 'M'.  "modification
                    ie021-stat = '002'.
                  when 'D'.  "deletion
                    ie021-stat = '003'.
                endcase.
                move-corresponding uty_vendors to ie021.
                move-corresponding izss7b21 to ie021.
                perform convert_po_no using izss7b21-pono_poline
                                   changing ie021-po_number
                                            ie021-po_lineno.
                perform convert_dates using ie021-lifnr
                                            izss7b21-etd
                                            izss7b21-eta
                                            izss7b21-ship_method
                                            izss7b21-create_date
                                   changing ie021-eta
                                            ie021-ship_days.
                perform quantity_conversion
                                    using izss7b21-qty_uom
                                          izss7b21-invoice_qty
                                          izss7b21-unit_price
                                    changing ie021-qty_uom
                                             ie021-invoice_qty
                                          izss7b21-line_amount.
                perform money_conversion
                                    using izss7b21-currency
                                          izss7b21-unit_price
                                          izss7b21-price_uom
                                          izss7b21-line_amount
                                    changing ie021-currency
                                             ie021-price_uom
                                             ie021-price_qty
                                             ie021-unit_price
                                             ie021-line_amount.
                perform SAP_vendor_partno
                                    changing ie021-cust_partno.
                append ie021.
              when 4.  "EOF
                perform process_one_vendor using infile.
                exit.  "process next vendor's file
              when others.
    *ERROR reading dataset & - &
                message i015 with infile sy-datum.
                exit.
            endcase.
          enddo.
          close dataset: infile, outfile.
          delete dataset infile.
        endif.
      endif.
    endloop. "UTY_VENDORS
    *&      Form  process_one_vendor
    *       Pre-processed records from one vendor file are now in the
    *       internal table ie021 - ready to create IDocs
    FORM process_one_vendor using value(infile).
      sort ie021 by invoice_no stat po_number po_lineno.
      loop at ie021.
        if ( ie021-invoice_no <> save_invoice or
             ie021-stat <> save_stat ).
          if sy-tabix > 1.
            perform post_idocs using ie021-stat.
          endif.
          perform idoc_header_segs using ie021-stat.
        endif.
        if ( ie021-stat <> save_stat or
             ie021-po_number <> save_po or
             ie021-po_lineno <> save_line or
             ie021-invoice_no <> save_invoice ).
          if ( sy-tabix > 1 and
               ie021-stat = '000' ).
            perform idoc_poheader_segs.
          endif.
        endif.
        perform idoc_item_segs using ie021-stat.
        save_po = ie021-po_number.
        save_line = ie021-po_lineno.
        save_invoice = ie021-invoice_no.
        save_stat = ie021-stat.
      endloop.
      perform post_idocs using ie021-stat.
    * File successfully processed: &
      message s035 with infile.
    ENDFORM.                    " process_one_vendor
    *&      Form  convert_po_no
    *       Break the PO number & line field into separate fields
    FORM convert_po_no using value(infield)
                       changing po_number like ie021-po_number
                                po_line like ie021-po_lineno.
    data:  cpos like sy-fdpos,
           lpos like sy-fdpos,
           cline(6) type c.
    * if the infield contains a hyphen, assume that the preceding characters
    * represent the po number, if they are numeric. The po line number is
    * assumed to be all numeric characters after the hyphen.
      if infield ca '-'.
        if infield(sy-fdpos) co ' 0123456789'.  "numeric
          po_number = infield(sy-fdpos).
          cpos = sy-fdpos + 1.
        endif.
      else.  "no hyphen - PTY
        if infield(2) = '71'.  "SAP number range
          cpos = 10.
        else.                  "SyteLine number
          cpos = 6.
        endif.
        if infield(cpos) co ' 0123456789'.  "numeric
          po_number = infield(cpos).
        endif.
      endif.
      if not po_number is initial.
        while infield+cpos(1) co '0123456789'.
          cline+lpos(1) = infield+cpos(1).
          lpos = lpos + 1.
          cpos = cpos + 1.
        endwhile.
        shift cline left deleting leading '0'.
        if not cline is initial.
          po_line = cline.
        endif.
      endif.
    * Put out a warning in the job log, but create the IDoc to save the data
      if ( po_number is initial or
           po_line is initial ).
    * PO number - line item conversion failed: &
        message i034 with infield.
      endif.
    ENDFORM.                    " convert_po_no
    *&      Form  convert_dates
    *       Convert ship date to delivery date, if necessary
    FORM convert_dates using value(vendor_no)
                             value(i_ship_date)
                             value(i_delivery_date)
                             value(i_ship_code)
                             value(i_create_date)
                    changing o_delivery_date
                             ship_days.
    data:  ship_date type d.
    * if delivery date not sent, calculate it from ship date plus
    * ship days.
    * Note that this logic could leave delivery date blank,
    * if ship date is not numeric.
      if ( i_delivery_date is initial or
           i_delivery_date co ' 0' ).  "no delivery date sent
        if ( i_ship_date co ' 0123456789' and
             i_ship_date cn ' 0' ).    "ship date sent
    * move the ship date into a date field to add days
          ship_date = i_ship_date.
        elseif ( i_create_date co ' 0123456789' and
                 i_create_date cn ' 0' ).
          ship_date = i_create_date.
        endif.
        if not i_ship_code is initial.
          select single ship_days from zst7f_ty_vendors
                   into ship_days
                  where lifnr = vendor_no
                    and ship_code = i_ship_code.
        endif.
        if not ship_date is initial.
          if ship_days > 0.
            ship_date = ship_date + ship_days.
            o_delivery_date = ship_date.
            shift o_delivery_date left deleting leading ' '.
          endif.
        endif.
      else.  "delivery date sent
        o_delivery_date = i_delivery_date.
      endif.
    ENDFORM.                    " convert_dates
    *&      Form  quantity_conversion
    *       The quantities in the input file are implied 3-decimal,
    *       so need to be converted into a "real" number.
    *       Also, the unit of measure may be 'KP' indicating that the qty
    *       is given in thousands.
    FORM quantity_conversion USING    value(i_UOM)
                                      value(i_invoice_qty)
                                      value(i_unit_price)
                        CHANGING o_uom like iE021-qty_UOM
                                 o_invoice_qty like IE021-INVOICE_QTY
                                 c_LINE_AMOUNT like izss7b21-line_amount.
    data:  f_invoice_qty type f.
    data:  n_invoice_qty like lips-kcmeng.
    data:  f_unit_price type f.
    data:  f_line_amt type f.
    data:  n_line_amt0 type p decimals 0.
      if ( i_invoice_qty co ' 0123456789' and
           i_invoice_qty cn ' 0' ).
        f_invoice_qty = i_invoice_qty.
    * if no extended price is sent, calculate it
        if c_line_amount is initial.
    * the qty is implied 3-dec, the price is still implied
    * 5-dec, and line amount should be implied 3-dec.
          f_unit_price = i_unit_price.
          f_line_amt = ( f_invoice_qty * f_unit_price ) / 100000.
          n_line_amt0 = f_line_amt.
          c_line_amount = n_line_amt0.
          shift c_line_amount left deleting leading space.
        endif.
    * if the invoice qty is per 1000, the implied 3-dec times 1000 equals
    * the unconverted value. Otherwise, divide by 1000 to get the PCE qty
        if i_uom = 'KP'.
          n_invoice_qty = f_invoice_qty.
        else.
          n_invoice_qty = f_invoice_qty / thou.
        endif.
      endif.
      o_uom = 'PCE'.
      if not n_invoice_qty is initial.
        o_invoice_qty = n_invoice_qty.
        shift o_invoice_qty left deleting leading space.
      else.
        clear o_invoice_qty.
      endif.
    ENDFORM.                    " quantity_conversion
    *&      Form  money_conversion
    *       Add the implied decimals and store price-per qty, if
    *       price per 1,000 is sent.
    FORM money_conversion USING    value(I_CURR)
                                   value(i_UNIT_PRICE)
                                   value(i_UOM)
                                   value(i_LINE_AMOUNT)
                          CHANGING o_CURRENCY like ie021-currency
                                   o_PRICE_UOM like ie021-price_uom
                                   o_PRICE_QTY like ie021-price_qty
                                   o_UNIT_PRICE like ie021-unit_price
                                   o_LINE_AMOUNT like ie021-line_amount.
    data:  n_unit_price type p decimals 5,
           n_line_amount type p decimals 3.
    * not all of the vendors send the currency code, so use the vendor
    * master default
      case i_curr(2).
        when 'US'.
          o_currency = 'USD'.
        when 'JP'.
          o_currency = 'JPY'.
        when others.
          o_currency = uty_vendors-waers.
      endcase.
    * unit price is implied 5-dec
      if ( i_unit_price cn ' 0' and
           i_unit_price co ' 0123456789' ).
        n_unit_price = i_unit_price.
        n_unit_price = n_unit_price / hun_thou.
      endif.
    * line price is implied 3-dec
      if ( i_line_amount co ' 0123456789' and
           i_line_amount cn ' 0' ).
        n_line_amount = i_line_amount.
        n_line_amount = n_line_amount / thou.
      endif.
    * 'KP' = price per thousand
      if i_uom = 'KP'.
        o_price_qty = '1000'.
      else.
        o_price_qty = '1'.
      endif.
      o_price_uom = 'PCE'.
      if not n_unit_price is initial.
        o_unit_price = n_unit_price.
        shift o_unit_price left deleting leading space.
      else.
        clear o_unit_price.
      endif.
      if not n_line_amount is initial.
        o_line_amount = n_line_amount.
        shift o_line_amount left deleting leading space.
      else.
        clear o_line_amount.
      endif.
    ENDFORM.                    " money_conversion
    *&      Form  SAP_vendor_partno
    *       replace UTY part number sent by vendor with SAP material no.
    *       from PO line item.
    FORM SAP_vendor_partno changing cust_partno like ie021-cust_partno.
    tables: makt.
    data: partno_sent like makt-maktx.
      partno_sent = cust_partno.
      clear: makt, cust_partno.
      select single matnr from ekpo into cust_partno
             where ebeln = ie021-po_number and
                   ebelp = ie021-po_lineno.
      if sy-subrc is initial.
    *compare material description to part number sent by vendor
        select single maktx from makt into makt-maktx
            where matnr = cust_partno.
        if partno_sent <> makt-maktx.
    * 'Part No. Mismatch: PO & - &, Part sent &, SAP mat.no. &'
          message i031 with ie021-po_number ie021-po_lineno
                            partno_sent makt-maktx.
        endif.
      else.  "PO line not found
    *try to find SAP material number using 20-char catalog no. sent
        select single matnr from makt into cust_partno
            where maktx = partno_sent.
        if not sy-subrc is initial.
    * 'SAP material no. not found for & - PO & - &'
          message i032 with partno_sent ie021-po_number ie021-po_lineno.
        endif.
      endif.
    *if not found, IDoc will go to workflow for missing material no.
    ENDFORM.                    " SAP_vendor_partno
    *&      Form  idoc_header_segs
    *       create internal table entries for header segments.
    *  DESADV:
    *          E1EDK07
    *          E1EDKA1
    *          E1EDK03
    *          E1EDK08
    *          E1EDKA2
    *          E1EDK06
    *  INVOIC:
    *          E1EDK01
    *          E1EDKA1(s)
    *          E1EDK02
    *          E1EDK03(s)
    FORM idoc_header_segs using value(desadv_ok).
    * INVOIC
      clear i_seg_num.
      invoicdata-segnam = 'E1EDK01'.
      e1edk01-action = ie021-stat.
      if ie021-currency(2) = 'US'.
        e1edk01-curcy = 'USD'.
      else.
        e1edk01-curcy = 'JPY'.
      endif.
      invoicdata-sdata = e1edk01.
      append_idoc_rec invoicdata i.
      clear e1edka1.
      invoicdata-segnam = 'E1EDKA1'.
      e1edka1-parvw = 'RE'.
      e1edka1-partn = ie021-shipto_id.
      invoicdata-sdata = e1edka1.
      append_idoc_rec invoicdata i.
      clear e1edka1.
      invoicdata-segnam = 'E1EDKA1'.
      e1edka1-parvw = 'LF'.
      e1edka1-partn = ie021-lifnr.
      e1edka1-lifnr = ie021-shipto_id.
      invoicdata-sdata = e1edka1.
      append_idoc_rec invoicdata i.
      if not ie021-endcust_name is initial.
        clear e1edka1.
        invoicdata-segnam = 'E1EDKA1'.
        e1edka1-parvw = 'WE'.
        e1edka1-name1 = ie021-endcust_name.
        invoicdata-sdata = e1edka1.
        append_idoc_rec invoicdata i.
      endif.
      clear e1edk02.
      invoicdata-segnam = 'E1EDK02'.
      e1edk02-qualf = '009'.
      e1edk02-belnr = ie021-invoice_no.
      invoicdata-sdata = e1edk02.
      append_idoc_rec invoicdata i.
      clear e1edk03.
      invoicdata-segnam = 'E1EDK03'.
      e1edk03-iddat = '012'.
      e1edk03-datum = ie021-create_date.
      invoicdata-sdata = e1edk03.
      append_idoc_rec invoicdata i.
      invoicdata-segnam = 'E1EDK03'.
      e1edk03-iddat = '024'.
      invoicdata-sdata = e1edk03.
      append_idoc_rec invoicdata i.
      check desadv_ok = '000'.
    * DESADV
      clear d_seg_num.
      desadvdata-segnam = 'E1EDK07'.
      e1edk07-action = ie021-stat.
      e1edk07-bolnr = ie021-invoice_no.
      desadvdata-sdata = e1edk07.
      append_idoc_rec desadvdata d.
      clear e1edka1.
      desadvdata-segnam = 'E1EDKA1'.
      desadvdata-sdata = e1edka1.
      append_idoc_rec desadvdata d.
      clear e1edk03.
      desadvdata-segnam = 'E1EDK03'.
      desadvdata-sdata = e1edk03.
      append_idoc_rec desadvdata d.
      clear e1edk08.
      desadvdata-segnam = 'E1EDK08'.
      e1edk08-vbeln = ie021-invoice_no.
      e1edk08-traid = ie021-ship_id.
      e1edk08-traty = ie021-ship_method.
      desadvdata-sdata = e1edk08.
      append_idoc_rec desadvdata d.
      clear e1edka2.
      desadvdata-segnam = 'E1EDKA2'.
      desadvdata-sdata = e1edka2.
      append_idoc_rec desadvdata d.
      clear e1edk06.
      desadvdata-segnam = 'E1EDK06'.
      e1edk06-iddat = '025'.  "document date
      e1edk06-datum = ie021-create_date.
      desadvdata-sdata = e1edk06.
      append_idoc_rec desadvdata d.
      if not ie021-eta is initial.
        clear e1edk06.
        desadvdata-segnam = 'E1EDK06'.
        e1edk06-iddat = '001'.  "delivery date
        e1edk06-datum = ie021-eta.
        desadvdata-sdata = e1edk06.
        append_idoc_rec desadvdata d.
      endif.
      if not ie021-etd is initial.
        clear e1edk06.
        desadvdata-segnam = 'E1EDK06'.
        e1edk06-iddat = '010'.  "ship date
        e1edk06-datum = ie021-etd.
        desadvdata-sdata = e1edk06.
        append_idoc_rec desadvdata d.
      endif.
    ENDFORM.                    " idoc_header_segs
    *&      Form  idoc_poheader_segs
    *       create internal table entries for DESADV PO/item segments
    *          E1EDP07
    FORM idoc_poheader_segs.
    *DESADV
      clear e1edp07.
      desadvdata-segnam = 'E1EDP07'.
      e1edp07-bstnk = ie021-po_number.
      e1edp07-posex = ie021-po_lineno.
      desadvdata-sdata = e1edp07.
      append_idoc_rec desadvdata d.
      p07_ctr = p07_ctr + 1.
    ENDFORM.                    " idoc_poheader_segs
    *&      Form  idoc_item_segs
    *       create internal table entries for PO item segments:
    *          DESADV:   E1EDP09
    *          INVOIC:   E1EDP01        Qtys
    *                    E1EDP02        ref nos. (PO number / line)
    *                    E1EDP19        part numbers
    *                    E1EDP26        amounts
    *                    E1EDP04        taxes
    FORM idoc_item_segs using value(desadv_ok).
    data:  n_line_amt  type p decimals 3.
    *INVOIC
      clear e1edp01.
      invoicdata-segnam = 'E1EDP01'.
      e1edp01-menee = ie021-qty_uom.
      e1edp01-menge = ie021-invoice_qty.
      e1edp01-vprei = ie021-unit_price.
      e1edp01-pmene = ie021-price_uom.
      e1edp01-peinh = ie021-price_qty.
      e1edp01-netwr = ie021-line_amount.
      invoicdata-sdata = e1edp01.
      append_idoc_rec invoicdata i.
      clear e1edp02.
      invoicdata-segnam = 'E1EDP02'.
      e1edp02-qualf = '001'.
      e1edp02-belnr = ie021-po_number.
      e1edp02-zeile = ie021-po_lineno.
      invoicdata-sdata = e1edp02.
      append_idoc_rec invoicdata i.
      clear e1edp19.
      invoicdata-segnam = 'E1EDP19'.
      e1edp19-qualf = '001'.
      e1edp19-idtnr = ie021-cust_partno.
      invoicdata-sdata = e1edp19.
      append_idoc_rec invoicdata i.
      clear e1edp19.
      invoicdata-segnam = 'E1EDP19'.
      e1edp19-qualf = '002'.
      e1edp19-idtnr = ie021-vendor_partno.
      invoicdata-sdata = e1edp19.
      append_idoc_rec invoicdata i.
      clear e1edp26.
      invoicdata-segnam = 'E1EDP26'.
      e1edp26-qualf = '003'.
      e1edp26-betrg = ie021-line_amount.
      invoicdata-sdata = e1edp26.
      append_idoc_rec invoicdata i.
    * dummy tax seg
      clear e1edp04.
      invoicdata-segnam = 'E1EDP04'.
      e1edp04-msatz = '0.00'.
      invoicdata-sdata = e1edp04.
      append_idoc_rec invoicdata i.
      n_line_amt = ie021-line_amount.
      invoice_total = invoice_total + n_line_amt.
      check desadv_ok = '000'.
    *DESADV
      clear e1edp09.
      desadvdata-segnam = 'E1EDP09'.
      e1edp09-vbeln = ie021-slip_number.
      e1edp09-matnr = ie021-vendor_partno.
      e1edp09-vrkme = ie021-qty_uom.
      e1edp09-lfimg = ie021-invoice_qty.
      desadvdata-sdata = e1edp09.
      append_idoc_rec desadvdata d.
    ENDFORM.                    " idoc_item_segs
    *&    Form  post_idocs
    *     create database IDocs from the idocdata tables and clear tables.
    FORM post_idocs using value(desadv_ok).
    *INVOIC
      clear e1eds01.
      invoicdata-segnam = 'E1EDS01'.
      e1eds01-sumid = '010'.
      e1eds01-summe = invoice_total.
      e1eds01-waerq = ie021-currency.
      shift e1eds01-summe left deleting leading space.
      invoicdata-sdata = e1eds01.
      append_idoc_rec invoicdata i.
      CALL FUNCTION 'INBOUND_IDOC_PROCESS'
        TABLES
          IDOC_CONTROL       =  iedidc
          IDOC_DATA          =  invoicdata.
      commit work.
    *DESADV
      if desadv_ok = '000'.
        clear e1eds02.
        desadvdata-segnam = 'E1EDS02'.
        e1eds02-sumid = '001'.
        e1eds02-summe = p07_ctr.
        shift e1eds02-summe left deleting leading space.
        desadvdata-sdata = e1eds02.
        append_idoc_rec desadvdata d.
        CALL FUNCTION 'INBOUND_IDOC_PROCESS'
          TABLES
            IDOC_CONTROL       =  dedidc
            IDOC_DATA          =  desadvdata.
        commit work.
      endif.
      refresh: desadvdata,
               invoicdata.
      clear:
        desadvdata,
        invoicdata,
        p07_ctr,
        invoice_total,
        save_stat,
        save_po,
        save_line,
        save_invoice.
    ENDFORM.                    " post_idocs
    *&      Form  init_desadv
    *       add a DESDAV control record and initialize fields
    FORM init_desadv.
    clear dedidc. refresh dedidc.
    * initialize control record:
    move:  '2'        to  dedidc-direct,
          'DESADV01'  to  dedidc-doctyp,
          'DESADV'    to  dedidc-mestyp,
          'F'         to  dedidc-std,
          'E021'      to  dedidc-stdmes,
          'LS'        to  dedidc-sndprt,
          'TY_VENDORS' to dedidc-sndprn,
          sy-datlo    to  dedidc-credat,
          sy-timlo    to  dedidc-cretim.
    append dedidc.
    ENDFORM.              " init_desadv
    *&      Form  init_invoic
    *       add a INVOIC control record and initialize fields
    FORM init_invoic.
    clear iedidc. refresh iedidc.
    * initialize control record:
    move:  '2'        to  iedidc-direct,
          'INVOIC01'  to  iedidc-doctyp,
          'INVOIC'    to  iedidc-mestyp,
          'MM'        to  iedidc-mescod,
          'F'         to  iedidc-std,
          'E021'      to  iedidc-stdmes,
          'LS'        to  iedidc-sndprt,
          'TY_VENDORS' to iedidc-sndprn,
          sy-datlo    to  iedidc-credat,
          sy-timlo    to  iedidc-cretim.
    append iedidc.
    ENDFORM.              " init_invoic
    REWARD POINTS IF HELPFUL
    Lakshmiraj.A

  • BDC code for transaction XD01

    Hi all,
    Can anyone of you provide me complete BDC code for Transaction XD01.
    An early reply will be highly appreciated and would be rewarded.
    Regards,
    Neeraj

    Hi Prakash
    hope this code will help you.
    ABAP BDC SAMPLE CODE XD01
    Table/Structure declarations. *
    TABLES : KNA1. "Customer master
    Constants declarations. *
    CONSTANTS : C_MODE VALUE 'A',
    C_UPDATE VALUE 'S',
    C_X VALUE 'X',
    C_SESS TYPE APQI-GROUPID VALUE 'ZCUSTOMER', "Session Name
    C_XD01 LIKE TSTC-TCODE VALUE 'XD01'.
    Variable declarations. *
    DATA : V_FNAME(15) VALUE SPACE, " Name of file to be created
    V_FAILREC TYPE I, " No of failed records
    V_MSG(255), " Message Text
    V_ERRREC TYPE I, " No of failed records
    V_LINES TYPE I, " No of records
    V_BANKS(15), " Table column BANKS
    V_BANKL(15), " Table column BANKL
    V_BANKN(15), " Table column BANKN
    V_TIDX(2) TYPE N. " Table row index
    *-- FLAG DECLARATIONS
    DATA : FG_DATA_EXIST VALUE 'X', " Check for data
    FG_SESSION_OPEN VALUE ' '. " Check for Session Open
    *-- MACRO DEFINITIONS
    *-- Macro for BANKS
    DEFINE BANKS.
    CLEAR V_BANKS.
    CONCATENATE 'KNBK-BANKS(' &1 ')' INTO V_BANKS.
    CONDENSE V_BANKS.
    END-OF-DEFINITION.
    *-- Macro for BANKL
    DEFINE BANKL.
    CLEAR V_BANKL.
    CONCATENATE 'KNBK-BANKL(' &1 ')' INTO V_BANKL.
    CONDENSE V_BANKL.
    END-OF-DEFINITION.
    *-- Macro for BANKN
    DEFINE BANKN.
    CLEAR V_BANKN.
    CONCATENATE 'KNBK-BANKN(' &1 ')' INTO V_BANKN.
    CONDENSE V_BANKN.
    END-OF-DEFINITION.
    Structures / Internal table declarations *
    *-- Structure to hold BDC data
    TYPES : BEGIN OF T_BDCTABLE.
    INCLUDE STRUCTURE BDCDATA.
    TYPES END OF T_BDCTABLE.
    *-- Structure to trap BDC messages
    TYPES : BEGIN OF T_MSG.
    INCLUDE STRUCTURE BDCMSGCOLL.
    TYPES : END OF T_MSG.
    *-- Structure to trap ERROR messages
    TYPES : BEGIN OF T_ERR_MSG,
    MESSAGE(255),
    END OF T_ERR_MSG.
    *--Internal table to store flat file data
    DATA : BEGIN OF IT_KNA1 OCCURS 0,
    KUNNR LIKE KNA1-KUNNR,
    KTOKD LIKE T077D-KTOKD,
    NAME1 LIKE KNA1-NAME1,
    SORTL LIKE KNA1-SORTL,
    ORT01 LIKE KNA1-ORT01,
    PSTLZ LIKE KNA1-PSTLZ,
    LAND1 LIKE KNA1-LAND1,
    SPRAS LIKE KNA1-SPRAS,
    LZONE LIKE KNA1-LZONE,
    END OF IT_KNA1.
    *--Internal table to store bank details
    DATA : BEGIN OF IT_BANK OCCURS 0,
    BANKS LIKE KNBK-BANKS,
    BANKL LIKE KNBK-BANKL,
    BANKN LIKE KNBK-BANKN,
    END OF IT_BANK.
    *-- Internal table to hold BDC data
    DATA: IT_BDCDATA TYPE STANDARD TABLE OF T_BDCTABLE WITH HEADER LINE,
    *-- Internal Table to store ALL messages
    IT_MSG TYPE STANDARD TABLE OF T_MSG WITH HEADER LINE,
    *-- Internal Table to store error messages
    IT_ERR_MSG TYPE STANDARD TABLE OF T_ERR_MSG WITH HEADER LINE.
    Selection Screen. *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FLNAME(15) OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R_LIST RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003.
    PARAMETERS : R_SESS RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 30(20) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Event:Initialization *
    INITIALIZATION.
    AT Selection Screen. *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection *
    START-OF-SELECTION.
    V_FNAME = P_FLNAME.
    PERFORM GET_DATA.
    PERFORM GET_BANKDATA.
    PERFORM GENERATE_DATASET.
    Event: End-of-Selection *
    END-OF-SELECTION.
    IF FG_DATA_EXIST = ' '.
    MESSAGE I010 WITH TEXT-009.
    EXIT.
    ENDIF.
    PERFORM GENERATE_BDCDATA.
    PERFORM DISPLAY_ERR_RECS.
    Event: top-of-page
    TOP-OF-PAGE.
    FORM DEFINITIONS *
    *& Form get_data
    Subroutine to get the data from mard
    --> p1 text
    <-- p2 text
    FORM GET_DATA.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'C:\XD01.TXT'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    DATA_TAB = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF IT_KNA1[] IS INITIAL.
    FG_DATA_EXIST = ' '.
    ENDIF.
    ENDFORM. " get_data
    *& Form GENERATE_DATASET
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_DATASET.
    MESSAGE I010 WITH 'OPENING FILE IN APPLICATION SERVER'.
    **--Creating a data set in application server
    OPEN DATASET V_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    **---Transfering data from internal table to dataset
    MESSAGE I010 WITH 'TRANSFERING DATA FROM INETERAL TABLE TO THE FILE'.
    LOOP AT IT_KNA1.
    TRANSFER IT_KNA1 TO V_FNAME.
    ENDLOOP.
    **--Closing the dataset
    MESSAGE I010 WITH 'CLOSING THE FILE'.
    CLOSE DATASET V_FNAME.
    ENDFORM. " GENERATE_DATASET
    *& Form BDC_DYNPRO
    text
    -->P_0467 text
    -->P_0468 text
    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
    text
    -->P_0472 text
    -->P_0473 text
    FORM BDC_FIELD USING FNAM FVAL.
    IF NOT FVAL IS INITIAL.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-FNAM = FNAM.
    IT_BDCDATA-FVAL = FVAL.
    APPEND IT_BDCDATA.
    ENDIF.
    ENDFORM.
    *& Form GENERATE_BDCDATA
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_BDCDATA.
    REFRESH IT_KNA1.
    Opening dataset for reading
    OPEN DATASET V_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    Reading the file from application server
    DO.
    CLEAR: IT_KNA1,IT_BDCDATA.
    REFRESH IT_BDCDATA.
    READ DATASET V_FNAME INTO IT_KNA1.
    IF SY-SUBRC <> 0.
    EXIT.
    ELSE.
    Populate BDC Data for Initial Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0100',
    BDC_FIELD USING 'BDC_CURSOR' 'RF02D-KUNNR',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'RF02D-KUNNR' IT_KNA1-KUNNR,
    BDC_FIELD USING 'RF02D-KTOKD' IT_KNA1-KTOKD.
    Populate BDC Data for Second Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0110',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-NAME1',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'KNA1-NAME1' IT_KNA1-NAME1,
    BDC_FIELD USING 'KNA1-SORTL' IT_KNA1-SORTL,
    BDC_FIELD USING 'KNA1-ORT01' IT_KNA1-ORT01,
    BDC_FIELD USING 'KNA1-PSTLZ' IT_KNA1-PSTLZ,
    BDC_FIELD USING 'KNA1-LAND1' IT_KNA1-LAND1,
    BDC_FIELD USING 'KNA1-SPRAS' IT_KNA1-SPRAS.
    Populate BDC Data for Third Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0120',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-LZONE',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'KNA1-LZONE' IT_KNA1-LZONE.
    Populate BDC Data for Fourth Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0125',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-NIELS',
    BDC_FIELD USING 'BDC_OKCODE' '/00'.
    Populate BDC Data for Table control for bank details.
    V_TIDX = '01'.
    LOOP AT IT_BANK.
    BANKS V_TIDX.
    BANKL V_TIDX.
    BANKN V_TIDX.
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0130',
    BDC_FIELD USING 'BDC_CURSOR' V_BANKN,
    BDC_FIELD USING 'BDC_OKCODE' '=ENTR',
    BDC_FIELD USING V_BANKS IT_BANK-BANKS,
    BDC_FIELD USING V_BANKL IT_BANK-BANKL,
    BDC_FIELD USING V_BANKN IT_BANK-BANKN.
    V_TIDX = V_TIDX + 1.
    ENDLOOP.
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0130',
    BDC_FIELD USING 'BDC_CURSOR' V_BANKS,
    BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.
    CALL TRANSACTION C_XD01 USING IT_BDCDATA
    MODE C_MODE
    UPDATE C_UPDATE
    MESSAGES INTO IT_MSG.
    IF SY-SUBRC <> 0.
    *--In case of error list display
    IF R_LIST = C_X.
    V_ERRREC = V_ERRREC + 1.
    PERFORM FORMAT_MESSAGE.
    IT_ERR_MSG-MESSAGE = V_MSG.
    APPEND IT_ERR_MSG.
    CLEAR : V_MSG,IT_ERR_MSG.
    ENDIF.
    *--In case of session log
    IF R_SESS = C_X.
    *-- In case of transaction fails.
    IF FG_SESSION_OPEN = ' '.
    FG_SESSION_OPEN = C_X.
    PERFORM BDC_OPEN_GROUP.
    ENDIF. " IF FG_SESSION_OPEN = ' '.
    *-- Insert BDC Data..
    PERFORM BDC_INSERT_DATA.
    ENDIF. " IF R_SESS = C_X.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDDO.
    Closing the dataset
    CLOSE DATASET V_FNAME.
    *-- Close the session if opened
    IF FG_SESSION_OPEN = C_X.
    PERFORM BDC_CLOSE_GROUP.
    CALL TRANSACTION 'SM35'.
    ENDIF.
    ENDFORM. " GENERATE_BDCDATA
    *& Form BDC_OPEN_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_OPEN_GROUP.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = C_SESS
    HOLDDATE = FILLER8
    KEEP = C_X
    USER = SY-UNAME
    RECORD = FILLER1
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11
    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. " BDC_OPEN_GROUP
    *& Form BDC_INSERT_DATA
    text
    --> p1 text
    <-- p2 text
    FORM BDC_INSERT_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_XD01
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    TABLES
    DYNPROTAB = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    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. " BDC_INSERT_DATA
    *& Form BDC_CLOSE_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_CLOSE_GROUP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3.
    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. " BDC_CLOSE_GROUP
    *& Form FORMAT_MESSAGE
    text
    --> p1 text
    <-- p2 text
    FORM FORMAT_MESSAGE.
    CLEAR V_LINES.
    DESCRIBE TABLE IT_MSG LINES V_LINES.
    READ TABLE IT_MSG INDEX V_LINES.
    CLEAR V_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = IT_MSG-MSGID
    LANG = IT_MSG-MSGSPRA
    NO = IT_MSG-MSGNR
    V1 = IT_MSG-MSGV1
    V2 = IT_MSG-MSGV2
    V3 = IT_MSG-MSGV3
    V4 = IT_MSG-MSGV4
    IMPORTING
    MSG = V_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " FORMAT_MESSAGE
    *& Form DISPLAY_ERR_RECS
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ERR_RECS.
    LOOP AT IT_ERR_MSG.
    WRITE: / IT_ERR_MSG-MESSAGE.
    ENDLOOP.
    ENDFORM. " DISPLAY_ERR_RECS
    *& Form GET_BANKDATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_BANKDATA.
    IT_BANK-BANKS = 'AD'.
    IT_BANK-BANKL = '1000'.
    IT_BANK-BANKN = 'S.B A/C'.
    APPEND IT_BANK.
    IT_BANK-BANKS = 'AD'.
    IT_BANK-BANKL = 'CITY'.
    IT_BANK-BANKN = 'CURR. A/C'.
    APPEND IT_BANK.
    IT_BANK-BANKS = 'AD'.
    IT_BANK-BANKL = 'H001'.
    IT_BANK-BANKN = 'S.B A/C'.
    APPEND IT_BANK.
    reward if help.

  • Error using clientgen

    I'm having the following error while trying to use the clientgen task in WLS 7.0
    [weblogic.xml.schema.model.XSDValidityException: unable to resolve element ref:
    "xsd:schema"]
    I'hv checked the WSDL and it has the following entry in the header.
    xmlns:xsd="http://www.w3.org/2001/XMLSchema
    Any suggestions ? The wsdl is generated from .net environement and has some type
    mapping information at the top of it (this is where the error seems to be coming).
    thanks
    - John.

    I'm attaching the wsdl file alongwith.
    Thanks for your help.
    - John.
    Also cut and past here.
    <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
         <types>
              <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
                   <s:import namespace="http://www.w3.org/2001/XMLSchema"/>
                   <s:element name="getEvtDetailWithEVTIDdb2call">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailWithEVTIDdb2callResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getEvtDetailWithEVTIDdb2callResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailWithEVTID">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailWithEVTIDResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getEvtDetailWithEVTIDResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailWithMBLPH">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="mblph" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailWithMBLPHResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getEvtDetailWithMBLPHResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetails">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                                  <s:element minOccurs="0" maxOccurs="1" name="mblph" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getEvtDetailsResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getEvtDetailsResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="Testng">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="ds">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="TestngResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="TestngResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getDueDate">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getDueDateResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getDueDateResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getDueTime">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getDueTimeResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getDueTimeResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getResolution">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getResolutionResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getResolutionResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getTicketNumber">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getTicketNumberResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getTicketNumberResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getMultipleTicketNumbers">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="evtid" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getMultipleTicketNumbersResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getMultipleTicketNumbersResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatDate">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="date" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatDateResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="formatDateResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatDueDate">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="date" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatDueDateResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="formatDueDateResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getRemedyComments">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="param" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="getRemedyCommentsResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="getRemedyCommentsResult">
                                       <s:complexType>
                                            <s:sequence>
                                                 <s:element ref="s:schema"/>
                                                 <s:any/>
                                            </s:sequence>
                                       </s:complexType>
                                  </s:element>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatTime">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="time" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="formatTimeResponse">
                        <s:complexType>
                             <s:sequence>
                                  <s:element minOccurs="0" maxOccurs="1" name="formatTimeResult" type="s:string"/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="DataSet" nillable="true">
                        <s:complexType>
                             <s:sequence>
                                  <s:element ref="s:schema"/>
                                  <s:any/>
                             </s:sequence>
                        </s:complexType>
                   </s:element>
                   <s:element name="string" nillable="true" type="s:string"/>
              </s:schema>
         </types>
         <message name="getEvtDetailWithEVTIDdb2callSoapIn">
              <part name="parameters" element="s0:getEvtDetailWithEVTIDdb2call"/>
         </message>
         <message name="getEvtDetailWithEVTIDdb2callSoapOut">
              <part name="parameters" element="s0:getEvtDetailWithEVTIDdb2callResponse"/>
         </message>
         <message name="getEvtDetailWithEVTIDSoapIn">
              <part name="parameters" element="s0:getEvtDetailWithEVTID"/>
         </message>
         <message name="getEvtDetailWithEVTIDSoapOut">
              <part name="parameters" element="s0:getEvtDetailWithEVTIDResponse"/>
         </message>
         <message name="getEvtDetailWithMBLPHSoapIn">
              <part name="parameters" element="s0:getEvtDetailWithMBLPH"/>
         </message>
         <message name="getEvtDetailWithMBLPHSoapOut">
              <part name="parameters" element="s0:getEvtDetailWithMBLPHResponse"/>
         </message>
         <message name="getEvtDetailsSoapIn">
              <part name="parameters" element="s0:getEvtDetails"/>
         </message>
         <message name="getEvtDetailsSoapOut">
              <part name="parameters" element="s0:getEvtDetailsResponse"/>
         </message>
         <message name="TestngSoapIn">
              <part name="parameters" element="s0:Testng"/>
         </message>
         <message name="TestngSoapOut">
              <part name="parameters" element="s0:TestngResponse"/>
         </message>
         <message name="getDueDateSoapIn">
              <part name="parameters" element="s0:getDueDate"/>
         </message>
         <message name="getDueDateSoapOut">
              <part name="parameters" element="s0:getDueDateResponse"/>
         </message>
         <message name="getDueTimeSoapIn">
              <part name="parameters" element="s0:getDueTime"/>
         </message>
         <message name="getDueTimeSoapOut">
              <part name="parameters" element="s0:getDueTimeResponse"/>
         </message>
         <message name="getResolutionSoapIn">
              <part name="parameters" element="s0:getResolution"/>
         </message>
         <message name="getResolutionSoapOut">
              <part name="parameters" element="s0:getResolutionResponse"/>
         </message>
         <message name="getTicketNumberSoapIn">
              <part name="parameters" element="s0:getTicketNumber"/>
         </message>
         <message name="getTicketNumberSoapOut">
              <part name="parameters" element="s0:getTicketNumberResponse"/>
         </message>
         <message name="getMultipleTicketNumbersSoapIn">
              <part name="parameters" element="s0:getMultipleTicketNumbers"/>
         </message>
         <message name="getMultipleTicketNumbersSoapOut">
              <part name="parameters" element="s0:getMultipleTicketNumbersResponse"/>
         </message>
         <message name="formatDateSoapIn">
              <part name="parameters" element="s0:formatDate"/>
         </message>
         <message name="formatDateSoapOut">
              <part name="parameters" element="s0:formatDateResponse"/>
         </message>
         <message name="formatDueDateSoapIn">
              <part name="parameters" element="s0:formatDueDate"/>
         </message>
         <message name="formatDueDateSoapOut">
              <part name="parameters" element="s0:formatDueDateResponse"/>
         </message>
         <message name="getRemedyCommentsSoapIn">
              <part name="parameters" element="s0:getRemedyComments"/>
         </message>
         <message name="getRemedyCommentsSoapOut">
              <part name="parameters" element="s0:getRemedyCommentsResponse"/>
         </message>
         <message name="formatTimeSoapIn">
              <part name="parameters" element="s0:formatTime"/>
         </message>
         <message name="formatTimeSoapOut">
              <part name="parameters" element="s0:formatTimeResponse"/>
         </message>
         <message name="getEvtDetailWithEVTIDdb2callHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getEvtDetailWithEVTIDdb2callHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailWithEVTIDHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getEvtDetailWithEVTIDHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailWithMBLPHHttpGetIn">
              <part name="mblph" type="s:string"/>
         </message>
         <message name="getEvtDetailWithMBLPHHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailsHttpGetIn">
              <part name="evtid" type="s:string"/>
              <part name="mblph" type="s:string"/>
         </message>
         <message name="getEvtDetailsHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getDueDateHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getDueDateHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getDueTimeHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getDueTimeHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getResolutionHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getResolutionHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getTicketNumberHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getTicketNumberHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getMultipleTicketNumbersHttpGetIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getMultipleTicketNumbersHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="formatDateHttpGetIn">
              <part name="date" type="s:string"/>
         </message>
         <message name="formatDateHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="formatDueDateHttpGetIn">
              <part name="date" type="s:string"/>
         </message>
         <message name="formatDueDateHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getRemedyCommentsHttpGetIn">
              <part name="param" type="s:string"/>
         </message>
         <message name="getRemedyCommentsHttpGetOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="formatTimeHttpGetIn">
              <part name="time" type="s:string"/>
         </message>
         <message name="formatTimeHttpGetOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getEvtDetailWithEVTIDdb2callHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getEvtDetailWithEVTIDdb2callHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailWithEVTIDHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getEvtDetailWithEVTIDHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailWithMBLPHHttpPostIn">
              <part name="mblph" type="s:string"/>
         </message>
         <message name="getEvtDetailWithMBLPHHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getEvtDetailsHttpPostIn">
              <part name="evtid" type="s:string"/>
              <part name="mblph" type="s:string"/>
         </message>
         <message name="getEvtDetailsHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="getDueDateHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getDueDateHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getDueTimeHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getDueTimeHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getResolutionHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getResolutionHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getTicketNumberHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getTicketNumberHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getMultipleTicketNumbersHttpPostIn">
              <part name="evtid" type="s:string"/>
         </message>
         <message name="getMultipleTicketNumbersHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="formatDateHttpPostIn">
              <part name="date" type="s:string"/>
         </message>
         <message name="formatDateHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="formatDueDateHttpPostIn">
              <part name="date" type="s:string"/>
         </message>
         <message name="formatDueDateHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <message name="getRemedyCommentsHttpPostIn">
              <part name="param" type="s:string"/>
         </message>
         <message name="getRemedyCommentsHttpPostOut">
              <part name="Body" element="s0:DataSet"/>
         </message>
         <message name="formatTimeHttpPostIn">
              <part name="time" type="s:string"/>
         </message>
         <message name="formatTimeHttpPostOut">
              <part name="Body" element="s0:string"/>
         </message>
         <portType name="OracleGatewaySoap">
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <input message="s0:getEvtDetailWithEVTIDdb2callSoapIn"/>
                   <output message="s0:getEvtDetailWithEVTIDdb2callSoapOut"/>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <input message="s0:getEvtDetailWithEVTIDSoapIn"/>
                   <output message="s0:getEvtDetailWithEVTIDSoapOut"/>
              </operation>
              <operation name="getEvtDetailWithMBLPH">
                   <input message="s0:getEvtDetailWithMBLPHSoapIn"/>
                   <output message="s0:getEvtDetailWithMBLPHSoapOut"/>
              </operation>
              <operation name="getEvtDetails">
                   <input message="s0:getEvtDetailsSoapIn"/>
                   <output message="s0:getEvtDetailsSoapOut"/>
              </operation>
              <operation name="Testng">
                   <input message="s0:TestngSoapIn"/>
                   <output message="s0:TestngSoapOut"/>
              </operation>
              <operation name="getDueDate">
                   <input message="s0:getDueDateSoapIn"/>
                   <output message="s0:getDueDateSoapOut"/>
              </operation>
              <operation name="getDueTime">
                   <input message="s0:getDueTimeSoapIn"/>
                   <output message="s0:getDueTimeSoapOut"/>
              </operation>
              <operation name="getResolution">
                   <input message="s0:getResolutionSoapIn"/>
                   <output message="s0:getResolutionSoapOut"/>
              </operation>
              <operation name="getTicketNumber">
                   <input message="s0:getTicketNumberSoapIn"/>
                   <output message="s0:getTicketNumberSoapOut"/>
              </operation>
              <operation name="getMultipleTicketNumbers">
                   <input message="s0:getMultipleTicketNumbersSoapIn"/>
                   <output message="s0:getMultipleTicketNumbersSoapOut"/>
              </operation>
              <operation name="formatDate">
                   <input message="s0:formatDateSoapIn"/>
                   <output message="s0:formatDateSoapOut"/>
              </operation>
              <operation name="formatDueDate">
                   <input message="s0:formatDueDateSoapIn"/>
                   <output message="s0:formatDueDateSoapOut"/>
              </operation>
              <operation name="getRemedyComments">
                   <input message="s0:getRemedyCommentsSoapIn"/>
                   <output message="s0:getRemedyCommentsSoapOut"/>
              </operation>
              <operation name="formatTime">
                   <input message="s0:formatTimeSoapIn"/>
                   <output message="s0:formatTimeSoapOut"/>
              </operation>
         </portType>
         <portType name="OracleGatewayHttpGet">
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <input message="s0:getEvtDetailWithEVTIDdb2callHttpGetIn"/>
                   <output message="s0:getEvtDetailWithEVTIDdb2callHttpGetOut"/>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <input message="s0:getEvtDetailWithEVTIDHttpGetIn"/>
                   <output message="s0:getEvtDetailWithEVTIDHttpGetOut"/>
              </operation>
              <operation name="getEvtDetailWithMBLPH">
                   <input message="s0:getEvtDetailWithMBLPHHttpGetIn"/>
                   <output message="s0:getEvtDetailWithMBLPHHttpGetOut"/>
              </operation>
              <operation name="getEvtDetails">
                   <input message="s0:getEvtDetailsHttpGetIn"/>
                   <output message="s0:getEvtDetailsHttpGetOut"/>
              </operation>
              <operation name="getDueDate">
                   <input message="s0:getDueDateHttpGetIn"/>
                   <output message="s0:getDueDateHttpGetOut"/>
              </operation>
              <operation name="getDueTime">
                   <input message="s0:getDueTimeHttpGetIn"/>
                   <output message="s0:getDueTimeHttpGetOut"/>
              </operation>
              <operation name="getResolution">
                   <input message="s0:getResolutionHttpGetIn"/>
                   <output message="s0:getResolutionHttpGetOut"/>
              </operation>
              <operation name="getTicketNumber">
                   <input message="s0:getTicketNumberHttpGetIn"/>
                   <output message="s0:getTicketNumberHttpGetOut"/>
              </operation>
              <operation name="getMultipleTicketNumbers">
                   <input message="s0:getMultipleTicketNumbersHttpGetIn"/>
                   <output message="s0:getMultipleTicketNumbersHttpGetOut"/>
              </operation>
              <operation name="formatDate">
                   <input message="s0:formatDateHttpGetIn"/>
                   <output message="s0:formatDateHttpGetOut"/>
              </operation>
              <operation name="formatDueDate">
                   <input message="s0:formatDueDateHttpGetIn"/>
                   <output message="s0:formatDueDateHttpGetOut"/>
              </operation>
              <operation name="getRemedyComments">
                   <input message="s0:getRemedyCommentsHttpGetIn"/>
                   <output message="s0:getRemedyCommentsHttpGetOut"/>
              </operation>
              <operation name="formatTime">
                   <input message="s0:formatTimeHttpGetIn"/>
                   <output message="s0:formatTimeHttpGetOut"/>
              </operation>
         </portType>
         <portType name="OracleGatewayHttpPost">
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <input message="s0:getEvtDetailWithEVTIDdb2callHttpPostIn"/>
                   <output message="s0:getEvtDetailWithEVTIDdb2callHttpPostOut"/>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <input message="s0:getEvtDetailWithEVTIDHttpPostIn"/>
                   <output message="s0:getEvtDetailWithEVTIDHttpPostOut"/>
              </operation>
              <operation name="getEvtDetailWithMBLPH">
                   <input message="s0:getEvtDetailWithMBLPHHttpPostIn"/>
                   <output message="s0:getEvtDetailWithMBLPHHttpPostOut"/>
              </operation>
              <operation name="getEvtDetails">
                   <input message="s0:getEvtDetailsHttpPostIn"/>
                   <output message="s0:getEvtDetailsHttpPostOut"/>
              </operation>
              <operation name="getDueDate">
                   <input message="s0:getDueDateHttpPostIn"/>
                   <output message="s0:getDueDateHttpPostOut"/>
              </operation>
              <operation name="getDueTime">
                   <input message="s0:getDueTimeHttpPostIn"/>
                   <output message="s0:getDueTimeHttpPostOut"/>
              </operation>
              <operation name="getResolution">
                   <input message="s0:getResolutionHttpPostIn"/>
                   <output message="s0:getResolutionHttpPostOut"/>
              </operation>
              <operation name="getTicketNumber">
                   <input message="s0:getTicketNumberHttpPostIn"/>
                   <output message="s0:getTicketNumberHttpPostOut"/>
              </operation>
              <operation name="getMultipleTicketNumbers">
                   <input message="s0:getMultipleTicketNumbersHttpPostIn"/>
                   <output message="s0:getMultipleTicketNumbersHttpPostOut"/>
              </operation>
              <operation name="formatDate">
                   <input message="s0:formatDateHttpPostIn"/>
                   <output message="s0:formatDateHttpPostOut"/>
              </operation>
              <operation name="formatDueDate">
                   <input message="s0:formatDueDateHttpPostIn"/>
                   <output message="s0:formatDueDateHttpPostOut"/>
              </operation>
              <operation name="getRemedyComments">
                   <input message="s0:getRemedyCommentsHttpPostIn"/>
                   <output message="s0:getRemedyCommentsHttpPostOut"/>
              </operation>
              <operation name="formatTime">
                   <input message="s0:formatTimeHttpPostIn"/>
                   <output message="s0:formatTimeHttpPostOut"/>
              </operation>
         </portType>
         <binding name="OracleGatewaySoap" type="s0:OracleGatewaySoap">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <soap:operation soapAction="http://tempuri.org/getEvtDetailWithEVTIDdb2call"
    style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <soap:operation soapAction="http://tempuri.org/getEvtDetailWithEVTID" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getEvtDetailWithMBLPH">
                   <soap:operation soapAction="http://tempuri.org/getEvtDetailWithMBLPH" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getEvtDetails">
                   <soap:operation soapAction="http://tempuri.org/getEvtDetails" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="Testng">
                   <soap:operation soapAction="http://tempuri.org/Testng" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getDueDate">
                   <soap:operation soapAction="http://tempuri.org/getDueDate" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getDueTime">
                   <soap:operation soapAction="http://tempuri.org/getDueTime" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getResolution">
                   <soap:operation soapAction="http://tempuri.org/getResolution" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getTicketNumber">
                   <soap:operation soapAction="http://tempuri.org/getTicketNumber" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getMultipleTicketNumbers">
                   <soap:operation soapAction="http://tempuri.org/getMultipleTicketNumbers" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="formatDate">
                   <soap:operation soapAction="http://tempuri.org/formatDate" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="formatDueDate">
                   <soap:operation soapAction="http://tempuri.org/formatDueDate" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="getRemedyComments">
                   <soap:operation soapAction="http://tempuri.org/getRemedyComments" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
              <operation name="formatTime">
                   <soap:operation soapAction="http://tempuri.org/formatTime" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
         </binding>
         <binding name="OracleGatewayHttpGet" type="s0:OracleGatewayHttpGet">
              <http:binding verb="GET"/>
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <http:operation location="/getEvtDetailWithEVTIDdb2call"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <http:operation location="/getEvtDetailWithEVTID"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getEvtDetailWithMBLPH">
                   <http:operation location="/getEvtDetailWithMBLPH"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getEvtDetails">
                   <http:operation location="/getEvtDetails"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getDueDate">
                   <http:operation location="/getDueDate"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getDueTime">
                   <http:operation location="/getDueTime"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getResolution">
                   <http:operation location="/getResolution"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getTicketNumber">
                   <http:operation location="/getTicketNumber"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getMultipleTicketNumbers">
                   <http:operation location="/getMultipleTicketNumbers"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="formatDate">
                   <http:operation location="/formatDate"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="formatDueDate">
                   <http:operation location="/formatDueDate"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getRemedyComments">
                   <http:operation location="/getRemedyComments"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="formatTime">
                   <http:operation location="/formatTime"/>
                   <input>
                        <http:urlEncoded/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
         </binding>
         <binding name="OracleGatewayHttpPost" type="s0:OracleGatewayHttpPost">
              <http:binding verb="POST"/>
              <operation name="getEvtDetailWithEVTIDdb2call">
                   <http:operation location="/getEvtDetailWithEVTIDdb2call"/>
                   <input>
                        <mime:content type="application/x-www-form-urlencoded"/>
                   </input>
                   <output>
                        <mime:mimeXml part="Body"/>
                   </output>
              </operation>
              <operation name="getEvtDetailWithEVTID">
                   <http:operation location="/getEvtDetailWithEVTID"/>

  • Uploading from excel sheet

    can anyone tel me how 2 upload data from a excel sheet ??
    can it be done using gui_upload or os there any other funtion module ??

    Hi Vignesh,
    Steps to create a BDC program.
    1. Create an internal table with fields same as Excel sheet fields.
    2. Declare an internal table with BDCDATA table to store the BDC recording.
    3. Declare an internal table with BDCMSGCOL to store the error messages after
    the execution of the BDC.
    4. Write the code using the fun. module ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload the data from the excel sheet.
    5. loop that internal table and write the Subroutines to fill the internal table
    BDCDATA with the recording of a specified Transaction Code.
    6. Using Call Transaction execute the BDC recording.
    7. Check Sy-subrc = 0 and store the error messages in the internal table.
    8. If you want you can pass those error records to a session using the SESSION method.
    Here is an example of a BDC program, but this program is from a text file. Change the function module WS_UPLOAD with ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload an excel and write the program with your BDC recording. You can do recording using t-code SHDB.
    Sample Program:
    REPORT ZRAJ_DATASET_XD01 NO STANDARD PAGE HEADING LINE-SIZE 132
    LINE-COUNT 60
    MESSAGE-ID Z00.
    Table/Structure declarations. *
    TABLES : KNA1. "Customer master
    Constants declarations. *
    CONSTANTS : C_MODE VALUE 'N',
    C_UPDATE VALUE 'S',
    C_X VALUE 'X',
    C_SESS TYPE APQI-GROUPID VALUE 'ZCUSTOMER', "Session Name
    C_XD01 LIKE TSTC-TCODE VALUE 'XD01'.
    Variable declarations. *
    DATA : V_FNAME(15) VALUE SPACE, " Name of file to be created
    V_FAILREC TYPE I, " No of failed records
    V_MSG(255), " Message Text
    V_ERRREC TYPE I, " No of failed records
    V_LINES TYPE I. " No of records
    *-- FLAG DECLARATIONS
    DATA : FG_DATA_EXIST VALUE 'X', " Check for data
    FG_SESSION_OPEN VALUE ' '. " Check for Session Open
    Structures / Internal table declarations *
    *-- Structure to hold BDC data
    TYPES : BEGIN OF T_BDCTABLE.
    INCLUDE STRUCTURE BDCDATA.
    TYPES END OF T_BDCTABLE.
    *-- Structure to trap BDC messages
    TYPES : BEGIN OF T_MSG.
    INCLUDE STRUCTURE BDCMSGCOLL.
    TYPES : END OF T_MSG.
    *-- Structure to trap ERROR messages
    TYPES : BEGIN OF T_ERR_MSG,
    MESSAGE(255),
    END OF T_ERR_MSG.
    *--Internal table to store flat file data
    DATA:BEGIN OF IT_KNA1 OCCURS 0,
    KUNNR LIKE KNA1-KUNNR,
    KTOKD LIKE T077D-KTOKD,
    NAME1 LIKE KNA1-NAME1,
    SORTL LIKE KNA1-SORTL,
    ORT01 LIKE KNA1-ORT01,
    PSTLZ LIKE KNA1-PSTLZ,
    LAND1 LIKE KNA1-LAND1,
    SPRAS LIKE KNA1-SPRAS,
    LZONE LIKE KNA1-LZONE,
    END OF IT_KNA1.
    *-- Internal table to hold BDC data
    DATA: IT_BDCDATA TYPE STANDARD TABLE OF T_BDCTABLE WITH HEADER LINE,
    *-- Internal Table to store ALL messages
    IT_MSG TYPE STANDARD TABLE OF T_MSG WITH HEADER LINE,
    *-- Internal Table to store error messages
    IT_ERR_MSG TYPE STANDARD TABLE OF T_ERR_MSG WITH HEADER LINE.
    Selection Screen. *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FLNAME(15) OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R_LIST RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003.
    PARAMETERS : R_SESS RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 30(20) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Event:Initialization *
    INITIALIZATION.
    AT Selection Screen. *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection *
    START-OF-SELECTION.
    V_FNAME = P_FLNAME.
    PERFORM GET_DATA.
    PERFORM GENERATE_DATASET.
    Event: End-of-Selection *
    END-OF-SELECTION.
    IF FG_DATA_EXIST = ' '.
    MESSAGE I010 WITH TEXT-009.
    EXIT.
    ENDIF.
    PERFORM GENERATE_BDCDATA.
    PERFORM DISPLAY_ERR_RECS.
    Event: top-of-page
    TOP-OF-PAGE.
    FORM DEFINITIONS *
    *& Form get_data
    Subroutine to get the data from mard
    --> p1 text
    <-- p2 text
    FORM GET_DATA.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'C:\XD01.TXT'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    DATA_TAB = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF IT_KNA1[] IS INITIAL.
    FG_DATA_EXIST = ' '.
    ENDIF.
    ENDFORM. " get_data
    *& Form GENERATE_DATASET
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_DATASET.
    MESSAGE I010 WITH 'OPENING FILE IN APPLICATION SERVER'.
    **--Creating a data set in application server
    OPEN DATASET V_FNAME FOR OUTPUT IN TEXT MODE.
    **---Transfering data from internal table to dataset
    MESSAGE I010 WITH 'TRANSFERING DATA FROM INETERAL TABLE TO THE FILE'.
    LOOP AT IT_KNA1.
    TRANSFER IT_KNA1 TO V_FNAME.
    ENDLOOP.
    **--Closing the dataset
    MESSAGE I010 WITH 'CLOSING THE FILE'.
    CLOSE DATASET V_FNAME.
    ENDFORM. " GENERATE_DATASET
    *& Form BDC_DYNPRO
    text
    -->P_0467 text
    -->P_0468 text
    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
    text
    -->P_0472 text
    -->P_0473 text
    FORM BDC_FIELD USING FNAM FVAL.
    IF NOT FVAL IS INITIAL.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-FNAM = FNAM.
    IT_BDCDATA-FVAL = FVAL.
    APPEND IT_BDCDATA.
    ENDIF.
    ENDFORM.
    *& Form GENERATE_BDCDATA
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_BDCDATA.
    REFRESH IT_KNA1.
    Opening dataset for reading
    OPEN DATASET V_FNAME FOR INPUT IN TEXT MODE.
    Reading the file from application server
    DO.
    CLEAR: IT_KNA1,IT_BDCDATA.
    REFRESH IT_BDCDATA.
    READ DATASET V_FNAME INTO IT_KNA1.
    IF SY-SUBRC <> 0.
    EXIT.
    ELSE.
    Populate BDC Data for Initial Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0100',
    BDC_FIELD USING 'BDC_CURSOR' 'RF02D-KUNNR',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'RF02D-KUNNR' IT_KNA1-KUNNR,
    BDC_FIELD USING 'RF02D-KTOKD' IT_KNA1-KTOKD.
    Populate BDC Data for Second Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0110',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-NAME1',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'KNA1-NAME1' IT_KNA1-NAME1,
    BDC_FIELD USING 'KNA1-SORTL' IT_KNA1-SORTL,
    BDC_FIELD USING 'KNA1-ORT01' IT_KNA1-ORT01,
    BDC_FIELD USING 'KNA1-PSTLZ' IT_KNA1-PSTLZ,
    BDC_FIELD USING 'KNA1-LAND1' IT_KNA1-LAND1,
    BDC_FIELD USING 'KNA1-SPRAS' IT_KNA1-SPRAS.
    Populate BDC Data for Third Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0120',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-LZONE',
    BDC_FIELD USING 'BDC_OKCODE' '=UPDA',
    BDC_FIELD USING 'KNA1-LZONE' IT_KNA1-LZONE.
    CALL TRANSACTION C_XD01 USING IT_BDCDATA
    MODE C_MODE
    UPDATE C_UPDATE
    MESSAGES INTO IT_MSG.
    IF SY-SUBRC <> 0.
    *--In case of error list display
    IF R_LIST = C_X.
    V_ERRREC = V_ERRREC + 1.
    PERFORM FORMAT_MESSAGE.
    IT_ERR_MSG-MESSAGE = V_MSG.
    APPEND IT_ERR_MSG.
    CLEAR : V_MSG,IT_ERR_MSG.
    ENDIF.
    *--In case of session log
    IF R_SESS = C_X.
    *-- In case of transaction fails.
    IF FG_SESSION_OPEN = ' '.
    FG_SESSION_OPEN = C_X.
    PERFORM BDC_OPEN_GROUP.
    ENDIF. " IF FG_SESSION_OPEN = ' '.
    *-- Insert BDC Data..
    PERFORM BDC_INSERT_DATA.
    ENDIF. " IF R_SESS = C_X.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDDO.
    Closing the dataset
    CLOSE DATASET V_FNAME.
    *-- Close the session if opened
    IF FG_SESSION_OPEN = C_X.
    PERFORM BDC_CLOSE_GROUP.
    CALL TRANSACTION 'SM35'.
    ENDIF.
    ENDFORM. " GENERATE_BDCDATA
    *& Form BDC_OPEN_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_OPEN_GROUP.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = C_SESS
    HOLDDATE = FILLER8
    KEEP = C_X
    USER = SY-UNAME
    RECORD = FILLER1
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11
    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. " BDC_OPEN_GROUP
    *& Form BDC_INSERT_DATA
    text
    --> p1 text
    <-- p2 text
    FORM BDC_INSERT_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_XD01
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    TABLES
    DYNPROTAB = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    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. " BDC_INSERT_DATA
    *& Form BDC_CLOSE_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_CLOSE_GROUP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3
    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. " BDC_CLOSE_GROUP
    *& Form FORMAT_MESSAGE
    text
    --> p1 text
    <-- p2 text
    FORM FORMAT_MESSAGE.
    CLEAR V_LINES.
    DESCRIBE TABLE IT_MSG LINES V_LINES.
    READ TABLE IT_MSG INDEX V_LINES.
    CLEAR V_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = IT_MSG-MSGID
    LANG = IT_MSG-MSGSPRA
    NO = IT_MSG-MSGNR
    V1 = IT_MSG-MSGV1
    V2 = IT_MSG-MSGV2
    V3 = IT_MSG-MSGV3
    V4 = IT_MSG-MSGV4
    IMPORTING
    MSG = V_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " FORMAT_MESSAGE
    *& Form DISPLAY_ERR_RECS
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ERR_RECS.
    LOOP AT IT_ERR_MSG.
    WRITE: / IT_ERR_MSG-MESSAGE.
    ENDLOOP.
    ENDFORM. " DISPLAY_ERR_RECS
    And
    To simply load Excel to Internal table follow this :
    First of all , before you move your data from excel sheet to the internal table, you need to specify a location for uploading the excel sheet into your internal table.
    for this u need to use two specific FM's .
    the first one for file selection : WS_FILENAME_GET.
    The second one for data upload : TEXT_CONVERT_XLS_TO_SAP.
    After doing this the regular part of mapping comes and then we can run the session and then execute and release it.
    Hope this resolves your query.
    <b>Reward all the helpful answers.</b>
    Regards

  • Proble with BDC

    Hi experts how to create  customer records in xd01?
    i.e sales office ,group,division,ales person?
    after how to prepare the flat file then upload thn build ITAB?
    could u forwad any demo for customer methods in bdc ,lsmw,bapi
    sample demo for customer in bdc ,lsmw ,bapi

    Hi,
    Go through this code
    REPORT Z_TABCTL_XD01 NO STANDARD PAGE HEADING LINE-SIZE 132
                                                         LINE-COUNT 60
                                                         MESSAGE-ID Z00.
                        Table/Structure declarations.                    *
    TABLES : KNA1.  "Customer master
                  Constants declarations.                                *
    CONSTANTS : C_MODE   VALUE 'A',
                C_UPDATE VALUE 'S',
                C_X      VALUE 'X',
                C_SESS   TYPE  APQI-GROUPID VALUE 'ZCUSTOMER', "Session Name
                C_XD01   LIKE  TSTC-TCODE   VALUE 'XD01'.
                  Variable declarations.                                 *
    DATA : V_FNAME(15)  VALUE  SPACE,      " Name of file to be created
           V_FAILREC    TYPE I,            " No of failed records
           V_MSG(255),                     " Message Text
           V_ERRREC     TYPE I,            " No of failed records
           V_LINES      TYPE I,            " No of records
           V_BANKS(15),                    " Table column BANKS
           V_BANKL(15),                    " Table column BANKL
           V_BANKN(15),                    " Table column BANKN
           V_TIDX(2)    TYPE N.            " Table row index
    *--             FLAG DECLARATIONS
    DATA : FG_DATA_EXIST   VALUE 'X',             " Check for data
           FG_SESSION_OPEN VALUE ' '.             " Check for Session Open
    *--              MACRO DEFINITIONS
    *-- Macro for BANKS
    DEFINE BANKS.
      CLEAR V_BANKS.
      CONCATENATE 'KNBK-BANKS(' &1 ')' INTO V_BANKS.
      CONDENSE V_BANKS.
    END-OF-DEFINITION.
    *-- Macro for BANKL
    DEFINE BANKL.
      CLEAR V_BANKL.
      CONCATENATE 'KNBK-BANKL(' &1 ')' INTO V_BANKL.
      CONDENSE V_BANKL.
    END-OF-DEFINITION.
    *-- Macro for BANKN
    DEFINE BANKN.
      CLEAR V_BANKN.
      CONCATENATE 'KNBK-BANKN(' &1 ')' INTO V_BANKN.
      CONDENSE V_BANKN.
    END-OF-DEFINITION.
                   Structures / Internal table declarations              *
    *-- Structure to hold BDC data
    TYPES : BEGIN OF T_BDCTABLE.
            INCLUDE STRUCTURE BDCDATA.
    TYPES  END OF T_BDCTABLE.
    *-- Structure to trap BDC messages
    TYPES : BEGIN OF T_MSG.
            INCLUDE STRUCTURE BDCMSGCOLL.
    TYPES : END OF T_MSG.
    *-- Structure to trap ERROR messages
    TYPES : BEGIN OF T_ERR_MSG,
              MESSAGE(255),
            END OF T_ERR_MSG.
    *--Internal table to store flat file data
    DATA : BEGIN OF IT_KNA1 OCCURS 0,
             KUNNR LIKE KNA1-KUNNR,
             KTOKD LIKE T077D-KTOKD,
             NAME1 LIKE KNA1-NAME1,
             SORTL LIKE KNA1-SORTL,
             ORT01 LIKE KNA1-ORT01,
             PSTLZ LIKE KNA1-PSTLZ,
             LAND1 LIKE KNA1-LAND1,
             SPRAS LIKE KNA1-SPRAS,
             LZONE LIKE KNA1-LZONE,
           END OF IT_KNA1.
    *--Internal table to store bank details
    DATA : BEGIN OF IT_BANK OCCURS 0,
             BANKS LIKE KNBK-BANKS,
             BANKL LIKE KNBK-BANKL,
             BANKN LIKE KNBK-BANKN,
           END OF IT_BANK.
    *-- Internal table to hold BDC data
    DATA: IT_BDCDATA TYPE STANDARD TABLE OF T_BDCTABLE WITH HEADER LINE,
    *-- Internal Table to store ALL messages
          IT_MSG     TYPE STANDARD TABLE OF T_MSG WITH HEADER LINE,
    *-- Internal Table to store error messages
          IT_ERR_MSG TYPE STANDARD TABLE OF T_ERR_MSG WITH HEADER LINE.
    Selection Screen.                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FLNAME(15) OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R_LIST  RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003.
    PARAMETERS : R_SESS  RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 30(20) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Event:Initialization                                                 *
    INITIALIZATION.
    AT Selection Screen.                                                 *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection                                            *
    START-OF-SELECTION.
      V_FNAME = P_FLNAME.
      PERFORM GET_DATA.
      PERFORM GET_BANKDATA.
      PERFORM GENERATE_DATASET.
    Event: End-of-Selection                                            *
    END-OF-SELECTION.
      IF FG_DATA_EXIST = ' '.
        MESSAGE I010 WITH TEXT-009.
        EXIT.
      ENDIF.
      PERFORM GENERATE_BDCDATA.
      PERFORM DISPLAY_ERR_RECS.
    Event: top-of-page
    TOP-OF-PAGE.
                          FORM DEFINITIONS                               *
    *&      Form  get_data
          Subroutine to get the data from mard
    -->  p1        text
    <--  p2        text
    FORM GET_DATA.
      CALL FUNCTION 'UPLOAD'
       EXPORTING
       CODEPAGE                      = ' '
         FILENAME                       = 'C:\XD01.TXT'
         FILETYPE                       = 'DAT'
       ITEM                          = ' '
       FILEMASK_MASK                 = ' '
       FILEMASK_TEXT                 = ' '
       FILETYPE_NO_CHANGE            = ' '
       FILEMASK_ALL                  = ' '
       FILETYPE_NO_SHOW              = ' '
       LINE_EXIT                     = ' '
       USER_FORM                     = ' '
       USER_PROG                     = ' '
       SILENT                        = 'S'
    IMPORTING
       FILESIZE                      =
       CANCEL                        =
       ACT_FILENAME                  =
       ACT_FILETYPE                  =
        TABLES
          DATA_TAB                      = IT_KNA1
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       INVALID_TABLE_WIDTH           = 2
       INVALID_TYPE                  = 3
       NO_BATCH                      = 4
       UNKNOWN_ERROR                 = 5
       GUI_REFUSE_FILETRANSFER       = 6
       OTHERS                        = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF IT_KNA1[] IS INITIAL.
        FG_DATA_EXIST = ' '.
      ENDIF.
    ENDFORM.                    " get_data
    *&      Form  GENERATE_DATASET
          text
    -->  p1        text
    <--  p2        text
    FORM GENERATE_DATASET.
      MESSAGE I010 WITH 'OPENING FILE IN APPLICATION SERVER'.
    **--Creating a data set in application server
      OPEN DATASET V_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    **---Transfering data from internal table to dataset
      MESSAGE I010 WITH 'TRANSFERING DATA FROM INETERAL TABLE TO THE FILE'.
      LOOP AT IT_KNA1.
        TRANSFER IT_KNA1 TO V_FNAME.
      ENDLOOP.
    **--Closing the dataset
      MESSAGE I010 WITH 'CLOSING THE FILE'.
      CLOSE DATASET V_FNAME.
    ENDFORM.                    " GENERATE_DATASET
    *&      Form  BDC_DYNPRO
          text
         -->P_0467   text
         -->P_0468   text
    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
          text
         -->P_0472   text
         -->P_0473   text
    FORM BDC_FIELD USING FNAM FVAL.
      IF NOT FVAL IS INITIAL.
        CLEAR IT_BDCDATA.
        IT_BDCDATA-FNAM = FNAM.
        IT_BDCDATA-FVAL = FVAL.
        APPEND IT_BDCDATA.
      ENDIF.
    ENDFORM.
    *&      Form  GENERATE_BDCDATA
          text
    -->  p1        text
    <--  p2        text
    FORM GENERATE_BDCDATA.
      REFRESH IT_KNA1.
    Opening dataset for reading
      OPEN DATASET V_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    Reading the file from application server
      DO.
        CLEAR:  IT_KNA1,IT_BDCDATA.
        REFRESH IT_BDCDATA.
        READ DATASET V_FNAME INTO IT_KNA1.
        IF SY-SUBRC <> 0.
          EXIT.
        ELSE.
      Populate BDC Data for Initial Screen
          PERFORM : BDC_DYNPRO USING 'SAPMF02D'    '0100',
                    BDC_FIELD  USING 'BDC_CURSOR'  'RF02D-KUNNR',
                    BDC_FIELD  USING 'BDC_OKCODE'  '/00',
                    BDC_FIELD  USING 'RF02D-KUNNR' IT_KNA1-KUNNR,
                    BDC_FIELD  USING 'RF02D-KTOKD' IT_KNA1-KTOKD.
      Populate BDC Data for Second Screen
          PERFORM : BDC_DYNPRO USING 'SAPMF02D'    '0110',
                    BDC_FIELD  USING 'BDC_CURSOR'  'KNA1-NAME1',
                    BDC_FIELD  USING 'BDC_OKCODE'  '/00',
                    BDC_FIELD  USING 'KNA1-NAME1'  IT_KNA1-NAME1,
                    BDC_FIELD  USING 'KNA1-SORTL'  IT_KNA1-SORTL,
                    BDC_FIELD  USING 'KNA1-ORT01'  IT_KNA1-ORT01,
                    BDC_FIELD  USING 'KNA1-PSTLZ'  IT_KNA1-PSTLZ,
                    BDC_FIELD  USING 'KNA1-LAND1'  IT_KNA1-LAND1,
                    BDC_FIELD  USING 'KNA1-SPRAS'  IT_KNA1-SPRAS.
      Populate BDC Data for Third Screen
          PERFORM : BDC_DYNPRO USING 'SAPMF02D'    '0120',
                    BDC_FIELD  USING 'BDC_CURSOR'  'KNA1-LZONE',
                    BDC_FIELD  USING 'BDC_OKCODE'  '/00',
                    BDC_FIELD  USING 'KNA1-LZONE'  IT_KNA1-LZONE.
      Populate BDC Data for Fourth Screen
          PERFORM : BDC_DYNPRO USING 'SAPMF02D'    '0125',
                    BDC_FIELD  USING 'BDC_CURSOR'  'KNA1-NIELS',
                    BDC_FIELD  USING 'BDC_OKCODE'  '/00'.
      Populate BDC Data for Table control for bank details.
          V_TIDX = '01'.
          LOOP AT IT_BANK.
            BANKS V_TIDX.
            BANKL V_TIDX.
            BANKN V_TIDX.
            PERFORM : BDC_DYNPRO USING 'SAPMF02D'   '0130',
                      BDC_FIELD  USING 'BDC_CURSOR' V_BANKN,
                      BDC_FIELD  USING 'BDC_OKCODE' '=ENTR',
                      BDC_FIELD  USING  V_BANKS     IT_BANK-BANKS,
                      BDC_FIELD  USING  V_BANKL     IT_BANK-BANKL,
                      BDC_FIELD  USING  V_BANKN     IT_BANK-BANKN.
            V_TIDX = V_TIDX + 1.
          ENDLOOP.
          PERFORM : BDC_DYNPRO USING 'SAPMF02D'   '0130',
                    BDC_FIELD  USING 'BDC_CURSOR' V_BANKS,
                    BDC_FIELD  USING 'BDC_OKCODE' '=UPDA'.
          CALL TRANSACTION C_XD01 USING  IT_BDCDATA
                                  MODE   C_MODE
                                  UPDATE C_UPDATE
                                  MESSAGES INTO IT_MSG.
          IF SY-SUBRC <> 0.
    *--In case of error list display
            IF R_LIST = C_X.
              V_ERRREC = V_ERRREC + 1.
              PERFORM FORMAT_MESSAGE.
              IT_ERR_MSG-MESSAGE = V_MSG.
              APPEND IT_ERR_MSG.
              CLEAR : V_MSG,IT_ERR_MSG.
            ENDIF.
    *--In case of session log
            IF R_SESS = C_X.
    *-- In case of  transaction fails.
              IF FG_SESSION_OPEN = ' '.
                FG_SESSION_OPEN = C_X.
                PERFORM BDC_OPEN_GROUP.
              ENDIF.  "      IF FG_SESSION_OPEN = ' '.
    *-- Insert BDC Data..
              PERFORM BDC_INSERT_DATA.
            ENDIF.    "                        IF R_SESS = C_X.
          ENDIF.      "                        IF SY-SUBRC <> 0.
        ENDIF.        "                        IF SY-SUBRC <> 0.
      ENDDO.
    Closing the dataset
      CLOSE DATASET V_FNAME.
    *-- Close the session if opened
      IF FG_SESSION_OPEN = C_X.
        PERFORM BDC_CLOSE_GROUP.
        CALL TRANSACTION 'SM35'.
      ENDIF.
    ENDFORM.                    " GENERATE_BDCDATA
    *&      Form  BDC_OPEN_GROUP
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_OPEN_GROUP.
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
         CLIENT                     = SY-MANDT
      DEST                      = FILLER8
         GROUP                      = C_SESS
      HOLDDATE                  = FILLER8
         KEEP                       = C_X
         USER                       = SY-UNAME
      RECORD                    = FILLER1
    IMPORTING
      QID                       =
       EXCEPTIONS
         CLIENT_INVALID            = 1
         DESTINATION_INVALID       = 2
         GROUP_INVALID             = 3
         GROUP_IS_LOCKED           = 4
         HOLDDATE_INVALID          = 5
         INTERNAL_ERROR            = 6
         QUEUE_ERROR               = 7
         RUNNING                   = 8
         SYSTEM_LOCK_ERROR         = 9
         USER_INVALID              = 10
         OTHERS                    = 11
      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.                    " BDC_OPEN_GROUP
    *&      Form  BDC_INSERT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_INSERT_DATA.
      CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          TCODE                  = C_XD01
      POST_LOCAL             = NOVBLOCAL
      PRINTING               = NOPRINT
        TABLES
          DYNPROTAB              = IT_BDCDATA
       EXCEPTIONS
         INTERNAL_ERROR         = 1
         NOT_OPEN               = 2
         QUEUE_ERROR            = 3
         TCODE_INVALID          = 4
         PRINTING_INVALID       = 5
         POSTING_INVALID        = 6
         OTHERS                 = 7
      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.                    " BDC_INSERT_DATA
    *&      Form  BDC_CLOSE_GROUP
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_CLOSE_GROUP.
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                NOT_OPEN    = 1
                QUEUE_ERROR = 2
                OTHERS      = 3.
      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.                    " BDC_CLOSE_GROUP
    *&      Form  FORMAT_MESSAGE
          text
    -->  p1        text
    <--  p2        text
    FORM FORMAT_MESSAGE.
      CLEAR V_LINES.
      DESCRIBE TABLE IT_MSG LINES V_LINES.
      READ TABLE IT_MSG INDEX V_LINES.
      CLEAR V_MSG.
      CALL FUNCTION 'FORMAT_MESSAGE'
           EXPORTING
                ID        = IT_MSG-MSGID
                LANG      = IT_MSG-MSGSPRA
                NO        = IT_MSG-MSGNR
                V1        = IT_MSG-MSGV1
                V2        = IT_MSG-MSGV2
                V3        = IT_MSG-MSGV3
                V4        = IT_MSG-MSGV4
           IMPORTING
                MSG       = V_MSG
           EXCEPTIONS
                NOT_FOUND = 1
                OTHERS    = 2.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " FORMAT_MESSAGE
    *&      Form  DISPLAY_ERR_RECS
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_ERR_RECS.
      LOOP AT IT_ERR_MSG.
        WRITE: / IT_ERR_MSG-MESSAGE.
      ENDLOOP.
    ENDFORM.                    " DISPLAY_ERR_RECS
    *&      Form  GET_BANKDATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_BANKDATA.
      IT_BANK-BANKS = 'AD'.
      IT_BANK-BANKL = '1000'.
      IT_BANK-BANKN = 'S.B A/C'.
      APPEND IT_BANK.
      IT_BANK-BANKS = 'AD'.
      IT_BANK-BANKL = 'CITY'.
      IT_BANK-BANKN = 'CURR. A/C'.
      APPEND IT_BANK.
      IT_BANK-BANKS = 'AD'.
      IT_BANK-BANKL = 'H001'.
      IT_BANK-BANKN = 'S.B A/C'.
      APPEND IT_BANK.
    reward points if useful
    regards
    suman

  • Download read only excel file

    Hi Experts,
    How to download a READ ONLY excel file to workstation (local Machine).

    Hi kaleemullah,
    Steps to create a BDC program.
    1. Create an internal table with fields same as Excel sheet fields.
    2. Declare an internal table with BDCDATA table to store the BDC recording.
    3. Declare an internal table with BDCMSGCOL to store the error messages after
    the execution of the BDC.
    4. Write the code using the fun. module ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload the data from the excel sheet.
    5. loop that internal table and write the Subroutines to fill the internal table
    BDCDATA with the recording of a specified Transaction Code.
    6. Using Call Transaction execute the BDC recording.
    7. Check Sy-subrc = 0 and store the error messages in the internal table.
    8. If you want you can pass those error records to a session using the SESSION method.
    Here is an example of a BDC program, but this program is from a text file. Change the function module WS_UPLOAD with ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload an excel and write the program with your BDC recording. You can do recording using t-code SHDB.
    Sample Program:
    REPORT ZRAJ_DATASET_XD01 NO STANDARD PAGE HEADING LINE-SIZE 132
    LINE-COUNT 60
    MESSAGE-ID Z00.
    Table/Structure declarations. *
    TABLES : KNA1. "Customer master
    Constants declarations. *
    CONSTANTS : C_MODE VALUE 'N',
    C_UPDATE VALUE 'S',
    C_X VALUE 'X',
    C_SESS TYPE APQI-GROUPID VALUE 'ZCUSTOMER', "Session Name
    C_XD01 LIKE TSTC-TCODE VALUE 'XD01'.
    Variable declarations. *
    DATA : V_FNAME(15) VALUE SPACE, " Name of file to be created
    V_FAILREC TYPE I, " No of failed records
    V_MSG(255), " Message Text
    V_ERRREC TYPE I, " No of failed records
    V_LINES TYPE I. " No of records
    *-- FLAG DECLARATIONS
    DATA : FG_DATA_EXIST VALUE 'X', " Check for data
    FG_SESSION_OPEN VALUE ' '. " Check for Session Open
    Structures / Internal table declarations *
    *-- Structure to hold BDC data
    TYPES : BEGIN OF T_BDCTABLE.
    INCLUDE STRUCTURE BDCDATA.
    TYPES END OF T_BDCTABLE.
    *-- Structure to trap BDC messages
    TYPES : BEGIN OF T_MSG.
    INCLUDE STRUCTURE BDCMSGCOLL.
    TYPES : END OF T_MSG.
    *-- Structure to trap ERROR messages
    TYPES : BEGIN OF T_ERR_MSG,
    MESSAGE(255),
    END OF T_ERR_MSG.
    *--Internal table to store flat file data
    DATA:BEGIN OF IT_KNA1 OCCURS 0,
    KUNNR LIKE KNA1-KUNNR,
    KTOKD LIKE T077D-KTOKD,
    NAME1 LIKE KNA1-NAME1,
    SORTL LIKE KNA1-SORTL,
    ORT01 LIKE KNA1-ORT01,
    PSTLZ LIKE KNA1-PSTLZ,
    LAND1 LIKE KNA1-LAND1,
    SPRAS LIKE KNA1-SPRAS,
    LZONE LIKE KNA1-LZONE,
    END OF IT_KNA1.
    *-- Internal table to hold BDC data
    DATA: IT_BDCDATA TYPE STANDARD TABLE OF T_BDCTABLE WITH HEADER LINE,
    *-- Internal Table to store ALL messages
    IT_MSG TYPE STANDARD TABLE OF T_MSG WITH HEADER LINE,
    *-- Internal Table to store error messages
    IT_ERR_MSG TYPE STANDARD TABLE OF T_ERR_MSG WITH HEADER LINE.
    Selection Screen. *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FLNAME(15) OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R_LIST RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003.
    PARAMETERS : R_SESS RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 30(20) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Event:Initialization *
    INITIALIZATION.
    AT Selection Screen. *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection *
    START-OF-SELECTION.
    V_FNAME = P_FLNAME.
    PERFORM GET_DATA.
    PERFORM GENERATE_DATASET.
    Event: End-of-Selection *
    END-OF-SELECTION.
    IF FG_DATA_EXIST = ' '.
    MESSAGE I010 WITH TEXT-009.
    EXIT.
    ENDIF.
    PERFORM GENERATE_BDCDATA.
    PERFORM DISPLAY_ERR_RECS.
    Event: top-of-page
    TOP-OF-PAGE.
    FORM DEFINITIONS *
    *& Form get_data
    Subroutine to get the data from mard
    --> p1 text
    <-- p2 text
    FORM GET_DATA.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'C:\XD01.TXT'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    DATA_TAB = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF IT_KNA1[] IS INITIAL.
    FG_DATA_EXIST = ' '.
    ENDIF.
    ENDFORM. " get_data
    *& Form GENERATE_DATASET
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_DATASET.
    MESSAGE I010 WITH 'OPENING FILE IN APPLICATION SERVER'.
    **--Creating a data set in application server
    OPEN DATASET V_FNAME FOR OUTPUT IN TEXT MODE.
    **---Transfering data from internal table to dataset
    MESSAGE I010 WITH 'TRANSFERING DATA FROM INETERAL TABLE TO THE FILE'.
    LOOP AT IT_KNA1.
    TRANSFER IT_KNA1 TO V_FNAME.
    ENDLOOP.
    **--Closing the dataset
    MESSAGE I010 WITH 'CLOSING THE FILE'.
    CLOSE DATASET V_FNAME.
    ENDFORM. " GENERATE_DATASET
    *& Form BDC_DYNPRO
    text
    -->P_0467 text
    -->P_0468 text
    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
    text
    -->P_0472 text
    -->P_0473 text
    FORM BDC_FIELD USING FNAM FVAL.
    IF NOT FVAL IS INITIAL.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-FNAM = FNAM.
    IT_BDCDATA-FVAL = FVAL.
    APPEND IT_BDCDATA.
    ENDIF.
    ENDFORM.
    *& Form GENERATE_BDCDATA
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_BDCDATA.
    REFRESH IT_KNA1.
    Opening dataset for reading
    OPEN DATASET V_FNAME FOR INPUT IN TEXT MODE.
    Reading the file from application server
    DO.
    CLEAR: IT_KNA1,IT_BDCDATA.
    REFRESH IT_BDCDATA.
    READ DATASET V_FNAME INTO IT_KNA1.
    IF SY-SUBRC <> 0.
    EXIT.
    ELSE.
    Populate BDC Data for Initial Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0100',
    BDC_FIELD USING 'BDC_CURSOR' 'RF02D-KUNNR',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'RF02D-KUNNR' IT_KNA1-KUNNR,
    BDC_FIELD USING 'RF02D-KTOKD' IT_KNA1-KTOKD.
    Populate BDC Data for Second Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0110',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-NAME1',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'KNA1-NAME1' IT_KNA1-NAME1,
    BDC_FIELD USING 'KNA1-SORTL' IT_KNA1-SORTL,
    BDC_FIELD USING 'KNA1-ORT01' IT_KNA1-ORT01,
    BDC_FIELD USING 'KNA1-PSTLZ' IT_KNA1-PSTLZ,
    BDC_FIELD USING 'KNA1-LAND1' IT_KNA1-LAND1,
    BDC_FIELD USING 'KNA1-SPRAS' IT_KNA1-SPRAS.
    Populate BDC Data for Third Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0120',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-LZONE',
    BDC_FIELD USING 'BDC_OKCODE' '=UPDA',
    BDC_FIELD USING 'KNA1-LZONE' IT_KNA1-LZONE.
    CALL TRANSACTION C_XD01 USING IT_BDCDATA
    MODE C_MODE
    UPDATE C_UPDATE
    MESSAGES INTO IT_MSG.
    IF SY-SUBRC <> 0.
    *--In case of error list display
    IF R_LIST = C_X.
    V_ERRREC = V_ERRREC + 1.
    PERFORM FORMAT_MESSAGE.
    IT_ERR_MSG-MESSAGE = V_MSG.
    APPEND IT_ERR_MSG.
    CLEAR : V_MSG,IT_ERR_MSG.
    ENDIF.
    *--In case of session log
    IF R_SESS = C_X.
    *-- In case of transaction fails.
    IF FG_SESSION_OPEN = ' '.
    FG_SESSION_OPEN = C_X.
    PERFORM BDC_OPEN_GROUP.
    ENDIF. " IF FG_SESSION_OPEN = ' '.
    *-- Insert BDC Data..
    PERFORM BDC_INSERT_DATA.
    ENDIF. " IF R_SESS = C_X.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDDO.
    Closing the dataset
    CLOSE DATASET V_FNAME.
    *-- Close the session if opened
    IF FG_SESSION_OPEN = C_X.
    PERFORM BDC_CLOSE_GROUP.
    CALL TRANSACTION 'SM35'.
    ENDIF.
    ENDFORM. " GENERATE_BDCDATA
    *& Form BDC_OPEN_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_OPEN_GROUP.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = C_SESS
    HOLDDATE = FILLER8
    KEEP = C_X
    USER = SY-UNAME
    RECORD = FILLER1
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11
    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. " BDC_OPEN_GROUP
    *& Form BDC_INSERT_DATA
    text
    --> p1 text
    <-- p2 text
    FORM BDC_INSERT_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_XD01
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    TABLES
    DYNPROTAB = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    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. " BDC_INSERT_DATA
    *& Form BDC_CLOSE_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_CLOSE_GROUP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3
    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. " BDC_CLOSE_GROUP
    *& Form FORMAT_MESSAGE
    text
    --> p1 text
    <-- p2 text
    FORM FORMAT_MESSAGE.
    CLEAR V_LINES.
    DESCRIBE TABLE IT_MSG LINES V_LINES.
    READ TABLE IT_MSG INDEX V_LINES.
    CLEAR V_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = IT_MSG-MSGID
    LANG = IT_MSG-MSGSPRA
    NO = IT_MSG-MSGNR
    V1 = IT_MSG-MSGV1
    V2 = IT_MSG-MSGV2
    V3 = IT_MSG-MSGV3
    V4 = IT_MSG-MSGV4
    IMPORTING
    MSG = V_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " FORMAT_MESSAGE
    *& Form DISPLAY_ERR_RECS
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ERR_RECS.
    LOOP AT IT_ERR_MSG.
    WRITE: / IT_ERR_MSG-MESSAGE.
    ENDLOOP.
    ENDFORM. " DISPLAY_ERR_RECS
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Error Message: The data provider required to connect to the local data file could not be found. The file will be added to the project but the typed DataSet associated with the file will ont be generated.

    I am currently taking the course "C# Fundamentals" from Bob Tabors site:  LearnVisualStudio.NET .  I'm on day 8 where we are integrating SQL Server with C#.  In Lesson 6 and 7, (havent' gotten past these two) I am having an
    issue.  In Lesson 6, "Retrieving Data with ADONET 2 in a Connected Scenario (SQL Server Compact Edition) when I go to create the data file I get the error message I typed into the title.  I cannot get the db to appear in the Solution
    Explorer, or open up so I can create a table.  When I try to skip by that lesson, and complete lesson7, I'm running into the same basic problem, where the error messages are different but I get an exception when I attempt to run the program.  Even
    though I have been able to create the table for this lesson, the Exception states I have an invalid object name 'Customers' which is the name of the table. I have tried reading several different suggestions for correcting this issue, but have not understood
    exactly what I need to do.  Since I work from home on my computer, I do not want to do anything with files or downloads unless I understand what I need to do, cause I do not want to lose my job.  Any help would be appreciated. 
    JennyBarrett7

    Hi
    According to your error message, we need to verify if Microsoft SQL Server Compact appears in the
    Change Data Source dialog. If not, you need to install
    SQL Server Compact components for Visual Studio firstly, and if you choose to install SQL Server Compact 4.0 , you should note that SQL Server Compact 4.0 supports in Visual Studio 2010 Service Pack 1 or later versions. I recommend you to install the latest
    Service Pack (SP) of SQL Server Compact, and latest SP of Visual Studio, then check if the error still occurs. For more information, see:
    http://blogs.msdn.com/b/sqlservercompact/archive/2011/03/15/sql-server-compact-4-0-tooling-support-in-visual-studio-2010-sp1-and-visual-web-developer-express-2010-sp1.aspx
    However if there is no problem with the installation of SQL Server Compact, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, you can review the following link:
    Working with SQL Server Compact in Visual Studio:http://msdn.microsoft.com/en-us/library/gg606540(v=vs.100).aspx
    Thanks
    Lydia Zhang

  • Timesheet Error - DataSet Actuals Error Message

    What does this error message idicate?
    TimesheetDataSet
    Table Actuals
    Row: TS_LINE_UID='eeb88119-13b2-4d81-b806-aa33ffd3f6c5' TS_ACT_START_DATE='05/13/2011 00:00:00'
    Error GeneralReadOnlyColumn (20005) - column TS_ACT_FINISH_DATE

    Hello Prasanna, 
    I'm having a different case here, still isn't solved.
    we are using the SEM method, and for the period 22/2 - 28/2 for many resource is having this error - the catch here is that in my personal timesheet, I'm only submitting for Administrative times, I have no project tasks
    does this make any sense ?
    Hany Zayed

  • Open and Close Dataset problem

    Hi All,
    I am facing a weird problem in transferring data to application server.
    I have used Open dataset to write my file in text format to the application server.
    Now everything works fine when small amount of data is there.When the number of records increases and when it takes lot of time , the format of the text file is completely distorted.
    I have used tab as the delimiter. Please suggest me some solution for this.
    Is this due to the time taken?
    Regards.

    Hi
    in the above program , when i had created 1st i had same problem
    then i had worte the logic likethis
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.</b>
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.
    with the bold letters above
    i had wrote that logic for that
    reward if usefull

  • Reporting Services - All Datasets Broken

    Hello there.
    We’re having some problems with Reporting Services on a prod site and I was hoping someone might be able to offer a suggestion.
    Here are the facts :
    We have a SP Server 2010 (not foundation) farm which uses Reporting Services. There is 1 web / application server and 1 SQL server. Reporting Services 2008 R2 is installed on the SQL box.
    Sometime in the last 2 weeks the reports all stopped working (last known report run 2 weeks ago). This was picked up yesterday. I'm not aware of anything being manually changed in the farm to cause this.
    The reports report directly on SP lists using datasets with SharePoint data connections. There is one dataset per list.
    The SQL / Reporting Services box has previously had SP installed on it (Ouch! Inherited system – not sure why SP was installed on SQL box).
    A few weeks ago we stopped all SP services on the SQL box but did not uninstall SP from it. This did not affect reporting at the time.
    When a report fails, we see this message in the UI :
    Looking in the reporting services log messages are like the following, one per dataset :
    Query execution failed for dataset 'DataSet1'. ---> System.ArgumentException: Feature '22d91f57-00d1-4e0b-9c04-863a82deaa07' for list template '10001' is not installed in this farm. 
    The operation could not be completed.
    This happens for all datasets for all reports. All datasets are complaining that the feature for the list the data set uses is missing. These are features with list definitions / instances for the lists used in the reports.
    The initial thought was that someone had renamed a field or similar, but this would only impact that one dataset. What we are seeing is that
    all datasets simultaneously broke.
    The features Reporting Services are complaining about are indeed activated in SP in the relevant webs.
    On the SQL box the folders for the features Reporting Services are complaining about are not present in the 14 hive at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES, but then as far as I know they never were. On
    our dev environment we deleted these feature folders but this didn't reproduce the same error.
    We modified an unrelated SP list view yesterday via the SP UI. It’s unlikely but I wonder if there is some kind of list definition XML / voodoo behind the scenes that was interrupted by this.
    If you open the broken report in Report Builder directly from SP (via the list context menu), you can run the datasets OK, and do a test connection for the data source - but if you run the report itself you get the usual error. If I use Report Builder on
    my local machine to try to save to the web where the reports are stored, I get one of the “feature…is not installed in this farm” errors. I can’t even browse to that web in Report Builder without getting the error.
    Things I've tried so far (my infrastructure experience amounts to restart things until they work):
    App pool recycle web server.
    IISReset web server.
    Restart reporting service on SQL box.
    Delete the view I thought might have been somehow related.
    In summary I have no idea what the root cause is here or what has changed recently. I’m a 
    programmer and someone else who is no longer available set up this environment so I’m a bit stuck!
    Thanks for reading.
    Lee

    We've resolved this.
    It turns out the features it was complaining about really were missing on the Reporting Services box and needed to be present. I wrongly concluded this wasn't the problem initially when we deleted these features on a dev box, restarted a few things and reports
    didn't break. I guess something was still being cached somewhere.
    Best  guess as to why the features went away is that when we disabled all of the SP services on the reporting services box via Central Admin, one of these (probably SharePoint Foundation Web Application), all custom features / solutions were removed
    from the box.
    Moral of the story I think is make sure your reporting services box is a valid part of the SP farm and has all required features present.
    Cheers
    Lee

  • Catch datetime exception and custom error message in SSRS

    I currently working on create report by using SSRS. I have 2 parameters: [Start date] and [End date] to filter data from database and show it on report. I want to validate 2 datetime parameter as describe above. Please tell me a solution to do this.
    For example:
    When user type the text like: 4/15/2014mmm => System validation thrown a message: [The From Date not correct type]
    But in my case, I want to receive a custom error message by myself.(Look like: [Date Invalid!])

    Hi Brain,
    According to your description, you have a report with two parameters for user to input. Now you want to validate these two parameters and display custom error message when the date is invalid. Right?
    In Reporting Service, it doesn’t provide any interference for us to modify the system error message (the text in grey color). That means we can’t modify the system message when error occurs. However we can create a textbox in this report, use custom code
    and expression to display the custom error message. But this all based on the report is successfully running. So if error occurs during report processing, all the custom code and expression will not work. In this scenario, we find a workaround for you. We
    use custom code to judge if the date is valid, if the users type an invalid date, we return a default value to make sure this report can successfully run. Then we use expression to control the visibility of tablix in this report and create a textbox to show
    the custom error message. Your case has been tested in our local environment. Here are steps and screenshots for your reference:
    Go to Report Properties. Put the code below into custom code:
    Public Shared a As Integer=0
    Public Shared Function IsDate(d1 As String,d2 As String) as Integer
            Try
               FormatDateTime(d1)
               FormatDateTime(d2)
            Catch ex As Exception
                       a=1
            End Try
    return a
    End Function
    Create two parameters. One is StartDate, the other is EndDate. Set the data type of these two parameters Text.
    Create a filter for StartDate, put the expression below into Value:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,CDate(IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,Parameters!StartDate.Value,"1/1/2012")),CDate("1/1/2012"))
    Create a filter for EndDate, put the expression below into Value:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,CDate(IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,Parameters!EndDate.Value,"1/1/2013")),CDate("1/1/2013"))
    Ps: In step3 and step4, the date(“1/1/2012”, “1/1/2013”) in the expression are the default we set to make sure the report can successfully process. You can set any date existing in your dataset.
    Use the expression below to set the visibility of the tablix:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,false,true)
    Create a textbox, put the expression below into it:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,"","Date invalid")
    Save and preview. It looks like below:
    Reference:
    SSRS Calendar and Date Restriction
    Errors and Events Reference (Reporting Services)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

Maybe you are looking for

  • Plz...  How to Create .war file in tomcat 5.0

    plz... i want clear steps to create .war file for jsp or servlet in tomcat 5.0. yours vijay

  • OracleAS 10g (9.0.4.0.2) Load Balancing  Forms, Discoverer and reports

    I am having some problems trying to load balance with Oracle Forms, Discoverer and reports Oracle Application Server Release 10g (9.0.4.0.2) and I was wondering if you could help. Has any one ever got this to work consistently? We are an ERP product

  • CORBA command prompt

    Hi guys, I finished my CORBA programming in Java. I need to start the ORBd first then Saver second then client last. The Problem is; by right, when i start the saver, another prompt should open and print message "Sever is Online OK!" (i.e before i lu

  • How to export/import prefs.js? Copying the file doesnt work

    I want to export/import about:config changes. The paths is "Firefox/Profiles/i63866ho.default-1384517947097/prefs-js". I copied prefs.js, all the content of the folder "i63866ho.default-1384517947097" and "Profiles" folder also. Nothing worked. When

  • Two dependent lists in a search form

    How can i create two dependent lists in a search form? Am using jdev 10.1.3? Is there any sample wich can help me? THanks in advance ! cheers,