How to check if the accounting Document is cleared or not. Need a FM

Hi Gurus,
I have a requirement which I need to know if an accounting document is cleared or not.
My requirement is: from an invoice (VBRK-VBELN), I need to know the correspondent accounting document number which I can get from table BKPF (accounting doc number - BELNR). After that I can go to table BSEG to check the status, then I will know if the document is cleared or not... But this will take a lot of time, and the performance will not be good. I need to implement this functionality in a program.. And I would like to know if I can get all this information using some Function Module.
Thanks

Hi again,
IF you have the invoice document + BUKRS + GJAHR, try this:
Search in the BKPF with the following:
BKPF-BUKRS = VBRK-BUKRS
GJAHR = Fiscal Year (get from the dates)
BKPF-AWKEY = (INVOICEDOC Concatenated with GJAHR. Example 54002230392009)
I tried that on my system and it was pretty fast.
PD. I have checked with a trace and SAP works the same way, it uses the fields described before + AWTYP (If you know it, In my case I used RMRP) to obtain the Accounting Doc.
Regards,
Gilberto Li
Edited by: Gilberto Li on Mar 10, 2009 5:37 PM

Similar Messages

  • How to find out the Accounting document status for sales order

    Hi
    We have created the sales document by referring the billing document of contract no.Aftre that we have raised invoice for sales document. Now system is generated both invoice , accounting document and the value is appearing against the invoice document. However the status against the accounting document is showing as not cleared. I want to know where we could see this status in Table,
    Normally we can see the status in FPLT for contracts since its having the billing plan no. Suppose if the billing plan is not available like S.O , How to check the status in table?
    I have refered so many tables but not helping. Since i want to get the uncleared value of accouting document.
    Please help me.
    Regards
    Thenna

    Hi Thenna
    The accounting document status in the document flow is determined dynamically when you display the document flow,
    it's not saved in a specific table.
    Here is the relevant logic:
    LV05CF01 -> form BUCHHALTUNGSBELEG
    IF vbrk-vbeln <> vbfa_tab-vbeln.
       PERFORM vbrk_ermitteln USING vbfa_tab-vbeln.
       REFRESH xbkpf.
       CALL FUNCTION 'FI_DOCUMENT_READ'
        LOOP AT xbseg WHERE bukrs EQ xbkpf-bukrs
                      AND   belnr EQ xbkpf-belnr
                      AND   gjahr EQ xbkpf-gjahr
                      AND   ( koart EQ 'D' OR koart EQ 'K' ).
        ENDLOOP.
                IF NOT sy-subrc IS INITIAL.
      SET STATUS TO 'No items are cleared'
                  l_xdoc_num-status = 'A'. <<<
                ELSE.
                  LOOP AT xbseg WHERE augbl IS initial
                                AND   umskz NE 'A'
                                AND   vorgn NE 'AZUM'
                                AND   ( koart EQ 'D' OR koart EQ 'K' ).
                  ENDLOOP.
                  IF NOT sy-subrc IS INITIAL.
      Set status to 'All items are cleared'
                    l_xdoc_num-status = 'C'. <<<
                  ENDIF.
                ENDIF.
    Regards,
    Alex

  • How to check wheather the project is having 'AUC' or not.

    Hi friends,
    How to check wheather the project is having 'AUC' or not.
    Regards,
    Safiq.

    Hi Basha ,
    as per my knowledge , WBS will have AUC ,Settlement rules  etc, so u need to check asset tables based on the WBS element .
    regards
    Prabhu

  • Posting the accounting document to RM-CA not to FI G/L

    Hi guys,
    I'm working on the system which include RM-CA for netting the open issues with payments. I have a problem with posting of the accounting document to the FI G/L. Usually (in standard) the accounting document is posted from SD to the G/L automatically. Now I send the accounting document with "home made" FM like FKK_EBS_DOC idoc (only that it is for outbound sending) to the RM-CA through output for ALE messages, which works fine. It is filled from accounting document. Now this document is sent to the RM-CA (through output determination) and in the same time (automatically) to the G/L so it is posted twice (connection from RM-CA to G/L is also established). RM-CA is separated system.
    My question is, how to prevent the accounting document from SD to be posted to the G/L.
    Any sugestions would be apreciated.
    Regards,
    Matija

    Hello,
    One possible solution for that would be to take the current ( first configuration of SO>DLY>INVOICE) that you have mentioned in the first statement
    add a user exit like
    EXIT_SAPLV60B_008: Change the transfer structure ACCCR, ACCIT and ACCHD
    make all the values that are passed to accounts and costing as zero . through this there would be no accouitng document generated for nil values and even if generated would be for zero values
    the actual posting can be done through the Idoc
    Hope this helps
    Thanks
    akasha

  • How to check whether the Application Server directory exits or not

    Hi,
    I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
    Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
    Can anyone help me on the same how to check whether the server directory exists or not.
    Thanks in advance.
    Best Regards,
    Pradeep.

    Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
      Store the directory name
        l_dpath = p_file+0(l_no).
      Validate the directory of the application server
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = l_dpath
          TABLES
            dir_list               = l_i_dlist
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
      If any problem occurs with the directory then display proper
      error message
        IF sy-subrc <> 0.
        Display error message
          MESSAGE e018 WITH 'Problem with directory entered'(008).
        ENDIF. " sy-subrc <> 0
    Regards,
    Joy.

  • How to create invoice but accounting document is cleared already?

    Hi,
    I cannot able to create invoice for the return order, for this return order accounting document has been cleared
    but the invoice is not created.
    Here i need to create the invoice.
    Advice me to solve this issue.
    Thanks
    Raghu

    for this return order accounting document has been cleared
    For return order, accounting document will not be generated.  Not sure what do you mean by this.
    thanks
    G. Lakshmipathi

  • How to check whether the user has a certificate or not?

    Hi everyone.
    We're currently finishing a web project and the last step is to check whether users accessing the application have a valid certificate or not.
    Users with a valid certificate can access all the data. Users without any certificate installed on their browsers may still proceed, but they won't be able to see all data. Please note that the lack of a certificate doesn't mean an error - it's just another use case.
    Is there any way to check whether users have a certificate installed on their browsers?
    Thanks in advance.
    Edit: sorry, I forgot to post some tech details. We're using Struts 1.2 on a Tomcat 5 app server.
    Message was edited by:
    advaca

    I am not sure how Tomcat handles this, but you need to use two-way (mutual authentication) request but not enforce SSL between Tomcat and the client browser. This will make the browser prompt the user for the cert they want to send. Then you'll need to tackle the other part of your problem, getting the correct content displayed depending on whether the user sent a cert or not. I'm even less help there than I was on the first part of your question.
    So, yeah - good luck with that
    Lee

  • How to check whether the report is being called or not

    Iam using srw.run_report.for calling another report. I have registered both the report in oracle apps11.0.3. When i run the master report in oracle apps I want to see whether the second report is called or not. How to check this.
    Thanks.

    try to check it in C:\Reports6i\Bin
    C:\Reports6i\Bin <-- this may varry depending on the location of your reports.
    btw, are you generating a pdf file?

  • How to check if the Companian CD is istalled or not ??

    Hi All,
    I Have a 10g Oracle Database running on a Solaris 10g machine.I m not sure if the Companian CD is installed or not.My question is How can I check if it is installed or not.If not installed can I installed even after I have created my databases.
    Best Regards.

    In 10g, the base software for db comes in the first cd itself. So if have that, you can go ahead to create database and so on. Companion cd is just for the installation of hte additional products like APEX and so on.
    For the completion of it, you may want to review the installation log.. That should help,
    http://download.oracle.com/docs/cd/B19306_01/install.102/b15708/app_ts.htm#sthref561
    HTH
    Aman....

  • How to check whether the new records are inserted or not in SSIS

    Hi All,
    I have a SSIS package which insert data from Table A  to Table B . I need to insert only new records to Table B. If any record is not there it should insert the record if not ignore that record.
    I used Lookup Transformation but it doesn't works from me, which tab should i need to select? Like in General tab we have  ignore failure, Fail Component,Redirect rows to no match output, Redirect rows to error output?
    Please help me on this issue. 
    Thanks, Shyam Reddy.

    On what basis you're doing the lookup? Are you using correct column for the lookup? It should be based on common columns based on which tables are related (mostly primary key column)
    Can you also show the column tab to see how you've done the mapping  ?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to check whether the Workflow event is triggered or not ?

    Hello All,
        My scenario is like this :
    1. Go to MM02
    2. Change a material of any view other than the classification.
    3. Save it.
    4. Go to transaction SWEL and check there .
    5. An entry has been created in that across the object type Y01BUS1001.
    6. Now I can check in the Transaction CFG1 the Log details.
    7. This is correct.
    8. Now the same procedure is not working when I change the material for the classification View.
    9. Do i need to check something else ?
    10. When the classification data is changed for a material the Object type Y01BUS1003 has to be triggered.
    Can any one help me out ?
    Regards,
    Deepu.K

    Hi,
    If you are using the Event collector, you can check in from RSA1-> Tools-> Event collector. You cannot trace whether that event was raised from anywhere I think
    Regards

  • How to check for the sub folder in the document library Is already Exist using CSOM?

    Hi,
    My requirement is to create the  folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
    I able to check for the parent folder.
    But cant able to check the subfolder in the document library.
    How to check for  the sub folder in the document library?
    Here is the code for the folder
    IsFolder alredy Exist.
    private
    string IsFolderExist(string InputFolderName)
    string retStatus = false.ToString();
    try
    ClientContext context =
    new ClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
                context.Credentials =
    CredentialCache.DefaultCredentials;
    List list = context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
    FieldCollection fields = list.Fields;
    CamlQuery camlQueryForItem =
    new CamlQuery();
                camlQueryForItem.ViewXml =
    string.Format(@"<View  Scope='RecursiveAll'>
    <Query>
                                            <Where>
    <Eq>
    <FieldRef Name='FileDirRef'/>
    <Value Type='Text'>{0}</Value>
                                                </Eq>
    </Where>
    </Query>
                                </View>",
    @"/sites/test/hcl/"
    + InputFolderName);
                Microsoft.SharePoint.Client.ListItemCollection listItems = list.GetItems(camlQueryForItem);
                context.Load(listItems);
                context.ExecuteQuery();
    if (listItems.Count > 0)
                    retStatus =
    true.ToString();
    else
                    retStatus =
    false.ToString();
    catch (Exception ex)
                retStatus =
    "X02";
    return retStatus;
    thanks
    Sundhar 

    Hi Sundhar,
    According to your description, you might want to check the existence of sub folder in a folder of a library using Client Object Model.
    Please take the code demo below for a try, it will check whether there is sub folder in a given folder:
    public static void createSubFolder(string siteUrl, string libName, string folderServerRelativeUrl)
    ClientContext clientContext = new ClientContext(siteUrl);
    List list = clientContext.Web.Lists.GetByTitle(libName);
    CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =
    @"<View Scope='RecursiveAll'>
    <Query>
    <Where>
    <Eq>
    <FieldRef Name='FSObjType' />
    <Value Type='Integer'>1</Value>
    </Eq>
    </Where>
    </Query>
    </View>";
    //camlQuery.FolderServerRelativeUrl = "/Lib1/folder1";
    camlQuery.FolderServerRelativeUrl = folderServerRelativeUrl;
    ListItemCollection items = list.GetItems(camlQuery);
    clientContext.Load(items);
    clientContext.ExecuteQuery();
    Console.WriteLine(items.Count);
    if (0 == items.Count)
    //create sub folder here
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to find the accounting document

    Dear all,
    Can somebody tell me how to find the accounting document from the MIGO transaction. I entered a goods delivery into the system. An accounting document should already be created.
    Best Regards
    Jerome

    Hi Jerome
    Go to that that material document (which was created through migo transcation)and click on Doc info header. There you can find FI documents. It will give the accounting documents (if any that has been created).
    Hope this helps.
    regards
    Anand.c

  • How will I save the downloaded documents or files from my gmail account?

    How will I save the downloaded documents or files from my gmail account?

    http://forums.adobe.com/docs/DOC-2532

  • Unable to get the accounting documents in Sales process

    Hi All,
    While running the Sales Business cycle, accounting documents are not generated for any goods movement i.e. MB1C (561), MB31 (101) and also PGI. But the accounting document is generated while doing the billing. I have checked the settings of OBYC and OMS2.
    Please tell me the solution to resolve this.
    Thank you,
    Satya

    Hi Benni,
    THank you for your reply.
    Accounting documents are not generating for both movement types i.e. initial stock entry (561) and Delivery (601).
    Thank you,
    satya

Maybe you are looking for

  • Network Questions on 2012 R2 Hyper-V Cluster

    I am going through the setup and configuration of a clustered Windows Server 2012 R2 Hyper-V host.  I’ve followed as much documentation as I can find, and the Cluster Validation is passing with flying colors, but I have three questions about the netw

  • What tools were used to make this cartoon picture?

    I want to make a picture like these ones, but i dont know which tools to use. it seems they didnt use the pen tool at all, and i cant quite figure out how they did all the shadows and highlights. its seems they used the brush, but when i use the brus

  • Defining a table field as radiobutton

    Hi experts, I have a client table with two fields defined as char 1. Now, when creating the screen for SM30, I want these two fields as radiobutton. In the layout, I have created them as radiobutton but now, I don't know how to group them. It underst

  • Composite Application in Adobe AIR?

    Hello All,                 We are trying to build a solution in Composite Application that could be deployed in desktops and mobile. We are thinking that such an application would need to be an air package that run seamlessly. We have a few questions

  • Spctl says rejected for signed flat package

    I have a flat package, signed by a Apple supplied Developer Id, and spctl rejects it The TOC in the xar file is proper looking and has a valid XML signature in it (best I can tell).  Certificate chain is elided here, but matches the output from pkgut