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.

Similar Messages

  • Update the database table

    Hi All,
      i need to do  direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table .  So  i am looping  the internal table and what is the best approach to update the database table is it to  use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001  each time in the loop to update each record  and commit work which hits database for each record or use the statement UPDATE  pa0001 from table it_0001 and if count = 1000 then  COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,
    Thanks,
    Latha.

    My Code to update PA0006 is :
    DATA:  t_pa0006 TYPE STANDARD TABLE OF pa0006 INITIAL SIZE 0,
           wa_pa0006 LIKE LINE OF t_pa0006,
           w_lin TYPE i.
    FIELD-SYMBOLS:  <fs_pa0006> LIKE LINE OF t_pa0006.
    SELECT * FROM pa0006 INTO TABLE t_pa0006 WHERE uname = 'PKHAROR'.
    LOOP AT t_pa0006 ASSIGNING <fs_pa0006>.
      <fs_pa0006>-stras = 'My Street'.
    ENDLOOP.
    DESCRIBE TABLE t_pa0006 LINES w_lin.
    UPDATE pa0006 FROM TABLE t_pa0006.
    IF sy-subrc EQ 0.
      COMMIT WORK.
      WRITE:/ w_lin, ' Records have been updated..'.
    ENDIF.
    Reward points for useful answers
    Regards
    Pradeep
    Regards
    Pradeep

  • Updating values in database table through Transaction

    Hi,
    Actually We have one transaction named EWAWA01. In that when we display the values from the transaction, there is a netweight field. The transaction displaying netweight values, but that value is not updated in the database table named EWA_WA_WEIGHPROC. How can i update that netweight value in the table.

    data:v_v_EWA_WA_WEIGHPROC type  (v_EWA_WA_WEIGHPROC lenth) c.
    decleare the data in charter type.
    after pass the data charter type.
    v_EWA_WA_WEIGHPROC = EWA_WA_WEIGHPROC
    update db.

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • Updating data in the database table

    Can any help me in the code for updating data in the database table.
    Regards,
    Rahul

    Hi Rahul,
    A slightly longer procedure that i'm adding here...
    1.) Create the component (i'm sure you have this covered)
    2.) Next on the button click that updates the database - add an action.
    3.) double click the action so that you are taken to the methods section of the view.
    4.) next you need to add the code that is required the update the database - this will be in the form of the above two posts.
    5.) compile and test the application
    Let me know in case you need further information on how to do this with a function module or something.
    Thanks.

  • Update the database table with the content of the internal table

    Hello!
      I have the next form:
      FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
      DELETE TABLE itab_adrress: FROM zadrress,
                                 WITH TABLE KEY adrid = '456'.
      WRITE 'The information after the DELETE operation'
      COLOR 2.
      LOOP AT itab_adrress INTO wa_adrress .
        WRITE:/
               wa_adrress-adrid COLOR 5,
               wa_adrress-name COLOR 7,
               wa_adrress-email COLOR 5,
               wa_adrress-depart COLOR 7,
               wa_adrress-display COLOR 5.
      ENDLOOP.
      SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
       MODIFY zadrress FROM wa_adrress.
       COMMIT WORK.
       IF sy-subrc = 0.
         WRITE 'OK !'.
         SKIP.
       ELSE.
         WRITE 'FAIL !'.
         SKIP.
       ENDIF.
    ENDLOOP.
      MODIFY zadrress FROM TABLE itab_adrress.
      UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM.                    "erase_data
    I see that my record is deleted  when I display the records from my internal table, but
    now I want to delete the record from database table.
       For that I want to move the content of the modified internal table in the database table. You can see the methods I tried (some of them commented), but nothing seems to work.
    Any advice ?
    Thank you.

    FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
    DELETE TABLE itab_adrress: FROM zadrress,
    WITH TABLE KEY adrid = '456'.
    WRITE 'The information after the DELETE operation'
    COLOR 2.
    LOOP AT itab_adrress INTO wa_adrress .
    WRITE:/
    wa_adrress-adrid COLOR 5,
    wa_adrress-name COLOR 7,
    wa_adrress-email COLOR 5,
    wa_adrress-depart COLOR 7,
    wa_adrress-display COLOR 5.
    ENDLOOP.
    SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
    MODIFY zadrress FROM wa_adrress.
    COMMIT WORK.
    IF sy-subrc = 0.
    WRITE 'OK !'.
    SKIP.
    ELSE.
    WRITE 'FAIL !'.
    SKIP.
    ENDIF.
    ENDLOOP.
    <b>DELETE FROM zadrress.</b>  "Make this change and try
    MODIFY zadrress FROM TABLE itab_adrress.
    UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM. "erase_data'.

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Using Tabstrip update the database table

    Hi Guy's,
    I created two screens(100 & 110).
    Click 1 pushbutton HRP1000 related information is displayed.
    Click 2 pushbutton it displays HRP1001 relatd information.
    worked to read the data from the Database tables and output displayed sucessfuly .   However i want to entered data in those fields wants to update to database table.
    Please friends help me how to work this senario.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    To update the database records, wrote the logic in PAI
       WHEN 'SAVE'.
        INSERT HRP1001.
    INSERT INTO HRP1001  VALUES wa_P2.
    it displaying an error message " the work area wa_p2 is not long enough.
    and also i tried using it_p2
    it displaying an error message " you can't use internal table as work area".
    Please help me friends  it is very urgent.
    Thanks and Regards,
    Sai.

  • FM or BAPI to update the database table /TDAG/CPT_DEC_IN

    Hi All,
      I need to update a few entries in the database table /TDAG/CPT_DEC_IN (CP: Declarable Substances, Independent attributes). This table contains data for the EHS ( Environment, Health and Safety) Module in SAP.
      Instead of doing a direct database update, I needed a FM or a BAPI to update the same.
    Any pointers towards this will be really useful.
    Thanks and Regards,
    Arti Dohare

    Hi Raymond,
    Thanks for the reply. it seems I was using the wrong BAPI then.
    I actually created the network using the BAPI "BAPI_BUS2002_CREATE".
    This BAPI does not have the field call "Resp. cost cntr" in its input parameters and so I could not pass it there. Now I am trying to find if there is any standard FM or BAPI to maintain this field in the networks.
    I request you to please suggest some FM or BAPI if you know.
    Thanks and Regards.
    Piyush R Sakharkar.

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Field value is getting double while updating the database table

    Hi Experts,
    A simple doubt :
    there is a standard program through which a zfunction module is getting triggered, through this zfunction module i am updating the database table.
    Now what happening is one of the field(KCQTY) value in database is getting double at a time when i am executing the Program with same variant only.
    I have also done the CLEAR & REFRESH internal tables starting of the Function module.
    Can you please help me out.
    Max points wil be awarded.
    thanks
    rico.

    Hi Nicole,
    this is the part of the coding where you can see how the field KCQTY is getting moved in the loop statement.
      DELETE IT_CE20002B_815 WHERE
          KONDA = SPACE  OR
          WERKS = SPACE  OR
          VVB01001 < 0.
        LOOP AT IT_CE20002B_815.
          INDX = SY-TABIX.
          CONCATENATE IT_CE20002B_815-PERBL0(4) IT_CE20002B_815-PERBL5(2)
                                                    INTO MONAT.
       MOVE itab_ce20001b-perbl TO monat.
          CLEAR S815.
          READ TABLE IT_ZPL_MCS5 WITH KEY KONDA = IT_CE20002B_815-KONDA
                                           BINARY SEARCH.
            SELECT SINGLE * FROM S815 WHERE VRSIO = '000'
                                         AND SPMON = MONAT
                                         AND KONOB = 'APO'
                                         AND MVGR2 = IT_CE20002B_815-KONDA
                                         AND PRODH = IT_CE20002B_815-PRDHA
                                         AND WERKS = IT_CE20002B_815-WERKS.
                                        AND VTWEG EQ CO_VTWEG_99.
    BREAK SAMEE.
          IF SY-SUBRC EQ 0.
    Eintrag in S810 existiert
            IF S815-AEMENGE <= IT_CE20002B_815-VVB01001.
    wenn die Auftragseingangsmenge kleiner gleich der Kontingentsmenge
    wird die Kontingentmenge in das Steploop übernommen
              MOVE IT_CE20002B_815-VVB01001 TO  W_T_DATA_815-KCQTY.
    *Liste ausgeben
             PERFORM AUSGABE4.
              PERFORM AUSGABE4_815.
            ELSE.
    Ausgabe Fehlermeldung, wenn die Auftragsmenge größer als die
                           Kontingentmenge ist.
    *Liste mit fehlermeldungen ausgeben, Kontingent trotzdem übernehmen
              MOVE IT_CE20002B_815-VVB01001 TO  W_T_DATA_815-KCQTY.
             PERFORM AUSGABE_FEHLER4.
              PERFORM AUSGABE_FEHLER4_815.
            delete it_ce20002b index indx.
            continue.
            ENDIF.
          ELSE.
    Es existiert kein Eintrag in S810, dann direkt eingeben
            MOVE IT_CE20002B_815-VVB01001 TO W_T_DATA_815-KCQTY.
            MODIFY IT_CE20002B_815 INDEX INDX.
    *Liste ausgeben (Kein Eintrag in S810)
           PERFORM EINTRAG2.
            PERFORM EINTRAG2_815.
          ENDIF.
    *Übergabestructur für die Weiterverarbeitung durch das Copymanagement
    *im Functionsbaustein wird gefüllt.
          W_T_DATA_815-SPMON = MONAT.   "itab_ce20001a-perbl.
          W_T_DATA_815-KONOB = CO_KONOB_APO.
          READ TABLE IT_ZPL_MCS5 WITH KEY KONDA = IT_CE20002B_815-KONDA
                                          BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            W_T_DATA_815-MVGR2 = CO_MVGR2_999.
          ELSE.
            W_T_DATA_815-MVGR2 = IT_CE20002B_815-KONDA.
          ENDIF.
          W_T_DATA_815-WERKS = IT_CE20002B_815-WERKS.
          W_T_DATA_815-PRODH = IT_CE20002B_815-PRDHA.
         W_T_DATA_815-VTWEG = '99'.
         W_T_DATA_815-KUNNR = '9999999999'.
          W_T_DATA_815-KCQTY = IT_CE20002B_815-VVB01001.
          W_T_DATA_815-BASME = IT_CE20002B_815-VVB01_ME.
    JR181005 - begin of ins.
         w_t_data_810-matkl = it_ce20002b-matkl.
    JR181005 - end of ins.
          APPEND W_T_DATA_815 TO TAB_DATA.
          CLEAR IT_CE20002B_815.
        ENDLOOP.
    thanks for reply
    rico

  • Rfc enabled function module for the updating the database table

    Hi,
            I need one rfc enabled function module for the updating the database table from the legacy system.currently i am using the rfc_read_table to read the database table.similarly i need for the update.

    Hi
    I believe you need to create one by yourself
    Max

  • After REFRESH the cached object is not consistent with the database table

    After REFRESH, the cached object is not consistent with the database table. Why?
    I created a JDBC connection with the Oracle database (HR schema) using JDeveloper(10.1.3) and then I created an offline database (HR schema)
    in JDeveloper from the existing database tables (HR schema). Then I made some updates to the JOBS database table using SQL*Plus.
    Then I returned to the JDeveloper tool and refreshed the HR connection. But I found no any changes made to the offline database table JOBS in
    JDeveloper.
    How to make the JDeveloper's offline tables to be synchronized with the underling database tables?

    qkc,
    Once you create an offline table, it's just a copy of a table definition as of the point in time you brought it in from the database. Refreshing the connection, as you describe it, just refreshes the database browser, and not any offline objects. If you want to syncrhnonize the offline table, right-click the offline table and choose "Generate or Reconcile Objects" to reconcile the object to the database. I just tried this in 10.1.3.3 (not the latest 10.1.3, I know), and it works properly.
    John

  • To replace values of one of the field in the database table

    How to replace values of one of the field in the database table with a new values? Pls help to solve

    Hi
    You can use the UPDATE command to update one of the field value in a table
    see the UPDATE syntax and use it
    but in real time you should not do like this
    Regards
    Anji

  • The type of the database table and work area are not Unicode convertible

    ***Data declaration
    TYPES : BEGIN OF t_zle_lagerplanung,
                       SEl, "stores which row user has selected
                       kdauf TYPE zle_lagerplanung-kdauf,
                       kdpos TYPE zle_lagerplanung-kdpos,
                       etenr TYPE zle_lagerplanung-etenr,
                       papiermaschine TYPE zle_lagerplanung-papiermaschine,
                       runnr TYPE zle_lagerplanung-runnr,
                       prio TYPE zle_lagerplanung-prio,
                       werk TYPE zle_lagerplanung-werk,
                       durchmesser TYPE zle_lagerplanung-durchmesser,
                       breite TYPE zle_lagerplanung-breite,
                       anzle TYPE zle_lagerplanung-anzle,
                       lgpla TYPE zle_lagerplanung-lgpla,
                       lgtyp TYPE zle_lagerplanung-lgtyp,
                       art TYPE zle_lagerplanung-art,
                       anzhoehe TYPE zle_lagerplanung-anzle,
                       fa TYPE zle_lagerplanung-fa,
    END OF t_zle_lagerplanung.
    DATA : it_zle_lagerplanung TYPE STANDARD TABLE OF t_zle_lagerplanung INITIAL SIZE 0,
                wa_zle_lagerplanung TYPE t_zle_lagerplanung.
    Here I am getting the data in internal table by using thiis select statement.
    SELECT kdauf kdpos etenr papiermaschine runnr prio werk durchmesser breite
                  anzle lgpla lgtyp art anzhoehe fa
    FROM    zle_lagerplanung INTO CORRESPONDING FIELDS OF TABLE it_zle_lagerplanung
    WHERE  kdauf IN s_kdauf
    AND       KDPOS IN s_kdpos
    AND      werk = p_werks.
    But while updating the particular field in zle_lagerplanung using this statement
    UPDATE zle_lagerplanung from table it_zle_lagerplanung.
    it is giving syntax error
    "The type of the database table and work area (or internal table)
    "IT_ZLE_LAGERPLANUNG" are not Unicode convertible. "
    Could any one help me out how to resolve this problem....
    Thanks in advance

    Dear Shayamal,
    XXX....are not Unicode convertible
    This  error comes while inserting or updating database and the fields are not matching between  data base table and structure .
    Check you fields of data base table and  "zle_lagerplanung" and struture "it_zle_lagerplanung" . There fields must match.
    thanks and regrds,
    Anup Banerjee

