Query for chart of accounts

SELECT    T0.DocEntry, T0.DocNum, T0.Series, T0.PostDate, T0.DueDate,
T0.ItemCode AS Parent,T0.PlannedQty, T0.CmpltQty, T0.RjctQty,
T1.ItemCode AS CHLD, T1.BaseQTY, T1.PlannedQTY,T1.IssuedQTY,
T0.CmpltQtyT1.BaseQTY AS Compl_QTY, T0.RjctQtyT1.BaseQTY AS Rej_QTY,
T2.LastPurPrc as PurPrise, T2.LstEvlPric as EvlPrice,
T3.LineTotal AS Total,
T1.IssuedQTY -((T0.CmpltQtyT1.BaseQTY) + (T0.RjctQtyT1.BaseQTY)) As WIP_QTY,
(T1.IssuedQTY -((T0.CmpltQtyT1.BaseQTY) + (T0.RjctQtyT1.BaseQTY)))* T2.LstEvlPric As WIP_Valuation,
T0.Comments
FROM         OWOR T0 INNER JOIN
                      WOR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
                      OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN
                      IGE1 T3 ON T1.DocEntry = T3.BaseEntry AND T1.LineNum = T3.BaseLine
WHERE T0.Status='R'
The above query returns the cost of production orders that are issued for production.The column WIP_Valuation in the query is equivalent to C/D (L/C) in Account Balance of Chart of Accounts i.e
Financials -> Chart of accounts ->WIP  -> C/D (LC)
I have used user defined  accounts.
But this query does not trace the goods that are returned.So the total received in query is larger than the total of chart of accounts.
For eg,
Details                                                                 C/D  (LC)
Issue for Production                                           1,952.96 INR
Receipt from Production                                   (1,952.96 INR)
For the above production order the goods are returned.So 1,952.96 is subtracted.In the query I am not able to subtract 1,952.96.I am considering 1,952.96  in total.What change should be done in the query to neglect the goods that are returned.

On OJDT/JDT1, you are looking for postings that result from Production Orders, which you can identify by OJDT.TransType = 202 andOJDT.BaseRef is the production order.
I also do not know exactly how B1 can tell the difference between a Goods Issue and an Issue to Production. You would expect a flag on OIGE, but there does not seem to be one.
You could try finding the stock movements from the movements records OINM where I think OINM.ApplObj = 202 is a production movement.
Regards,
Douglas McDove

