martes, 21 de abril de 2015

Consumo de web services con xsd:dateTime (UTC) en SAP.

Para los web services que tienen tipo de datos xsd:dateTime, sap los transforma en el tipo sap XSDDATETIME_Z (Evento XSD (UTC): aaaa-mm-ddThh:ssZ [ext.]). Este tipo de dato guarda internamente la fecha, la hora y el huso horario.

Para poder pasar de UTC a fecha, hora y huso y viceversa podemos servirnos de guía de este código que he extraido de la clase de SAP cl_appointment. Prueba con este código.

Programa de ejemplo.

  DATAl_tst TYPE xsddatetime_z"LIKE scappt-tst_from,
        l_zone TYPE tznzone,      "LIKE scappt-zone_from,
        l_date TYPE datum,        "LIKE scappt-date_from,
        l_time TYPE sytime.       "LIKE scappt-time_from.

  CLEARl_tstl_zonel_datel_time.
*
  GET TIME STAMP FIELD l_tst.
  l_zone 'CET'."No es necesario si nos viene ya dentro del l_tst y nos lo resolvería el convert time. 
*
  WRITE'UTC->fecha, hora, huso'.
*
  CONVERT TIME STAMP l_tst
           TIME ZONE l_zone
           INTO DATE l_date
                TIME l_time.
*
  WRITE'TIME STAMP 'l_tst.
*
  WRITE'ZONE 'l_zone.
  WRITE'DATE 'l_date.
  WRITE'TIME 'l_time.
*
  WRITE/.
  WRITE'fecha, hora, huso->UTC'.
*
  CLEARl_tstl_zonel_datel_time.
*
  l_date sy-datum.
  l_time sy-uzeit.
  l_zone SY-ZONLO.
*
  CONVERT DATE l_date
  TIME l_time
  INTO TIME STAMP l_tst
  TIME ZONE l_zone.
*
  WRITE'ZONE 'l_zone.
  WRITE'DATE 'l_date.
  WRITE'TIME 'l_time.
*
  WRITE'TIME STAMP 'l_tst.
*

domingo, 19 de abril de 2015

Excepción de clase CX_AI_SOAP_FAULT (SoapFaultCode:4 ) al invocar un WebService.

Para este errores al intentar implementar un Web Services que había creado en .Net:

SoapFaultCode:4  System.Web.Services.Protocols.SoapException: Server did not
recognize the value of HTTP Header SOAPAction: .##   at
System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()##   at
System.Web.Services.Protocols.SoapServerProtocol.Initialize()##   at
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&

abortProcessing)


    Excepción de clase CX_AI_SOAP_FAULT

Solución.

En el soamanager he ido al endpoint que había creado. Luego en pestaña "Operation Specific" hay que mirar que todas las operaciones tengan el SOAP Action informado. 

viernes, 17 de abril de 2015

Excepción de clase CX_AI_SOAP_FAULT (SoapFaultCode:3 ) al invocar un WebService.

Para estos 2 errores al intentar implementar un par Web Services que había creado en .Net:

Error 1.

SoapFaultCode:3  The header 'Action' from the namespace
http://schemas.xmlsoap.org/ws/2004/08/addressing' was not understood by the
ecipient of this message, causing the message to not be processed.  This
rror typically indicates that the sender of this message has enabled a
ommunication protocol that the receiver cannot process.  Please ensure that
he configuration of the client's binding is consistent with the service's
inding.

   Excepción de clase CX_AI_SOAP_FAULT

Error 2.

SoapFaultCode:3  System.Web.Services.Protocols.SoapHeaderException: SOAP
header Action was not understood.##   at
System.Web.Services.Protocols.SoapHeaderHandling.
SetHeaderMembers(SoapHeaderCollection headers, Object target,
SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client)##
at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance()##
at System.Web.Services.Protocols.WebServiceHandler.Invoke()##   at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

    Excepción de clase CX_AI_SOAP_FAULT

Solución.

En el soamanager he ido al endpoint que había creado. Luego en pestaña Messaging y en Message ID Protocol lo he cambiado a "SAP Message ID".


miércoles, 11 de marzo de 2015

Problemas con notas SEPA.

Hemos aplicado las notas para SEPA:

  • 1857318 CGI_XML_CT: DMEE XML Format as per ISO20022
  • 1923419 - CGI_XML_CT: SEPA changes for Spain

Pero al activar el DMEE (PAYM / CGI_XML_CT) y me da error:
DMEE_ABA203 Format tree CGI_XML_CT inconsistent (see log); tree saved in maintenance version

Miro el log y tengo errores DMEE_ABA358 del estilo "Node AdrLine: function module DMEE_EXIT_CGI_CRED_STREET has incorrect interface"

