Approval query to check on project code status cannot work

Hi all,
I setup project codes using SAP project master. I create a user-defined field in project master call 'status' with list down options 'O-open' or 'C-close'.
when user create a document, example sales quotation, user will enter project code in the accounting tab the BP project field. In the project field at row level, use will also enter project code.
I want to have a approval check that the project selected in sales quotation is not in closed status. If the project status is close, then need to submit for approval.
i created a query below to check on the header level project code but cannot work:
SELECT DISTINCT 'TRUE'
FROM OQUT T0  INNER JOIN OPRJ T1 ON T0.Project = T1.PrjCode
WHERE $[OPRJ.U_Status] ='C'
Can anyone advise what is wrong with my query?
Also how can i do include the row level project code check into the query.
Thanks.

Hi Veron,
Please find below a query requesting an approval when a selected project has u201CClosedu201D status in Project Codes table.
SELECT 'TRUE'
FROM OPRJ T0 WHERE T0.U_Status ='C' AND T0.PrjCode = $[OQUT.Project]
hope it helps,
Regards,
Ladislav
SAP Business One Forum Team

Similar Messages

  • Where we check the Project closing status?T.code for List of Closing Projec

    Dear Guru's,
    Where can we check the Project closing status? Can we change the closing status if want to do some modification, and what is the transaction code that we to view the list of closing project.
    Regards,
    Kalyan

    1.You can find the project status ( all the  status )  in any project maintenance transaction for ex. Run Cj20n > Open you project> on the basic data tab you will find the project status.
    ( If you want to see the status of other  PS oject than click on that object, similarly you will get the status of that object on Basic data tab. )
    2.Yes you can change the closing status of proejct for midification. path is clickon the object for which you want to change the closed object > Edit> Status--> Close --> Undo.
    3.For the list of Project status go to CN41
    on the projectno. input line click on multiple selection--> give the proejct no. list for which you wanted to see the  status. -->enter --> Excute.
    Report will open in screen. in that report go to toolbar and click on 'choose filed' button.(F5) -->one pop up window will open -->right handside scroll down in that window >select 'status' field and move it to left side>enter
    project status will be shown against you project list. you can verify the same in maintenance txn.
    If you have activated user status the same will also get populated.
    You can downlaod the same in Excle file path is  : Evaluation menu>export>save to file. ( via filtering in Excle you call do all the analysis realted to project status how amny are in clised status etc. )
    Regards
    Nitin

  • Error while approving change document(TR lost project code)

    Hi All,
    I am having issue in change document approval, when we are approving change document for unit testing or if release management approving change for pre-production or production approval, we are getting error, I started coming from last two days only,\
    when I did detail analysis,  in all transports project code related to change document, disappear
    although if I create new change document, project code appear,
    Do we have  way to solve this issue?, I even not able to decouple the transport from change document, it giving error, do we have way where we can resync change document and transport?
    Dinesh

    Hi All,
    Do anyone have some solution for this issue?, it  is bigger than I thought, I can check it impacted all systems, and all transports,  all transports seems to issue they lost project code in it we rollover maintenance cycle last week and this problem started from their, we put charm master note and few other charm fixes(notes) last week,
    this problem not coming any new change document, but all change document created before rollover impacted
    Dinesh

  • Approval Query to skip for one Vendor Group - Not working

    Dear All,
    I am trying to create an approval query wherein when a user creates a Purchase Order for a Particular Vendor Group then the approval check is not required and for other Vendor Group approval check is required. The query is as under :
    SELECT distinct 'true'  FROM OPOR T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN OCRG T2 ON T1.GroupCode = T2.GroupCode WHERE T2.GroupName <> 'Supplier Own Group'
    I don't want that which vendors are in Supplier Own Group check go for an approval process. Means all vendors in this group should get skipped for approval.
    How to achieve this because this query seems not to be working in the approval process because when a user creates a PO whose Vendor group is under Supplier Own Group then also the approval checking is happening.
    Please help how to resolve this issue.
    Regards,
    Depika

    Hi,
    Try this
    SELECT distinct 'true'  FROM OPOR T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN OCRG T2 ON T1.GroupCode = T2.GroupCode
    AND T2.GroupName <> 'Supplier Own Group' where T0.CardCode = $[$4.1.0]
    Hope this helps,
    Son.

  • Query to check BP Payment terms and Document Payment terms

    Hi All,
    Can any one help me to create an approval query to check the BP payment terms and Document Payment terms are same or not?
    Normally we change our BP payment terms regularly as per the agreements between Customer and us.
    but when we copy any previous document into invoice it calculate the Due date as per previous payment terms. so we need an query to check wether the BP payment terms and document Payment terms are same or not? if it is different they it should ask for authorization from manager or else the document should be saved.
    Thanks in Advance,
    Prachi.

    Hi
    I will test this and will let you know if it works or not?
    Thank you very much.
    Prachi.

  • SP to work in AR Invoice row for Project Code excluding One Document Series

    Hi Experts,
    I have a SP and its working fine to check wether project code is entered in the row level of the invoice. Now I have 4 document series named 1) Wholesale 2) Trading 3) Manufacturing 4) General
    I want this this stored procedure should only check and give error for the series 1) Wholesale 2) Trading 3) Manufacturing and not for series General. Can it be done for SP to warn for specific series and if there is no Project Code given in General Series then the document should be added to the system.
    My SP is as under :
    ----Project Code
    IF @transaction_type IN ('A', 'U') AND @object_type = '13'
    begin
    if exists (SELECT DISTINCT ISNULL(T0.Project,'') FROM [dbo].[inv1] T0 WHERE T0.Docentry=@list_of_cols_val_tab_del)
    begin
    SELECT @error = 10, @error_message = N' Project Code is missing....'
    end
    end
    Is there any options by which I can use the same SP for all marketing document by making a single Stored Procedure or I have to make seperate for each individual marketing document.
    Regards,
    Kamlesh
    Edited by: Kamlesh Gupta on Mar 21, 2009 1:15 AM

    Hi,
    I am trying to write a SP as under :
    ----Project Code
    IF @transaction_type IN ('A', 'U') AND @object_type IN ('13','15','16','17')
    begin
    if exists (SELECT DISTINCT ISNULL(T0.Project,'')
    FROM [dbo].[inv1] T0 INNER JOIN [dbo].[OINV] T1 ON T0.DocEntry = T1.DocEntry,
    FROM [dbo].[dln1] T0 INNER JOIN [dbo].[ODLN] T1 ON T0.DocEntry = T1.DocEntry,
    FROM [dbo].[rdn1] T0 INNER JOIN [dbo].[ORDN] T1 ON T0.DocEntry = T1.DocEntry,
    FROM [dbo].[rdr1] T0 INNER JOIN [dbo].[ORDR] T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.Docentry=@list_of_cols_val_tab_del
    begin
    SELECT @error = 10, @error_message = N' Project Code is missing....'
    end
    end
    to block documents which does not have poject code but I am getting an error while executing it as under :
    Msg 156, Level 15, State 1, Procedure SBO_SP_TransactionNotification, Line 275
    Incorrect syntax near the keyword 'FROM'.
    Also note that when I am having only one SP as under :
    AR Invoice Project Code
    IF @transaction_type IN ('A') AND @object_type = '13'
    begin
    if exists (SELECT DISTINCT ISNULL(T0.Project,'') FROM [dbo].[inv1] T0 WHERE T0.Docentry=@list_of_cols_val_tab_del)
    begin
    SELECT @error = 10, @error_message = N' Project Code is missing....'
    end
    end
    then if in AR invoice there is No project Code then its giving an error to put to project code but after putting the project code in the row level also the AR invoice is not getting added to the system. It gives me the error as
    [ADOC] Project Code is missing....'
    What might be the problem please let me know.
    regards,
    kamlesh
    Edited by: Kamlesh Gupta on Mar 21, 2009 11:25 AM
    Edited by: Kamlesh Gupta on Mar 21, 2009 12:28 PM

  • SPTN - Project Code

    Hi ALL,
    Can anybody help me in writing the STPN for making Project Code compulsory in every document of the SAP B1 2007B?
    Regards,
    Abhishek

    The following code checks for 'Project Code' in Purchase Order
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER proc [dbo].[SBO_SP_TransactionNotification]
    @object_type nvarchar(25),                     -- SBO Object Type
    @transaction_type nchar(1),               -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                    -- Result (0 for no error)
    declare @error_message nvarchar (200)           -- Error string to be displayed
    select @error = 0
    select @error_message = N'Ok'
    --     ADD     YOUR     CODE     HERE
    IF @transaction_type = 'A' AND @object_type = '22'
    BEGIN
    if Exists(select * from OPOR T0 where T0.Project is null and T0.docnum=@list_of_cols_val_tab_del)
              SET @error = 10
              SET @error_message ='Project Cannot Be Empty'
    END
    -- Select the return values
    select @error, @error_message
    end

  • Query to check BitLocker Status

    Hello everyone,
    I am running a query against a collection of computers to try to check the BitLocker encryption status of these machines. The query results are error codes like (0,1,2,4,13)! I tried googling around for these codes and couldn't find any doc on it.
    does any one know what does these codes means as a result so I can interpret them?
    The only one I could make some sense is the 1 meaning Success. I think!
    Thank you very much in advance for any help on the topic.

    I can partially help you. See here
    http://msdn.microsoft.com/en-us/library/aa376483(v=VS.85).aspx
    0
    PROTECTION OFF
    The volume is not encrypted, partially encrypted, or the volume's encryption key for the volume is available in the clear on the hard disk.
    1
    PROTECTION ON
    The volume is fully encrypted and the encryption key for the volume is not available in the clear on the hard disk.
    2
    PROTECTION UNKNOWN
    The volume protection status cannot be determined.  One potential cause is that the volume is in a locked
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • T code to check the job run status

    Hi Gurus,
    I am filling the setup tables for inventory, but i didn't run in background. I clicked on execute button, but suddenly i got disconnected from net and my server also.
    Now i have to check the job run status whether it is running or not.
    Request you to provide the suggessions.
    Thanks & Regards,
    Saketh

    Hi,
    if you ran job in background you can see at SM37.use proper time ,date and use id to get your job.
    if you ran on frond end then you won't see job.if your job was completed then you can see data at SE11 by using setup table name or you can see at t code NPRT by using name of the run.
    if you won't find your job then just delete your setup tables again and fill it.
    No issues.
    Thanks

  • Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?

    Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?
    I found one such tool "Fortify" in the below link. Are there any such kind of tools available which supports SharePoint?
    Reference: http://www.securityresearch.at/en/development/fortify/
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

    Hi Amalaraja Fernando,
    I'm not sure that there is one more tool that combines all these features. But you may take a look at these solutions:
    SharePoint diagnostic manager
    SharePoint enterprise manager
    What is SPCop SharePoint Code Analysis?
    Dmitry
    Lightning Tools Check
    out our SharePoint tools and web parts |
    Lightning Tools Blog | Мой Блог

  • Short Dump while using BAPI_PS_PRECOMMIT to set Project Definition Status

    Hi All,
    I am getting a short dump while using BAPI_PS_PRECOMMIT for setting the Project Definition status..
    The requirement is to create a Project Definition and then set its status to REL from CRTD. For this purpose i am using the BAPI's in the following sequence :
    1. BAPI_PS_INITIALIZATION
    2. BAPI_PROJECT_MAINTAIN
    3. BAPI_BUS2001_SET_STATUS
    4. BAPI_PS_PRECOMMIT
    5. BAPI_TRANSACTION_COMMIT
    The Proj Def creation is happening successfully in step2. Interestingly, when I debug the program and stop at PRECOMMIT BAPI the program does not give a dump. I have also tried to give COMMIT WORK / WAIT FOR n SECONDS after BAPI_BUS2001_SET_STATUS, to give BAPI sometime for DB update but nothing seems to be a permanent solution.
    Please give your views on a solution for this problem..
    Thanks & Regards,
    Somil

    Can you please check how to post code in SDN ...
    I cannot read your code properly

  • Project Code to be included in Depreciation run

    Hi Friends,
    Previously, the Cost Center was mandatory for all assets. Now, they want the depreciation to flow to either a cost center or to a project code. In accordance with the requirement, I had made Cost Center optional, along with Maintenance Order. Previously Cost Center was mandatory and Maintenance Order was not shown in the asset class master data configuration screen.
    Hi Friends,
    Find below the description of the issue faced.
    Previously, the Cost Center was mandatory for all assets. Now, the depreciation HAS to flow to either a cost center or to a project code. In accordance with the requirement, I had made Cost Center optional, along with Maintenance Order. Previously Cost Center was mandatory and Maintenance Order was not shown in the asset class master data configuration screen.
    Further, there was a validation which checked that each asset master had a Cost Center field filled in and a substitution which filled the Cost Center field with a default Cost Center. I have changed the validation to reflect that either a Cost Center or a Maintenance Order is filled in. I have modified the Substitution to reflect either a Cost Center or a Maintenance Order.
    Before the above changes were made, the Depreciation run was being executed without any error. After the above changes were made in the system, the Depreciation Run is ending with an error "Account 551100 requires an assignment to a CO object - Message no. KI235"
    Even prior to the error, the Default Account Assignment tab in the relevant Cost Element was empty.
    I have checked the Field Status Variant and Cost Center is only optional in that.
    Can you suggest any further config. settings that have to be changed? Two SAP Notes, ‘827363’ and ‘98778’ have suggested patches, which have already been applied to SAP.
    Regards,
    GV Shivakkumar

    Answered .thanks

  • Need sql query  to get sales channel code

    Hi Experts,
    As per my requirement i need to get the sales channel code by passing invoice number or transaction number ,or concurrent request id, with out any join condition . Please help me on this.
    Regards
    Deb

    1. Below query will give you status of all the request.
    SELECT REQ.REQUEST_ID , REQ.REQUEST_STATUS FROM REQUEST REQ
    2. You can have following status
    Obtaining Operation Approval
    Obtaining Template Approval
    Operation Approval Approved
    Operation Approval Rejected
    Post Operation Processing Initiated
    Request Approval Rejected
    Request Closed
    Request Completed
    Request Created
    Request Failed
    Request Withdrawn
    Template Approval Rejected
    3. Now prepare the query from above sapmle, the requset status string should not contains foloowing values.
    Rejected
    Failed
    Closed
    Withdrawn
    Completed
    The builded query will give you the desired result for 11g
    for 10 G
    Get the OST_STATUS from Req table, and do you logic above stated
    -Kuldeep
    Edited by: Kuldeep on May 22, 2012 1:04 AM

  • Report based on project codes

    Dear all,
    I have a number of projects in our system with different codes and I would like to produce a report with the various Business Partners (BPs) with their different account balances displayed as per the various projects.
    This is very important because a BP can have more than one project code assigned to them .
    I have tried the Query Generator but this is not working for me since the query generates aggregated values of account balances rather than separated balances as per a specific project code.
    Any help will be appreciated.
    Regards,
    Davis M Onsakia

    Hi
    Please Check if the following solution work for u
    in SAP B1 2007 PL 08
    In most of financial  report there is a tab named expansion press it cheek the project code and  select the project code or range of project code and also BP  u will get transaction related only to the selected BP and selected  project Code .
    please let me know if it works
    I will help you if it does not work .
    Avtar Singh

  • IP Job in BW finished, but how can I check the IDoc receive status in BW ?

    Hi,experts
    After I execute a Infopackage with loading more than 200000 records data, the infopackage monitor show me yellow light, 186020 from 200000 records. this infomation still show me till now, seaval hours,it looks pause here.
    And I check the request in the R/3, the Job has finished. as you know it means the R/3 push the IDoc already finished.
    and how can I do now ? or how can I check the IDoc receive status in BW side?

    Hi,
    I too had the same problem, i executed the following to solve the proble, may be this will help you:
    1) Go to T-code SM58 and select TRFC and press F6,
    2) For manual push of I-Docs, GO to T-COde BD87 select perticular idoc and see the status if it is not executed properly then do the manual push by pressing Execute option,
    Thanks,

Maybe you are looking for