Validate Journal Entries using write back BADI (UJR_WRITE_BACK)

Hi Experts
I need to validate journal entries such that the total credit and debit postings for each COMPANY is equal. Also I need to do the same validation by PROFIT CENTER. After doing a bit of research I found out that the best way to do it is by coding it in the write back BADI.
Has anyone faced such a situation before? Is there any better way to do it? Can anyone share the code?
Thanks
Edited by: Shisher Chakrabarty on Mar 1, 2012 10:22 AM

Hi Shisher,
Please check the below guide for Write Back BADI. The doc has also got the source code for the same.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0309226-814f-2d10-61a6-ef8da29e3727?QuickLink=index&overridelayout=true&48056389302995
Regards,
Raghu

Similar Messages

  • Write back Badi

    HI Everyone,
    We have developed Write Back Badi, Which does distribution values equally at two different Parent level (Entity, Product) and all other base members and working fine
    Actually there are some accounts we have called percentage rate accounts.
    If I plan at this all rate accounts against Parent level and all base members. It has to distribute the same value to all Base members and should not roll up.
    Ex: If I plan 4% value at any rate account against parent level, Then BAdi has to be distribute same 4% value to all base members and Value of Rate account is same 4%, So it should not be the roll up
    I used below code to distribute same value to all base members for specific accounts and account is getting roll up.
    Please let me know how to solve this issues.
    "IF SPD_account is anything other than the accounts below then ELSE part will be executed
    IF <zlf_chk> = 'Drivers_001_01_N' OR <zlf_chk> = 'Drivers_002_01_N' OR <zlf_chk> = 'Driver_003_01N' OR <zlf_chk> = 'Driver_003_03_N' OR <zlf_chk> = 'Driver_003_05_N' OR <zlf_chk> = 'Driver_003_07_N' OR <zlf_chk> = 'Driver_004_01_N'.
              " Avoid divide by zero
              IF l_num_base > 0.
                <l_keyfigure> = <l_keyfigure>.
                " Copy N times with new base members
                LOOP AT lt_SPD_PRODUCT_mbr ASSIGNING <l_base_mbr>.
                  <l_SPD_PRODUCT> = <l_base_mbr>.
                  " When IF_CALC_DELTA = true, appending means the latest records take effects,
                  " previous records with same dimension member will be overwritten.
                  " The newly appended records will also be looped and processed.
                  APPEND <ls_record> TO ct_array.
                ENDLOOP.
              ENDIF.
            ELSE.
              IF l_num_base > 0.
                <l_keyfigure> = <l_keyfigure> / l_num_base.
                " Copy N times with new base members
                LOOP AT lt_SPD_PRODUCT_mbr ASSIGNING <l_base_mbr>.
                  <l_SPD_PRODUCT> = <l_base_mbr>.
                  " When IF_CALC_DELTA = true, appending means the latest records take effects,
                  " previous records with same dimension member will be overwritten.
                  " The newly appended records will also be looped and processed.
                  APPEND <ls_record> TO ct_array.
                ENDLOOP.
              ENDIF. " divide by zero
            endif.
            " Remove the old one
            DELETE ct_array.

    Hi Vadim,
    Let me explain,
    The rate accounts (Drivers_001_01_N, Drivers_002_01_N, Driver_003_01_N, Driver_003_03_N, Driver_003_05_N, Driver_003_07_N, Driver_004_01_N )
    If I plan at this all rate accounts against Product (Pharmaceutical Bx- Parent level - Please see the hierarchy below). It has to distribute the same value to all Base members(SKU) and should not aggregate.
    Ex: If I plan 4% value at any rate account against Pharmaceutical Bx, Then BAdi has to be distribute same 4% value to all seven base members(SKU) and Value of Rate account is same 4%, So it should not Aggregate.
           Currently it is distributing 4% Value to all the base members and it is rolling up to 28 for Rate accounts.
    -Viswanath

  • Problem with BPC 10 REST SERVICE. (Write-Back  BAdI)

    Hello!
    We have implemented a Write-Back BAdI order to write values ​​to a parent and copy those values ​​to their children in the hierarchy. Proper operation.
    Then through the Default Logic we are making various calculations (many to be honest), based on the data recorded with the Write-Back BADI.
    The problem arises when we try to write in a parent hierarchy with many children.
    We receive the following message in Excel.
    We have configured the service as follows
    The transaction st22 says nothing about our problem.
    If I go to log the EPM Add-in for Excel see the following. A problem with REST service (I think that is the PROBLEM)
    Write-Back BAdI writes values properly.
    Thank you!

    Thanks for answering.
    Yes, if I try to write in a parent without Default.lgf there is no problem. I performed the test to the parent node of all hierachy.
    I send the Default.lgf and the others scripts .
    I think the problem is that the communication between BPC and Netweaver is lost, which is done through the REST service??
    thank you very much.

  • BPC75NW: Query on write-back BAdI

    Hi,
    I have a requirement wherein for 2 set of input schedules that are based on same APPSET and APPLICATION, have different ABAP logic to be built through write-back BAdI.
    I try to built a second BAdI to put in the logic for second set of input schedules. But the resultant filter criteria comes out to be same as in the first write-back BAdI, which results in error during activation of object.
    Possible solution: I will not be able to alter the filter criteria; but during run-time, is it possible to check the input schedule that invokes the write-back BadI, so I can put the IF at the start of logic to process either for first or second set of input schedules.
    Regards,
    Pankaj

    Hi Rich,
    Thanks for the reply. 
    Currently as a work-around, I read CT_ARRAY, which has account dimension as a column.
    The values coming in CT_ARRAY (for time-being) are different for the first and second set.
    So I have written READ TABLE.. for certain values of first set and for certain other values for set 2.
    I guess the CL_UJ_CONTEXT class will give me the information about members on current view, which is kind of similar to my current work-around.
    Going ahead I anticipate to come across scenarios when the current view remains identical and we need to process the logic based on the input schedule that invokes the BAdI.
    Anything identifying the source input schedule should be perfect.
    Regards,
    Pankaj

  • Capture comments in write back badi!!!!

    Hi All,
    Can I capture comments inside write back BAdI?
    i checked to read comments table but the comment table is not updated by then.....
    is there a way i can get comments updated in the same input schedule that triggers the write back BAdI?
    Kind Regards,
    Surya Tamada.

    Thats a very big story mate!!!!!
    Client wants to plan at contract level (highest granular) and he wants to enter some text as the description of the contract. Now I have to read this in the write back badi and dynamically generate a new contract ID and capture the comment and save this comment as the EVdescription of the newly generated contract ID.
    If i have this comment flowing through Write Back Badi then i can update the masterdata with the newly generated contract id and assign the comment to the EVdescription of the contract ID.
    If you need to know more..... please let me know.... i can elaborate the situation and let you know......
    Regards,
    Surya Tamada.

  • Parking a Journal Entry to come back later

    Hi,
    Stupid question no doubt; How do I park an unbalanced journal entry so that I can come back to it later/tomorrow?
    Cheers
    Dan

    Hi Dan
    If I recall correctly, you have to create the journal in the voucher and there is no import or copy from a standard journal to the voucher. However, you can use duplicate to copy journals created in the voucher by right clicking on the line.
    Kind regards
    Peter Juby

  • Update only the row in DB where the cursor are positioned using Write Back

    Hello,
    I need to have the possibility to create/change values (insert or update data back into the database), dynamically or by typing, in some columns of the physical DB that are mapped in a report request, and that new or changed values could be used as a filter columns in another report request.
    So, I have created a new report request in a Subject Area where a certain column of the request result could be editable to make possible change the present value and then write it back in the physical DB.
    I have implemented for the column name ‘MOV_VALUE’ the value interaction type format Write Back, and every time I changed any value on this column it updates all rows with this same value from the table ‘MOVEMENTS’.
    See below the Template file used in the Write Back table properties:
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name= "UpdateMovementData">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert>
    <update> UPDATE MOVEMENTS SET MOV_VALUE=@{c4} </update>
    <!-- <postUpdate>COMMIT</postUpdate> -->
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Is there any possibility to only update the record from where it is the cursor positioned by using the Write Back in the Answers report?
    Is necessary to create any condition to the where clause for the update statement? Which conditions?
    Thanks in advance.
    Regards,
    Pedro Resende

    You might try posting to a BPM forum. BPM is a layered product that happens to use WL JMS, but I think most of the folks on this forum aren't familiar with BPM.
    Tom

  • Import GL Journal Entries

    Can someone please tell me the exact format to use when importing GL Journal entries using the SDK DI
    I have tried using the sample that is in the DI Objects with absolutely no luck at all.
    What exactly ARE the mandatory fields? I have a .txt file which is so simple it should work. 2 lines only plus a minimal header.
    When I use the AccountCode and the ContraAccount and the shortname Account in the one line the system throws me back an error which states the ContraAccount does not exist which is not true.
    Then my default period is set as this month and the system gives me an error stating my date is in the wrong period.
    I would appreciate all the help someone can give me please as I am confused.
    File input is:
    "GJH","10/08/04"
    "GJL",161010,500045,,22.00,"10.08.04",0,"10.08.04",161010,"10.08.04"
    "GJL",500045,161010,22.00,,"10.08.04",1,"10.08.04",500045,"10.08.04"
    Mapping is:
    GJH equals Header and the date is mapped to TaxDate
    GJL equals Line and the mapping is:
    Field 02 = AccountCode
    Field 03 = ContraAccount
    Field 04 = Credit
    Field 05 = Debit
    Field 06 = DueDate
    Field 07 = LineNbr
    Field 08 = TaxDate
    Field 09 = ShortName
    Field 10 = ReferenceDate1
    I am testing using the UK Demo Database

    Hi,
    You haven't posted all of code, but I suppose you add a Line object immediately after creating a new JournalEntry object. But when you create JournalEntry object you already get one empty Line, so you have add lines from 2-nd. It's a common issue with the DI Business Objects. I've got the same messages when tried to recieve invoices.
    Best regards,
    Mark

  • Journal Entry

    Hi All,
    I have to update one field(Header- User defined) in journal entry using DI API for each and every transaction. I know how to update journal entries using DI API but my issue is under which event i will write my update code when system post Journal entries automatically
    or
    How I will update journal entry which is posted by system using DI API.
    I dont want to write update query in Transaction notification Procedure also.
    Regards
    Firos

    Hello Firoz,
    The problem:
    Documents using integration booking (JE-s) are notified by SP_TRANSACTIONNOTIFICATION,  but JE.-s are not recorded there. So you cannot monitor the creation of JE-s.
    But, some logic you can find the JE-s booked by Integration
    You monitor the et_form_data_Add  event on all forms,
    -  if you are before action, record the journal entry autokey from ONNM (object type 30)
    -  and when this event executed, you can compare the autokey of journal entries in ONNM table as you have recorded. If the number is difference, you have a background posting happened, so you can call your DI API update procedure.
    What i would do in this situation (running logic of the addon)
    1. Create an SQL table for storing the updated JE keys
    2. Check the OJDT table by time to time (ET_FORM_DATA_ADD event is a good)
    3. Update JE headers and record the updated keys in the SQL table created in point 1.
    By this method you can populate your field. This solution is also good when an addon is not running on each client.
    Regards
    János

  • OBIEE Write Back - Insert New Row

    Hello,
    I am new to these forums and looking for some help with OBIEE's Write Back feature.
    I have Write Back working fine with respect to updating existing rows in a table (ie: the UPDATE tag), but was wondering how to force Write back to invoke the INSERT feature. I would like to be able to create new rows in a table to allow my end user to dynamically add and remove information. I have heard of this being possible (perhaps through some sort of temp. table) in other forum posts, but have yet to see how this is implemented. Also, is it at all possible to use Write Back to delete rows in a table? Any help here would be greatly appreciated. Thanks!
    -Mike
    Here is an exerpt from my working XML file:
    <WebMessage name="NEWSNOTESADMIN">
    <XML>
    <writeBack connectionPool="Oracle Data Warehouse Connection Pool">
    <insert>INSERT INTO WC_NEWS_NOTES (CONTENTS, CONTENT_DATE, IMPORTANCE_LVL) VALUES(@{c0},@c{4},@{c2})</insert>
    <update>UPDATE WC_NEWS_NOTES SET CONTENTS='@{c0}', CONTENT_DATE='@{c4}', IMPORTANCE_LVL=@{c2} WHERE CONTENT_ID='@{c1}' </update>
    </writeBack>
    </XML>
    </WebMessage>

    Well first and foremost, Oracle explicitly states that writeback isn't meant to be used to transform OBIEE into a data entry system. Check the other posts on this subject...
    On the "force insert": put the same statement you have for INSERT into the UPDATE tag. Related to the initial point I mentioned: you will have to worry about uniqueness yourself. OBIEE isn't an OLTP platform!
    Re. delete: I liked Stijns recent post, so I'm going to use that as well:
    http://www.justfuckinggoogleit.com/search.pl?query=obiee+delete+through+writeback
    Third hit. Venkats blog.

  • BADI UJR_WRITE_BACK

    Hi Experts,
    I am a beginner in BPC and would like to know how many times UJR_WRITE_BACK BADI will be called per Input Schedule? I know the write back will be called automatically. The reason for this is i am trying to debug an application build by some one else and noticed that the BADI is called many times. Is there any specific rule or logic for this? I am sure there are couple of commit work statements in the script logic file.
    Thanks in advance.
    Thanks & Regards,
    Raja

    Hi Gersh,
    Thank you for your reply.
    As per my understanding WRITE BACK BADI will be called automatically and we can't call it explicitly from DEFAULT.LGF.
    Although my application has DEFAULT.LGF, it doesn't have any refrence to call the WRITE BACK BADI. However, it calls other BADI (Custom Logic) and is having COMMIT WORK statements. May i ask you to throw some light from this perspective?
    Thanks,
    Raja

  • Transaction Notification - Journal Entry

    Dear Experts,
    Can anyone tell me how to validate Journal Entry line wise using Transaction Notification Stored Procedures. I want to validate each and every row of the Journal Entry.
    Thanks in advance
    Regards
    Neslin 

    Hi,
    Please close this duplicated thread. Check this announcement:
    FYI
    Thanks & Regards,
    Nagarajan

  • 10g Write back works for some users, not others

    Dear Gurus,
    I have a strange problem with the Write Back in my system. We use Write-back pretty extensively and have maybe 10-20 separate reports, updating a number of tables.
    We have been using this system for almost a year with no problems - Myself (logging in as Administrator) and a member of the Business team, logging in as herself (a member of the Presentation Server Administrator Group).
    We now require two more Business power-users to use our Write-back reports. I have added them to the Presentation Server Administrator group. However, when they try to enter values into ANY of the write-back reports, they get the following error;
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists...
    *State: HY000. Code 10058 [NQODBC]... A general error has occurred. [nQSERROR 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute (HY000)*
    SQL issued: EXECUTE PHYSICAL CONNECTION POOL "GL Oracle Data Warehouse Connection Pool"
    I do not understand why the write back is working without error for my own user, the Admin user and a member of the business team who is in the Presentation Server Administrator group, but not for two new additions to that group.
    I have checked that the Presentation Server Admin group is granted on the "Enable/Manage Write Back" privilege and on the Execute SQL privilege.
    Any ideas what else I could check?
    Thanks,
    A.

    Hey Amith,
    Thanks for your quick reply! Unfortunately, this doesn't seem to be the case. The system is pretty much wide open, apart from the Write pack privilege, which only the Presentation Server Administrator group has access to.
    I'm having another of my Presentation Server Administrators who has been in the group forever try to use the write back.
    There's no specific connection pool or database level permissions for write back, is there? And there's no specific permissions which need to be set on the xml template files?
    Thanks,
    A.

  • Journal Entry Remarks not comming

    Hello Everyone,
    I am trying to create Journal Entry using  DI API .The problem i am facing is that  the remarks at the row level is not coming in certain cases.
    Code:-
    /*this is to add remarks at header level*/
                           _journalEntries.ReferenceDate = Convert.ToDateTime(_dataRowHeader["EntryDate"]);
                               _journalEntries.Memo = Convert.ToString(_dataRowHeader["Description"]);
    /**This is to add remarks at row level/
                                    _journalEntries.Lines.PaymentBlock = SAPbobsCOM.BoYesNoEnum.tNO;
                                   _journalEntries.Lines.Credit = Convert.ToDouble(row["CreditAmount"]);
                                   _journalEntries.Lines.Debit = Convert.ToDouble(row["DebitAmount"]);
                                   _journalEntries.Lines.CostingCode = Convert.ToString(row["CostCenterCode"]);
                                   _journalEntries.Lines.LineMemo = Convert.ToString(row["Remark"]);
                                   _journalEntries.Lines.Add();
    By default  in SAP B1 the remarks at the header level gets filled at the row level..so is this issue because of this reason.is there any way i can prevent the remarks at header level to be filled at row level..??
    Thanks and Regards,
    Anuj Kumra

    Hi Anuj,
    With this code I got the remarks on the line. Even when setting Memo to null.
    var je = oCompany.GetBusinessObject(BoObjectTypes.oJournalEntries) as JournalEntries;
    je.Memo = null;
    je.Lines.AccountCode = "100000";
    je.Lines.Credit = 0;
    je.Lines.Debit = 150;
    je.Lines.LineMemo = "some string";
    je.Lines.TaxDate = DateTime.Now;
    je.Lines.Add();
    je.Lines.SetCurrentLine(1);
    je.Lines.AccountCode = "101000";
    je.Lines.Credit = 150;
    je.Lines.Debit = 0;
    je.Lines.LineMemo = "some string";
    je.Lines.TaxDate = DateTime.Now;
    if(je.Add()!=0)
      throw new Exception(oCompany.GetLastErrorDescription());
    So I guess in your case it might be that the row["Remark"] has no data in it.
    Best regards,
    Pedro Magueija

  • Adding Journal Entry  throgh Incoming Payments,

    Hi Friend,
                  I need Help ....
    I need to create a journal entry using incoming payment. I have different types of deduction Accounts. All deductions need to display in  journal entry and also its reflect in Invoice.Then only invoice going to close.
    Dim junEntry As SAPbobsCOM.JournalEntries
    Ex :-
    :::::Journal Entry::::::
    *Account Code/BpName*                *AccountName*          *DR*            *CR*
    620005                                Deduction1            10      
    620006                                Deduction2           100
    620007                                Deduction3           100
    620008                                Deduction4           115
    620009                                Deduction5            10
    6200010                              Deduction6             10       
    6200011                         Cash Recived               655             1000
                                                              1000             1000 
            Dim decDebi As Decimal = 0
            Dim dtCount As Integer = dtDataTable.Rows.Count - 1
            junEntry = objAddOnCentral.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
            junEntry.Memo = strBpCode
            junEntry.ReferenceDate = Now.Date
            For intLoop = 0 To dtDataTable.Rows.Count - 1
                junEntry.Lines.AccountCode = dtDataTable.Rows(intLoop)("Account").ToString()
                junEntry.Lines.Debit = dtDataTable.Rows(intLoop)("Amount").ToString()
                decDebi += CDec(dtDataTable.Rows(intLoop)("Amount").ToString())
                junEntry.Lines.Add()
            Next
            junEntry.Lines.ShortName = strBpCode.Replace("Incoming Payments", "")
            junEntry.Lines.Credit = decDebi
            junEntry.Lines.Add()
            intErrCode = junEntry.Add()
            If intErrCode <> 0 Then
                objAddOnCentral.objApplication.StatusBar.SetText("" & objAddOnCentral.objCompany.GetLastErrorCode & " " & objAddOnCentral.objCompany.GetLastErrorDescription & "", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                Return False
            End If

    Hi,
    I thing no need addon once u add incoming payment automatically invoice will close and JE also will pass.
    Regards,
    Siva

Maybe you are looking for