PO  vs POR query

Hi,
The requirement is not to use purchase requisition at all but to use purchase order directly.This needs to be linked to a workflow.
Also the approvals are required for PO's directly and not PR's.
In terms of the customzing, what changes are needed, also to override the settings for not using PR at all but only POs for approval, which user exit needs to be written, if at all.
In summary, workflow + PO without PR, how can this be done...Thanks a lot in advance.

Dear  S V ,
You will remove customizing of release strategies from Purch.Requisition . And will keep your customizing to Purch.Order , and furthermore you will create structure at workflow thru tcode PPOME and link it with users. You can check it out completly at address help.sap.com , and search for  "workflow approval".
Best regards,
Carlos Moçatto

Similar Messages

  • Problemas con centavos

    Buenas tardes amigos tengo el siguiente problema ojala me puedan ayudar:
    No se si han tenido problemas en alguna version de sap 2007 con los decimales osea cuando en sql tiene mas decimales que el sap y genera diferencias de centavos a mi me ha pasado cuando estuve haciendo el cierre anual y el saldo de los socios de negocio q me mostraba sap para generar el asiento de cierre  diferia en 0.08 soles de el saldo que calcule por query en la base de datos y eso me distorcionaba el balance de fin de año
    saben si alguna version de sap soluciona ese bug????
    Tengo el sbo 2007 PL48

    Bueno, para empezar, hay una nota de SAP que asi lo menciona y te comparto que en la empresa donde estoy, migramos a ese parche en noviembre y ahora recien hicimos el cierre de año 2008 y 2009 y todo salio bien
    Prueba en un ambiente de pruebas, solicita a tu partner de SAP que te de una licencia temporal para que hagas tus pruebas y ya decides.

  • Por que no puedo usar variable fecha en este query.

    en este query he intentado utilizar la variable   para lo que sería mi variable fecha, por queno me la esta aceptando el generador de consultas del sap?.
    SELECT distinct 'series'= case
    When T0.series=1 then ' FORJADORES'
    WHEN T0.series=34 then  'UNIVERSIDAD'
    WHEN T0.series=35 then 'LIBRAMIENTO'
    WHEN t0.series=36 then 'CANGREJOS'
    WHEN T0.series=37 then 'ROSARITO'
    WHEN T0. Series=144 then 'SANTA ROSA'
    END,
    (select count(docentry) from oinv where (series=t0.series and doctime between '700' and '800' and docdate='2009/02/18')) as [7 AM A 8 AM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '800' and '900' and docdate='2009/02/18')) as [8 AM A 9 AM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '900' and '1000' and docdate='2009/02/18')) as [9 AM  A 10 AM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1000' and '1100' and docdate='2009/02/18')) as [10 AM A 11 AM],
    (SELECT Count(docentry) From OINV where (series = t0.series and doctime between '1100' and '1200' and docdate='2009/02/18')) As  [11 AM a 12 PM],
    (SELECT Count(docentry) From OINV where (series= t0.series and doctime between '1200' and '1300' and docdate='2009/02/18')) As [12 PM a 1 PM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1300' and '1400' and docdate='2009/02/18')) as [1 PM A 2 PM],
    (select count(docentry) from oinv where( series=t0.series and doctime between '1400' and '1500' and docdate='2009/02/18')) as [2 PM A 3 PM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1500' and '1600' and docdate='2009/02/18')) as [3PM A 4 PM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1600' and '1700' and docdate='2009/02/18')) as [4PM A 5 PM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1700' and '1800' and docdate='2009/02/18')) as [5 PM A 6 PM],
    (select count(docentry) from oinv where (series=t0.series and doctime between '1800' and '1900' and docdate='2009/02/18')) as [6 PM A 7 PM]
    From OINV T0
    where t0.docdate='2009/02/18'

    Por favor, marque esta
    Re: docdate search for current posting period
    Gracias,
    Gordon

  • Query para sumar cantidad vendida por mes.

    Estimados:
    Tengo un query en la que saco varios campos de distintas tablas, una de ellas es INV1 desde la cual saco la cantidad vendida por producto.
    Obviamente que esta consulta me trae las ventas una a una, pero yo necesito el total por mes, alguien sabe como lo puedo hacer?
    Ademas es posible que los meses me salgan por columnas y no por filas?
    Gracias.
    Saludos a todos,
    Viviana Medina

    Buenos días:
    Este query te puede servir para sacar la información que necesitas, solo es cuestión de que cambies un poco la sintáxis para que obtengas la información que quieres. En mi caso lo hice para sacar las ventas diarias del cliente mostrador.
    Ya que tú deseas sacar tu venta por articulo debes hacer algo similar, ya que deberás restar las cancelaciones hechas también para obtener la venta real. De ésta forma acomodas tus filas en columnas, y puesto que tú variables dinámicas son las fechas podrás obtener el rango de mes que desees.
    /*SELECT FROM .[OCRD] T2,[dbo].[ORDR] T3 */ DECLARE @FECHA1 DATETIME DECLARE @FECHA2 DATETIME
    SET @FECHA1 =  /* T3.DOCDATE */ '[%0]'
    SET @FECHA2 =  /* T3.DOCDATE */ '[%1]'
    SELECT Fecha 'FECHA', sum(Venta_Directa) 'VENTA DIRECTA',sum(Cancelaciones ) 'NOTAS CRDITO', sum(Venta_Credito) 'VENTA CREDITO' FROM ( SELECT distinct T0.CreateDate as 'Fecha' , sum(T0.DocTotal) as  'Venta_Directa' ,0  as Cancelaciones, 0 as Venta_Credito FROM NNM1 T1  INNER JOIN OINV T0 ON T0.Series = T1.Series WHERE T0.CardCode = 'BMOS' AND  T1.SeriesName  = 'bola' and T0.CreateDate between @FECHA1 and @FECHA2 group by T0.CreateDate
    union all
    SELECT T0.CREATEDATE, 0,SUM(T0.DocTotal),0 FROM ORIN T0, NNM1 T2 WHERE T0.Series = T2.Series AND T2.SeriesName  = 'bola' and T0.CreateDate between
    @FECHA1 and @FECHA2  group by T0.CREATEDATE union all SELECT T0.CreateDate ,0,0,SUM(T0.DocTotal) FROM NNM1 T1  INNER JOIN OINV T0 ON T0.Series = T1.Series WHERE T0.CardCode <> 'BMOS' AND  T1.SeriesName  = 'bola' and T0.CreateDate between @FECHA1 and @FECHA2  group by T0.CreateDate)AS T88  group by Fecha

  • Me estoy por comprar el nuevo Ipad wifi   celular y queria saber donde puedo comprar el chip en Madrid para poder usar la conexion 4g. Gracias

    me estoy por comprar el nuevo Ipad wifi   celular y queria saber donde puedo comprar el chip en Madrid para poder usar la conexion 4g. Gracias

    Tengoe el mismo problema con el muevo iPad, el wifi es inestable, desconectando y conectando nuevamente al roture si ayuda pero solamente de manera temporal aya que después el problema persiste, es frustrante tener que ver vídeos en youtube y que estos tarden demasiado en cargar, es evidente que la inestabilidad se encuentra en el iPad y no en el roture,  por ello debemos seguir comentado al respecto para que nos den una solucion.

  • Buen dia! queria descargar el programa itunes, lo hice se descargó pero no abre ya que dice el programa dejó de funcionar! peor nunca abre!! please help! como se resuelve eso? la laptop es nueva no se si sea por eso!

    no abre el programa itunes! apenas lo descargué sale el mensaje dejó de funcionar, pero nunca abre el programa, please como se arregla eso! ya voy intentando con la descarga 3 veces!

    iTunes does not open the program! I downloaded just get the message stopped working, but never open the program, por favor as fix that! and I'm trying to download 3 times!
    Translated by Google
    Take a look at If you can't install or update iTunes for Windows.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2
    Echa un vistazo a Problemas al instalar iTunes para Windows.
    Para obtener información general véase Resolución de problemas con iTunes para actualizaciones de Windows.
    Los pasos en la segunda casilla son una guía para la eliminación de todo lo relacionado con iTunes y luego reconstruirlo, que es a menudo un buen punto de partida a menos que los síntomas indican un enfoque más específico. Revise las otras cajas y la lista de documentos de apoyo más abajo en la página, en caso de que uno de ellos se aplica.
    Su biblioteca debe ser afectado por estas medidas, pero hay copias de seguridad y consejos de recuperación en la punta de usuario en otros lugares.
    tt2

  • Query Facturas reservadas por corte de fecha

    Como puedo hacer un query en donde puede ver las facturas reservadas que mantienen notas de creditos.
    saludos,
    asv

    Buenos dias
    Puedes ejecutar este query
    SELECT T0.isIns, T0.DocEntry'Facura', T2.DocEntry'NCredito'
    FROM OPCH T0
    INNER JOIN PCH1 T1 ON T1.DocEntry = T0.DocEntry
    LEFT JOIN ORPC T2 ON T2.DocEntry = T1.TrgetEntry
    WHERE T0.DocDate BETWEEN '[%0]' AND '[%1]'
    Todas las que tengan el campo IsIns = Y seran facturas reserva, si quieres filtrarlas agrega
    WHERE T0.isIns = 'Y'
    Saludos
    Edited by: Floyola on May 27, 2011 10:29 AM

  • Query to count differents values of a field

    I have to do counts to the quantity of entitys in the database i have to obtain the quantity of registries for entities that appear
    Buenas, les comento estoy trabajando con plsql y se me presenta un problema, necesito contar la cantidad de registros que devuelve la query por entidad, estoy trabajando con un procedure y evaluando con un cursor, pero no se como hacer trabajar la query para devolver ese valor
    ENTITY OVERALL DATE          HOUR     
    ======     =====     ====          ====
    ENT1          5          20100318          12:00
    ENT2          20          20100318          12:00
    ENT3          12          20100318          12:00
    CURSOR1
    SELECT distinct(rp.cod_entidad),
    YYYYYYYYY,
    to_date(to_char(SYSDATE,'YYYYMMDD'),'YYYY-MM-DD') as fecha_pago,
    to_char(sysdate,'hh-mi-ss') as hora_pago
    FROM registry rp, product pc
    where pc.nro_solicitud = rp.nro_solicitud
    and pc.resp_2= 'OK'
    and pc.resp_1= 'OK'
    Edited by: 862673 on 31/05/2011 10:01

    I must build a query to tell me how many records per entity is, YYYYYYY is not a field, i dont know that I write
    TABLE
    ====
    ENTITY      Cliente          telefono
    ======      =======          ========
    ENT1      indiana          234 54231
    ENT1      jose           566 78954
    ENT1      esteban      234 1234
    ENT3      juan           23434567
    ENT3      jacinto      56745
    ENT3      Perez           23467677
    ENT2      indiana          678967
    ENT1      jaime           234
    RESULT
    =====
    ENTITY OVERALL
    ====== =======
    ENT1     4
    ENT2     1
    ENT3     3
    SELECT cod_entidad
    ,     COUNT (DISTINCT yyyyyyyyy)     AS overall
    FROM      registry rp,
         product pc
    where      pc.nro_solicitud     = rp.nro_solicitud
    and     pc.resp_2          = 'OK'
    and      pc.resp_1          = 'OK'
    GROUP BY cod_entidad
    Edited by: 862673 on 31/05/2011 13:41

  • Prezados senhores, queria reativar a aba Sugestões, O ícone da engrenagem não aparece mais e no lugar aparece a informação de "Arquivo não Encontrado"

    Prezados senhores, queria reativar as janelas de sugestões, para que aparecesse os sites mais visitados quando eu abrisse uma nova aba, mas isso não acontece mais, no lugar aparece uma aba com a descrição abaixo, por favor me digam como posso reativá-las novamente, já Restaurei o Firefox e também já desistalei e reinstalei, mas não adiantou nada. Obrigado pela atenção, abraços!
    ISSO É O QUE APARECE:
    Servidor não encontrado
    O Firefox não conseguiu localizar browser.newtab.url.
    Verifique se há erro de digitação no endereço. Como ww.example.com em vez de www.example.com
    Se você não consegue abrir nenhuma página, verifique a conexão de rede do seu computador.
    Se o seu computador ou rede forem protegidos por um firewall ou proxy, certifique-se de que o Firefox esteja autorizado a acessar a web.

    Consulte o artigo: [[O Firefox não funciona em algumas versões do Windows XP]]

  • Sistema SAP que envia para Sefaz por Programa Z.

    Bom dia Especialistas.
    Estou implantando a versão 3.10 em um sistema SAP de contingência ONDE SE ENVIA PARA SEFAZ VIA PROGRAMA Z (o sistema foi comprado para funcionar assim.) Gostaria de saber por favor como é preenchido o campo IND_IEDEST para envio na Sefaz pois estou tendo erro neste .
    Queria saber como é a regra para pessoa física e juridica.
    Quando é 1 ou 2 ou 9.
    Obrigado.

    Ronaldo,
    Conforme manual do contribuinte NT2013.005:
    1=Contribuinte ICMS (informar a IE do destinatário);
    2=Contribuinte isento de Inscrição no cadastro de Contribuintes do ICMS;
    9=Não Contribuinte, que pode ou não possuir Inscrição Estadual no Cadastro de Contribuintes do ICMS;
    Nota 1: No caso de NFC-e informar indIEDest=9 e não informar a tag IE do destinatário;
    Nota 2: No caso de operação com o Exterior informar indIEDest=9 e não informar a tag IE do destinatário;
    Nota 3: No caso de Contribuinte Isento de Inscrição (indIEDest=2), não informar a tag IE do destinatário.

  • 105 lote esta processando - Erro 40 de sistema de PI - Batch Status Query

    Prezados,
    Nós temos um lote em GRC com os detalhes seguintes código de estado - 105 lote esta processando.
    Nós temos um lote em GRC com os detalhes seguintes:
    - Código de estado: 105 "lote esta processando"
    - Estado de lote: 04 "pedido enviou"
    - Estado de Error: 40 questão de estado de lote: Erro de sistema de PI"
    Reiniciando o lote por monitor de GRC resulta em um erro "Erro processo inicial Envie Lote (lote ID 000000000013825)"
    Algumas ideas ou sugestoes para proceder?
    Obrigado
    Marc de Ruijter
    Key words for thread search:
    - Error status 40 Batch status query: PI system error
    - Batch status 04 request sent
    - Status code 105 batch being processed

    Creio que estou com o mesmo problema,
    Estou com um lote com erro no status 5 mensagem "Consulta de status de lote: erro de sistema PI" e ao reiniciar o lote encontro a mensagem a abaixo:
    "Erro ao inicializar o processo Enviar lote (nº de lote 000000000000XXX)".
    Na sxi_monitor do PI não apresenta erro nenhum!! eu conferi a tabela citada na thread  e tinham vários registros e um deles referente ao meu lote. Apaguei apenas o referente ao meu lote porem ainda não reinicia.

  • Campos de entrada não obrigatório no Crystal Reports- Chamada por Procedure

    Olá a todos.
    Estou desenvolvendo relatórios em crystal para o B1 8.8.  os retornos de dados são realizados através de procedures desenvolvidas no sql.
    O problema é que não sei como posso estar fazendo para que determinados campos de minha tela de chamada do relatorio no B1 (Variaveis de entrada), não sejam obrigatórios.
    Por exemplo: Um relatório de clientes por estado onde os parametros de entrada são Grupo de clientes e Estado.  Caso o usuário não deseja preencher o campo grupo de cliente ele deixaria em branco e o campo estado preencheria ou até mesmos os dois campos deixaria em branco e executava direto para retornar todos os clientes.
    No Crystal dentro das opções do parametro tem la uma propriedade de não ser obrigatório o campo mas quando faço chamada por procedure esta opção fica desabilitada.
    Obrigado pela Ajuda.

    Bom dia,
    como vc esta usando procedure, deverá fazer da seguinte forma.
    se vc tiver o parametro @UF por exemplo .
    no filtro do crystal vc pode passar o valor 'T' para trazer todos.
    e na procedure usar uma variavel @Query para armazenar o select da consulta .
    antes de executar a @Query vc faz o filtro :
    if @UF (diferente) 'T' -- retirando os espacos entre < e >
    begin
        Set @Query = @Query + ' And UF = ''' + @UF + ''' '
    end
    Fazendo desta forma , o select irá filtrar a UF somente se o valor passado for diferente de T.
    Espero ter ajudado.
    Att. Leandro Khalil
    Edited by: leandro.khalil84 on Jul 12, 2010 3:44 PM
    Edited by: leandro.khalil84 on Jul 12, 2010 3:45 PM

  • Count on a header table including the line data also in the query

    Hi,
    I have a requirement to develop a report which shows the metrics on supplier. I need to find the total PO's for this supplier that are matched to invoice
    report has to have toatl#ofpo's, #invoice, total_inv_amt and total_po_amt, total_tax_amt with item numbers also with in a time period. So my question is how can we achieve this I have this below query whih gives all the data but not sure how to get the counts with this. Any ideas
    SELECT hou.name,
    pov.vendor_name,
    api.invoice_num,
    api.invoice_id,
    invoice_date,
    gl_date,
    api.invoice_currency_code,
    apid.line_type_lookup_code inv_line_type,
    apid.description inv_description,
    apid.amount,
    apid.unit_price inv_price,
    amount_paid,
    apt.name payment_terms,
    payment_status_flag,
    apc.check_number,
    apc.check_date,
    poh.segment1 po_num,
    poh.creation_date po_creation_date,
    por.creation_date po_rel_creation_date,
    por.release_num,
    pol.line_num,
    mc.segment1 category_name,
    (select msi.segment1 item_num
    from inv.mtl_system_items_b msi
    where msi.inventory_item_id = pol.item_id
    and msi.organization_id = 1) item_num,
    pol.item_description po_item_description,
    poll.need_by_date,
    pol.unit_price po_price,
    poll.quantity,
    poll.quantity_cancelled,
    poll.quantity_received,
    poll.quantity_billed
    FROM ap.ap_invoices_all api,
    hr_operating_units hou,
    ap_terms_tl apt,
    ap.ap_invoice_distributions_all apid,
    po.po_distributions_all pod,
    po.po_vendors pov,
    po.po_headers_all poh,
    po.po_lines_all pol,
    po.po_line_locations_all poll,
    po.po_releases_all por,
    ap.ap_checks_all apc,
    ap.ap_invoice_payments_all apip,
    -- inv.mtl_system_items_b msi,
    apps.mtl_categories_b mc
    WHERE apt.term_id = api.terms_id
    AND hou.organization_id = api.org_id
    AND TRUNC (poh.creation_date) BETWEEN :p_start_date AND :p_end_date
    AND api.invoice_id = apid.invoice_id
    AND apid.po_distribution_id = pod.po_distribution_id(+)
    AND pov.vendor_id = api.vendor_id
    AND poh.po_header_id(+) = pod.po_header_id
    AND poll.line_location_id (+) = pod.line_location_id
    AND pol.po_line_id (+) = pod.po_line_id
    AND apip.check_id = apc.check_id(+)
    AND apip.invoice_id(+) = api.invoice_id
    AND mc.category_id(+) = pol.category_id
    AND por.po_release_id (+) = pod.po_release_id
    AND pov.vendor_id = 1

    Hi,
    The sounds like a job for the COUNT function. That's all I can say with any confidence based on the information you gave.
    If you want to see, on each row of output, how many of the rows with the same value of api.invoice_num have a value for poh.po_header_id, the you can use
    COUNT (poh.po_header_id) OVER (PARTITION BY api.invoice_num)   AS po_cntI could give much better directions if you could post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data. I realize that's hard with so many tables. Even seeing some of your current output, and the desired output, might help.

  • Query vs Sales Analysis Report

    I wrote a query that does virtually the same thing as a sales analysis report -- add up all invoice totals and calculate a gross sales number.
    In the sales analysis report ItemXXX has a total sales of $1456.94
    My query ItemXXX has a total sales of $1457.73
    A $.79 discrepancy which I assumed was a result of the fact that my query doesn't include A/R Credit Memos. Only some items have this discrepancy.
    The problem is that if I do an inventory posting list on the item there are no A/R Credit Memos listed. Only A/R Invoices, A/P Invoices, and A/P Goods Receipts.
    What other documents could be affecting this number? Any other things that could be causing this?
    Thanks,
    -Steve

    Hi Nagarajan,
    Im user of Sap Business One, i need the completly query for obtain the Sales Analysis Report
    i have this but in some items dont match
    SELECT  ItemCode,   
            Sum(TotFac) - SUM(TotNC) as  'FacturadoNeto',   
            Sum(GBrutaFac)-SUM(GbrutaNC) as  'GBruta',   
            Round((Sum(GBrutaFac)-SUM(GbrutaNC))/case when  (Sum(TotFac) - SUM(TotNC))= 0 then 1 else (Sum(TotFac) - SUM(TotNC)) end  *100,2) as '% Margen'   
    FROM (   
    SELECT    
    ItemCode = T1.ItemCode, 
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = Sum(T1.Linetotal),    
    GBrutaFac = SUM(T1.GrssProfit),   
    TotNc= 0,   
    GbrutaNC = 0   
    FROM OINV T0 (NOLOCK) INNER JOIN INV1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231') 
      and T0.DocType  = 'I' -- solo facturas por articulos   
    Group by  T1.ItemCode  
    Union   
    SELECT    
    ItemCode = T1.ItemCode,   
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = 0,   
    GBrutaFac = 0,   
    TotNc= Sum(T1.LineTotal),    
    GbrutaNC = SUM(T1.GrssProfit)   
    FROM ORIN T0 (NOLOCK) INNER JOIN RIN1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231')
      and T0.DocType  = 'I' -- solo NC por articulos   
    Group by T1.ItemCode 
    Union
    SELECT    
    ItemCode = T1.ItemCode,   
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = 0,   
    GBrutaFac = 0,   
    TotNc= Sum(T1.LineTotal),    
    GbrutaNC = SUM(T1.GrssProfit)   
    FROM ODPI T0 (NOLOCK) INNER JOIN DPI1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231')     
      and T0.DocType  = 'I' -- solo Fact Anticipos por articulos   
    Group by T1.ItemCode
    ) T   
    Group by  ItemCode, Marca

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

Maybe you are looking for