Similar Messages

  • Hierarchical Query for Chart of Account

    Hellow all
    I have one Table which is for chart of account
    The Column in this Table is
    Acc_id and Acc_name
    I Insert data in This chart of account
    Insert into COA
    values
    *(01,'ASSETS');*
    values
    *(01001,'Current Assets');*
    values
    *(01002,'Fixed Assets');*
    values
    *(010010001,'Banks');*
    values
    *(010010002,'Cash');*
    values
    *(01001000100001,'Metrol Politan Bank');*
    values
    *(01001000100002,'Royal Bank');*
    values
    *(01001000100003,'Stander Charted Bank');*
    values
    *(01001000200001,'Cash in Hand');*
    values
    *(01001000200002,'Patty Cash');*
    That's all my record now i need to create a Hierarchical tree
    Which look like this
    *01- Assets*
    ------010001 Current Assets+
    ----------010010001 Bank+
    --------------01001000100001 Metrol Politan Bank+
    --------------01001000100002 Royal Bank+
    --------------01001000100003 Stander Charted Bank+
    ----------010010002 Cash+
    --------------01001000200001 Cash in Hand+
    --------------01001000200002 Patty Cash+
    ------010002 Fixed Assets+
    ----------010020001 Machinery Assets+
    --------------01002000100001 Needle Machine+
    --------------01002000100002 GGT Machine+
    ----------010020002 Computer Assets+
    --------------01002000200001 Computer Server+
    --------------01002000200002 Computer other+
    Hope you guys understand i need the Hierarchical query for making this kind of Tree
    Regards
    Shahzaib

    In above posts you have solution to your problem but maybe you can think about changeing the design slightly.
    I would suggest using parent_id to find parent account, instead of operations on strings which can be slower in larger tables.
    SQL> create table t14(id int, account_code varchar2(16), account_name varchar2(32), parent_id int)
      2  /
    Table created.
    SQL> insert into t14 values(1,'01','Assets',null);
    1 row created.
    SQL> insert into t14 values(2,'01001','Current Assets',1);
    1 row created.
    SQL> insert into t14 values(3,'01002','Current Assets',1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t14;
            ID ACCOUNT_CODE     ACCOUNT_NAME                      PARENT_ID
             1 01               Assets
             2 01001            Current Assets                            1
             3 01002            Current Assets                            1
    SQL> select lpad(' ',2*(level-1)) || account_code as account_code, account_name
      2  from t14
      3  start with parent_id is null connect by prior id = parent_id
      4  /
    ACCOUNT_CODE                   ACCOUNT_NAME
    01                             Assets
      01001                        Current Assets
      01002                        Current AssetsWith kind regards
    Krystian Zieja

  • GL A/c numbering logic for chart of accounts BAIN

    Hi,
    Will any expert pl let mek now What is the GL A/c numbering logic for chart of accounts BAIN (BAIN is standard ch of A/c for India apart from CAIN)?
    Regards
    Anand

    Your question is not clear about numbering logicu2026
    First of all the GL Account # are always externally assigned (it can be either numeric and alphanumeric)
    The length of GL account is 10 digits. But if you give it as 6 in TC OB13 then
    u2022     Numerical account numbers
    The system includes zeros to the left of the number
    0000001234
    u2022     Alpha-numeric account numbers
    The system includes zeros to the right of the number
    1131DB0000

  • Report for chart of accounts by transaction

    Hi All,
    I am looking for Report for chart of accounts by transaction. Could any one suggest me which report it is.
    Thanks,
    JP

    There are the answers.
    1. It is enough if you generate data model and activate it.
    2. With regard to Chart of Accounts, entity of COA, ACCOUNT, ACCCCDET should be mostly involved.
    3. You don't need to generate tables at all because after you activate the data model, all correlative tables will be generated automatically according to the definition of the data model.
    In transaction SE38, run program USMD_DATA_MODEL, you can see all generated table for your data model.
    If you have other questions, please feel free to let me know.
    Regards
    Edited by: Qi Liu on Feb 15, 2011 8:26 AM

  • Text ids for Chart of Accounts & Co Code Area

    Hi,
    Why do we need obt6 & obt7 i.e. Text ids for Chart of Accounts & Co Code Area.
    Regards,
    Vikas

    in case when u want to use some additional text for the creation of GL at a crertain level like COA then u create the standard text types and tick the relevant text... then whenever u create the GL then it will give u the option of putting text there..... it is more of information text....

  • MDGF for Chart of Accounts

    I am configuring MDGF for Chart of Accounts and I want to use standard data model 0F that comes out of the box with no customization that means no use of BADI's. I have few questions on this and I would appreciate if some one helps me on these:
    1. Is it enough if I generate data model 0F or do I have to generate the entity types of 0F  in this case Entity type COA alone?
    2. What other Entity types for data model 0F  to make MDG for Chart of Accounts work?
    3. If the answer is YES to question 1, after activation will I see generated Z tables as shown in
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/d4/09348181894e46a2c6cdc8e65ab28e/frameset.htm.
    Cheers...

    There are the answers.
    1. It is enough if you generate data model and activate it.
    2. With regard to Chart of Accounts, entity of COA, ACCOUNT, ACCCCDET should be mostly involved.
    3. You don't need to generate tables at all because after you activate the data model, all correlative tables will be generated automatically according to the definition of the data model.
    In transaction SE38, run program USMD_DATA_MODEL, you can see all generated table for your data model.
    If you have other questions, please feel free to let me know.
    Regards
    Edited by: Qi Liu on Feb 15, 2011 8:26 AM

  • RC 3 M8 147 Account determination for Chart of Accounts._ WRX not possible

    Hi All,
    When I am confirming the Service Entry Sheet from SRM Front end for the ECPO replicated in the Backend following error is displayed:
    <b>RC 3 M8 147 Account determination for Chart of Accounts._ WRX not possible</b>
    How can I get the Service Entry Sheet Posted/Accepted...?
    Regards,
    Rounak

    Hi Rounak,
    Thank for ther reply , I have checked all the settings which u have mentioned.
    1)Account assignment -K
    2)Field  Status Group -Z001 i.e General
    3)In OBYC -Valuation Modifier has been mapped to the GR/IR-- GL account.
    A)the cost centre and the GL account has been mapped .
    Still i am getting the same error ,
    RC=     3  M8                   147 Account determination for entry RCL WRX 0001 not possible
    What more can we check in the FI-MM integration  ??
    The same combination is working fine for Asset purchases.
    wth rgds
    SVU123
    Edited by: svu123 on Jan 31, 2008 6:37 AM

  • Hierarchical ID Recursion for Chart of Accounts

    This must be a pretty standard report format but so far it looks as though I’m not smart enough to figure out how to get ‘er done. I’m using 2008 R2 to work with a hierarchy of about 30k GL accounts. The hierarchy is narrow at the top—only 5 subtrees (Assets,
    Liabilities, etc.)—and it is only four levels deep but the bottom levels are several thousand accounts wide.
    In addition to the original Account_Number and Parent_Number columns, a straight-forward T-SQL recursive CTE has produced 3 new columns which I suppose should be useful. I’ve tried to work through the SSRS help examples on How To Create a Recursive Hierarchy
    Group but it’s not getting me where I want to go.
    Level     Hierarchy            
    Node                    
    Account_Type
    1             
    /1/                         
    0x58                      
    Assets
    1             
    /2/                         
    0x68                      
    Liabilities
    1             
    /3/                         
    0x78                      
    Equity
    1             
    /4/                         
    0x84                      
    Income
    1             
    /5/                         
    0x8C                     
    Expenses
    2             
    /1/1/                    
    0x5AC0                
    Assets -> Cash
    2             
    /1/2/                    
    0x5B40                 
    Assets -> Acct Receivable
    2             
    /2/1/                    
    0x6AC0                
    Liabilities -> Acct Payable
    I would like to a report which opens showing only the top 5 accounts but which will allow User to drill down through each of the remaining 3 levels. Using an expression to indicate level by simple indentation is not an option.
    Please point me to an example or some more instructions.
    HomeCookN

    Hi There
    As far as I understand you  have charts of account which have three levels and by default you would like to open first level and from there user will drill down to next level.
    You could do it easily by creating three row groups and visibility of the second and third level will be hidden initially and use display can be toggle by report item as shown in the figure.
    However if you don’t like to go on this track and give your user the option to select which level he would like to see after the first level then please create a parameter and give user the ability to go straight to that level.
    I am putting some screenshot for your help.
    If you still have a questions please let me know.
    Many thanks
    Syed Qazafi Anjum
    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • Query for Price difference account when item is not sold but not on stock

    Hi Experts!
    One of my clients accountant requires a report which will help for what to do with the balance of the price difference account.
    At the and of the year there are some postings on this account, but not every item that hadnt been on stock when A/P Invoice arrived were sold. Some item were waistrel and put into a waistrel warehouse, but not sold.Some item were sent back to the supplier, but not sold.
    Is it possibble to make a query for knowing where to post the balance of the price difference account? Not all should be post to the Cost of goods sold.
    Thank you in advance!

    Hi,
    The query is possible.  However, it is a complicated one. It is also need to involve detailed analysis to your transaction histories.  You may start from OINM table to check.
    Thanks,
    Gordon

  • Maximum length for Chart of Accounts

    hi experts,
    In chart of accounts max  length is 10. generally all are taken 6, if we take any other number other than 6 how is effect and how it works can you explain clerly ? pls explain effects wit all, like 1234578910
    Edited by: Lakshmipathi on Jan 4, 2012 7:02 PM
    Please use the subject effectively

    Hi,
    You can take any numbers considering that the number would be sufficient to accomodate the requirement of the company; even 3,4,5. You can even include alphabets in that. There is no hard rule that it should be 6, but the maximum is 10. Generally companies choose from 6-8; and for consolidated/group account even 10.
    Please let us know if you need any further details.
    Warm regards,
    Murukan Arunachalam
    Edited by: Murukan_A on Jan 4, 2012 5:34 PM

  • MDM for Chart of Accounts

    Hi,
    Can MDM be implemented for GL Master (Chart of Accounts)? If yes, does SAP provide standard repository for the same?
    Regards,
    Anoop Sahu

    Hi Annop,
    why not? Never seen standard repositories for this, but you can create a new one just to solve your requirements.
    Rgs,
    Vito

  • DTW for Chart of account Acct currency

    Hi all,
    I have uploaded chart of accounts and given Acct currency as INR. Now I want to change it to All currency. What should I give in Acct Currency?
    Regards
    Shashi

    Thanks for ur reply,
    Should I put 2 ## or 3 ###?
    Regards
    Shashi

  • DTW for Chart of Account changes

    Experts,
    I need to use the DTW for importing changes and new accounts to the standard Chart of Accounts.
    When I run the DTW, nothing is imported, even though this is successfull.
    Here is teh fields that I have populated:
    Header: Code, Name, Cashaccount, ActiveAccount, FaterAccountKey, Account type, AcctCurrency, ForeightName, FormatCode.
    Values: 1, COANew1, tNO, tYES, Cash and Equiv, at_Other, $, 12345, 111111110100101.
    What do I need to populate in the Code field? Is this different when I update or import a new account?
    Thanks,
    Marli

    Gordon,
    Thanks, this worked for the new accounts.
    The update of old accounts still give an error "Cannot find this object..." I believe this has to do with the 'Code' field, as there is a note in the cell:
    "This field serves as the key of the record in SAP BusinessOne system and it is mandatory. This field is used as a reference in the child template. When adding new data, the value of this field is user defined (e.g., 1,2,3, etc.). When updating existing data, the value of this field should be the real record key in SAP BusinessOne."
    What is the real record key in SBO?
    Marli

  • LSMW for Chart of Account: Field XSPEB not filled in batch-input session

    Hi all,
    we are using LSMW for importing the chart of account into a new system.
    The LSMW project uses the report RFBISA00 for the creation of the batch-input session.
    Some accounts need to be blocked in the new system. Therefore, we have the field XSPEB in our source structure and of course also in our target structure. But after the creation of the batch-input session the field is not included in the corresponding batch-input session.
    Does anybody know why it is not set? I already debugged the program RFBISA00 but couldn't find the place where the data get lost.
    Thanks in advance and regards,
    Martin

    Did your batch input end with save ( /11 ) or what ok_code are you using ?

  • Query for retrieving GL accounts in AR & AP

    Hi,
    I need to get the GL accounts for all the customers & suppliers.
    Do you know the tables contained this information?
    Thank you

    Hello
    +Dear all,
    How could I transfer opening balance for all GL. AR, AP accounts before system go libe ?
    Thank you very much,
    Kindly regards,
    Sylvecast+
    Ideally, One journal entry for all GL accounts is advisable. Open a clearing account. Debit all GL balances and credit the clearing account. For credit balances, debit the clearing account and credit the GL accounts.
    For open items in AR and AP use LSMW tool, this would take care of the postings to recon accounts also.
    For asset balances, depreciation balances use the LSMW tool. For any other balances, ensure credit or debit to the clearing account, like opening stocks etc.
    At the end of the process, ensure clearing account is zeroed
    Reg
    assign points if useful

Maybe you are looking for