Maybe you are looking for

  • Problem copying text from word to dreamweaver

    Howdy.. had a problem copying text from a word doc (07) to dreamweaver, for some strange reason it missed a complete section in the middle, 2 paragraphs gone... no errors... no blank spaces, just would not copy and paste the section, everything b4 an

  • Rollovers & actions work in Firefox but not IE

    Hello, The site www.lamps-on-line.com has rollovers and actions created a few years ago in GoLive and now these effects only work in Firefox, but not in Interenet Explorer (IE7), which displays page errors.  Is there a way to fix this? I acknowledge

  • Error while using pkgadd comand in Solaris 5.6

    Hi all, I am doing some R&D with Packaging in Solaris 5.6 for our project requirement. First i created one simple package, installed the package, tested it and removed. Then i am trying to create a package with the same files with extra depend file t

  • Address Book synching only half-works

    My iPod Classic seems unable to keep straight which addresses and phone numbers are "home" and which ones are "work", and, though my older iPod Photo could do it, does not seem able to transfer information from the "Notes" field. Is there any solutio

  • Ipod Touch 2.0 stuck saying "Restoring iPod Software"

    I downloaded 2.0 and it downloaded ok, but now, when it gets to the point to restore software, the green bar just barely starts and then it stays there... anyone have any suggestions? Oh, and it has been at this point overnite, and has not moved!!!