Query for Approvals on Documents series based.

Hi Experts,
SAP B1 8.81
I am Using the Purchase Quotation for the Purchase Requisition, like i  created a seperate Series as "PUR_REQ" for purchase requisition  documents . Here i want to give the approvals for the "PUR_REQ" series only in the purchase quotation.
So i thought we can workout this scenario using a Query.   can anyone please help me to create the query.
Thanks in Advance,
Regards,
Dwarakanath.

Hi GordonDu,
thanks for ur query. but unfortunately it doesn't works. The document is getting saved on originator itself.
If i am right,  u plz confom it.  i am pulling the query in the terms based on user query  under terms in the approval templates.
please review it.
thanks gordon,
regards,
dwarak.

Similar Messages

  • FMS Query for default Profit Center in SO

    Dear Experts,
    Can anybody help me by providing FMS query for getting default Profit  Center based on the default Warehouse in the user default settings.
    Regards
    Srini

    Hi Rahul,
    I created each Branch as a profit Centre and the filed name is OPRC.PrcCode . If the user at a particular branch logged in SAP by using his ID and when he is adding a SO the profit centres list should appear in Profit centre filed.
    And is there any provision to set the profit centre  (OPRC.Code) as default for the user at a branch by taking document no.series or location ID or User ID as consideration in the FMS query.
    Thanks
    Srinivas

  • Update routine to populate value for field ZDOCCATG(Document category)

    Hi Experts,
       I need to populate  data for field ZDOCCATG(Document Category) based on the value of the below  two fields,
    1. 0deb_cre_lc(Debit / credit Amount)
    2. 0ac_doc_typ(Belegart)
    The logic is as follows:
    if 0deb_cre_lc > '0'.
         if 0ac_doc_typ == 'dz'.
          ZDOCCATG = Disputes.
         else
      ZDOCCATG = Invoices.
       end If.
    else
    if 0ac_doc_typ < '0'.
    ZDOCCATG = Credits.
    end if.
    I need to write the update routine to get the values assigned for Document category based on these two fields. When i open the routine for the field ZDOCCATG, i can see the below screen:
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
               RETURNCODE LIKE SY-SUBRC "Do not use!
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine
      RESULT = .
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Please let me know the code to be inserted (based on the logic mentioned above) in the above screen . Thanks
    Regards,
    Kavitha Jagannath

    Hi Kavitha,
          Supposing the technical name of fields is /bic/0deb_cre_lc and /bic/0ac_doc_typ use the code below at the marked position.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA: ...
    $$ end of global - insert your declaration only before this line -
    FORM compute_data_field
    TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
    USING COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
    RECORD_NO LIKE SY-TABIX
    RECORD_ALL LIKE SY-TABIX
    SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
    CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
    RETURNCODE LIKE SY-SUBRC "Do not use!
    ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine                 
    <----- Paste the code below as shown here --->
    if comm_structure-/bic/0deb_cre_lc > 0.
      if comm_structure-/bic/0ac_doc_typ == 'DZ'.
       result = 'DISPUTES'.
      else
       result = 'INVOICES'.
      endIf.
    elseif comm_structure-/bic/0deb_cre_lc < 0.
      result = 'CREDITS'.
    end if.
    <----
    >
    if abort is not equal zero, the update process will be canceled
    ABORT = 0.
    $$ end of routine - insert your code only before this line -
    ENDFORM.
    Regards:
    Jitendra
    Edited by: Jitendra Gupta on Oct 15, 2009 3:05 PM

  • Query for vendor rating

    Dear All
    I want a query for Vendor rating, which is based on PO Date  PO Quantity GROP Date GRPO Quantity (i.e comparision on that and we can find out this vendor is good for me.)
    Pls Provide me solution.

    Moving this thread from ERP-MM to [SAP Business One Core|SAP Business One Application;

  • Journal entry series based on base document series

    We defined series starting with 141 and 142 for two locations for almost all document types. When I post a document (A/P invoice or outgoing payment or any other), the journal entry is getting posted with default series (141) instead of being based on the Origin document series (141 for 141 and 142 for 142). Is there any way to configure this?

    Hi,
    JE numbering document can not base on origin document. But they can be set default by user only. That is system behavior.
    Hope this helps,
    TVSon

  • Based document series need to be copied to target document

    Hi,
    There are 4 document series for every marketing document as Manufacturing - Series 1, Trading - Series 2, Retail - Series 3, Wholesale - Series 4, Shoppers - Series 5.
    Now User A is been given permission / authorization for document series 1 and 2 which is for Manufacturing and Trading and user B is given permission for document series 3,4 and 5 for Retail, Wholesale and Shoppers. Now when user B makes a sales order in say Wholesale which is document series 4 and then makes a delivery based on the sales order it is seen that in delivery note he has to again select the document series manually which is series 4 Wholesale. Why it is not possible to copy the based document series to the target document.
    Again for example user A makes PO in series 1 which is Manufacturing and then makes a Good Reciept PO then again he has to select the document series in the target document as 1 manually.
    Is there any way by which the base document series can be copied to the target document without manually selecting the same as its creates a mess if the user forgets to select the document series in the target document....Means SO is made in in Wholesales and Delivery is done in Shoppers. No default series also can be done as in any series as per requirement the user does the base document and he wants that once he put the series in the base document then automatically while doing the target document the base document series should be selected.
    Kindly let me know is there any possibility in SBO 2005B.
    Regards,
    Kamlesh

    Dear Shamseer,
    Default series has been set for that particular user. But for that user only 2-3 series are defined as per clients requirement. Now user wants that once in the base document the series is selected. All the corresponding target document should come with the same series ( Note all marketing document has the same series name but have diffrent series number )
    Regards,
    Kamlesh

  • Query to combine document series name and number

    Hi all,
    Example of Sales Quotation document numbering as following:
    Document series name: SQ10
    Document number: 1001
    Can I have a query to combine the series name and number as one field, e.g. SQ101001?
    This is for the purpose of if there is revision in a sales quotation, new quotation will be raise and UDF need to display previous sales quotation no.
    Thanks in advance!
    Phoebe

    Hi,
    Thanks for your help.
    Got the query as following:
    select T1.SeriesName + cast(T0.docnum as CHAR(15)) AS 'SQ No.', T1.[SeriesName],T0.[DocNum], T1.BeginStr AS 'Prefix', T0.[CardCode], T0.[CardName]
    from OQUT T0, NNM1 T1
    where T1.ObjectCode = 23 and T1.Series = T0.Series

  • Problem writing a sql query for a select list based on a static LOV

    Hi,
    I have the following table...
    VALIDATIONS
    ID          Number     (PK)
    APP_ID          Number     
    REQUESTED     Date          
    APPROVED     Date          
    VALID_TIL     Date
    DEPT_ID          Number     (FK)
    I have a search form with the following field item variables...
    P11_DEPT_ID (select list based on dynamic LOV from depts table)
    P11_VALID (select list based on static Yes/No LOV)
    A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
    SELECT v.APP_ID,
    v.REQUESTED,
    v.APPROVED,
    v.VALID_TIL,
    d.DEPT
    FROM DEPTS d, VALIDATIONS v
    WHERE d.DEPT_ID = v.DEPT_ID(+)
    AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
    This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
    Can anyone help me to extend my query to include this situation?
    Thanks.

    Hello !
    Let's have a look at my example:create table test
    id        number
    ,valid_til date
    insert into test values( 1, sysdate-3 );
    insert into test values( 2, sysdate-2 );
    insert into test values( 3, sysdate-1 );
    insert into test values( 4, sysdate );
    insert into test values( 5, sysdate+1 );
    insert into test values( 6, sysdate+2 );
    commit;
    select * from test;
    def til=yes
    select *
      from test
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);
    def til=no
    select *                                                                               
      from test                                                                            
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);  
    drop table test;  It's working fine, I've tested it.
    The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
    For understandings:
    1.) TRUNC removes the time part of DATE
    2.) The difference of to date-values is the number of days between.
    3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
    4.) DECODE is like an IF.
    Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
    Good luck,
    Heinz

  • Function returning SQL query for mutiple series in a chart

    Hi,
    I would like to know if there is a way to specify a single PL/SQL function returning the queries for multiple series in a 2D Line Flash Chart. I have multiple series in my chart that has different values in the where clause. I can write a PL/SQL function that can return all these queries in one shot. Is there anyway that I can specify this function as returning the queries for all the series in the chart?
    As an example, assume that I am using the following three queries for the series in my chart:
    select deptno, count(*) from emp where deptno = 10 group by deptno
    select deptno, count(*) from emp where deptno = 20 group by deptno
    select deptno, count(*) from emp where deptno = 30 group by deptno
    I can't write a PL/SQL function that returns a query in the multiple series syntax (SELECT link, label, series_1_value [, series_2_value [, ...]]FROM ...) as I am using an aggregate function and my where clause is different for each series.
    Thanks,
    Rupesh

    Hi Roel,
    Thanks for your reply. I am already using an analytical function (RATIO_TO_REPORT(COUNT(*)) OVER () ) in my actual report. My problem is that the query for one series differs from the other only in one where clause. I will be able to dynamically able to generate all the queries for all the series in one pl/sql function. But the chart definition screen does not allow us to define a single function that returns queries for the all the series - possibly seperated by some seperator like S1: select.... S2:select and so on.
    Regards,
    Rupesh

  • New Document Series for different locations for Production Orders

    Hi Experts,
    I have came across a scenario where we have to setup different Document Series for Different Locations. Actually the Company is having 2 units . First one is the factory itself and the second one is Subcontracting Unit to which the company sends the job work order . But there it wishes to track the productions processes and the Stock tracking Warehouse Wise for
    this Second unit also . As Such I have created 2 locations and one warehouse for (RM,SFG,FG) for both the units.
    The obvious requirement here is to maintain different Document Series for Productions orders for both the units .
    Please guide me about how to overcome this scenario.
    Thanks and Regards,
    Pooja Singh.

    Hi Pooja,
    Yes. You can maintain different document series for production Order or any documents depending upon your business scenario.  Let's say, you need to maintain Production orderu2019s of job work and sub contracting.
    You can define this under Administration>System Initialization> Document numbering.
    Select Production orders--> let say Factory first number 1, last number 199999, select current period indicator and update. Similarly for the subcontracting, in the name field, "work order", first number as 110001 or the way you desire, and then the last number.
    Reards,
    Senthil Maruthappan.

  • Need SP_TN for specific user must use specific document series and warehouse in Marketing Documents

    Hi experts,
       I need SP_TN for specific user must use specific document series and warehouses in Marketing Documents SAP B1.
       Kindly give solution ASAP.
    Thanks in advance

    Hi Nagarajan,
       It show (1) Not allowed to add PO.
       I used the following SP
    IF  @object_type = '22' AND @transaction_type IN (N'A',N'U')
    BEGIN
    IF Exists
    (SELECT T0.DocEntry FROM POR1 T0 INNER JOIN OPOR T1 ON T0.DocEntry = T1.DocEntry
    WHERE  T1.DocType = 'I' AND T1.Series = '142' OR T1.Series = '145' AND T0.[WhsCode] = 'STEX-01'
    or T0.[WhsCode] = 'STNEX-01' and T1.[UserSign] ='1'
    and T1.docentry = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @error = 1
    SELECT @error_message = 'Not allowed to add PO'
    END
    END
    warm regards,
    Guhan

  • FMS Query for Document Header UDF

    Hi,
    I have created an UDF in the header level of Marketing Document. I want to add FMS on it. UDF Value will be 4% of DocTotal Value and auto Refresh on DocTotal.
    What will be the query for Sales Order.

    I am saving this query
    Select ($[$29.0.number]) * 0.04
    and setting this query in the udf by.
    now when i am creating an order and pressing shift+f2 on it it's giving an error msg : internal error(3006) occured.
    Edited by: Sibasish Sengupta on Dec 8, 2008 1:11 PM

  • Query For Series wise Collection

    Hi
    Please anyone provide  query for series-wise collection

    Satish Doke,
    Im using this query as "Series Wise Outstanding" I want to create another  query for "series wise collection".How can  i do this.Im not into SAP accounting.Please help.
    DECLARE @Date AS DATETIME
    DECLARE @Series AS varchar(30)
    DECLARE @Branch AS varchar(30)
    DECLARE @Exec AS varchar(30)
    /* SELECT FROM [dbo].[OINV] S0 WHERE */ SET  @Date = /* S0.DocDate*/ '[%0]'
    /* SELECT FROM [dbo].[NNM1] S2 WHERE */ SET  @Series = /* S2.SeriesName*/ '[%2]'
    /* SELECT FROM [dbo].[OLCT] S3 WHERE */ SET  @Branch = /* S3.Location*/ '[%3]'
    /* SELECT FROM [dbo].[OSLP] S4 WHERE */ SET  @Exec = /* S4.SlpName*/ '[%4]'
    if( @Exec ='') set @Exec ='%'
    if( @Series ='') set @Series ='%'
    if( @Branch ='') set @Branch ='%'
    if( @Date ='') set @Date =GETDATE()
    Select distinct OINV.CardName [Customer Name], ISNULL(NNM1.SeriesName ,'-')+'/'+ CAST(OINV.DocNum as varchar) [Bill No.],
    OINV.DocDate [Bill Date],INV1.Dscription,INV1.Quantity,
    OINV.DocTotal - OINV.PaidToDate [Out Standing Amount],
    DATEDIFF(dd,OINV.DocDate,@Date)[No of Days]  from OINV
    inner join INV1 on OINV.DocEntry = INV1.DocEntry
    inner join OLCT on INV1.LocCode = OLCT.Code
    inner join NNM1 on OINV.Series = NNM1.Series
    inner join OSLP on OINV.SlpCode = OSLP.SlpCode 
    where OINV.DocType ='I' and (OINV.DocTotal - OINV.PaidToDate)>0
    and NNM1.SeriesName like @Series and OINV.DocDate<= @Date
    and OLCT.Location like @Branch and OSLP.SlpName like @Exec

  • 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

  • Incoming Excise document automaticaly show the base document Series ans Do

    Dear All,
    One of my customer  have two branches and for that they  created them as two separate warehouses. And both branches are excisable unit. So when they  are transferring inventory from one branch to other which are excisable so they have to raise Excise invoice based on Inventory Transfer.
    They require in an incoming Excise document automatically show the base document Series and Docnumber  in a  "Excise Ref No."  field .
    pl provide me FMS query .
    regards
    Rakesh

    Bom dia Marc de Ruijter,
    Não dá para ler sua thread, mas imagino que seu validador esteja desligado.
    No GRC vá em SPRO --> SAP GRC Nota Fiscal Electronica --> Configure System Response for Each Tax Number (CNPJ)
    Para ligar/desligar o Validador basta clicar no check box na coluna Validation.
    Observação: Para correto funcionamento do GRC deve-se sempre utilizar o validador ligado.
    Após isto refaça seu teste, é provável que você receba um erro de validação para a NF-e. Veja em GRC Web monitor -> NFe Detailed View -> Validation History.
    Atenciosamente,
    Fernando Da Ró

Maybe you are looking for

  • Windows 7 no longer recognizes or allows ASIO drivers for my usb audio interfaces

    Hello All, last year I purchased a new version of Propellerheads Reason and the  Balance digital audio interface that came with the bundle. Everything was fine it all worked well, especially when I added asio4all drivers. (The Balance comes with its

  • Itunes and quicktime unable to play music files

    I have an Apple Mac mini (Intel Core Duo - 1.66GHz, 1.25 GB RAM) that I just upgraded to Snow Leopard. After upgrading, itunes (newest version) won't play any audio files (aac, mpg, aiff). Neither will the new version of quicktime (x). The older vers

  • Error  al abrir XL REPORTER en Version 2007 A SP 01 PL 06

    Hola a Todos Tengo un problema para usar el XL REPORTER, al tratar de abrirlo desde el menu Herramientas en SAP, manda un error que dice UNABLE TO START XL REPORTER Object Variable or  With block  variable not set No he encontrado informacion que me

  • Canon 5D III tether to iPad 4 (either cable direct or wifi

    I'm using a Canon 5D III and I would like to RELIABLY transfer photos in real-time to my iPad 4 Retina for proofing/checking the photos.  Either cable-direct or wifi.  I have the latest version of Lightroom and PS CC 2014. Can I do it and how do I do

  • LabVIEW 2011, and Excel 2010: saving problems

    Hello to all! I am a student of Mechanical Engineeringfthat very little has been using this software. I present the problem: for a matter which is called Biomechanics, I and my colleagues, we have developed the design of a rheometer, which is control