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.

Similar Messages

  • Batch status at recurring insp lot creation

    We have setu recurring insp 09 for few materials. We use "insp stock at creation" option. So system work as expected and create lot and put stock in QI, but still batch status remain "unrestricted". Our req is at the time of lot creation it self system should set batch status as "restricted". How to setup it?
    When system setup "restricted" status for recurring batch? Help appreciated.

    check option
    Recurring Inspection: Block Batch at Lot Creation
    Specifies, that a batch is blocked, when the inspection lot is created, if the inspection date lies within the opening period.
    Use
    If you choose this option, batches are blocked, if their next inspection date lies within the opening period:
    If the batch status management is active in the corresponding plant, the batch status is changed to "restricted".
    If the batch status management is not active in the corresponding plant, the batch stocks are transferred to the blocked stock.
    If the batch status has changed or a transfer posting takes place, a new inspection lot is created for each storage location.
    If a relevant inspection lot already exists and the next inspection date has already been reached, the change of the batch status or the transfer posting also takes place

  • Consulta de status de lote: erro de sistema PI

    Pessoal, bom dia.
    Em alguns casos ocorre erro de comunicação na consulta do status do lote. Após o GRC enviar o lote pra SEFAZ, ele fica consultando o status do lote até n vezes (conforme atualizado nas configurações do lote no monitor do GRC), certo?.
    Quando ocorre esse erro de comunicação (Consulta de status de lote: erro de sistema PI), o GRC para de ficar consultando o status.
    Existe alguma forma de parametrizar/automatizar o GRC para que quando ocorrer esse erro, ele fique solicitando a consulta de status até as n vezes em vez de para a solicitação da consulta?
    Ou criar um Z que busque os lotes que estajam com este status e coloca-los em processamento?

    Bom dia Fábio,
    Não, a configuração de tentativas serve apenas para quando a Sefaz responde de forma clara com um 105 - Em processamento.
    Quanto acontece erros, o processo fica parado mesmo e a forma de restart é manual ou através de Z (Cristiane deu uma colaboração colocando o código para referência, veja: Sample code for automatic resend of batches with communication errors não consegui achar a thread que discutimos isso).
    Observação: É muito importante garantir que os problemas que estão fazendo seus lotes pararem são realmente externos e solucionáveis pelo job, do contrário você pode gerar sim problema interno no GRC para todas os processos/Sefazes ao insistir num reprocessamento automático.
    Sugestão:
    - certifique-se que o motivo para o restart é externo
    - faça log de todos os restarts em tabela
    - determine um número máximo de restarts automáticos
    - analise continuamente do que foi restartado sem sucesso para tentar obter regras que impeçam o restart sem sucesso
    Atenciosamente, Fernando Da Rós
    Edited by: Fernando Ros on Jul 21, 2010 5:41 PM

  • Status de erro 36 - Lote: erro de sistema PI

    Prezados, bom dia.
    Durante as chuvas de ontem em São Paulo caiu a conexão de internet da empresa e ficamos com alguns lotes de notas com status de processo incorreto.
    Status de lote 02 - Enviado ao PI
    Status de erro 36 - Lote: erro de sistema PI
    Já tentei reinicializar a atualizar os lotes no GRC porém nenhum resultado.
    Alguem pode ajudar ?
    R3 6.0 e ainda NÃO estamos na NFe 2.0
    Tks,
    Rodrigo Vieira

    Olá Rodrigo,
    no monitor de lotes, aba "erro de envio", os lotes aparecem disponíveis para reenvio?
    Selecione-os e clique em reenviar (ou restart, ou whatever).
    Abs,
    Henrique.

  • Status de erro: 50 - Cancelamento/inutilização: erro de sistema PI

    Boa noite, srs!
    Estamos com um problema na inutilização e cancelamento de NFe junto ao SEFAZ.
    Foi executado o report J_1BNFECHECKNUMBERRANGES para inutilização de numeração de NFe. A tabela J_1BNFENUMGAP foi preenchida com a numeração, porém a mesma não consta na consulta do site da Fazenda.
    Consultando o Monitor GRC com os IDs indicados na tabela, aparece o seguinte erro:
    Status de erro: 50 - Cancelamento/inutilização: erro de sistema PI
    De fato o processo aparece com erro no monitor do PI. Não consegui diagnosticar o erro na msg xml de retorno. A unica descrição disponível é:
    <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 415 Unsupported Media Type</SAP:AdditionalText>
    Reparei que o mesmo erro ocorre para estorno de NFes que já foram aprovadas no SEFAZ.
    Verifiquei os canais de comunicação para inutilização e cancelamento de notas e os endereços estão apontando corretamente para os WS da Fazenda. O serviço (Minas Gerais) também aparece como disponível/ativo na SEFAZ.
    Estou meio sem norte aqui para identificar o erro.
    Alguém já enfrentou este caso ou algo similar?
    Obrigado desde já!
    Carlos Penteado.

    Bom dia, caros!
    Obrigado pelas respostas!
    Metade dos meus problemas foi solucionado! =|
    Henrique e Bernardo, vocês tinham razão, era erro da própria SEFAZ. Tentei o re-envio do estorno da NFe pelo GRC e ela retornou com sucesso!
    No entanto, tive que alterar o status da nota no J_1BNFE_ACTIVE para que a nota completasse o estorno na J_1BNFE.
    Porém o erro da inutilização da numeração de NFe continua acontecendo. O funcional abriu um chamado na SAP, assim que tiver alguma resposta, replico aqui!
    Fernando, verifiquei o canal de comunicação de inutilização (SKIP) e as configurações parecem ok, estão assim como os canais que funcionam.
    Nunca utilizei o Visual Administrator. Vou verificar com o Basis a possibilidade...
    Obrigado pela ajuda! Atualizarei assim que encontrar mais alguma novidade!
    Abs,
    Carlos.

  • Cancelamento/inutilização: erro de sistema PI

    Pessoal, bom dia!
    Por favor, estamos testando o cenário de Cancelamento de NF e as notas estão ficando com os seguintes status:
    Stat. Processo: 06 - Enviado ao Processamento da Nota Fiscal Eletrônica
    Status de erro: 50 - Cancelamento/inutilização: erro de sistema PI
    Analisando o erro no Monitor do PI, peguei o XML enviado ao Sefaz e testei no endereço http://www.sefaz.rs.gov.br/NFE/NFE-VAL.aspx e os dados estão corretos.
    O Erro detalhado no Monitor do PI é (Error in response):
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Unexpected Error java.lang.NoSuchMethodError: javax.xml.soap.SOAPFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/SOAPFactory; at br.inf.portalfiscal.soapclient.ClientSoap.(TransitoCancelamentoClient.java:56) at br.inf.portalfiscal.nfe.controller.ValidaDadosCanc.verificarRegistroCirculacao(ValidaDadosCanc.java:248) at br.inf.portalfiscal.nfe.controller.ValidaDadosCanc.validaDadosCanc(ValidaDadosCanc.java:214) at br.inf.portalfiscal.nfe.controller.ValidacaoXMLHelper.validaCancelamento(ValidacaoXMLHelper.java:307) at br.inf.portalfiscal.nfe.controller.UtilSession.processarCancelamento(UtilSession.java:509) at sun.reflect.GeneratedMethodAccessor292.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.invocation.Invocation.performCall(Invocation.java:359) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169) at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168) at org.jboss.ejb.plugins.LogInterceptor.inv
    Obrigado,
    Danilo

    De fato, esse trace é do web service da propria SEFAZ.
    Esses objetos referenciados (e.g. ValidaDadosCanc.java) não fazem parte do pacote do SAP NFE.
    O status no GRC está como comunicacao de PI (vermelho)?
    Se sim, depois de a SEFAZ corrigir o problema, vc consegue restartar o processo pela aba de Erro de Cancelamento/Inutilizacao no Monitor de NFes.
    Abs,
    Henrique.

  • Erro "B2B: erro de sistema PI"

    Olá a todos. Aplicamos a versão 2.0 do GRC, Support Package 15 e após isso, quando uma Nota Fiscal é cancelada, o cliente não recebe o XML desse cancelamento, apresentando um erro no GRC como: B2B: erro de sistema PI. Nessa nova versão esse envio é obrigatório. Alguém já passou por esse erro? Tem alguma idéia do que pode ser?
    Obrigado a todos que puderem ajudar
    Marcos Cristiano Ickert
    Basis

    Marcos,
    Alem de configurar o Cenário para o novo namespace 006, no Design para o Produto/SWCV usado o B2B você precisa alterar o Interface Mapping(7.0)/Operation Mapping(7.1) de Envio(NTB2B_procNFe_TO_procNFe)/Cancelamento(CTB2B_procCancNFe_TO_procCancNFe) para o namespace 006, assim como já deve estar para a versão 005a.
    (isso apenas para os objetos do seu produto/swcv)
    OBS.: caso vocês utilizem a solução igual ou parecida com o que Henrique postou no forum.
    E caso você precise reiniciar esse erro de B2B no GRC, como você está SPK 15 será necessário aplicar a nota 1512936 para tirar o dump que gera.
    Espero que ajude.
    Abraço,
    Bruno Lima

  • Cancelamento/inutilização: erro de sistema PI - SEFAZ MG -  Erro: 50

    Bom dia,
    Estamos com problemas para relizar o cancelamento de notas junto ao SEFAZ de MG.
    Todos os cancelamentos retornam da seguinte forma:
    Status de Processo: 06 - Enviado ao Processamento da Nota Fiscal Eletrônica
    Status de Erro: Cancelamento/inutilização: erro de sistema PI
    Fizemos várias tentativas de reenvio, mas todas retornaram com o mesmo erro.
    Também alteramos o status de erro, através da tabela de histório de status, mas também continua retornando o mesmo erro.
    Aparentemente isso está acontecendo desde segunda-feira (03/10).
    Verificamos na sxi_monitor e não há registro de erro (sem bolinha vermelha), os precessos ficam "bandeirados", mas com o erro NEGATIVE_ACKNOWLEDGEMENT.
    Ao que tudo indica é algum problema no SEFAZ de MG, mas como podemos verificar isso?
    Alguém está tendo o mesmo problema?
    Desde já obrigada!
    Gilmara Silva

    Boa tarde.
    Estamos tendo o mesmo problema.
    Na verdade o problema começou na SEFAZ MG dia 30.09.2011. Algumas (muito poucas) empresas estão conseguindo cancelar. Acredito que depende de qual servidor da SEFAZ o pedido é processado.
    Depois de diversos contatos com SEFAZ via chamados, telefonemas, etc....recebemos o seguinte retorno:
    "Este é um problema intermitente e pela análise da STI deve estar ocorrendo apenas em uma das máquinas utilizadas no processamento. Alguns contribuintes estão conseguindo a autorização quando do reenvio da solicitação de cancelamento.
    Ainda não podemos precisar a disponibilidade da solução."
    SEF/MG - SAIF/DINF/DED
    Ou seja, sem previsão.
    At.,
    Bernardo Braga

  • NF-e 3.10 - Erro 204 - Duplicidade - Botão consulta status

    Boa tarde a todos.
    Estamos em fase de testes do projeto de implementação do XML 3.10.
    Eu tive algumas notas no meu ambiente de teste integrado com rejeição 204 (duplicidade de nota).
    Eu preciso realizar a consulta de status para essas notas, porém no botão Outras Funções, não aparece a opção Verificar Status (conhecido como Consulta de Status no monitor 2.00).
    Eu encontrei o seguinte post relacionado ao meu problema:
    NFe V3.10 Erro 204 - Duplicidade - Botão Consulta Status sumiu
    Porém, o procedimento de "Continuar Processo" descrito no post acima não resolveu meu problema (quando dou um Continuar Processo, o GRC tenta enviar novamente a nota para aprovação).
    Alguém sabe como faço para o botão de consulta de status aparecer? Seria algo de perfil?
    Att,
    Matheus Goulart

    Então Ricardo, na verdade não tem botão de consulta de status no detalhe.
    Acebei de descobrir que o Continuar Processo funcionou, o problema é que a consulta de status foi rejeitada pela SEFAZ (sefaz MG).
    E o motivo que no monitor não atualizou os status das notas, é porque deu um erro no proxy inbound.
    Mensagem da SPROXY:
    Falta elem.'{http://www.portalfiscal.inf.br/nfe}dhRecbto'
    XML (retorno):
    <?xml version="1.0" encoding="utf-8" ?>
    - <nfeConsultaNFResponse xmlns="http://sap.com/xi/NFE/008"> 
    - <nfeConsultaNF2Result> 
    - <retConsSitNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="3.10"> 
    <tpAmb>2</tpAmb>  
    <verAplic>13_2_28</verAplic>  
    <cStat>217</cStat>  
    <xMotivo>Rejeicao: NF-e nao consta na base de dados da SEFAZ</xMotivo>  
    <cUF>31</cUF>  
    <chNFe>31140940432544011262550160000014241463324953</chNFe>  
    </retConsSitNFe>
    </nfeConsultaNF2Result>
    <n0:mode xmlns:n0="http://sap.com/xi/NFE/008">O1</n0:mode>  
    </nfeConsultaNFResponse>

  • ERRO NO SISTEMA , NÃO CARREGA

    O Sistema Não Carrega, e quando consegue desconecta-se Sozinho, as pessoas não conseguem conectarse ao formulário,fica carregando o tempo todo ?? O que eu faço ??? estou o dia todo com este problema.

    Olá,
    Nós ter corrigido o problema. Por favor, tente novamente. Pedimos desculpas por quaisquer incoveniences que isso pode ter causado.
    Lucia

  • Lots of network devices in SCOM are showing grey status

    I have added an additional MS to the resource pool, but the network devices still show a grey status.
    Z

    Hi,
    Discovery troubleshooting :
    http://www.code4ward.net/main/Blog/tabid/70/EntryId/105/Troubleshooting-Network-Discovery-in-SCOM-2012.aspx
    Reference:
    Network Monitoring using System Center Operations Manager 2012
    http://blogs.technet.com/b/rohitkochher/archive/2011/11/26/network-monitoring-using-system-center-operations-manager-2012.aspx
    SCOM 2012 Network Monitoring - Dude, Where's My Network Device Components?
    http://kevingreeneitblog.blogspot.com/2012/07/scom-2012-network-monitoring-dude.html
    Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • NFE Produção - Código Status 204 Rejeição

    Olá, Boa tarde!
    Estamos com uma NFE da Produção parada, pois não estamos conseguindo atualizar o status dela.
    No monitor de GRC a NFE aparece da seguinte forma:
    Status NFE (bolinha vermelha): 05 resultado recebido
    Status de Erro: 90 erro de sistema PI
    Código Status: 204 Rejeição: Duplicidade NFE
    A opção "Consulta do Status" está disponível, porém já tentamos várias vezes, aparece a mensagem: O processo de consulta status NFE foi inicializado. Atualizar a exibição NFE.
    Atualizamos a página, porém não muda nenhum status.
    No monitor J1BNFE a NFE está aguardando o retorno do GRC.
    Não sei se tem algo a ver, mas recentemente fizemos a atualização da Versão para 2.0.
    Antes o procedimento funcionava normal... agora as NFES estão paradas...
    Aguardo comentários.
    Obrigada.
    Adriana

    Bom dia,
    Estou com esse mesmo erro, e não sei como resolver...
    Ao clicar em consultar status(Monitor GRC) da NFE em questão, o status não é atualizado(consultamos no SEFAZ e a NFe Está aprovada)..
    Verifiquei as msg na MONI e temos uma com o ACK NEG, porém desconheço o erro...segue os xml que consegui verificar na mensagem:
    XML INBOUND:
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:nfeConsultaNF2 xmlns:n0="http://sap.com/xi/NFE/006" xmlns:prx="urn:sap.com:proxy:PIP:/1SAI/TASB4840BC26BF382F75BE8:700:2009/02/10" xmlns:n1="http://www.portalfiscal.inf.br/nfe">
      <n0:cUF>41</n0:cUF>
      <n0:tpEmis>1</n0:tpEmis>
      <n0:tpAmb>1</n0:tpAmb>
      <n0:type>1</n0:type>
      <n0:versNum>001</n0:versNum>
      <n0:mode>I</n0:mode>
    - <n0:nfeDadosMsg>
    - <n1:consSitNFe versao="2.00">
      <n1:tpAmb>1</n1:tpAmb>
      <n1:xServ>CONSULTAR</n1:xServ>
      <n1:chNFe>41110300606549000124550000000231711903353574</n1:chNFe>
      </n1:consSitNFe>
      </n0:nfeDadosMsg>
      </n0:nfeConsultaNF2>
    XML RESPONSE:
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:nfeConsultaNF2 xmlns:n0="http://sap.com/xi/NFE/006" xmlns:prx="urn:sap.com:proxy:PIP:/1SAI/TASB4840BC26BF382F75BE8:700:2009/02/10" xmlns:n1="http://www.portalfiscal.inf.br/nfe">
      <n0:cUF>41</n0:cUF>
      <n0:tpEmis>1</n0:tpEmis>
      <n0:tpAmb>1</n0:tpAmb>
      <n0:type>1</n0:type>
      <n0:versNum>001</n0:versNum>
      <n0:mode>I</n0:mode>
    - <n0:nfeDadosMsg>
    - <n1:consSitNFe versao="2.00">
      <n1:tpAmb>1</n1:tpAmb>
      <n1:xServ>CONSULTAR</n1:xServ>
      <n1:chNFe>41110300606549000124550000000231711903353574</n1:chNFe>
      </n1:consSitNFe>
      </n0:nfeDadosMsg>
      </n0:nfeConsultaNF2>
    XML ACK ERROR:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Response
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">NEGATIVE_ACKNOWLEDGEMENT</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Negative acknowledgment triggered by a process</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    Alguém teria alguma dica?
    Edited by: João Luis da Silva Dovigo on Mar 16, 2011 6:20 PM

  • PP - QM: Reversal of the usage decision

    Hi Gurus,
    We have completed Result Recording using QE51N transaction and Usage decision using QA11. It has posted a stock from QI to Unrestricted use. Now I want to take it back from Unrestricted use to QI. This needs reversal of usage decision (What I think).
    Can you suggest me the proper way of performing the said transaction?
    I will really appreciate your concern.
    Thanks
    Shiv

    R/3 note no.   175842                        14.12.2001           Page 1
         Number              0175842
         Version             0021 from 29.11.2001
         Status              Released for customer
         Set by              SAP AG on 03.12.2001
         Language            EN
         Short text          Inspection lot: Reversal of goods movements from UD
         Administrator       SAP AG
         Component           QM-IM-UD Inspection Lot Completion
         Long text
         Symptom
         Goods movements, which were created from the transactions of the usage
         decision, can no longer be reversed.
         Additional key words
         QA11, QA12, QA14, MBST, MF41
         Inspection lot, usage decision, goods movements, reversal, material
         document
         Cause and preconditions
         Presently, the function is not provided in the standard system.
         Solution
         The function is not provided in the standard system up to and including
         Release 4.6C.
         When you do this bear the following in mind:
         1. Using the attached program corrections, stock transfer postings can
            be reset for the usage decision.If it is possible to post this
            document in the stock management, the inspection lot is also
            corrected and the Quality Management Information System is if
            necessary updated.After the reset has been successfully carried out,
            the inspection lot, related to the stocks, has the status before the
            first stock credit entry.The usage decision is not reset.If, after
            the usage decision, further transfer postings are carried out in the
            stock management which lead to the usage decision transfer postings
            not being able to be reset due to missing availability, these
            postings must be reversed first.
         2. The goods movement is carried out in each case with the reversal
            movement type (document neutral reversal).The original documents are
            not reversed related to the document.This may lead to deviations in
            the accounting caused by valuation.
         3. Resetting postings for materials requiring serial numbers is not
            supported.
         4. With this correction program, you cannot reverse goods movements for
            inpection lots for handling units (HU).
         5. Batch status changes which have possibly been carried out are not
            cancelled.
         6. Batches which have been created in the usage decision during a
            transfer posting are not deleted.The classification of these batches
            is not changed either.
                                                                           Page 2
         7. Within the adjustment posting, in Release 4.x, the reference records
            are also adjusted between the material document and inspection
            lot.This can possibly lead to an incorrect description of the
            reference type when displaying material documents for the inspection
            lot.In Release 3.x, the reference records are deleted in order to
            make sure that individual documents cannot be cancelled several
            times.
         8. The program does not contain any own authorization checks and should
            be used with utmost care and ONLY after a successful test. The
            program should ONLY be applied in exceptions and should not be part
            of the standard procedure.
         9. The logic implemented in the program for the generation of material
            documents or for the update of inspection lot quantities and
            inspection lot status should under no circumstances be be changed as
            this might lead to inconsistent data. Since this is a program that is
            not contained in the standard system, problems that are created as a
            result of the program application can be dealt with as problems that
            have arisen as a result of a customer modification.
         To implement the program, proceed as follows:
         1. Create an executable program and copy the attached source code.Then
            maintain the text for selection parameter PRUEFLOS by transferring
            the Dictionary text.
         2. If you a use a Release < 4.6, you must create the function group
            ZQMB. In this function group, you must create function module
            'ZQMB_QAMB_CANCEL'. Flag the function module as an update function
            module (Start immediately) and include table interface parameter
            'I_QAMB_TAB' (type specification LIKE, reference structure QAMB).
            Afterwards you must include exception 'ERROR_DURING_UPDATE' and
            implement the attached source code.
         3. Use Transaction OMJJ to enter further entries in level 'Allowed
            transactions' (table T158B) for transaction code 'QA11' (Record Usage
            Decision).The movement types for which these entries must be created
            are derived from the system settings for the goods movements for the
            usage decision (table TQ07M):The reversal movement type must be
            determined for every movement type that is entered in table TQ07M
            with the key VMENGE01 - VMENGE09 and the corresponding entry must be
            included in the above-mentioned table.You can use table T156N for
            determining the reversal movement type:You can determine the reversal
            movement type by entering the movement type (BWART) and function code
            (FCODE) ST (BWART_NEXT).For missing entries, the system generates
            error M7096 'Goods movement not possible with mvmt type &'.
         Source code corrections
                                                                           Page 3
         Valid releases
         R/3 Standard        46C - 46D
                             46A - 46B
                             45A - 45B
                             40A - 40B
                             30F - 31I
         Other components
         QM-IM               Quality Inspection
         Reference to related notes
         Number    Short text
         0033924   Cancelling usage decisions
         0048815   Checking possible inconsistencies between MM and QM
                                                                           Page 4
         Assigned correction instructions
    $$----
    $$
    $ Correction Instr.        : 0120024545 0000111772                   $
    $ Software Component       : SAP_APPL   SAP Application              $
    *$----
    $*
    $ Validity    : 40A          SAPKH40A01 - SAPKH40A25                 $
    $             : 40B          All Patches                             $
    $             : 45A          All Patches                             $
    $             : 45B          All Patches                             $
    *$----
    $*
    $ Changes/Objects Not Contained in Standard SAP System               $
    $$----
    $$
         *& Object          FUNC ZQMB_QAMB_CANCEL
         *& Object Header   FUGR ZQMB
         *& FUNCTION ZQMB_QAMB_CANCEL
         *>>>> START OF INSERTION <<<<
           UPDATE QAMB FROM TABLE I_QAMB_TAB.
           IF NOT SY-SUBRC IS INITIAL.
             RAISE ERROR_DURING_UPDATE.
           ENDIF.
         *>>>> END OF INSERTION <<<<<<
         *& Object          REPS RQEVAC50
         *& Object Header   PROG RQEVAC50
         *& REPORT RQEVAC50
         *>>>> START OF INSERTION <<<<
         REPORT RQEVAC50 MESSAGE-ID QA.
         TYPES:
           T_QAMB_TAB  LIKE QAMB  OCCURS 0,
           T_MKPF_TAB  LIKE MKPF  OCCURS 0,
           T_MSEG_TAB  LIKE MSEG  OCCURS 0.
         PARAMETERS:
           PRUEFLOS LIKE QALS-PRUEFLOS OBLIGATORY MEMORY ID QLS.
         DATA:
           G_MSGV1       LIKE SY-MSGV1,
           G_QALS        LIKE QALS,
           G_QALS_LEISTE LIKE QALS,
           G_QAMB_TAB    TYPE T_QAMB_TAB,
           G_QAMB_VB_TAB TYPE T_QAMB_TAB,
           G_MKPF_TAB    TYPE T_MKPF_TAB,
           G_MSEG_TAB    TYPE T_MSEG_TAB,
           G_SUBRC       LIKE SY-SUBRC.
         START-OF-SELECTION.
                                                                           Page 5
           PERFORM ENQUEUE_QALS USING PRUEFLOS
                                      G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_QALS USING PRUEFLOS
                                   G_QALS
                                   G_QALS_LEISTE
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '102'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_LOT USING G_QALS
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             CASE G_SUBRC.
               WHEN 128.
                 G_MSGV1 = 'Material & is serialized'.
                 REPLACE '&' WITH G_QALS-MATNR INTO G_MSGV1.
               WHEN  64.
                 G_MSGV1 = 'Lot & is not stock relevant'.
               WHEN  32.
                 G_MSGV1 = 'Lot &: No stock transferred'.
               WHEN  16.
                 G_MSGV1 = 'Lot & is cancelled'.
               WHEN   8.
                 G_MSGV1 = 'Lot & is archived'.
               WHEN   4.
                 G_MSGV1 = 'Lot & is blocked'.
               WHEN   2.
                 G_MSGV1 = 'Lot & is HU managed'.
             ENDCASE.
             REPLACE '&' WITH PRUEFLOS INTO G_MSGV1.
             MESSAGE ID '00' TYPE 'S' NUMBER '208'
                     WITH G_MSGV1.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_QAMB USING G_QALS
                                   G_QAMB_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_MKPF USING G_QAMB_TAB
                                   G_MKPF_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
                                                                           Page 6
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_MKPF USING G_MKPF_TAB
                                    G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_MSEG USING G_MKPF_TAB
                                   G_MSEG_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_MSEG USING G_MSEG_TAB
                                    G_QAMB_TAB
                                    G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CREATE_GOODS_MOVEMENT USING G_QALS
                                               G_MSEG_TAB
                                               G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM POST_GOODS_MOVEMENT.
           PERFORM POST_DATA USING G_QALS
                                   G_QALS_LEISTE
                                   G_QAMB_TAB
                                   G_QAMB_VB_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ELSE.
             COMMIT WORK AND WAIT.
             G_MSGV1 = 'inspection lot &'.
             REPLACE '&' WITH PRUEFLOS INTO G_MSGV1.
             MESSAGE ID '00' TYPE 'S' NUMBER '368'
                                                                           Page 7
                     WITH 'Stock posting reversed for ' G_MSGV1.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
          Form  ENQUEUE_QALS                                             *
          Los sperren                                                    *
         FORM ENQUEUE_QALS USING P_PRUEFLOS LIKE QALS-PRUEFLOS
                                 P_SUBRC    LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           CALL FUNCTION 'ENQUEUE_EQQALS1'
                EXPORTING
                     PRUEFLOS       = P_PRUEFLOS
                EXCEPTIONS
                     FOREIGN_LOCK   = 1
                     SYSTEM_FAILURE = 2
                     OTHERS         = 3.
           P_SUBRC = SY-SUBRC.
         ENDFORM.                               " ENQUEUE_QALS
          Form  READ_QALS                                                *
          Prüflos lesen                                                  *
         FORM READ_QALS USING P_PRUEFLOS    LIKE QALS-PRUEFLOS
                              P_QALS        LIKE QALS
                              P_QALS_LEISTE LIKE QALS
                              P_SUBRC       LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           CALL FUNCTION 'QPSE_LOT_READ'
                EXPORTING
                     I_PRUEFLOS  = P_PRUEFLOS
                     I_RESET_LOT = 'X'
                IMPORTING
                     E_QALS      = P_QALS
                EXCEPTIONS
                     NO_LOT      = 1.
           P_SUBRC = SY-SUBRC.
           IF P_SUBRC IS INITIAL.
             P_QALS_LEISTE = P_QALS.
           ELSE.
             CLEAR: P_QALS,
                    P_QALS_LEISTE.
           ENDIF.
         ENDFORM.                               " READ_QALS
          Form  CHECK_LOT                                                *
                                                                           Page 8
          Prüflos prüfen                                                 *
         FORM CHECK_LOT USING P_QALS  LIKE QALS
                              P_SUBRC LIKE SY-SUBRC.
           DATA:
             L_STAT      LIKE JSTAT,
             L_STAT_TAB  LIKE JSTAT OCCURS 0 WITH HEADER LINE.
           P_SUBRC = 128.
         */Serialized Material
           IF NOT P_QALS-SERNP IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 64.
           ENDIF.
         */BERF
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0203'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF NOT SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 32.
           ENDIF.
         */BTEI & BEND
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0219'. APPEND L_STAT TO L_STAT_TAB. "BTEI
           L_STAT-STAT = 'I0220'. APPEND L_STAT TO L_STAT_TAB. "BEND
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 16.
           ENDIF.
         */LSTO & LSTV
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0224'. APPEND L_STAT TO L_STAT_TAB. "LSTO
           L_STAT-STAT = 'I0232'. APPEND L_STAT TO L_STAT_TAB. "LSTV
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                                                                           Page 9
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF NOT L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 8.
           ENDIF.
         */ARSP & ARCH & REO1 & REO2 & REO3
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0225'. APPEND L_STAT TO L_STAT_TAB. "ARSP
           L_STAT-STAT = 'I0226'. APPEND L_STAT TO L_STAT_TAB. "ARCH
           L_STAT-STAT = 'I0227'. APPEND L_STAT TO L_STAT_TAB. "REO3
           L_STAT-STAT = 'I0228'. APPEND L_STAT TO L_STAT_TAB. "REO2
           L_STAT-STAT = 'I0229'. APPEND L_STAT TO L_STAT_TAB. "REO1
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF NOT L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 4.
           ENDIF.
         */SPER
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0043'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 2.
           ENDIF.
         */HUM
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0443'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 0.
           ENDIF.
                                                                          Page 10
         ENDFORM.                               " CHECK_LOT
          Form  READ_QAMB                                                *
          QAMBs lesen                                                    *
         FORM READ_QAMB USING P_QALS     LIKE QALS
                              P_QAMB_TAB TYPE T_QAMB_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           SELECT * FROM QAMB INTO TABLE P_QAMB_TAB
             WHERE PRUEFLOS =  P_QALS-PRUEFLOS
               AND TYP   = '3'.
           P_SUBRC = SY-SUBRC.
         ENDFORM.                               " READ_QAMB
          Form  READ_MKPF                                                *
          Read material document header                                  *
         FORM READ_MKPF USING P_QAMB_TAB TYPE T_QAMB_TAB
                              P_MKPF_TAB TYPE T_MKPF_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           DATA:
             BEGIN OF L_MKPF_KEY_TAB OCCURS 0,
               MBLNR LIKE MKPF-MBLNR,
               MJAHR LIKE MKPF-MJAHR,
             END   OF L_MKPF_KEY_TAB.
           DATA:
             L_QAMB   LIKE QAMB,
             L_MKPF   LIKE MKPF,
             L_TRTYP  LIKE T158-TRTYP VALUE 'A',
             L_VGART  LIKE T158-VGART VALUE 'WQ',
             L_XEXIT  LIKE QM00-QKZ.
           P_SUBRC = 4.
           LOOP AT P_QAMB_TAB INTO L_QAMB.
             L_MKPF_KEY_TAB-MBLNR = L_QAMB-MBLNR.
             L_MKPF_KEY_TAB-MJAHR = L_QAMB-MJAHR.
             COLLECT L_MKPF_KEY_TAB.
           ENDLOOP.
           LOOP AT L_MKPF_KEY_TAB.
             CALL FUNCTION 'ENQUEUE_EMMKPF'
                  EXPORTING
                       MBLNR          = L_MKPF_KEY_TAB-MBLNR
                       MJAHR          = L_MKPF_KEY_TAB-MJAHR
                  EXCEPTIONS
                       FOREIGN_LOCK   = 1
                                                                          Page 11
                       SYSTEM_FAILURE = 2
                       OTHERS         = 3.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ENDIF.
             CLEAR: L_MKPF.
             CALL FUNCTION 'MB_READ_MATERIAL_HEADER'
                  EXPORTING
                       MBLNR         = L_MKPF_KEY_TAB-MBLNR
                       MJAHR         = L_MKPF_KEY_TAB-MJAHR
                       TRTYP         = L_TRTYP
                       VGART         = L_VGART
                  IMPORTING
                       KOPF          = L_MKPF
                  EXCEPTIONS
                       ERROR_MESSAGE = 1.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ELSE.
               APPEND L_MKPF TO P_MKPF_TAB.
             ENDIF.
           ENDLOOP.
           IF NOT L_XEXIT IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 0.
           ENDIF.
         ENDFORM.                               " READ_MKPF
          Form  READ_MSEG                                                *
          MSEGs lesen                                                    *
         FORM READ_MSEG USING P_MKPF_TAB TYPE T_MKPF_TAB
                              P_MSEG_TAB TYPE T_MSEG_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           DATA:
             L_MKPF     LIKE MKPF,
             L_MSEG_TAB LIKE MSEG OCCURS 0 WITH HEADER LINE,
             L_TRTYP    LIKE T158-TRTYP VALUE 'A',
             L_XEXIT    LIKE QM00-QKZ.
           P_SUBRC = 4.
           LOOP AT P_MKPF_TAB INTO L_MKPF.
             CLEAR: L_MSEG_TAB. REFRESH: L_MSEG_TAB.
             CALL FUNCTION 'MB_READ_MATERIAL_POSITION'
                  EXPORTING
                                                                          Page 12
                       MBLNR  = L_MKPF-MBLNR
                       MJAHR  = L_MKPF-MJAHR
                       TRTYP  = L_TRTYP
         */            ZEILB  = P_ZEILE
         */            ZEILE  = P_ZEILE
                  TABLES
                     SEQTAB = L_MSEG_TAB
                EXCEPTIONS
                     ERROR_MESSAGE = 1.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ELSE.
               APPEND LINES OF L_MSEG_TAB TO P_MSEG_TAB.
             ENDIF.
           ENDLOOP.
           IF NOT L_XEXIT IS INITIAL.
             EXIT.
           ELSE.
         */  XAuto-Zeilen und Chargenzustandsänderung werden gelöscht
             DELETE P_MSEG_TAB WHERE XAUTO NE SPACE
                                  OR BWART EQ '341'
                                  OR BWART EQ '342'.
             P_SUBRC = 0.
           ENDIF.
         ENDFORM.                               " READ_MSEG
          Form  CREATE_GOODS_MOVEMENT                                    *
          Warenbewegung anlegen                                          *
         FORM CREATE_GOODS_MOVEMENT USING P_QALS     LIKE QALS
                                          P_MSEG_TAB TYPE T_MSEG_TAB
                                          P_SUBRC    LIKE SY-SUBRC.
           DATA:
             L_LMENGEZUB LIKE QALS-LMENGEZUB,
             L_LMENGEGEB LIKE QALS-LMENGEZUB,
             L_MBQSS     LIKE MBQSS,
             L_IMKPF     LIKE IMKPF,
             L_IMSEG     LIKE IMSEG,
             L_IMSEG_TAB LIKE IMSEG OCCURS 1,
             L_EMKPF     LIKE EMKPF,
             L_EMSEG     LIKE EMSEG,
             L_EMSEG_TAB LIKE EMSEG OCCURS 1,
             L_MSEG      LIKE MSEG,
             L_MSEG_TAB  LIKE MSEG  OCCURS 1,
             L_TCODE     LIKE SY-TCODE VALUE 'QA11',
             L_TABIX     LIKE SY-TABIX VALUE 1,
             L_XSTBW     LIKE T156-XSTBW.
           CLEAR: P_SUBRC.
                                                                          Page 13
         */QAMB initialisieren
           CALL FUNCTION 'QAMB_REFRESH_DATA'.
         */Kopf füllen
           L_IMKPF-BLDAT = SY-DATLO.
           L_IMKPF-BUDAT = SY-DATLO.
           L_IMKPF-BKTXT = 'Cancellation of QM UD postings'.
         */Ursprüngliche zu buchende Menge merken + inkrementieren
           L_LMENGEZUB = P_QALS-LMENGEZUB.
           L_LMENGEGEB =   P_QALS-LMENGE01
                         + P_QALS-LMENGE02
                         + P_QALS-LMENGE03
                         + P_QALS-LMENGE04
                         + P_QALS-LMENGE05
                         + P_QALS-LMENGE06
                         + P_QALS-LMENGE07
                         + P_QALS-LMENGE08
                         + P_QALS-LMENGE09.
         */Zeilen aufbauen
           L_MSEG_TAB[] = P_MSEG_TAB[].
           LOOP AT L_MSEG_TAB INTO L_MSEG.
             MOVE-CORRESPONDING L_MSEG  TO L_MBQSS.
             MOVE-CORRESPONDING L_MBQSS TO L_IMSEG.
         */  Referenzbeleg übergeben, falls Bestellnummer gefüllt
             IF NOT L_MSEG-EBELN IS INITIAL.
               MOVE: L_MSEG-LFBNR TO L_IMSEG-LFBNR,
                     L_MSEG-LFBJA TO L_IMSEG-LFBJA,
                     L_MSEG-LFPOS TO L_IMSEG-LFPOS.
             ENDIF.
             MOVE L_MSEG-KDAUF          TO L_IMSEG-KDAUF.
             MOVE L_MSEG-KDPOS          TO L_IMSEG-KDPOS.
             MOVE L_MSEG-PS_PSP_PNR     TO L_IMSEG-PS_PSP_PNR.
         */  Umlagerungsfelder setzen
             MOVE:
                 L_MSEG-UMMAT  TO L_IMSEG-UMMAT,
                 L_MSEG-UMWRK  TO L_IMSEG-UMWRK,
                 L_MSEG-UMLGO  TO L_IMSEG-UMLGO,
                 L_MSEG-UMCHA  TO L_IMSEG-UMCHA.
         */  Storno-Beleg setzen
             MOVE: L_MSEG-MJAHR  TO L_IMSEG-SJAHR,
                   L_MSEG-MBLNR  TO L_IMSEG-SMBLN,
                   L_MSEG-ZEILE  TO L_IMSEG-SMBLP.
         */  Falsch gefüllte Felder initialisieren
             CLEAR: L_IMSEG-MBLNR,
                    L_IMSEG-MENGE,
                    L_IMSEG-MEINS.
         */  Bewegungsart lesen
             SELECT SINGLE XSTBW FROM T156 INTO L_XSTBW
               WHERE BWART = L_IMSEG-BWART.
                                                                          Page 14
             IF NOT SY-SUBRC IS INITIAL.
               P_SUBRC = 4.
               EXIT.
             ENDIF.
         */  Werk/Lagerort füllen
             IF P_QALS-STAT11 IS INITIAL.
               IF L_XSTBW IS INITIAL.
                 MOVE P_QALS-LAGORTVORG TO L_IMSEG-LGORT.
               ELSE.
                 MOVE P_QALS-LAGORTVORG TO L_IMSEG-UMLGO.
               ENDIF.
             ENDIF.
             IF L_XSTBW IS INITIAL.
               MOVE P_QALS-WERKVORG TO L_IMSEG-WERKS.
             ELSE.
               MOVE P_QALS-WERKVORG TO L_IMSEG-UMWRK.
             ENDIF.
         */  Zusätzliche Felder
             MOVE P_QALS-MENGENEINH TO L_IMSEG-ERFME.
             "MOVE P_GRUND           TO L_IMSEG-GRUND.
             "MOVE P_ELIKZ           TO L_IMSEG-ELIKZ.
         */  Kennzeichen Storno-Buchung setzen
             MOVE 'X'               TO L_IMSEG-XSTOB.
             MOVE P_QALS-PRUEFLOS   TO L_IMSEG-QPLOS.
             APPEND L_IMSEG TO L_IMSEG_TAB.
             IF P_QALS-STAT11 IS INITIAL.
               ADD      L_IMSEG-ERFMG TO   L_LMENGEZUB.
               SUBTRACT L_IMSEG-ERFMG FROM L_LMENGEGEB.
             ELSE.
               IF     L_IMSEG-KZBEW EQ SPACE
                  AND L_IMSEG-WERKS NE SPACE
                  AND L_IMSEG-LGORT NE SPACE
                  AND L_IMSEG-UMWRK NE SPACE
                  AND L_IMSEG-UMLGO NE SPACE
                  AND L_IMSEG-WERKS EQ L_IMSEG-UMWRK
                  AND L_IMSEG-UMLGO EQ L_IMSEG-UMLGO.
         */      Dummy Buchung bei WE-Sperrbestand & Stichprobe
               ELSE.
                 ADD      L_IMSEG-ERFMG TO   L_LMENGEZUB.
                 SUBTRACT L_IMSEG-ERFMG FROM L_LMENGEGEB.
               ENDIF.
             ENDIF.
           ENDLOOP.
           IF NOT P_QALS-STAT11 IS INITIAL.
         */  Bei WE-Sperrbestand und Stichprobenbuchung Zeilen tauschen
             DO.
               READ TABLE L_IMSEG_TAB INDEX SY-INDEX INTO L_IMSEG.
               IF     SY-SUBRC      IS INITIAL
                  AND L_IMSEG-KZBEW EQ SPACE
                  AND L_IMSEG-WERKS NE SPACE
                  AND L_IMSEG-LGORT NE SPACE
                  AND L_IMSEG-UMWRK NE SPACE
                  AND L_IMSEG-UMLGO NE SPACE
                                                                          Page 15
                  AND L_IMSEG-WERKS EQ L_IMSEG-UMWRK
                  AND L_IMSEG-UMLGO EQ L_IMSEG-UMLGO.
                 IF SY-TABIX NE L_TABIX.
                   DELETE L_IMSEG_TAB INDEX SY-TABIX.
                   INSERT L_IMSEG     INTO  L_IMSEG_TAB INDEX L_TABIX.
                   L_TABIX = L_TABIX + 1.
                 ELSE.
                   L_TABIX = L_TABIX + 1.
                   CONTINUE.
                 ENDIF.
               ELSEIF SY-SUBRC IS INITIAL.
                 CONTINUE.
               ELSE.
                 EXIT.                          "from do
               ENDIF.
             ENDDO.
           ENDIF.
         */QM deaktivieren
           CALL FUNCTION 'QAAT_QM_ACTIVE_INACTIVE'
                EXPORTING
                     AKTIV = SPACE.
         */Buchen
           CALL FUNCTION 'MB_CREATE_GOODS_MOVEMENT'
                EXPORTING
                     IMKPF = L_IMKPF
                     XALLP = 'X'
                     XALLR = 'X'
                     CTCOD = L_TCODE
                     XQMCL = ' '
                IMPORTING
                     EMKPF = L_EMKPF
                TABLES
                     IMSEG = L_IMSEG_TAB
                     EMSEG = L_EMSEG_TAB.
         */QM wieder aktivieren
           CALL FUNCTION 'QAAT_QM_ACTIVE_INACTIVE'
                EXPORTING
                     AKTIV = 'X'.
         */Buchung auswerten
           IF L_EMKPF-SUBRC GT 1.
             IF L_EMKPF-MSGID NE SPACE.
         */    Fehler auf Kopfebene
               MESSAGE ID L_EMKPF-MSGID TYPE 'S'
                       NUMBER L_EMKPF-MSGNO
                       WITH L_EMKPF-MSGV1 L_EMKPF-MSGV2
                            L_EMKPF-MSGV3 L_EMKPF-MSGV4.
               SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
             ELSE.
         */    Fehler auf Zeilenebene (Ausgabe des ersten Fehlers)
               LOOP AT L_EMSEG_TAB INTO L_EMSEG.
                 IF L_EMSEG-MSGID NE SPACE.
                   MESSAGE ID L_EMSEG-MSGID TYPE 'S'
                         NUMBER L_EMSEG-MSGNO
                         WITH L_EMSEG-MSGV1 L_EMSEG-MSGV2
                              L_EMSEG-MSGV3 L_EMSEG-MSGV4.
                                                                          Page 16
                   SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
                 ENDIF.
               ENDLOOP.
             ENDIF.
           ENDIF.
           LOOP AT L_EMSEG_TAB INTO L_EMSEG.
             CALL FUNCTION 'QAMB_COLLECT_RECORD'
                  EXPORTING
                       LOTNUMBER   = P_QALS-PRUEFLOS
                       DOCYEAR     = L_EMKPF-MJAHR
                       DOCNUMBER   = L_EMKPF-MBLNR
                       DOCPOSITION = L_EMSEG-MBLPO
                       TYPE        = '7'.
           ENDLOOP.
         */Sonderkorrektur für Frei-An-Frei & WE-Sperr-An-We-Sperr
           IF NOT P_QALS-STAT11 IS INITIAL.
             IF P_QALS-LMENGE04 EQ L_LMENGEGEB.
               ADD      P_QALS-LMENGE04 TO   L_LMENGEZUB.
               SUBTRACT P_QALS-LMENGE04 FROM L_LMENGEGEB.
             ENDIF.
           ELSEIF P_QALS-INSMK IS INITIAL.
             IF         P_QALS-LMENGE01 GE L_LMENGEGEB
                AND NOT P_QALS-LMENGE01 IS INITIAL.
               ADD      L_LMENGEGEB     TO   L_LMENGEZUB.
               SUBTRACT L_LMENGEGEB     FROM L_LMENGEGEB.
             ENDIF.
           ENDIF.
           CLEAR: P_QALS-STAT34,
                  P_QALS-MATNRNEU,
                  P_QALS-CHARGNEU,
                  P_QALS-LMENGE01,
                  P_QALS-LMENGE02,
                  P_QALS-LMENGE03,
                  P_QALS-LMENGE04,
                  P_QALS-LMENGE05,
                  P_QALS-LMENGE06,
                  P_QALS-LMENGE07,
                  P_QALS-LMENGE08,
                  P_QALS-LMENGE09.
           P_QALS-LMENGEZUB = L_LMENGEZUB.
           IF NOT L_LMENGEGEB IS INITIAL.
             P_SUBRC = 4.
           ENDIF.
         ENDFORM.                               " CREATE_GOODS_MOVEMENT
          Form  POST_GOODS_MOVEMENT                                      *
          Warenbewegung buchen                                           *
         FORM POST_GOODS_MOVEMENT.
           CALL FUNCTION 'MB_POST_GOODS_MOVEMENT'.
                                                                          Page 17
         ENDFORM.                               " POST_GOODS_MOVEMENT
          Form  POST_DATA                                                *
          QM-Daten verbuchen                                             *
         FORM POST_DATA USING P_QALS        LIKE QALS
                              P_QALS_LEISTE LIKE QALS
                              P_QAMB_TAB    TYPE T_QAMB_TAB
                              P_QAMB_VB_TAB TYPE T_QAMB_TAB
                              P_SUBRC       LIKE SY-SUBRC.
           DATA:
             L_STAT        LIKE JSTAT,
             L_STAT_TAB    LIKE JSTAT OCCURS 0,
             L_QAMB        LIKE QAMB,
             L_UPDKZ       LIKE QALSVB-UPSL VALUE 'U'.
         */QAMBs umsetzen (7 = VE-Buchung storniert)
           LOOP AT P_QAMB_TAB INTO L_QAMB.
             L_QAMB-TYP = '7'.
             APPEND L_QAMB TO P_QAMB_VB_TAB.
           ENDLOOP.
         */BERF & BTEI zurücknehmen
           CLEAR L_STAT. CLEAR L_STAT_TAB.
           L_STAT-INACT = 'X'.
           L_STAT-STAT = 'I0219'. APPEND L_STAT TO L_STAT_TAB. "BTEI
           L_STAT-STAT = 'I0220'. APPEND L_STAT TO L_STAT_TAB. "BEND
           CALL FUNCTION 'STATUS_CHANGE_INTERN'
                EXPORTING
                     OBJNR         = P_QALS-OBJNR
                TABLES
                     STATUS        = L_STAT_TAB
                EXCEPTIONS
                     ERROR_MESSAGE = 1.
           IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
         */Prüflos aktualisieren
           CALL FUNCTION 'QPL1_UPDATE_MEMORY'
                EXPORTING
                     I_QALS  = P_QALS
                     I_UPDKZ = L_UPDKZ.
           CALL FUNCTION 'QPL1_INSPECTION_LOTS_POSTING'.
           CALL FUNCTION 'STATUS_UPDATE_ON_COMMIT'.
         */QAMB initialisieren
           CALL FUNCTION 'QAMB_REFRESH_DATA'.
                                                                          Page 18
           PERFORM UPDATE_QAMB ON COMMIT.
           P_SUBRC = 0.
         ENDFORM.                               " POST_DATA
          Form  UPDATE_QAMB                                              *

  • Shelf Life Expired Material will automatically be transferred to block stk

    Hi,
    We have purchased a material, RM u2013 XYZ, Qty u2013 5000 kg, Mfg date u2013 01.06.2010 and Expire date is 30.09.2011. The material was received on 25.06.2010. Presently the stock of material is lying as unrestricted type.
    I want to know that when the shelf life of the material will be expired, the material will atomically be transferred to block stock. How do I configure the same?
    Further, is there any standard alarming system as to know the shelf life of material is going to be expired?
    Regards,
    Amit

    The problem is that the section of the program (QA07) that blocks the stock  runs first.  Therefor all "expired" stcok within the time frame specified is moved.  When the program runs the section to create inspection lots, it will only take into consideration stock that is in unrestricted stock.  Since the stocks have already been moved to blocked stock, there is no stock in unrestricted inventory and hence no inspection lots.
    In your case, in the section "Batch status change when expiration date is reached"  you need to untick the "Block batch" and remove and values iin "Initial run in days" in this section.
    In the section above that tick on "Block batch at inspection date" and maintain a value in "Initial run in days".
    This will have the effect of creating lots when the next inspection date falls within the window specified and will move the material to blocked stock on the inspection date.
    Keep in mind that this is all working on the "Next Inspection Date" of the batch.  Not the expiration date.  So you should have a process to keep the next inspection date and the expriation date in sync.
    To cover yourself and make sure that batches are blocked if the expriation date is reached, set up QA07 to run again immediately after the above job.  In the varinat for this run, tick back on the "Block batch" and set a value in the "Initial run in days".  This will then block any stocks missed in the inspection lot creation process above.
    Also see the folowing threads which explain the deadline mointoring program.  There is a lot of info on this process on the net.
    http://sapfans.com/forums/viewtopic.php?f=27&t=334825&p=1016796&hilit=Deadline+monitoring#p1016796
    http://sapfans.com/forums/viewtopic.php?f=27&t=250686&hilit=+deadline
    FF

  • Return Stock -shelf life expired goods processing

    Hi Mates
    *Iam maintaining all the materials in Batches.
    *My scenerio is when customer returns the goods,matrerails has to posted to seperate storage location.This we have done.
    *But when customer returns the shelf life expired material iam unable to do PGR.Only then after changing the Date of MFG in transaction MSC2N iam iam able to do PGR.
    *But my requirement is if iam selecting return stock storage location system should not check whether that goods are shelf life expired or not.
    *Customer will revalidate the goods and change the date of mfg accordingly.
    Kindly do the needful.Thanx in advance

    The problem is that the section of the program (QA07) that blocks the stock  runs first.  Therefor all "expired" stcok within the time frame specified is moved.  When the program runs the section to create inspection lots, it will only take into consideration stock that is in unrestricted stock.  Since the stocks have already been moved to blocked stock, there is no stock in unrestricted inventory and hence no inspection lots.
    In your case, in the section "Batch status change when expiration date is reached"  you need to untick the "Block batch" and remove and values iin "Initial run in days" in this section.
    In the section above that tick on "Block batch at inspection date" and maintain a value in "Initial run in days".
    This will have the effect of creating lots when the next inspection date falls within the window specified and will move the material to blocked stock on the inspection date.
    Keep in mind that this is all working on the "Next Inspection Date" of the batch.  Not the expiration date.  So you should have a process to keep the next inspection date and the expriation date in sync.
    To cover yourself and make sure that batches are blocked if the expriation date is reached, set up QA07 to run again immediately after the above job.  In the varinat for this run, tick back on the "Block batch" and set a value in the "Initial run in days".  This will then block any stocks missed in the inspection lot creation process above.
    Also see the folowing threads which explain the deadline mointoring program.  There is a lot of info on this process on the net.
    http://sapfans.com/forums/viewtopic.php?f=27&t=334825&p=1016796&hilit=Deadline+monitoring#p1016796
    http://sapfans.com/forums/viewtopic.php?f=27&t=250686&hilit=+deadline
    FF

Maybe you are looking for