Update on FI-table BSEG

Hi,
i have an abap where i make a
update bseg set mansp = 'value' where cond..........
The update in bseg works well, BUT: the corresponding fields in BSID or BSAD are NOT updated. As bseg is a cluster-table i thought that the update in bsid and bsad will take place automaticly ???
How can i handle this ?

Martin,
As I said you should <b><u>NEVER EVER </b></u> update the standard database tables directly. If you can tell us the details of the business process then we probably can suggest a suitable function module to update the required details.
The problem with updating directly, we don't know what are the related tables and where all its going to affect us leading us to inconsistent data in the tables.
Regards,
Ravi
Note : Please mark all the helpful answers

Similar Messages

  • TDS amount not getting updated in the table under the field QBSHB

    Dear Friends,
    The TDS amount entered while booking the vendor invoices through MIRO T-cde, is not getting updated in the table BSEG under the field QBSHB. 
    Kindly let me know the reason for the same and guide me to correct it
    TIA.
    Regards,
    Vincent

    HI Vincent,
    Bseg-QBSHB field is relavent for classic WT.
    I hope you are using the EWT.
    Hence if you post a document through MIRO it will not update
    (but if you post document FB60 it will update but wrongly).
    Reason is Miro document is posted through interface.
    Hence SAP is suggested to not refer the Bseg-QBSHB and etc., fields.
    refer only with_item table.
    Please refer the below replay from SAP
       Please refer the below note .363309
    Please review attached note 363309 for detailed explanation
    BSEG-QBSHB is designed to fill for the classic withholding tax. And
    extended withholding tax information is stored exclusive in table
    WITH_ITEM.
    You can check in table BSEG for the fields and will find that system
    do NOT update field BSEG-QBSHB.
    In your line layout,you define a field BSEG-QBSHB. But actully the field
    of vendor/customer line item is filled with zero from FI. Thus,it shows
    zero in line item display.
    And as note 363309 says,
    "Remove the field which contains the withholding tax information
    from your display variant.
    If you want to display the withholding tax information, double-click on
    the document number and subsequently choose 'Withholding tax' button."
    (BSEG-QSSKZ, BSEG-QSSHB, BSEG-QBSHB) field is not relavent for
    Extended withholding tax and not suppose to use in report FBL1N.
    It basically does not make any sense to use the withholding tax fields
    of the document line items (BSEG-QSSKZ, BSEG-QSSHB, BSEG-QBSHB) with the
    activated extended withholding tax.
    regards
    Madhu M
    Edited by: M Madhu on Jan 31, 2011 1:19 PM

  • Update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK

    Hi FI Gurus,
    I am looking after a Support Project in SAP IS-Retail. I am from the FI functional and possess very limited knowledge in FI.
    My client has done the sales posting in SAP using IDOC's. During the postings, it was found that wrong Profit Centers were assigned. Due to this, the sales reports based on Profit Center are coming wrong. It was suggested to the client to reverse the IDOCs, do necessary changes in Profit Centers and re-post the IDOCs. The client wanted a short method to get the reports right. A senior consultant (Non FI) in the Company and the Management are forcing me to write a ABAP program to update certain (not all) FI tables. According to me, it will have some negative impact on the system for which reason I am not ready to take the call as a Project Manager. The management wants me to do the following (I am quoting the same mail which I received from the consultant ) :
    We need to update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK / BSID / BSAD, wherever the records exists against billing document numbers provided.
    BAPI for updating profit center in Accounting documents: BAPI_ACC_DOCUMENT_POST
    Function Module : 'BAPI_DOCUMENT_CHANGE'
    Also look at SAP Note: Note 966428 - FB02: Functional area (FKBER) can be changed on coding block
    Based on the above, the ABAPer has written the program, the program will update the tables BSEG, BSIS, BSIK, according to the selection criteria of document number, company code and line item number with the new profit centers.
    Please clarify me about the following :
    1. This program is updating profit center in just the FI tables (BSEG, BSIS, BSIK etc.), but the New GL tables (faglflexa and faglflext) which have approx. 65 lakh entries in PRD do not get updated with the correct profit center.
    2. The Controlling tables also do not get updated with this program yet. Also since the previoius updation of Profit centers did not happen correctly, most of the times the controlling document has not been generated at all. Since we will be updating the profit center in just the FI tables, the controlling document will not be created still. Though there are SAP notes suggesting re-creation of the Controlling documents, which is still an option you can choose. Please confirm.
    3. The Special GL also does not get updated because of this.
    This is a very critical and hot issue. My job is at Stake as the Management has threatened me of sacking if I do not follow their directives as they are only concerned with their money.
    Is the consultant who suggested this change RIGHT ?
    Your early replies will help me take the decision.
    Regards

    Hi,
    There is no standard program or BAPI that would update profit centre in a posted document. You should either develop your own process for it,which is not recommended, but sometimes is essential, or reverse the existing documents and post them with the correct profit centre.
    Regards,
    Eli

  • GL Posting using BAPI BAPI_ACC_DOCUMENT_POST but not updating in table BSEG

    Hi Experts,
    Hope all are doing greatu2026
    I need you help to resolve the below issue.
    We have on Z-Tcode to GL Posting the document using BAPI u2018BAPI_ACC_DOCUMENT_POST' and this program is successfully posted from the source file and documnet # also created successully.
    We have entries in BKPF, but the table BSEG not updating and we do not have entries.
    Please help me on this regards,
    Thanks in Advance.
    Amjad

    Hi Srikant,
    Thanks for your reply...
    As you suggest, i have checked the structure ACCOUNTGL and below values are passing.
    ACCOUNTGL -ITEMNO_ACC
    ACCOUNTGL -GL_ACCOUNT
    ACCOUNTGL- ITEM_TEXT
    ACCOUNTGL- COMP_CODE
    ACCOUNTGL- COSTCENTER
    ACCOUNTGL- CS_TRANS_T
    Could you please suggest me if there are any  changes needs to do.
    Thanks & Regards,
    Amjad Hussain

  • Bapi or function module to update rstgr field in bseg table

    what is the bapi or function module used to update the fields in bseg table particularly "rstgr" field?

    Hi,
    Use Bapi
    BAPI_ACC_DOCUMENT_POST
    Regards,
    Prashant

  • Update a field in bseg table

    Hi experts,
    i want to update a field in BSEG  table (field name is BUPLA).
    Using UPDATE statement i am going to update the bseg table.
    I know only update statement.
    This my immediate requirement.
    please give me suggesstion.

    Hi,
    If you want to update the existing table record or field.. it is always advisable to use MODIFY statement instead of  UPDATE.
    syntax: 
    fetch the BSEG data to internal table IT_BSEG and do you modificaltions.
    Loop at it_bseg.
        it_bseg- XYZ = 'ABC'.
        it_bseg-UVW = '123'.
       modify it_bseg transporting XYZ  UVW .
    endloop.
    MODIFY BSEG FROM TABLE IT_BSEG   (here it_bseg is the internal table)
    COMMITWORK.
    Modify always check in the database whether the record exists or not if it is there it will modify the existing one.. otherwise create a new record.... in Update statement.. there is always a chance of creating a new record.. instead of updating the existing one...

  • BAPI to update Business Area in table BSEG and BSAD

    Hi,
    Is there any BAPI that will update the field Business Area in table BSEG and BSAD?
    Thanks,
    Ekit
    Moderator: Please, search SDN

    Hi,
    You can not update the business area in the posted documents.
    You need to reverse them and have to recreate.
    Regards,
    Gaurav

  • Updating custom fields in BSEG table

    Hi Experts,
    I searched through SDN but did not find satisfactory answer to my problem.
    The scenario is that FIDCC2 Idoc is coming to SAP system. This Idoc has extended to include few custom fields. These fields need to be updated in table BSEG. Table BSEG also contains these custom fields. However, the Idoc processing routine is not updating custom fields in table BSEG with the data coming in Idoc. How can I do that?
    Thanks in advance,
    Netrey

    This message is processed by function module IDOC_INPUT_FIDCC2. If you drill down into the code a little bit, you should be able to find BTE/open FI or user exit calls (CALL CUSTOMER-FUNCTION) before the document is being posted.
    I found two that are using the ACCIT structure for passing the line items, which should contain your customer fields as well, if they were added to BSEG properly (via transaction OXK3).
    Please have a look.
    Thomas

  • How to update the field ZLSPR of table BSEG

    HI Friends,
    Can anyone tell me how to update the field ZLSPR of table BSEG? I've a 700 line abap program and I should include some logic in this program to make an entry into BSEG-ZLSPR. Is there any FM/BAPI available? Is BDC a healthy approach?. My team lead do not want me to use UPDATE statement....please help.
    Thanks in advans,
    Varsha.

    Hi,
    Hi ,
    You will need to group that radiobuttons so that SAP knows they are linked together. To do this using the grahical layout editor simply select all the radiobuttons and then right click on them, Now choose define group. Once you have done this you should not need any of the "clear" or "='X'" statements SAP should control it all for you.
    hope this helps
    Reward if found helpfull...
    Venkoji Babu.

  • FI_ITEMS_MASS_CHANGE failing to update all items of BSEG

    Hi All,
    I am facing problem using FM FI_ITEMS_MASS_CHANGE while updating multiple line items of BSEGfor text and assignment.The program is posting FI document by calling transaction FB05. The requirement is to update all the itmes of clearing document with predefined text , assignment which is coming from excel.
    The program currently gets the clearing doc number from FB05; gets the BSEG table entries and loops the items one by one. For every loop of BSEG the FM FI_ITEMS_MASS_CHANGE is called to update text and assignment fields in corresponding item of BSEG.So expectedly all the items should be updated with the text , asignment.
    But problems is that only first item is updated and rest are not updated. I have added wait time of 5 seconds to avoid locking of tables in case if any. But still the change is not working. The results after wait time additon are inconsistent. In developemnt the changes worked for 7-8 items while  it failed in quality even for only 2 items.
    The FM possibly calls FB02 internally. Is there any locking happening?
    Anybody has any suggestion?
    Thanks in Advance.
    Regards,
    Chirdip

    Hi,
    I am also facing the same problem while updating ZUONR filed in BSEG.
    FI_ITEMS_MASS_CHANGE is not updating all the line items in bseg. I called the FM inside loop-endloop at item table.
    Still few items(randomly) are updating in first executuion of my program. Few in 2nd execution an so on.
    I tried using COMMIT WORK and WAIT statements after calling the FM, but of no use!!
    Please suggest is there any other way to update all the items in a single execution??
    Otherwise do I have to go for BDC on FB02 ??
    Thanks,
    Sagar

  • BAPI_ACC_DOCUMENT_POST Update reason code on BSEG

    Is the only way to update the reason code (BSEG-RSTGR) using the above bapi is by using the extension1 .
    Tnks

    I spent the last two days getting this working. It is really difficult but I got there in the end.
    In the function module BAPI_ACC_DOCUMENT_POST in routine INIT_GLOBALS the program searches for an implementation of ACC_DOCUMENT. The filter is the document type which for this BAPI is BKPFF (two letter F's).
    Later in routine CALL_BADI the methdo CHANGE is called of the implementation.
    I copied the sample code from CL_EXM_IM_ACC+DOCUMENT into my Z BADI which I wittily called ZCL_IM_ACC_DOCUMENT. As I am changing the value of a field already in ACCIT I can leave the code exactly as is.
    I then created my own structure (has to be all character fields regardless of the target field type in ACCIT), and filled up the extension table as follows just before calling the BAPI.
    DATA: lt_extension2     TYPE STANDARD TABLE OF bapiparex
                                       WITH HEADER LINE,
              ls_extension2     TYPE zzbank_bapi_structure.
    CLEAR ls_extension2.
            ls_extension2-posnr = 2.                  "Second Item
            ls_extension2-rebzg = gt_details-vbeln_vf."Invoice
            ls_extension2-rebzt = 'Z'.                "It's an invoice
            ls_extension2-rebzz = 1.                  "Item
            SELECT SINGLE gjahr FROM bkpf
              INTO ls_extension2-rebzj
              WHERE bukrs = gt_header-bukrs
              AND   belnr = gt_details-vbeln_vf.
    The BAPI chooses ir's own posting keys, which we do not like
            IF gt_details-shkzg = 'S'."Normal
              ls_extension2-bschl = '15'."Incoming Customer Payment
            ELSE.
              ls_extension2-bschl = '05'."Outgoing Customer Payment
            ENDIF.
            lt_extension2-structure = 'ZZBANK_BAPI_STRUCTURE'.
            lt_extension2-valuepart1 = ls_extension2.
            APPEND lt_extension2.
    The trick with BADIS is not just to activate the class but also the implemenation. I forget the second part every time.
    Hope this helps.
    Cheersy Cheers
    Paul

  • Decimal error in table BSEG.

    Dear experts,
    I will present my problem in a scenario.
    I'm using txc FB70 to make an invoice in currency COP (columbian peso) or MXP (mexican peso).
    When using MXP it works fine, but with COP the amount entry in table BSEG gets divided by 100.
    The reason is that the amount field in bseg is packed with decimal 2 and FB70 automatically adds *.00 on every amount (that does not already have it) entered by me. Thus 150 becomes 150.00. This is fine except in my system the currency COP is not allowed to contain any decimal and therefore, somehow it get stored as 1.50 instead.
    I have tracked what I believe to be the fault to the FM CURRENCY_AMOUNT_IDOC_TO_SAP which returns the value of 1.50 when entering 150 in a currency that do not contain decimals. I also found a note that described this error (69944) but it was posted in 1998 referring to txc MR01, and should be taken care of in following releases.
    So my question is: Is this the way it should be? is my system obsolete (missing updates of some sort)? or is there an alternative way of reading the data from BSEG? for instance a flag that says I need to multiply by 100 in these scenarios. I know it is a long shot, but still I cannot imagine that this is something that only me have encountered.
    Thanks in advance.

    Hi Johan,
    I do not think, that there is something wrong with your definitions. Please, read the following note 126857 and you will see how the system treats these cases storage-wise.
    Regards,
    Eli

  • Unicode Export - unable to retrieve nametab info for logic table BSEG

    Hi
    We are performing a unicode export (CUUC from 4.6C upgrade to ECC 6.0) and we have incurred this error.
            Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    Our OS is HPUX11.31 & Database is 10.2.0.2
    myCluster (63.21.Exp): 1610: inconsistent settings for table position validity detected.
    myCluster (63.21.Exp): 1611: nametab says table positions are valid.
    myCluster (63.21.Exp): 1614: alternate nametab says table positions are not valid.
    myCluster (63.21.Exp): 1617: for field 310 of nametab displacement is 1877, yet dbtabpos shows 1885.
    myCluster (63.21.Exp): 1621: character length is 1 (in) resp. 2 (out).
    myCluster (63.21.Exp): 1257: unable to retrieve nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 8358: unable to acquire nametab info for logic table BSEG      .
    myCluster (63.21.Exp): 2949: failed to convert cluster data of cluster item.
    myCluster: RFBLG      *400**AT10**0000100000**2004*
    myCluster (63.21.Exp): 322: error during conversion of cluster item.
    myCluster (63.21.Exp): 323: affected physical table is RFBLG.
    (CNV) ERROR: data conversion failed.  rc = 2
    (DB) INFO: disconnected from DB
    /usr/sap/SBX/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SBX/SYS/exe/run/R3load: END OF LOG: 20081102104452
    We checked the note 913783 as per the CUUC guide but the correction only for package SAPKB70004 to 6. but we are in package SAPKB70011.
    We had found two notes:
    1. Note 1238351 - Hom./Het.System Copy SAP NW 7.0 incl. Enhancement Package 1
    :Solution:
    There are two possible workarounds:
    1. Modify DDL<dbs>.TPL (<dbs> = ADA, DB2, DB4, DB6, IND, MSS, ORA) BEFORE the R3load TSK files are generated;
                  search for the keyword "negdat:" and add "CLU4" and "VER_CLUSTR" to thisline.
    2. Modify the TSK file (most probably SAPCLUST.TSK) BEFORE R3load import is(re-)started.
                  search for the lines starting with "D CLU4 I" and "D VER_CLUSTR I" and change the status (i.e. "err" or "xeq") to "ign" or remove the lines. "
    I tried the above solution by editing the file DDL*.TPL but it is skipping the table and marks it as completed but its not the good solution as we will be miss the data from the table RFBLG.
    2. Note 991401 - SYSCOPY EXPORT FAILS:SAPCLUST:ERROR: Code page conversion:
    Solution
    Activate the table.
    Then call the RADCUCNT report. Do not change the selected parameters, but ensure that 'Overwrite Entries' is selected.  Set the 'Unicode Length' to 2 and fill the last two fields 'Type' and 'Name' with TABL and TACOPAB respectively. Then select 'No Log' or specify a log name.
    Execute the RADCUCNT report and restart the export.
    We have not tried this solution, bcos SAP is still down and CDCLS job is still running.
    We would like to know whether you have faced any issues like the above one and what is your suggested approach and solution.
    Is it safe to start SAP now (when the CDCLS job runs) and then try to activate the table RFBLG?
    Regards
    Senthil
    Edited by: J. Senthil Murugan on Nov 3, 2008 1:41 AM
    Edited by: J. Senthil Murugan on Nov 3, 2008 3:36 AM

    Hi Senthil,
    If you have done your pre-conversion steps before upgrade and after upgrade successfully then you should not see the below errors. However changes to SPDD tables may some times also have some impact during conversion and throws nametab errors occurs. Program RADCUCNT runs in the end of upgrade to update nametab tables if any new changes happned during upgrade.
    You can do any no of exports to complete  jobs successfully.yeah When export running you shouldnt bring SAP up.
    The tables you have mentioned all are cluster tables and CDCLS being the biggest table it will take hrs to complete depending on your size of the database.
    Do not pay around with the .TSK file until if you are sure you want to re-execute it.Your first possiblility is skipped because there may be multiple same .TSK files present locally(where u r running distribution.monitor (or) sapinst ) and on the common directory. You may also look at the .TSK.bkp files because it get information and creates a new .TSK. This is not complicated but tricky.
    secound possibility is to update the changed tables(eg: RFBLG...)  to conversion tables.Follow the Note but make sure no R3load processes are running before you start SAP. If you dont want to wait long and sure to restart other processes which are running you can kill it and start SAP. Specify your error tables only and follow instructions given in the note.Once done bring down  SAP app. and restart the export process using ur sapinst or distribution monitor.
    Regards,
    Vamshi.

  • Jython error while updating a oracle table based on file count

    Hi,
    i have jython procedure for counting counting records in a flat file
    Here is the code(took from odiexperts) modified and am getting errors, somebody take a look and let me know what is the sql exception in this code
    COMMAND on target: Jython
    Command on source : Oracle --and specified the logical schema
    Without connecting to the database using the jdbc connection i can see the output successfully, but i want to update the oracle table with count. any help is greatly appreciated
    ---------------------------------Error-----------------------------
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 45, in ?
    java.sql.SQLException: ORA-00936: missing expression
    ---------------------------------------Code--------------------------------------------------
    import java.sql.Connection
    import java.sql.Statement
    import java.sql.DriverManager
    import java.sql.ResultSet
    import java.sql.ResultSetMetaData
    import os
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    filesrc = open('c:\mm\xyz.csv','r')
    first=filesrc.readline()
    lines = 0
    while first:
    #get the no of lines in the file
    lines += 1
    first=filesrc.readline()
    #print lines
    ## THE ABOVE PART OF THE PROGRAM IS TO COUNT THE NUMBER OF LINES
    ## AND STORE IT INTO THE VARIABLE `LINES `
    def intWithCommas(x):
    if type(x) not in [type(0), type(0L)]:
    raise TypeError("Parameter must be an integer.")
    if x < 0:
    return '-' + intWithCommas(-x)
    result = ''
    while x >= 1000:
    x, r = divmod(x, 1000)
    result = ",%03d%s" % (r, result)
    return "%d%s" % (x, result)
    ## THE ABOVE PROGRAM IS TO DISPLAY THE NUMBERS
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number( "#lines ") where load_audit_key=418507"
    sqlstring.executeQuery(sqlstmt)
    sourceConnection.close()
    s0=' \n\nThe Number of Lines in the File are ->> '
    s1=str(intWithCommas(lines))
    s2=' \n\nand the First Line of the File is ->> '
    filesrc.seek(0)
    s3=str(filesrc.readline())
    final=s0 + s1 + s2 + s3
    filesrc.close()
    raise final

    i changed as you adviced ankit
    am getting the following error now
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 37, in ?
    java.sql.SQLException: ORA-00911: invalid character
    here is the modified code
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number('#lines') where load_audit_key=418507;"
    result=sqlstring.executeUpdate(sqlstmt)
    sourceConnection.close()
    Any ideas
    Edited by: Sunny on Dec 3, 2010 1:04 PM

  • The currency is not getting updated in the table VBAP

    Hi ,
    The currency is not getting updated in the table VBAP. The currency was suppossed to be copied from the header table VBAK for a Sales Order. When the user creating a Sales Order the currency WAERK is not shown in VBAP table. VBAK-WAERk is in EUR . Does anyone know why is this happenning?
    Currency is maintained in the Customer Master, Material Master and Sales Org. Any suggestions?.
    Also it is happened for only one line item in a set of line items , Other line items did display the currency field.
    The net Value has data in it .
    The system is ECC 5.0
    Regards,
    Senthil

    Dear Senthil,
    Please apply the following notes (if they apply to your support pack level) and retest:
    1460621 VBAP-WAERK is deleted after the sold-to party is changed
    1426441 VBAP-WAERK deleted for subitems
    1493998 VBAP-WAERK deleted for subitems
    This should resolve the issue. I hope this helps.
    Best regards,
    Ian Kehoe

Maybe you are looking for