Need to upload the z table whenever vendor is created

Hi all
    I have one scenario in which I need to populat one ztable whenever a new vendor is created.
    similarly whenver the vendor data is changed I need to downoad the changes in XL sheet.Can
    you pls let me know how to proceed. Thanks in advance.
Cheers,
sami.

try this...
Transaction Code - SE11                     ABAP Dictionary Maintenance
Enhancement/ Business Add-in            Description
Enhancement
SEDD0001                                Customer exits in ABAP/4 Dictionary
No.of Exits:          1
No.of BADis:          0
here you have to attach your code that whenever the lfa1 table is get updated then also the data will go into your customized table..

Similar Messages

  • Need to upload morethan 20 tables from excel sheet

    Hi Everyone,
    I need to upload 20 different tables from the excel sheets. One way to implement is to write 20 different report programs.
    But can we meet the above requirement from a single report program?
    Regards,
    Yugesh

    Hi
    You can do from One report. You have to take 20 diff. naming convention of your file and then read these fille and upload them into appropriate table.
    Regards,
    Shiv.

  • FM to upload the Internal table data into application server.

    Hi,
      Could you please give me Function module to Upload the Internal table data into Application server ie., in Tcode AL11.
    I know for downloading the Application server file into itab is "SUBST_GET_FILE_LIST" FM and using open dtaa set we get the data.
    Regards,
    deepthi.

    Hi Deepthi
    Incase you are looking to upload data in the AL11 through a program , then you can make use of OPEN DATASET...CLOSE DATASET statements.
    Here's the code snippet:
    IF tb_alvdisplay[] IS INITIAL.
        MESSAGE e999(/dcsea/zais_msg) WITH text-e01.
      ELSE.
        IF  NOT cb_ufile IS INITIAL  "Download to file
         AND sy-pagno = 0.            "Only down page headers for first page
          PERFORM fm_concatenate_path_name USING    p_path
                                                    p_file
                                           CHANGING v_file.
    *Open file for download.
          PERFORM fm_open_file USING v_file .
        ENDIF.
        LOOP AT tb_alvdisplay.
          IF  NOT cb_ufile IS INITIAL.
    *Passing the values of the respective headings to the structure.
            ws_rec-vend_no     = tb_alvdisplay-vendno.
            ws_rec-vend_nm     = tb_alvdisplay-vendnm.
            ws_rec-title       = tb_alvdisplay-vendtl.
            ws_rec-add         = tb_alvdisplay-add.
            ws_rec-city1       = tb_alvdisplay-city1.
            ws_rec-region      = tb_alvdisplay-region.
            ws_rec-country     = tb_alvdisplay-country.
            ws_rec-pobox       = tb_alvdisplay-po.
            ws_rec-phone       = tb_alvdisplay-telf1.
            ws_rec-extn        = tb_alvdisplay-extn.
            ws_rec-fax         = tb_alvdisplay-telfx.
            ws_rec-zterm       = tb_alvdisplay-zterm.
            ws_rec-remark      = tb_alvdisplay-remark.
            ws_rec-email       = tb_alvdisplay-email.
    *Passing the separator 'PIPE' to the structure.
              ws_rec-sep01  = co_sep.
              ws_rec-sep02  = co_sep.
              ws_rec-sep03  = co_sep.
              ws_rec-sep04  = co_sep.
              ws_rec-sep05  = co_sep.
              ws_rec-sep06  = co_sep.
              ws_rec-sep07  = co_sep.
              ws_rec-sep08  = co_sep.
              ws_rec-sep09  = co_sep.
              ws_rec-sep10  = co_sep.
              ws_rec-sep11  = co_sep.
              ws_rec-sep12  = co_sep.
              ws_rec-sep13  = co_sep.
            TRANSFER ws_rec TO v_file.
          ENDIF.
          AT LAST.
            IF NOT cb_ufile IS INITIAL.
    *Closing the DATASET file.
              CLOSE DATASET v_file.
              IF sy-subrc <> 0.
    *Failure Message.
                MESSAGE e999(/dcsea/zais_msg) WITH text-t04 text-t06.
              ELSE.
    *Success message.
                MESSAGE s999(/dcsea/zais_msg) WITH text-t05.
              ENDIF.
            ENDIF.
          ENDAT.
        ENDLOOP.
      ENDIF.
    Also as Gautham suggested you can use tcode CG3Z or CG3Y incase you are looking to upload the data directly.
    FInally, you can search SCN using the keywords, "Upload to AL11" and you'll get loads of results.
    Hope this helps.
    Harsh

  • Wht r the standard tables for vendor customer and sales order report/

    Hi wht r the standard tables for vendor and customer reports and is how in normal we cannot use them for vendor reporting and etc ?

    Hi
    Customer is related to Sales Module
    So for a customer we fetch the reports of Sales orders , Deliveries and Billing doc's
    CUstomer and Vendor related tables with important fields:
    KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
    KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
    KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
    KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
    KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
    KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
    KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
    KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
    KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
    KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
    LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
    LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
    LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
    Sales related Tables for a customer
    VBAK: Sales Document(Header Data) (VBELN, KUNNR)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
          Enquiry, Quotation, Sales Order are differentiated based on Doc.
          Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
          for Quotation 'B' & for Order it is 'C'.)
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
          (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    VTTK: Shipment Table (Header Data)(TKNUM)
    VTTP: Shipment Table (Item Data)( TKNUM,TPNUM,VBELN)
          (VTTP-VBELN = LIKP-VBELN)
    VTFA: Shipping Document Flow(TKNUM,VBELV,VBELN)
    VTPA: Shipping Partners data(VBELN,PARVW,KUNNR,PERNR)
    VTTS: Stages in Shipment(TKNUM,TSNUM,TSTYP)
    VTSP: Transport Stage/Shipment Item Allocation(TKNUM,TSNUM,TPNUM)
    VEKP: Handling Unit: Header(Packing)(VENUM,VSTEL)
    VEPO: Handling Unit: Item (Packing)(VENUM,VEPOS,VBELN)
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
          (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
          Apart from these tables there are lot of other tables which starts with
          ‘V’, but we use the following tables frequently.
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
          VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice) 
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    Vendor related MM tables
    EBAN-- Pur.Reqn. Data (BANFN,BNFPO,BADAT,MATNR)
    EBKN-- Purchase Requisition Account Assignment(BANFN,BNFPO,VBELN)
    EINA—- Purchase Info.Record (General Data)(INFNR,MATNR,LIFNR)
    EINE-- Purchase Info.Record (Pur.Orgn Data )(INFNR,EKORG)
    ELBK-- Vendor Evaluation Header Data(LIFNR,EKORG,KLASS)
    EKKO-- Purchase Order Data (Header)(EBELN,BSTYP,BSART)
    EKPO-- Purchase Order Data (Item)(EBELN,EBELP,MATNR)
           RFQ and PO are differentiated by Doc Type(BSTYP)in EKKO table.
           For RFQ it is ‘A’ and for PO it is ‘F’.
    MKPF-- GRN Data (Header) (EBELN,BLDAT,BUDAT,XBLNR,BKTXT)
    MSEG-- GRN Data (Item)(MBLNR,BWART,LIFNR,MATNR,EBELN)
           Apart from this there are lot of tables which begin with 'M'& 'E', but we
           use the following very often.
    EKBE--PO History Data (EBELN,EBELP,BELNR,BLDAT,MATNR,VGABE)
    EKBZ--PO History with delivery Costs(EBELN,BELNR,LIFNR,XBLNR)
    EKET--Schedule lines data of a PO (EBELN,EINDT,SLFDT)
    EKES--Vendor Confirmations Data(EBELN,EBTYP,EINDT,XBLNR)
    Reward points if useful
    Regards
    Anji

  • Do I need to upload the player to my server?

    I'm sorry if this is an obvious question. I created a video with Captivate and now I want to upload it to a website, do I need to upload a flash player or any other file besides the video, html and js file.

    No you do not need to upload the flash player to the website. If the browser where this video will be viewed does not have the flash player plugin the user will be prompted to download the plugin from Adobe's site.
    Manish
    http://blogs.adobe.com/captivate

  • Need to make the internal table structure dynamic

    Hi ,
    I need to upload data from an excel file, the columns in the excel keep on varying
    E.g the number of columns in one excel file can be 10, in the second excel file it can be 15.
    So in order to upload the data into an internal table the structre of internal table needs to be dynamic and change according to the number of fields in the input file .
    Is it possible by using field symbols or is there any other method to do the same
    Thanks.
    Nishant
    Edited by: nishant patel on Sep 17, 2009 10:48 AM

    Hi Nishant,
    According to ur requirement, dynamic internal table can be created like below. But database table name has to passed dynacimally.
        DATA: ftab TYPE STANDARD TABLE OF ddfield,
              ftab_wa TYPE ddfield,
              fcat_itab TYPE lvc_t_fcat,
              fcat_wa TYPE lvc_s_fcat,
              poi_itab TYPE REF TO data.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE.
        CALL FUNCTION 'DD_NAMETAB_TO_DDFIELDS'
          EXPORTING
            tabname  = p_table  " Pass database table name dynamically
          TABLES
            ddfields = ftab.
        LOOP AT ftab INTO ftab_wa.
          fcat_wa-fieldname = ftab_wa-fieldname.
          fcat_wa-ref_field = ftab_wa-fieldname.
          fcat_wa-ref_table = p_table.
          APPEND fcat_wa TO fcat_itab.
        ENDLOOP.
        CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = fcat_itab
          IMPORTING
            ep_table                  = poi_itab
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2.
        ASSIGN poi_itab->* TO <itab>.  " <itab> is dynamic internal table
    Might help u.
    Thanks.
    Edited by: Sap Fan on Sep 17, 2009 1:19 PM

  • In OWB I need to update the target table with same field for match/update

    In OWb I am trying to update the target table with the match and the update on the same field can this be done. I am getting a error match merge error saying you cannot update and match on the same field. But in SQl my select is
    Update table
    set irf = 0
    where irf = 1
    and process_id = 'TEST'
    Hwo do i do this in OWB.

    table name is temp
    fields in the table
    field1 number
    field2 varchar2(10)
    field3 date
    values in the table are example
    0,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    In the above example I need to update the first row field1 to 1.
    Update temp
    set field1 = 1
    where field1 = 0
    and field2 = 'TEST'
    when I run this I just need one row to be updated and it should look like this below
    1,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    But when I run my mapping I am getting the rows like below the second row with 9 also is getting updated to 1.
    1,'TEST',05/29/2009
    1,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009

  • Generate an Upload the current table to a comma seperated file

    Hi Freaks,
    i want to generate a comma seperated file from the current table (which was modified in the current Apex Window) and also upload the file to a file server.
    What is the best practice?
    Thanks a lot
    Wolle

    Hello Wolle,
    In the APEX SQL Workshop -> Object browser, when you select a table, and select the Data tab. There's a link at the bottom of the table, "Download". This will automatically generate a csv file for you.
    Alternatively you can use a client like toad or sql developer to generate a csv.
    Greetings,
    Rutger
    http://rutgerderuiter.blogspot.com/
    ===============================================================================
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Need to Upload the image into XMII server from a desktop

    Hi,
    Can anyone let me know how to upload the image from my laptop on to the server which i should be using in my pages. I tried using Image Loader and Image Saver. But it lead me no where. Is there a detailed documentation for this ?
    Thanks for your help in Advance.
    Regards,
    Deepthi lakshmi.A.

    Hi Deepti,
    Could you give some details on what you are trying to achieve.
    Is this a use case scenario where images need to be uploaded by a handful of people using some web UI?
    or
    Is this a use case scenario where you wish to upload images from the harddrive of absolutely any user?
    The reason for my questions is as follows.
    If you wish to allow some high-level (technically savvy) users the ability to upload images to be shown in dynamic content for remainder of the public, you could, in theory, set up a network directory that xMII is able to see.  These High-Level users could drop their images in the folder and specify the path in a text box.
    You could go one step further and use Get Folder List action from within an Xacute transaction and display the list of images in this folder on a web UI.  Users could pick the image from the list and "Bob's your Uncle!".
    Hope this helps,
    Cheers,
    Jai.

  • Need to know the reference table incase of 105 (GR for Blocked STK)

    Hi,
    I have created one PO and then I have done two 103(GR into Bolcked STK) then after I have done a 105(GR for Blocked STK) against one of the 103.
    My question is how could I identify for which 103 I have done 105. Is there any reference table-field where SAP actually stored the corresponding 103 material document number for that 105 material document. How could I link the 105 with the original 103.
    Actually I need to show the original 103 number for 105 in FORM output through MB90.
    please help me.

    The PO is same but I know for 103 and 105 there will be different material document number(MBLNR). But my question is as I have done a 105 against 103. How sap maintain in its table data that against which 103 it actually done 105. in which table it stores the reference data. There is no details in EKBE. Can you guys please do it in real time and check this and let me know.

  • Need to upload the excel file having extension .XLSX

    Hello,
    I am not able to upload the excel file having extension .XLSX But i can upload the excel file having extension .XLS .
    Please Guide me what are the changes i need to do... for uploading the excel file".XLSX".
    Thanks.

    Hi,
    What issue you are facing? Refer this document:  Upload/Read .xlsx file in SAP Web Dynpro . You need to on Netweaver 712 to use the classes mentioned in this document.
    Regards,
    Kiran

  • What upload speed do I need to upload the XL photo books with over 25 pages?

    I have just recently gotten a new Internet provider and the max upload speed I can get is 1mbps but I am only getting .4 mbps at the most.  When trying to upload an XL photo book with over 26 pages it keeps failing to transfer/upload and the error message says to check the internet connection.  I'm wondering what upload speed I need to upload?  I need to cancel this internet provider before my free month runs out if 1mbps is not going to be fast enough.

    Well I have my first order coming in tomorrow (according to Fedex) and I have my fingers crossed.
    So far I haven't been able to find any local printers that will print and bind the books at a reasonable cost - best I've found so far is $200 (or more) per book.
    Hardly cost effective for my relatively meager budget.
    I've explored Asuka a littoe more, and their quality does appear to be superior at first glance, but it seems I am not able to take advantage of submitting my aperture-generated book directly. According to their templates I have to put everything together manually in Photohop. Great for end-control, but one thing that made me pursue this was the ability to generate a book inside Aperture using versions direct from collection (any changes I made to an original image were automatically incorporated in my book. Had I done it all manually, teh time/effort I'd be putting into the book with be well over 5x greater!
    I've also looked at shutterfly.com so far - and they seem promising, and am wiating for my colleagues order to go through before I get too excited.
    Either way, I hope to have my first printing this week - I'll keep ya posted!

  • Update & upload the database table

    Hi
    I have a small issue. In which i have to Upload the data from a flat file based on primary key its a  customised table in which there are 4 primary keys. Based on this the customer numbers should be updated and on emore thing is the data should not be repeated. In the selection screen i'll provide a path based on this path it will upload all the data in the flat file
    Regards
    Nanda

    Hi,
    Below is the sample code :
    *& Report  ZCUSTOMER_MASTER_UPLOAD
    REPORT  ZCUSTOMER_MASTER_UPLOAD
           no standard page heading line-size 255.
    *include bdcrecx1.
    TABLES : T100.      "Company Codes
    *        Internal table declaration                                    *
    DATA : begin of it_customer  occurs 0,        "Internal table for creating customer
                  INDEX(4),    "Index
                  KUNNR(16),    "Customer No
                  BUKRS(4),     "Company code
                  VKORG(4),     "Sales Organization
                  VTWEG(2),     "Distribution Channel
                  SPART(2),     "Division
                  KTOKD(4),     "Account group
                  ANRED(30),    "Title
                  NAME1(35),    "Name1
                  SORTL(10),    "Search field
                  NAME2(35),    "Name2
                  NAME3(35),    "Name3
                  NAME4(35),    "Name4
                  STRAS(35),    "House and street
                  STREET2(35),
                  PFACH(10),    "PO box
                  ORT01(35),    "City
                  PSTLZ(10),    "Postal code
                  ORT02(35),    "District
                  PFORT(35),    "PO Box city
                  PSTL2(10),    "Postal code
                  LAND1(3),     "Country Key
                  REGIO(3),     "Region
                  SPRAS(2),     "Language key
                  TELX1(30),    "Telex number
                  TELF1(16),    "First telephone number
                  TELFX(30),    "Fax number
                  TELF2(16),    "Second telephone number
                  TELTX(30),    "Second telex number
                  KNURL(132),   "URL
                  STCEG(20),    "VAT Registration number
                  AKONT(10),    "Recon Account
                  ZUAWA(4),     "Sort key
                  ZTERM(4),     "Terms of payment key
                  ZWELS(10),    "List of payment methods to be considered
                  BZIRK(6),     "Sales district
    *              AWAHR(3),     "Order probability
                  VKBUR(4),     "Sales office
                  VKGRP(3),     "Sales group
                  KDGRP(2),     "Customer group
                  WAERS(5),     "Currency
                  KALKS(1),     "Pricing procedure assigned to this customer
                  VERSG(1),     "Customer statistics group
                  LPRIO(2),     "Delivery Priority
                  VWERK(4),     "Delivering Plant
    *              ANTLF(1)  VALUE 9,  "Maximum partial deliveries allowed
                  INCO1(3),     "Inco terms1
                  INCO2(28),     "Inco terms2
                  ZTERM_01(4),  "Terms of payment key
                  KTGRD(2),     "Account assignment group
                  TAXKD_01(1),  "Tax classification1
                  TAXKD_02(1),  "Tax classification2
                  er_message(100),
           end of it_customer.
    data : begin of it_customer_ext occurs 0,      "Internal table for extending customer
                  KUNNR(16),    "Customer No
                  VKORG(4),     "Sales Organization
                  VTWEG(2),     "Distribution channel
                  SPART(2),     "Division
                  KTOKD(4),     "Account group
                  BZIRK(6),     "Sales district
                  VKBUR(4),     "Sales office
                  VKGRP(3),     "Sales group
                  KDGRP(2),     "Customer group
                  WAERS(5),     "Currency
                  KALKS(1),     "Pricing procedure assigned to this customer
                  VERSG(1),     "Customer statistics group
                  LPRIO(2),     "Delivery priority
                  VWERK(4),     "Delivery plant
                  INCO1(3),     "Incoterms (part 1)
                  INCO2(28),    "Incoterms (part 2)
                  ZTERM(4),     "Terms of payment key
                  KTGRD(2),     "Account assignment group for this customer
                  TAXKD_01(1),  "Tax classification1
                  TAXKD_02(1),  "Tax classification2
            end of it_customer_ext.
    * Internal table to get the error data                                 *
    DATA : it_error like it_customer occurs 0 with header line.
    DATA : BDCDATA like BDCDATA occurs 0 with header line.
    DATA : i_msgtab like bdcmsgcoll occurs 0 with header line.
    * Internal table to find the error from the legacy data                *
    DATA : begin of it_erfind occurs 0,
                  INDEX(10),        "Index for error file
                  kunnr(16),
                  er_message(100),  "For Error Message
            end of it_erfind.
    * Variables declaration                                                *
    DATA : g_message(200),
           time(10),
           date(10)  ,
           v_error_filename like RLGRAP-FILENAME.
           date      = sy-datum.
           time      = sy-uzeit.
    *        Initialization
    initialization.
    * Generating Error file name with date and time.
      perform make_file_name.
    *        Selection Screen                                              *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    parameter: p_file like IBIPPARMS-PATH obligatory.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-005.
                    parameters    : pm_crt radiobutton group g1 default 'X',
                                    pm_ext radiobutton group g1.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30)  text-003.
    SELECTION-SCREEN COMMENT 33(79) text-004.
    SELECTION-SCREEN end OF LINE.
    SELECTION-SCREEN:END OF BLOCK B1.
    at selection-screen ON VALUE-REQUEST FOR p_file .
          perform get_filename.
    * Start of selection
    start-of-selection.
            perform upload_data.
            if pm_crt = 'X'.       "If Customer creation is selected
                perform fill_data_create.
            elseif pm_ext = 'X'.   "If Customer extension is selected
                perform fill_data_extension.
            endif.
    end-of-selection.
    FORM fill_data_create.
            loop at it_customer.
                        perform bdc_dynpro      using 'SAPMF02D' '0100'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'RF02D-KTOKD'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '/00'.
                        perform bdc_field       using 'RF02D-KUNNR'
                                                      it_customer-KUNNR.
                        perform bdc_field       using 'RF02D-BUKRS'
                                                      it_customer-BUKRS.
                        perform bdc_field       using 'RF02D-VKORG'
                                                      it_customer-VKORG.
                        perform bdc_field       using 'RF02D-VTWEG'
                                                      it_customer-VTWEG.
                        perform bdc_field       using 'RF02D-SPART'
                                                      it_customer-SPART.
                        perform bdc_field       using 'RF02D-KTOKD'
                                                      it_customer-KTOKD.
                         perform bdc_dynpro      using 'SAPMF02D' '0110'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNA1-KNURL'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNA1-ANRED'
                                                      it_customer-ANRED.
                        perform bdc_field       using 'KNA1-NAME1'
                                                      it_customer-NAME1.
                        perform bdc_field       using 'KNA1-SORTL'
                                                      it_customer-SORTL.
                        perform bdc_field       using 'KNA1-NAME2'
                                                      it_customer-NAME2.
                        perform bdc_field       using 'KNA1-NAME3'
                                                      it_customer-NAME3.
                        perform bdc_field       using 'KNA1-NAME4'
                                                      it_customer-NAME4.
                        perform bdc_field       using 'KNA1-STRAS'
                                                      it_customer-STRAS.
                        perform bdc_field       using 'KNA1-STREET2'
                                                      it_customer-STREET2.
                        perform bdc_field       using 'KNA1-PFACH'
                                                      it_customer-PFACH.
                        perform bdc_field       using 'KNA1-ORT01'
                                                      it_customer-ORT01.
                        perform bdc_field       using 'KNA1-PSTLZ'
                                                      it_customer-PSTLZ.
                        perform bdc_field       using 'KNA1-ORT02'
                                                      it_customer-ORT02.
                        perform bdc_field       using 'KNA1-PFORT'
                                                      it_customer-PFORT.
                        perform bdc_field       using 'KNA1-PSTL2'
                                                      it_customer-PSTL2.
                        perform bdc_field       using 'KNA1-LAND1'
                                                      it_customer-LAND1.
                        perform bdc_field       using 'KNA1-REGIO'
                                                      it_customer-REGIO.
                        perform bdc_field       using 'KNA1-SPRAS'
                                                      it_customer-SPRAS.
                        perform bdc_field       using 'KNA1-TELX1'
                                                      it_customer-TELX1.
                        perform bdc_field       using 'KNA1-TELF1'
                                                      it_customer-TELF1.
                        perform bdc_field       using 'KNA1-TELFX'
                                                      it_customer-TELFX.
                        perform bdc_field       using 'KNA1-TELF2'
                                                      it_customer-TELF2.
                        perform bdc_field       using 'KNA1-TELTX'
                                                      it_customer-TELTX.
                        perform bdc_field       using 'KNA1-KNURL'
                                                      it_customer-KNURL.
                        if it_customer-KTOKD = 'Z002' or
                           it_customer-KTOKD = 'Z003' or
                           it_customer-KTOKD = 'Z004' or
                           it_customer-KTOKD = 'Z005' or
                           it_customer-KTOKD = 'Z006' or
                           it_customer-KTOKD = 'Z007'.
                           perform customer_001.
                        elseif it_customer-KTOKD = 'Z011'.
                           perform customer_002.
                        else.
                           perform customer_003.
                        endif.
                        perform bdc_transaction tables i_msgtab using 'XD01' 'A' 'L' .
    *        To fetch the error message from the standard error table
                    select  single * from T100 where SPRSL = 'E'
                                               and ARBGB = SY-MSGID
                                               and MSGNR = SY-MSGNO.
                                               G_MESSAGE = T100-TEXT.
    *        subroutine to change the error message for every document number
                    perform REPLACE_PARAMETERS  using SY-MSGV1
                                                      SY-MSGV2
                                                      SY-MSGV3
                                                      SY-MSGV4
                                            changing  G_MESSAGE.
                     write: / 'System variables:'.
                     skip.
                     write: / '        Sy-msgty:', SY-MSGTY.
                     write: / '        Sy-msgid:', SY-MSGID.
                     write: / '        Sy-msgno:', SY-MSGNO.
                     write: / '        Sy-msgv1:', SY-MSGV1.
                     write: / '        Sy-msgv2:', SY-MSGV2.
                     write: / '        Sy-msgv3:', SY-MSGV3.
                     write: / '        Sy-msgv4:', SY-MSGV4.
                     skip.
                     write: / 'Message:'.
                     skip.
                     write: / SY-MSGTY, G_MESSAGE.
    *        To find out the error in the legacy data if there is anything and pass
    *        the document no with error message to the seperate internal table
    *        called it_erfind
                    if sy-msgty = 'E'.
                          it_erfind-index = it_customer-index.
                          it_erfind-er_message = G_MESSAGE.
                          append it_erfind.
                    endif.
    *        Finally we are segregating the error and downloading the error data.
                  at last.
    *        To segregate the error
                           perform segregate_error.
    *        To download the error from it_error internal table with err mesg
                           perform error_download.
                           perform display_message.
                  endat.
            endloop.
            clear it_customer.
    ENDFORM.
    FORM fill_data_extension.
        loop at it_customer_ext.
                perform bdc_dynpro      using 'SAPMF02D' '0107'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'RF02D-KTOKD'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '/00'.
                perform bdc_field       using 'RF02D-KUNNR'
                                              it_customer_ext-KUNNR.
                perform bdc_field       using 'RF02D-VKORG'
                                              it_customer_ext-VKORG.
                perform bdc_field       using 'RF02D-VTWEG'
                                              it_customer_ext-VTWEG.
                perform bdc_field       using 'RF02D-SPART'
                                              it_customer_ext-SPART.
                perform bdc_field       using 'RF02D-KTOKD'
                                              it_customer_ext-KTOKD.
                if it_customer_ext-KTOKD = 'Z002' or
                   it_customer_ext-KTOKD = 'Z003' or
                   it_customer_ext-KTOKD = 'Z004' or
                   it_customer_ext-KTOKD = 'Z005' or
                   it_customer_ext-KTOKD = 'Z006' or
                   it_customer_ext-KTOKD = 'Z007' or
                   it_customer_ext-KTOKD = 'Z011'.
                           perform customer_extension_001.
                else.
                           perform customer_extension_002.
                endif.
                perform bdc_transaction tables i_msgtab using 'VD01' 'N' 'L' .
    *        To fetch the error message from the standard error table
                    select  single * from T100 where SPRSL = 'E'
                                               and ARBGB = SY-MSGID
                                               and MSGNR = SY-MSGNO.
                                               G_MESSAGE = T100-TEXT.
    *        subroutine to change the error message for every document number
                    perform REPLACE_PARAMETERS  using SY-MSGV1
                                                      SY-MSGV2
                                                      SY-MSGV3
                                                      SY-MSGV4
                                            changing  G_MESSAGE.
                     write: / 'System variables:'.
                     skip.
                     write: / '        Sy-msgty:', SY-MSGTY.
                     write: / '        Sy-msgid:', SY-MSGID.
                     write: / '        Sy-msgno:', SY-MSGNO.
                     write: / '        Sy-msgv1:', SY-MSGV1.
                     write: / '        Sy-msgv2:', SY-MSGV2.
                     write: / '        Sy-msgv3:', SY-MSGV3.
                     write: / '        Sy-msgv4:', SY-MSGV4.
                     skip.
                     write: / 'Message:'.
                     skip.
                     write: / SY-MSGTY, G_MESSAGE.
    *        To find out the error in the legacy data if there is anything and pass
    *        the document no with error message to the seperate internal table
    *        called it_erfind
                    if sy-msgty = 'E'.
                           it_erfind-kunnr = it_customer_ext-kunnr.
                           it_erfind-er_message = G_MESSAGE.
                           append it_erfind.
                    endif.
    *        Finally we are segregating the error and downloading the error data.
                  at last.
    *        To segregate the error
                           perform segregate_error.
    *        To download the error from it_error internal table with err mesg
                           perform error_download.
                           perform display_message.
                  endat.
            endloop.
            clear it_customer_ext.
    ENDFORM.
    *This subroutine is used to fill the data for the Account groups
    *Z002,Z003,Z004,Z005,Z006 AND Z007
    FORM customer_001.
              perform bdc_dynpro      using 'SAPMF02D' '0120'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNA1-TXJCD'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0360'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVK-NAMEV(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0310'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVV-VERSG'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_field       using 'KNVV-BZIRK'
                                            it_customer-BZIRK.
              perform bdc_field       using 'KNVV-VKBUR'
                                            it_customer-VKBUR.
              perform bdc_field       using 'KNVV-VKGRP'
                                            it_customer-VKGRP.
              perform bdc_field       using 'KNVV-VERSG'
                                            it_customer-VERSG.
              perform bdc_dynpro      using 'SAPMF02D' '0324'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVP-PARVW(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=UPDA'.
    *          perform bdc_transaction using 'XD01'.
    ENDFORM.
    *This subroutine is used to fill the data for the Account group Z011
    FORM customer_002.
              perform bdc_dynpro      using 'SAPMF02D' '0120'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNA1-LIFNR'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0125'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNA1-NIELS'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0130'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNBK-BANKS(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0340'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'RF02D-KUNNR'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0370'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'RF02D-KUNNR'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_field       using 'KNA1-CIVVE'
                                            'X'.
              perform bdc_dynpro      using 'SAPMF02D' '0360'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVK-NAMEV(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_dynpro      using 'SAPMF02D' '0310'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVV-VERSG'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_field       using 'KNVV-BZIRK'
                                            it_customer-BZIRK.
              perform bdc_field       using 'KNVV-VERSG'
                                            it_customer-VERSG.
              perform bdc_dynpro      using 'SAPMF02D' '0324'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVP-PARVW(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=UPDA'.
    ENDFORM.
    *This subroutine is used to fill the data for the Account groups
    *Z020,Z021,Z022,Z023,Z200,Z201.
    FORM customer_003.
                        perform bdc_dynpro      using 'SAPMF02D' '0120'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNA1-STCEG'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNA1-STCEG'
                                                      it_customer-STCEG.
                        perform bdc_dynpro      using 'SAPMF02D' '0125'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNA1-NIELS'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0130'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNBK-BANKS(01)'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0340'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'RF02D-KUNNR'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0370'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'RF02D-KUNNR'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNA1-CIVVE'
                                                      'X'.
                        perform bdc_dynpro      using 'SAPMF02D' '0360'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVK-NAMEV(01)'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0210'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNB1-KNRZE'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNB1-AKONT'
                                                      it_customer-AKONT.
                        perform bdc_field       using 'KNB1-ZUAWA'
                                                      it_customer-ZUAWA.
                        perform bdc_dynpro      using 'SAPMF02D' '0215'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNB1-ZWELS'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNB1-ZTERM'
                                                      it_customer-ZTERM.
                        perform bdc_field       using 'KNB1-ZWELS'
                                                      it_customer-ZWELS.
                        perform bdc_dynpro      using 'SAPMF02D' '0220'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNB5-MAHNA'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0230'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNB1-VRSNR'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_dynpro      using 'SAPMF02D' '0610'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'RF02D-KUNNR'.
                        perform bdc_dynpro      using 'SAPMF02D' '0310'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVV-VERSG'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNVV-BZIRK'
                                                      it_customer-BZIRK.
    *                    perform bdc_field       using 'KNVV-AWAHR'
    *                                                  it_customer-AWAHR.
                        perform bdc_field       using 'KNVV-VKBUR'
                                                      it_customer-VKBUR.
                        perform bdc_field       using 'KNVV-VKGRP'
                                                      it_customer-VKGRP.
                        perform bdc_field       using 'KNVV-KDGRP'
                                                      it_customer-KDGRP.
                        perform bdc_field       using 'KNVV-WAERS'
                                                      it_customer-WAERS.
                        perform bdc_field       using 'KNVV-KALKS'
                                                      it_customer-KALKS.
                        perform bdc_field       using 'KNVV-VERSG'
                                                      it_customer-VERSG.
                        perform bdc_dynpro      using 'SAPMF02D' '0315'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVV-VWERK'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNVV-LPRIO'
                                                      it_customer-LPRIO.
    *                    perform bdc_field       using 'KNVV-KZAZU'
    *                                                  'X'.
                        perform bdc_field       using 'KNVV-VWERK'
                                                      it_customer-VWERK.
    *                    perform bdc_field       using 'KNVV-ANTLF'
    *                                                  it_customer-ANTLF.
                        perform bdc_dynpro      using 'SAPMF02D' '0320'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVV-KTGRD'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNVV-INCO1'
                                                      it_customer-INCO1.
                        perform bdc_field       using 'KNVV-INCO2'
                                                      it_customer-INCO2.
                        perform bdc_field       using 'KNVV-ZTERM'
                                                      it_customer-ZTERM_01.
                        perform bdc_field       using 'KNVV-KTGRD'
                                                      it_customer-KTGRD.
                        perform bdc_dynpro      using 'SAPMF02D' '1350'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVI-TAXKD(02)'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=VW'.
                        perform bdc_field       using 'KNVI-TAXKD(01)'
                                                      it_customer-TAXKD_01.
                        perform bdc_field       using 'KNVI-TAXKD(02)'
                                                      it_customer-TAXKD_02.
                        perform bdc_dynpro      using 'SAPMF02D' '0324'.
                        perform bdc_field       using 'BDC_CURSOR'
                                                      'KNVP-PARVW(01)'.
                        perform bdc_field       using 'BDC_OKCODE'
                                                      '=UPDA'.
    *                   perform bdc_transaction using 'XD01'.
    ENDFORM.
    FORM customer_extension_001.
              perform bdc_dynpro      using 'SAPMF02D' '0310'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVV-VERSG'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=VW'.
              perform bdc_field       using 'KNVV-BZIRK'
                                            it_customer_ext-BZIRK.
              if not it_customer_ext-KTOKD = 'Z011'.
                    perform bdc_field       using 'KNVV-VKBUR'
                                                  it_customer_ext-VKBUR.
                    perform bdc_field       using 'KNVV-VKGRP'
                                                  it_customer_ext-VKGRP.
              endif.
                    perform bdc_field       using 'KNVV-VERSG'
                                                  it_customer_ext-VERSG.
              perform bdc_dynpro      using 'SAPMF02D' '0324'.
              perform bdc_field       using 'BDC_CURSOR'
                                            'KNVP-PARVW(01)'.
              perform bdc_field       using 'BDC_OKCODE'
                                            '=UPDA'.
    ENDFORM.
    FORM customer_extension_002.
                perform bdc_dynpro      using 'SAPMF02D' '0310'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'KNVV-VERSG'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '=VW'.
                perform bdc_field       using 'KNVV-BZIRK'
                                              it_customer_ext-BZIRK.
    *            perform bdc_field       using 'KNVV-AWAHR'
    *                                          '100'.
                perform bdc_field       using 'KNVV-VKBUR'
                                              it_customer_ext-VKBUR.
                perform bdc_field       using 'KNVV-VKGRP'
                                              it_customer_ext-VKGRP.
                perform bdc_field       using 'KNVV-KDGRP'
                                              it_customer_ext-KDGRP.
                perform bdc_field       using 'KNVV-WAERS'
                                              it_customer_ext-WAERS.
                perform bdc_field       using 'KNVV-KALKS'
                                              it_customer_ext-KALKS.
                perform bdc_field       using 'KNVV-VERSG'
                                              it_customer_ext-VERSG.
                perform bdc_dynpro      using 'SAPMF02D' '0315'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'KNVV-VWERK'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '=VW'.
                perform bdc_field       using 'KNVV-LPRIO'
                                              it_customer_ext-LPRIO.
    *            perform bdc_field       using 'KNVV-KZAZU'
    *                                          'X'.
                perform bdc_field       using 'KNVV-VWERK'
                                              it_customer_ext-VWERK.
    *            perform bdc_field       using 'KNVV-ANTLF'
    *                                          '9'.
                perform bdc_dynpro      using 'SAPMF02D' '0320'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'KNVV-KTGRD'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '=VW'.
                perform bdc_field       using 'KNVV-INCO1'
                                              it_customer_ext-INCO1.
                perform bdc_field       using 'KNVV-INCO2'
                                              it_customer_ext-INCO2.
                perform bdc_field       using 'KNVV-ZTERM'
                                              it_customer_ext-ZTERM.
                perform bdc_field       using 'KNVV-KTGRD'
                                              it_customer_ext-KTGRD.
                perform bdc_dynpro      using 'SAPMF02D' '1350'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'RF02D-KUNNR'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '=VW'.
                perform bdc_dynpro      using 'SAPMF02D' '0324'.
                perform bdc_field       using 'BDC_CURSOR'
                                              'KNVP-PARVW(01)'.
                perform bdc_field       using 'BDC_OKCODE'
                                              '=UPDA'.
    ENDFORM.
    *Subrotine to replace the parameters
        FORM REPLACE_PARAMETERS USING P_PAR_1 P_PAR_2 P_PAR_3
                                      P_PAR_4 CHANGING P_MESSAGE.
    * erst mal pruefen, ob numerierte Parameter verwendet wurden
        DO.
              REPLACE '&1' WITH P_PAR_1 INTO P_MESSAGE.
              IF SY-SUBRC <> 0.
                EXIT.
              ENDIF.
        ENDDO.
        DO.
              REPLACE '&2' WITH P_PAR_2 INTO P_MESSAGE.
              IF SY-SUBRC <> 0.
                EXIT.
              ENDIF.
        ENDDO.
        DO.
              REPLACE '&3' WITH P_PAR_3 INTO P_MESSAGE.
              IF SY-SUBRC <> 0.
                EXIT.
              ENDIF.
        ENDDO.
        DO.
              REPLACE '&4' WITH P_PAR_4 INTO P_MESSAGE.
              IF SY-SUBRC <> 0.
                EXIT.
              ENDIF.
        ENDDO.
    * falls keine numerierten Parameter vorh., ersetzen wie gehabt
              REPLACE '&' WITH P_PAR_1 INTO P_MESSAGE.
              CONDENSE P_MESSAGE.
              IF SY-SUBRC EQ 0.
                REPLACE '&' WITH P_PAR_2 INTO P_MESSAGE.
                CONDENSE P_MESSAGE.
                    IF SY-SUBRC EQ 0.
                        REPLACE '&' WITH P_PAR_3 INTO P_MESSAGE.
                        CONDENSE P_MESSAGE.
                        IF SY-SUBRC EQ 0.
                          REPLACE '&' WITH P_PAR_4 INTO P_MESSAGE.
                          CONDENSE P_MESSAGE.
                        ENDIF.
                    ENDIF.
              ENDIF.
    ENDFORM.
    *Subroutine to segregate the error data from the legacy data
              FORM segregate_error.
                loop at it_erfind.
                     if pm_crt = 'X'.
                             loop at it_customer where index = it_erfind-index.
                                   move-corresponding it_customer to it_error.
                                   it_error-er_message = it_erfind-er_message.
                                   append it_error.
                             endloop.
                     elseif pm_ext = 'X'.
                             loop at it_customer_ext where kunnr = it_erfind-kunnr.
                                   move-corresponding it_customer_ext to it_error.
                                   it_error-er_message = it_erfind-er_message.
                                   append it_error.
                             endloop.
                     endif.
                endloop.
              ENDFORM.
    *Subroutine to download the error data from the it_error table.
          FORM error_download.
              if it_error[] is not initial.
                  call function 'WS_DOWNLOAD'
                       exporting
                          CODEPAGE = 'IBM'
                          FILENAME = v_error_filename
                          FILETYPE = 'DAT'
                  tables
                          DATA_TAB = IT_ERROR.
              endif.
          ENDFORM.
    *        Start new screen                                              *
          FORM BDC_DYNPRO USING PROGRAM DYNPRO.
                CLEAR BDCDATA.
                BDCDATA-PROGRAM  = PROGRAM.
                BDCDATA-DYNPRO   = DYNPRO.
                BDCDATA-DYNBEGIN = 'X'.
                APPEND BDCDATA.
          ENDFORM.
    *        Insert field                                                  *
          FORM BDC_FIELD USING FNAM FVAL.
    *          IF FVAL <> NODATA.
               CLEAR BDCDATA.
               BDCDATA-FNAM = FNAM.
               BDCDATA-FVAL = FVAL.
               APPEND BDCDATA.
    *          ENDIF.
          ENDFORM.
          FORM bdc_transaction tables MESSTAB USING  TCODE CTUMODE CUPDATE .
                  CALL TRANSACTION TCODE USING BDCDATA
                                        MODE   CTUMODE
                                        UPDATE CUPDATE
                                        MESSAGES INTO MESSTAB.
                  REFRESH BDCDATA.
                  clear   BDCDATA.
           ENDFORM.                    " bdc_transaction
    * Uploading data file to internal table.                           *
           FORM upload_data.
               if pm_crt = 'X'.
                      CALL FUNCTION 'WS_UPLOAD'
                          EXPORTING
                             FILENAME                      = p_file
    *                         CODEPAGE                      = 'IBM '
                             FILETYPE                      = 'DAT'
                          TABLES
                              DATA_TAB                      = it_customer
                          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.
              elseif pm_ext = 'X'.
                          CALL FUNCTION 'WS_UPLOAD'
                          EXPORTING
                             FILENAME                      = p_file
    *                         CODEPAGE                      = 'IBM '
                             FILETYPE                      = 'DAT'
                          TABLES
                              DATA_TAB                      = it_customer_ext
                          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.
              endif.
    {size:13}Here you can use sort and delete statement to delete the duplicate entries.{size}
          ENDFORM.
    *&      Form  display_message
    FORM display_message .
        if it_error[] is initial.
           message i019(zmsg).   "Success
        else.
           message e020(zmsg).   "Failed
        endif.
    ENDFORM.                    " display_message
    *&      Form  get_filename
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_filename .
        CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           PROGRAM_NAME        = SYST-CPROG
           DYNPRO_NUMBER       = SYST-DYNNR
    *       FIELD_NAME          = p_file
         IMPORTING
           FILE_NAME           = p_file .
         if sy-subrc NE 0  .
            write : / 'Enter File Name'.
         endif.
    ENDFORM.                    " get_filename
    *&      Form  make_file_name
    FORM make_file_name .
           write sy-datum to date  MM/DD/YYYY.
           write sy-uzeit to time  USING EDIT MASK ' __ __ __'.
           concatenate Text-002 date time '.txt'
                  into v_error_filename.
    ENDFORM.                    " make_file_name
    Thanks,
    Sriram Ponna.

  • Need to know the base tables for the QM datasources

    Hello SAP Experts,
    I want to know the base tables for the below mentioned datasources which stores the transaction data.
    1. 2LIS_05_QE1:  Inspection Characterstics Results
    2. 2LIS_05_QE2: Inspection Characterstics Results (Quan)
    3. 2LIS_05_QVUDN: Usage decision for Inspection
    Need your inputs.
    Thanks,
    Lasya.
    Edited by: lasya john on Dec 10, 2008 8:28 PM

    Hi Lasya,
    You can use help.sap.com for this.
    If you do not find this data source there...then
    You can go to LBWE t-code in R/3 and then infront of the data source...you have maintenance option.
    Click on that ...and go inside it in the display mode.
    Here you can see a generic pool of fields on the left side which can be included in the data source........  field present in the data sources in the right side of the pool.
    For every field you have a tructure name infront of it like MCXXXX where XXXX is the table name.
    So the field is being from that particular table.
    Even I would the same thing to reply to your thread.
    You can follow the same procedure to find the table for any LO data source.
    This is accurate in 99% cases...only in very few cases like purchasing...we get one or two fields from different tables.
    Hope it helps.
    Thanks
    Ajeet

  • Help needed in knowing the B2B Table strucure

    Hi All,
    I would like to know the tables in the B2B database that stores the ISA,GS,ST,Receiver ID and Ack flag data.
    Or any document which contains the description of all the tables and what data is stored in them .
    Thanks in advance.
    Regards,
    Kaavya

    Hi Kaavya,
    There is a view called b2b_instancemessage where you will get all the details. Please refer the post Getting the ISA Control Number and other details from a b2b generated file
    which has the view creation script. If you analyze the script you will get to know the relationship between tables in the b2b schema.
    Hope that it helps!!
    Thanks,
    Dibya Prakash Mohapatra

Maybe you are looking for

  • MS Access, ODBC and SPs returning ref cursor

    I have some functions and procedures in a package returning ref cursors that work fine in my C++ batch applications. I would like for the GUI to be able to call these as well. Unfortunately, we are using Access as the front end (for now), and we have

  • HT4614 how do I connect a mac cinema display to a mac mini

    Is it possible to connect both an Apple 30" HD cinema display and an Apple 23" cinema display to a Mac Mini and use both as dual monitors?

  • HT4910 how to transfer file from PC to Ipad ?

    Please Help ! I have windows 7 as my OS & would like to transfer /doc, .txt, .pdf files from my PC to Ipad ? Please inform the procedure.

  • Exchange 2007 EXCDO 8206 error in Exchange 2007 SP2 with Rollup 4

    Dear sir,     We have a problem on Exchange 2007 Server. When user use OWA to access web mail calendar, server event log will show EXCDO error 8206: Calendaring agent failed with error code 0x8000ffff while saving appointment Type: Error Event ID: 82

  • Hierarchy derive

    Hi all, I have a problem with hierarchy derivation . I can't use standard derivation (type H) because I should use two different hierarchies (on 0ACCOUNT) in the 'Characteristic Rels' folder of the Planning Area.  Since I'm allowed to use only one in