Problem while creating MS-ACCESS tables from Internal tables

Hi All,
I need to create Access tables from the Internal tables of an ABAP program.
I am using RIACCESS program to create Access table and  FM TABLE_EXPORT_TO_MSACCESS for populating the records into Access table.
Internal table name is ITAB1. I have created Z table with the same number of fields of ITAB1.
Key fields of Ztable is MANDT and Project ID.
I have two problems.
1. When I am trying to create access table from RIACCESS, the Access table is not having the MANDT and Project ID as key fields. Is there any way to pass the Internal table with key fields to the selection parameter of RIACCESS?
2. How to avoid the MANDT field from the Access table.
Please help me.
Thanks,
Prabhakar

select * from tablo@aaa;
ERROR at line 1:
ORA-02085: database link AAA.US.ORACLE.COM connects to HO.WORLD
Why is it unsuccessful?
02085, 00000, "database link %s connects to %s"
// *Cause: a database link connected to a database with a different name.
//  The connection is rejected.
// *Action: create a database link with the same name as the database it
//  connects to, or set global_names=false.
//Maybe a configuration mismatch somewhere? What's your global_names setting?
you should look in the trace files, enable listenner logging and tracing to get more clues about EOF error.
Yoann.

Similar Messages

  • Can not insert or update [TABLE] from internal table in method

    I've faced a problem with OO abap. I've tried to insert into [ TABLE ] from internal table, but i've got error msg after i compiled.
    "An explicit work area is necessary in the OO context. Use "INSERT wa INTO [TABLE] itab""
    After  i changed to loop in work area and INSERT INTO  [TABLE] VALUES gw_data., everything is fine, can compile and run.
    This is error code.
      METHOD set_data_to_table.
        REFRESH gi_data.
        CLEAR gi_data.
        IF gi_file[] IS NOT INITIAL.
    * Set data for modify table
          LOOP AT gi_file INTO gw_file.
            MOVE-CORRESPONDING gw_file TO gw_data.
            me->conversion_input( EXPORTING im_vendor = gw_data-vendor
                                  CHANGING  ch_vendor = gw_data-vendor ).
            APPEND gw_data TO gi_data.
          ENDLOOP.
          INSERT [TABLE] FROM TABLE gi_data.
    *      LOOP AT gi_data INTO gw_data.
    *        INSERT INTO  [TABLE] VALUES gw_data.
    *        IF sy-subrc = 0.
    *          COMMIT WORK.
    *        ELSE.
    *          ROLLBACK WORK.
    *        ENDIF.
    *      ENDLOOP.
        ELSE.
          MESSAGE 'No data found' TYPE 'I'.
        ENDIF.
      ENDMETHOD.                    "set_data_to_table

    Hi Matthew,
    I think there is no difference in database insert between OO and non-OO.
    The correct syntax according to ECC600 online documentation is
    [Inserting Several Lines|http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm]
    To insert several lines into a database table, use the following:
    INSERT target FROM TABLE itab \[ACCEPTING DUPLICATE KEYS].
    This writes all lines of the internal table itabto the database table in one single operation. If one or more lines cannot be inserted because the database already contains a line with the same primary key, a runtime error occurs. You can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS.
    Whenever you want to insert more than one line into a database table, it is more efficient to work with an internal table than to insert the lines one by one.
    I think the syntax
    INSERT my_dbtable FROM TABLE gi_data.
    should work, your suggestion may lead to syntax error.
    Regards,
    Clemens

  • Modify database table from internal table

    Hi All,
    I need to update database table from internal table which is having around 30000 records.
    I am using MODIFY tabname FROM TABLE int_tabname...
    Using this statement, I can modify the databse records very well. But user has some additional requirement.
    He wants that the table should be modified from the internal table and after modification we should have the erroneous records to be displayed if any.
    e.g. if 1500 records out of 30000 are erroneous then only 28500 records should be updated and 1500 records should be displayed as erroneous records so that the user can correct them and use them again for executing the program.
    Is there any FM which imports the database table name and internal table, modifies the database and exports an internal tanle with erroneous records?
    Any help will be appriciated,
    Regards,
    Neha

    Hi
    modifying datbase table useing internal table
    <b>advises</b> before updating this datbase table plz lock that table to avoid incosistency
    write the logic for modifying
    Modify the database table as per new dunning procedure
      MODIFY fkkvkp FROM TABLE lt_fkkvkp   .
    and finally unlock the table
    <b>example</b>
    *To lock table for further operations
      constants: lc_tabname TYPE  rstable-tabname  VALUE 'FKKVKP'  . "FKKVKP
      CALL FUNCTION 'ENQUEUE_E_TABLE'
        EXPORTING
          tabname        = lc_tabname
        EXCEPTIONS
          foreign_lock   = 1
          system_failure = 2
          OTHERS         = 3.
      IF sy-subrc EQ 0.
      To fetch all the contract accounts for customers of the segment
      Households/SME.
        PERFORM fetch_contract_accounts using lc_tabname .
      ENDIF.                    " IF sy-subrc EQ 0.
    *wrote the logic
    Modify the database table as per new dunning procedure from internal table
      MODIFY fkkvkp FROM TABLE lt_fkkvkp   .
    *unlock the tbale
      CALL FUNCTION 'DEQUEUE_E_TABLE'
       EXPORTING
         TABNAME   =  uc_tabname .
    <b>Reward if usefull</b>

  • Fill database table from internal table

    I made one table ZDISP_CHDOC_CC and want to fill that table from internal table.and i got runtime error. that duplicate entry
    and two entry are like 10 200000    likhp 10
                                        10 200000    likp   10
    DESCRIBE TABLE IT_CHDOC .
        LOOP AT IT_CHDOC.
        INSERT ZDISP_CHDOC_CC FROM  IT_CHDOC.
        endloop.
        IF SY-SUBRC = 0.
          COMMIT WORK.
        ELSE.
    and when i used following then only one entry is insreted.
    DESCRIBE TABLE IT_CHDOC .
        LOOP AT IT_CHDOC.
        INSERT ZDISP_CHDOC_CC FROM  IT_CHDOC.
        IF SY-SUBRC = 0.
          COMMIT WORK.
    endloop.
        ELSE.

    Hi,
    Replace your current code
    DESCRIBE TABLE IT_CHDOC .
    LOOP AT IT_CHDOC.
    INSERT ZDISP_CHDOC_CC FROM IT_CHDOC.
    endloop.
    IF SY-SUBRC = 0.
    COMMIT WORK.
    ELSE.
    WITH THE ONE GIVEN BELOW
    DESCRIBE TABLE IT_CHDOC .
    INSERT ZDISP_CHDOC_CC FROM TABLE IT_CHDOC ACCEPTING DUPLICATE KEYS.
    IF SY-SUBRC = 0.
    COMMIT WORK.
    ELSE.
    Regards,
    Siddarth

  • Updating database table from internal table

    I am updating the database table from internal table for this is have used the following syntax
    Update kna1 from table itab.
    And it is giving error message as the work are itab is not long enough.
    Please help me.

    Hi,
       Refer this code
    *&      Form  SUB_READ_UPDATE_BSEG
          text
    FORM sub_read_update_bseg.
      IF NOT it_final[] IS INITIAL.
        LOOP AT it_final INTO wa_final.
          UPDATE bseg SET zuonr = wa_final-ccnum
                      WHERE bukrs EQ wa_final-bukrs
                      AND   belnr EQ wa_final-vbeln
                      AND   rfzei EQ wa_final-rfzei
                      AND   saknr NE ' '.
        ENDLOOP.
    *--Message data updated successfully
        MESSAGE i888 WITH text-002.
        LEAVE LIST-PROCESSING.
      ELSE.
    *--Message No data found
        MESSAGE i888 WITH text-003.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " SUB_READ_UPDATE_BSEG
    Regards,
    PRashant

  • Fill dinamic internal table from internal table

    Hi gurus i need to know how can i fill a dinamic interna table from another internal table
    example i have  the table called it_info with the followin information
    field1    field2         field3
    Alex     Ross           1
    Rita      Campos       1
    because i have the same value in field 3 i have to agroup register 1 and 2  in the same line so the data should be in the next way
    Field1 field2  field3  field4 field5
    Alex    Ross   1        Rita    Campos
    I have made a dinamic interna table so my table has the 5 fields but i dont know how to trasfer the data to my dinamic internal table, any idea? my source code:
          it_campos-campo = 'Field1'. APPEND it_campos.
          it_campos-campo = 'Field2'. APPEND it_campos.
          it_campos-campo = 'Field3'. APPEND it_campos.
          it_campos-campo = 'Field4'. APPEND it_campos
        loop at  it_campos .
          t_fieldcat_wa-col_pos = SY-TABIX.
          t_fieldcat_wa-fieldname = it_campos-campo.
          APPEND t_fieldcat_wa TO t_fieldcat.
        endloop  .
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
            it_fieldcatalog            = t_fieldcat
        IMPORTING
            ep_table                   = tabla
        EXCEPTIONS
            GENERATE_SUBPOOL_DIR_FULL  = 1
        others                         = 2.
        ASSIGN tabla->* TO <l_table>.
        CREATE DATA ep_line LIKE LINE OF <l_table>.
        ASSIGN ep_line->* TO <l_line>.
    Now my dinamic internal table <l_table> is ready but how should i trasnfer the it_info data to this other table?

    This method (cl_alv_table_create=>create_dynamic_table) is really old-fashioned and counter-performant and limited as it uses GENERATE SUBROUTINE POOL statement.
    Instead you should now use RTTC to create data, search forum for more information (sometimes referred as RTTS or RTTI, though this last one doesn't correspond to creation; you'll have to use CREATE DATA statement).
    That said, your question has been asked many times in the forum: http://www.sdn.sap.com/irj/scn/advancedsearch?query=filldynamicinternal+table.
    To help you a little bit, you need to use ASSIGN and FIELD-SYMBOLS statements (ASSIGN COMPONENT field_name OF STRUCTURE <fs_line> TO <fs_field>)

  • How to update database table from Internal Table

    hi experts,
        Can anyone please assist me in inserting records to a database table from an Internal Table
    whose structures are identical.
    Thanks in Advance,
    Sudhaa............

    Hi Sudha,
    Here are some example of update and insert:
    UPDATE SFLIGHT SET PLANETYPE = 'A310'
    PRICE = PRICE - '100.00'
    WHERE CARRID = 'LH' AND CONNID = '0402'.
    This example overwrites the contents of the PLANETYPE column with A310 and decreases the value of the PRICE column by 100 for each entry in SFLIGHT where CARRID contains u2018LHu2019 and CONNID contains u2018402u2019.
    TABLES SPFLI.
    DATA WA TYPE SPFLI.
    MOVE 'AA' TO WA-CARRID.
    MOVE '0064' TO WA-CONNID.
    MOVE 'WASHINGTON' TO WA-CITYFROM.
    UPDATE SPFLI FROM WA.
    MOVE 'LH' TO SPFLI-CARRID.
    MOVE '0017' TO SPFLI-CONNID.
    MOVE 'BERLIN' TO SPFLI-CITYFROM.
    UPDATE SPFLI.
    CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
    DATA: ITAB TYPE HASHED TABLE OF SPFLI
    WITH UNIQUE KEY CARRID CONNID,
    WA LIKE LINE OF ITAB.
    WA-CARRID = 'UA'. WA-CONNID = '0011'. WA-CITYFROM = ...
    INSERT WA INTO TABLE ITAB.
    WA-CARRID = 'LH'. WA-CONNID = '1245'. WA-CITYFROM = ...
    INSERT WA INTO TABLE ITAB.
    WA-CARRID = 'AA'. WA-CONNID = '4574'. WA-CITYFROM = ...
    INSERT WA INTO TABLE ITAB.
    UPDATE SPFLI FROM TABLE ITAB.
    This example fills a hashed table ITAB and then overwrites the lines in SPFLI that have the same primary key (CARRID and CONNID) as a line in the internal table.
    Insert statement :
    TABLES SPFLI.
    DATA WA TYPE SPFLI.
    WA-CARRID = 'LH'.
    WA-CITYFROM = 'WASHINGTON'.
    INSERT INTO SPFLI VALUES WA.
    WA-CARRID = 'UA'.
    WA-CITYFROM = 'LONDON'.
    INSERT SPFLI FROM WA.
    SPFLI-CARRID = 'LH'.
    SPFLI-CITYFROM = 'BERLIN'.
    INSERT SPFLI.
    If the database table does not already contain a line with the same primary key as specified in the work area, the operation is completed successfully and SY-SUBRC is set to 0. Otherwise, the line is not inserted, and SY-SUBRC is set to 4.
    Regards,
    Premraj kaushik

  • Add records to the physical table from Internal table

    Hello,
    I am trying to insert the records from IT table to physical table. But, its not inserting. Please let me know how do I add the records to the table zebp_iv_cf_log.
    I have used only few fields for example *
    After looping I get about 800 records in it_non_ebp tab *
    loop at non_ebp_inv.
        it_non_ebp-zspgrv = non_ebp_inv-spgrv.
        it_non_ebp-zspgrq = non_ebp_inv-spgrq.
        it_non_ebp-zspgrs = non_ebp_inv-spgrs.
        it_non_ebp-inv_ref_num = non_ebp_inv-xblnr.
        it_non_ebp-zspgrc = non_ebp_inv-spgrc.
        it_non_ebp-zlifnr = non_ebp_inv-lifnr.
        append it_non_ebp.
        endloop.
        insert   zebp_iv_cf_log from table it_non_ebp[] accepting duplicate keys .
    I also tried inserting one by one by putting insert syntex within a loop but, it takes keeps processing.
    Shall appreciate the response.
    Thks & Rgds,
    Hemal
    Edited by: hemalgandhi on Jun 12, 2009 6:27 PM

    Hi,
    for the internal table you are using for appending , you must declare it with the header line option
    as
    data it_non_ebp type table of zebp_iv_cf_log with HEADER LINE.
    or else you can have a separate workarea of type zebp_iv_cf_log
    as
    data wa_zebp_iv_cf_log type zebp_iv_cf_log.
    then the code should be like :
    loop at non_ebp_inv.
    wa_zebp_iv_cf_log -zspgrv = non_ebp_inv-spgrv.
    wa_zebp_iv_cf_log -zspgrq = non_ebp_inv-spgrq.
    wa_zebp_iv_cf_log -zspgrs = non_ebp_inv-spgrs.
    wa_zebp_iv_cf_log -inv_ref_num = non_ebp_inv-xblnr.
    wa_zebp_iv_cf_log -zspgrc = non_ebp_inv-spgrc.
    wa_zebp_iv_cf_log -zlifnr = non_ebp_inv-lifnr.
    append wa_zebp_iv_cf_log to it_non_ebp.
    clear wa_zebp_iv_cf_log .
    endloop.
    and use 
       modify zebp_iv_cf_log from table it_non_ebp accepting duplicate keys .
    instead of
       insert zebp_iv_cf_log from table it_non_ebp[] accepting duplicate keys .
    Please try out and let me know of you face any problem

  • Problem while creating a Sales Order from RFC

    Dear All,
    I get an error ( Errror ID "TD" Number "600" ) "Text XXXXXXXXXX000001 ID X106 language EN not found" whenever I try to create a Sales Order for a particular Customer and Material.
    But when I create Manually using VA01 for the same details, a Sales Order is created Successfully.
    The error is coming from the Standard Function Module "SD_SALES_ITEM_MAINTAIN".
    Please let me know if any of you have come accross similar problem and if yes, please provide me a solution.
    Thanks and Regards,
    Dinakaran.R

    Hi Dinakaran,
    How ru passing the values in the RFC????
    pass the item details through the tables option of FM...else it will give the error...
    Regards,
    Vamshi

  • Script- problem in printing the values in from internal table

    Hi all,
    I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
    The problem is i should take the invoice number, invoice date, number of days  from TABLE <b>BSEG</b> and  inovice amount and start date, end date from table<b> INTITIT</b>.  for a particular document number there are diffent invoce numbers in both the table.
    i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
    data:   begin of hbseg occurs 10.
            include structure hsortp.
            include structure bseg.
    data:   end of hbseg.
    data: begin of hsortp,
            sortp1 like sortp1,
            sortp2 like sortp2,
            sortp3 like sortp3,
            sortp4 like sortp4,
            sortp5 like sortp5,
            EKVBD  LIKE KNB1-EKVBD,
          end   of hsortp.
    loop at hbseg.
            WHERE BUKRS = SAVE_BUKRS.
              save_bukrs  = hbseg-bukrs.
              if  ( hbseg-kunnr = save_kunnr
              and   not save_kunnr is initial )
              or  ( hbseg-lifnr = save_lifnr
              and   not save_lifnr is initial ).
               clear bseg.
                move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
                  perform curr_document_convert_bseg
                              using
                                 bkpf-budat
                                 *bkpf-waers
                                 *bkpf-hwaer
                                 bkpf-waers
                              changing
                                 bseg.
                  if not bseg-pycur is initial.
                    alw_waers = bseg-pycur.
                    perform currency_get_subsequent
                                using
                                   save_repid
                                   bkpf-budat
                                   bkpf-bukrs
                                changing
                                   alw_waers.
                    if alw_waers ne bseg-pycur.
                      bseg-pycur = alw_waers.
                      perform convert_foreign_to_foreign_cur
                                  using
                                     bkpf-budat
                                     *bkpf-waers
                                     *bkpf-hwaer
                                     bseg-pycur
                                  changing
                                     bseg-pyamt.
                    endif.
                  endif.
                endif.
                perform fill_waehrungsfelder_bseg.
                perform fill_waehrungsfelder_bseg_2.
                if bseg-sgtxt(1) ne '*'.
                  bseg-sgtxt = space.
                else.
                  bseg-sgtxt = bseg-sgtxt+1.
                endif.
                clear save_bschl.
                clear save_umskz.
                clear tbslt.
                save_bschl = bseg-bschl.
                save_umskz = bseg-umskz.
                perform read_tbslt.
    ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
               v_gsaldf = rf140-gsaldf + rf140-wrshb.
               rf140-gsaldf = v_gsaldf.
               clear v_gsaldf.
    SUNIL *********************
                 *rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
                if  xmultk is initial
                and xactiv is initial
                and linecnt = '1'
                and not      xumsst is initial
                and not save_xumstn is initial.
                  if bkpf-bstat = 'V'.
                    perform read_vbset.
                  else.
                    perform read_bset.
                  endif.
                  describe table hbset lines linecnt.
                  if linecnt = '1'.
                    loop at hbset.
                      move-corresponding hbset to bset.
                       *bset = bset.
                      if bkpf-waers ne *bkpf-waers.
                        perform curr_document_convert_bset
                                    using
                                       bkpf-budat
                                       *bkpf-waers
                                       *bkpf-hwaer
                                       bkpf-waers
                                    changing
                                       bset.
                      endif.
                      clear rf140-msatz.
                      clear rf140-vtext.
                      save_ktosl = bset-ktosl.
                      perform read_t687t.
                      rf140-msatz = bset-kbetr / 10.
                       *rf140-msatz = rf140-msatz.
                      rf140-vtext = save_vtext.
                       *rf140-vtext = rf140-vtext.
                      if bset-shkzg = 'H'.
                        rf140-mwshb = bset-fwste.
                         *rf140-mwshb = *bset-fwste.
                        rf140-mdshb = bset-hwste.
                         *rf140-mdshb = *bset-hwste.
                      else.
                        rf140-mwshb = 0 - bset-fwste.
                         *rf140-mwshb = 0 - *bset-fwste.
                        rf140-mdshb = 0 - bset-hwste.
                         *rf140-mdshb = 0 - *bset-hwste.
                      endif.
                      exit.
                    endloop.
                    rf140-wrshb = rf140-wrshb - rf140-mwshb.
                     *rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
                    rf140-dmshb = rf140-dmshb - rf140-mdshb.
                     *rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
                  endif.
                endif.
    *****************Begin of Change by Karthikeyan J********************
                i_count = i_count + 1.
                clear rf140-element.
                clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
    comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
                select single * from bseg into
                corresponding fields of it_bseg where belnr = bseg-rebzg  anD GJAHR = BSEG-GJAHR.
                select single * from intitit into corresponding fields of  it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
    added by Jayshree on 09/01/2007
                MOVE ' ' TO it_kna1-name1.
                SELECT SINGLE name1
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
                WHERE a~vbeln = it_bseg-vbeln
                  AND a~parvw = 'zd'.
                SELECT SINGLE fkdat
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM vbrk
                WHERE vbrk~vbeln = it_bseg-vbeln.
    added by Jayshree on 01/02/2007
              CONCATENATE  it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
                INTO vfkdat SEPARATED BY '.'.
              CONCATENATE  it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
                INTO vaugdt SEPARATED BY '.'.
                i_wrbtr = i_wrbtr + it_bseg-wrbtr.
    added as on 29.06.2007 by jayshree again transport  on 21.07.2007
                tot_wrbtr = tot_wrbtr + i_wrbtr.
                i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
                CALL FUNCTION 'fima_date_create'
                  EXPORTING
                    i_date                        = it_bseg-zfbdt
                 I_FLG_END_OF_MONTH            = ' '
                 I_YEARS                       = 0
                 I_MONTHS                      = 0
                   i_days                        = i_totday
                 I_CALENDAR_DAYS               = 0
                 I_SET_LAST_DAY_OF_MONTH       = ' '
                 IMPORTING
                   e_date                        = i_bday
                 E_FLG_END_OF_MONTH            =
                 E_DAYS_OF_I_DATE              =
    added by JAYSHREE 01.02.2007
                CONCATENATE  i_bday6(2) i_bday4(2) i_bday+2(2)
                INTO vbday SEPARATED BY '.'.
                i_day = it_bseg-augdt - i_bday.
            CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
              EXPORTING
                date1                         = it_bseg-zfbdt
                date2                         = it_bseg-augdt
               OUTPUT_FORMAT                 = '01'
             IMPORTING
               YEARS                         =
               MONTHS                        =
               DAYS                          = i_day
             EXCEPTIONS
               INVALID_DATES_SPECIFIED       = 1
               OTHERS                        = 2
            IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *added by sunil 5.11.07 ***********
    *read table it_intitit with key BELNR_TO = BSEG-BELNR  .
    *LOOP AT IT_INTITIT.
                rf140-element = '521'.
                CALL FUNCTION 'write_form'
                  EXPORTING
                    window  = 'main'
                    element = '521'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
                IF sy-subrc = 1.
                  window = 'main'.
                  PERFORM message_window.
                ENDIF.
                IF sy-subrc = 2.
                  window = 'main'.
                  ereignis = '521'.
                  PERFORM message_element.
                ENDIF.
                IF save_xumstn IS INITIAL.
    *-------Umsatzsteuer -
                  IF xactiv IS INITIAL.
                    save_waers = rf140-waers.
                    PERFORM tax_data.
                    CLEAR taxlines.
                    DESCRIBE TABLE atax LINES taxlines.
                    IF NOT taxlines IS INITIAL.
                      LOOP AT atax.
                        CLEAR ereignis.
                        CLEAR rf140-msatz.
                        CLEAR rf140-vtext.
                        rf140-msatz = atax-msatz.
                         *rf140-msatz = atax-msatz.
                        rf140-vtext = atax-vtext.
                         *rf140-vtext = atax-vtext.
    *******begin of change by karthikeyan on 10.03.06*********************
                        IF sy-tabix = '1'.
                          ereignis = '522'.
                          v_stax = rf140-msatz * rf140-gsaldf / 100.
                        ELSE.
                          ereignis = '523'.
                          v_ecs = rf140-msatz * v_stax / 100.
                          v_total = rf140-gsaldf + v_stax + v_ecs.
                        ENDIF.
                        CALL FUNCTION 'hr_in_chg_inr_wrds'
                          EXPORTING
                            amt_in_num               = v_total
                          IMPORTING
                            amt_in_words             = v_spell
                        EXCEPTIONS
                          DATA_TYPE_MISMATCH       = 1
                          OTHERS                   = 2
                        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                        ENDIF.
    ***************************end of change******************************
                        CLEAR rf140-element.
                        rf140-element = ereignis.
                        IF NOT ereignis IS INITIAL.
                          CALL FUNCTION 'write_form'
                            EXPORTING
                              window  = 'main'
                              element = ereignis
                            EXCEPTIONS
                              window  = 1
                              element = 2.
                          IF sy-subrc = 1.
                            window = 'main'.
                            PERFORM message_window.
                          ENDIF.
                          IF sy-subrc = 2.
                            window = 'main'.
                            PERFORM message_element.
                          ENDIF.
                        ENDIF.
                      ENDLOOP.
                    ENDIF.
                  ENDIF.
                ENDIF.
               ENDLOOP.
              ENDIF.
            ENDLOOP.
    '521' is the element name in the main  window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT.  Belnr is the document no with ref to that
    there are number  of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT  in belnr only it is taking single value it is not getting refreshed.
       move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
    this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
    How to write the syntax for INTITIT? As per invoice number it is giving new values.
    The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
    it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE)  rf140-wrshb(INTREST AMOUNT).
    THE VALUE OF IT_BESG-REBZG IS CHANGING  BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
    ONLY SINGLE RECORD.
    for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
    here in bseg-rebzg is chaning but in INTITIT-BELNR IS  not changing.
    If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
    a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
    Please help me out it is very urgent.
    <b>USEFUL ANSWERS WILL BE REWARDED.</b>
    regards,
    Sunil kumar.

    assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
    try with AT NEW - ENDAT.
    AT NEW belnr.
    here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
    ENDAT.
    pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
    thanq
    Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM

  • Problem: While creating PO partners differ from vendor

    Hi all,
    There was a problem with two users in our production system. They created several POs for several vendors, and all of them return in PO tab "Partners" different information (different vendors), than the one on Vendors Master Data. All "Partners Functions" configuration is correct. This only happens with these two users. Example:
    Vendor 111 Master Data tab "Partner Functions":
    - Function FO: Vendor 111 (display mode)
    - Function VN: Vendor 111 (display mode)
    - Function PI: Vendor 111 (change mode)
    PO created for Vendor 111, tab "Partners":
    - Function FO: Vendor 222 (display mode)
    - Function VN: Vendor 222 (display mode)
    - Function PI: Vendor 222 (change mode)
    Can anybody please tell me where the problem may be and why this happens??
    Thanks in advance,
    MG

    Go with SE16 to table EKPA and check what this table has for your PO number and partner VN.
    I bet it is 222.
    Maybe someone has changed the vendor of the PO, instead of the partner. and the PO was originally created with vendor 222 and was then changed to vendor 111 (before saving)
    the program fix is in OSS Note 1385935 - Incorrect partner determination
    However,  like always, SAP does not give you a solution how to correct the wrong data in the database

  • Create XML file from internal table and vise a versa

    Hi Friends,
    I have requirement to create an XML string from internal table data and also read XML string data to internal table.
    Can anybody tell are there any Function Modules or methods existing for this?
    Thanks.
    Krishna Yerram.

    1. Write XSLT program. T.code XSLT . e.g. XSLT name "ZTRANS".
    2. Write ABAP program
    Which includes declaration of internal tables
    that you need "IT_DATA".
    Upload XML data to an internal table "IT_XML "
    use below statement to convert XML to internal table.
    Call transformation ZTRANS
    source XML IT_XML
    result IT_DATA.

  • How to update whole external table(in ABAP dictionary) from internal table at once

    Hi,
    How can I update the content of the external table (in ABAP dictionary) from the content of internal table data at once. I created the internal tables with out the header line, with the work area. I tried UPDATE TARGET_EXTERNAL_TABLE FROM TABLE INTERNAL_TABLE. But it returns 4 for sy-subrc and did not work.
    Thank you
    Regards.
    CHINTHAKA

    Hi Feiyun Wu,
    Thank you very much. Your code worked. Is there any way to replace the whole content of the external table from internal table data ?
    Regards,
    Chinthaka

  • Is it possible to update internal table from database table

    Hello All:
              I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
    thanks.
    Mithun

    Hello my friend,
    You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
    To update some fields at once use:
    UPDATE DBTABLE FROM TABLE IT_TABLE
    Hope this helps!!
    Gabriel

  • Update databse from internal table statement not using index

    Hi Guys,
    We are updating a databse table from a file. The file has a couple of fields which have data different from what the database has (non-primary fields :). We upload the file data into an internal table and then update the database table from internal table. At a time, internal table is supposed to have 10,000 records. I did SQL trace and found that the update statement is not making use of the databse index.
    Should not the update statement here be using the table index (for primary key)?
    Regards,
    Munish

    ... as often there are recommendations in this forum which makes me wonder, how people overestimate their knowledge!!!
    Updates and Deletes do of course use indexes, as can be seen in the SQL Trace (use explain).
    Inserts don't use indexes, because in many databases inserts are just done somewhere, But also with the INSERT, the primary key is the constraint for the uniqueness condition, duplicate keys are not allowed.
    Coming to the original question, what is you actually coding for the update?
    What is the table, which fields are in the internal table and what are the indexes?
    Siegfried

Maybe you are looking for