"No documentation is assigned to the format tree
Node Id: function module DMEE_EXIT_CGI_XML has incorrect interface
Node Issr: function module DMEE_EXIT_CGI_XML has incorrect interface
Node Nm: function module DMEE_EXIT_CGI_DEBT_NAME has incorrect interf X
Node Nm: function module DMEE_EXIT_CGI_DEBT_NAME has incorrect interf X
Node Issr: function module DMEE_EXIT_CGI_XML has incorrect interface
Node Amt: function module DMEE_EXIT_CGI_EQVTAMT has incorrect interfa X
Node CcyOfTrf: function module DMEE_EXIT_CGI_CCYOFTRF has incorrect i X
Node ZNME1: function module DMEE_EXIT_CGI_CRED_NAME has incorrect int X
Node StrtNm: function module DMEE_EXIT_CGI_CRED_STREET has incorrect X
Node POBoxCity: function module DMEE_EXIT_CGI_CRED_PO_CITY has incorr X
Node City: function module DMEE_EXIT_CGI_CRED_CITY has incorrect inte X
Node CtrySubDvsn: function module DMEE_EXIT_CGI_CRED_REGION has incor X
Node AdrLine: function module DMEE_EXIT_CGI_CRED_STREET has incorrect X
Node StrtNm: function module DMEE_EXIT_CGI_CRED_STREET has incorrect X
Node City: function module DMEE_EXIT_CGI_CRED_CITY has incorrect inte X
Node TaxId: function module DMEE_EXIT_CGI_CRED_TAXID has incorrect in X
Node Mtd: function module DMEE_EXIT_CGI_TAX_METHOD has incorrect inte X
Node SeqNb: function module DMEE_EXIT_CGI_TAX_SQNB has incorrect inte X
Node Ctgy: function module DMEE_EXIT_CGI_TAX_CATEGORY has incorrect i X
Node CtgyDtls: function module DMEE_EXIT_CGI_TAX_CTGRY_DTLS has incor X
Node FrmsCd: function module DMEE_EXIT_CGI_TAX_FORMS_CODE has incorre X
Node Rate: function module DMEE_EXIT_CGI_TAXAMT_RATE has incorrect in X
Node Amt: function module DMEE_EXIT_CGI_TAXAMT_TTLAMT has incorrect i X
Node TaxblBaseAmt: function module DMEE_EXIT_CGI_TAXAMT_TXBASEAMT has X
Node Amt: function module DMEE_EXIT_CGI_TAXAMT_TTLAMT has incorrect i X
Node TaxblBaseAmt: function module DMEE_EXIT_CGI_TAXAMT_TXBASEAMT has X"

Lee 1901772 DMEE: Checking errors with SEPA* formats - DMEE_ABA 358, 118 during upload y aplica 1914322 DMEE: can not activate DMEE tree due to wrong interface.

jueves, 5 de marzo de 2015

340 / 2015. Validador y documentación AEAT.

Programa con formulario 2015 para el 340 y ejecutar con el explorador, luego el "programa" lo tendremos en C:\aeat\340_2015\PROGRAMA\nre15340.html. Así no será mucho más fácil validar el resultado de S_ALR_87012403 - Declaración recapitulativa (España).

jueves, 15 de enero de 2015

SAFT por WebService: Define Rejection Codes

Estoy aplicando las notas para poder recibir el codigo AT para los movimientos de mercancías en Portugal. Ahora mismo en el punto de http://help.sap.com/saphelp_sfin100/helpdata/en/8c/dbb752112fbd66e10000000a441470/content.htm
·         Defined rejection codes for web services. You do this in Customizing for Sales and Distribution, under  Logistics Execution ->Shipping ->Deliveries ->Country-Specific Functions ->Portugal ->Define Rejection Codes  .


Esta opción de hecho es para llenar la vista WSPT_V_REJ_CODES, pero no queda claro de donde sacar lo valores. Deben ser los del documento de la AT portuguesa, desde la página 26 al final en el punto "Documentos de transporte - Resposta ao pedido SOAP".

Comentario (PD): también vienen en la nota 0001901252 [1901252 - PT: WS - Online communication to AT:Solution Details] que aunque en mi caso deberían ya estar informados los valores por parche no lo están. De hecho hay más valores y creo que es mejor coger los del documento AT.

Excel con los valores WSPT_V_REJ_CODES.

martes, 13 de enero de 2015

Un programa para crear objetos de diccionario y otros objetos de desarrollo.

Estoy aplicando la nota "1997540 - PT: Manual changes flag added to WSPT_LIKP" y me he encontrado la grata sorpresa que aplicando la nota se instala el programa NOTE_1997540 que según pone en la nota "This program generates ABAP dictionary objects and other ABAP development objects in the ERP system" lo cual es un gran que y va en una buena línea por parte de SAP porque siempre me ha costado entender lo de tener que hacer pasoS manuales para crear elementos, dominios y otros objetos de diccionario de la SE11. Agradezco el detalle y habrá que buscar tiempo para mirar el programa y poder readaptarlo para situaciones análogas.

Como curiosidad en la nota también habla de la tabla DWINACTIV que es la tabla donde se guardan los objetos pendientes de activación. 

Y parece que la línea es esta.

Porque en la nota "1992838 - PT: WS - Contingency approval" tenemos un programa análogo NOTE_1992838.