viernes, 30 de octubre de 2015

Problemas aplicando nota 1841781 SEPA composite SAP Note: Payment medium

Aplicando la nota múltiple 1841781 SEPA composite SAP Note: Payment medium para (SAPKH60511 SAPKA70214) me he encontrado con problemas al aplicar algunas de sus notas. Problemas del tipo de no poder encontrar el código previsto aunque no indicaba prerequisitos la nota.

Así los he resuelto:

Para la nota "1948973 Accompanying sheet with more fields (hash value) in exit 41" no sabe encontrar código para ldmee5f01, he aplicado nota "1928773 - DMEE: Accompanying Sheet - wrong sums"

Para la nota "2111694 - Runtime too long for SEPA_CT with country exit: Correction in BAdI for countries" no sabe encontrar el código y da errores al activar de CL_FI_DMEE_SEPA_COUNTRIES_IMP IF_FI_DMEE_SEPA_COUNTRIES~GET_VALUE sobretodo con I_REGUP. Aplico nota"2013784 - SEPA CT: Austria Tax Payments" y esta me pide también la "1983343 - Portugal: SEPA CT: Corrections regarding the tags Ustrd, Strd, CtgyPurp-> Cd and DbtrAcct-> Ccy."

lunes, 19 de octubre de 2015

SAFT con SAP. Error SECSTORE:023

Estoy aplicando las notas para el SAFT de la AT Portugal para hacer la comunicación de los transportes Online con Web Services:

• Note 1901250 - PT Web Services- Online communication to AT : Technical Req
• Note 1901252 - PT Web Services- Online communication to AT:Solution Details

Al probar la transacción WSPT_MONI me da el siguiente error:
  • (SECSTORE:023) No se ha encontrado entrada /WSPT/DELIVERY/<código de la empresa>;* en memoria segura 
  • (SECSTORE:023) Entrada /WSPT/DELIVERY/<código de la empresa>;* não encontrada na memória segura
La solución es introducir el usuario y password de la AT portuguesa con la transacción WSPT_STORE_PASS.

Por cierto es importante saber que los certificados correctos son los de "2054553 - PT: WS - Online communication to AT: Certificates" y NO los de la nota "1901250 - PT Web Services- Online communication to AT : Technical Req".

lunes, 28 de septiembre de 2015

Seguimiento (trace) del log de un Web Service en SAP.

Es interesante lo que explica la nota "1901252 - PT: WS - Online communication to AT:Solution Details" en el documento "Guidelines_for_endpoint_config2_v2.pdf" para como mirar el log al usar un web service.

For trace and LOG you can either use SRT_UTIL transaction or the trace functionality in SOAMANAGER. For the later proceed as indicated below:



Press Add New Button,



After you can define the duration of the trace in seconds, and in order to reduce overhead in SMICM choose a value that can allow you to test.
Example 10h = 36000s.

You should refine the trace either by adding the interface name CO_WSPT_DOCUMENTOS_TRANSPORTE or choose a Username.


jueves, 16 de julio de 2015

Campos adicionales para acreedor / proveedor.

Para añadir campos adicionales de acreedor (lfa1, lfb1) he seguido estos 2 links:
  1. Custom Screen in Vendor Master
  2. Adding Customer Fields In Vendor Master
El primero no me acababa de funcionar a la hora de grabar y el segundo no me acaba de gustar lo que hace para dejar modificar los campos o no. He seguio lo que decía para activar las BADIS. Aqui explico lo que he hecho para poder grabar, he usado un grupo de funciones para el control del screen como hace el segundo link. 

Mi append lo he hecho para la LFB1 y le he llamado ZLFB1.

Me he creado un grupo de funciones ZBC_VENDOR con un dynpro 9000 y he puesto he cogido los campos de diccionario de LFB1.

Tiene como variables globales en LZBC_VENDORTOP
tableszlfb1.datagl_activity type aktyp.

La dynpro tiene   process before output  module status_9000.

module status_9000 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
loop at screen.
*For XD01, It would be H
*For XD02, it would be V
*For XD03, it would be A. 
 if gl_activity = 'A'. " 
Display screen-input = '0'. 
 endif. 
 modify screen. 
 endloop.*
endmodule.

Y tiene 2 módulos de funciones.

function z_bc_vendor_screen_get.
*"----------------------------------------------------------------------
*"*"Interfase local
*"  EXPORTING
*"     REFERENCE(P_ZLFB1) TYPE  ZLFB1
*"----------------------------------------------------------------------

  move-corresponding zlfb1 to p_zlfb1.

endfunction.

function z_bc_vendor_screen_set.
*"----------------------------------------------------------------------
*"*"Interfase local
*"  IMPORTING
*"     REFERENCE(P_ACTIVITY) TYPE  AKTYP OPTIONAL
*"     REFERENCE(P_ZLFB1) TYPE  ZLFB1 OPTIONAL
*"----------------------------------------------------------------------
*
  move-corresponding p_zlfb1 to zlfb1.
  gl_activity p_activity.
*
endfunction.

Y las implementos en los métodos de la BADI VENDOR_ADD_DATA_CS de la siguiente forma.

  method if_ex_vendor_add_data_cs~set_data.
*
    datal_zlfb1 type zlfb1.
    move-corresponding  i_lfb1 to l_zlfb1.
*
    call function 'Z_BC_VENDOR_SCREEN_SET'
      exporting
        p_activity i_activity
        p_zlfb1   l_zlfb1.
*
  endmethod.

  method if_ex_vendor_add_data_cs~get_data.
    datal_zlfb1 type zlfb1.
    call function 'Z_BC_VENDOR_SCREEN_GET'
      importing
        p_zlfb1 l_zlfb1.
*
    move-corresponding l_zlfb1 to s_lfb1.
*
  endmethod.

method if_ex_vendor_add_data_cs~get_taxi_screen.
  if flt_val 'Z1'.
    case i_taxi_fcode.
      when 'ZTAB1'.
      e_program 'SAPLZBC_VENDOR'"Grupo de funciones ZBC_VENDOR
      e_screen '9000'.
      e_headerscreen_layout 'B'.
    when others.
    endcase.
  endif.
endmethod.


Además para que si no hay datos de sociedad no salga la pestaña ZTAB1

  METHOD if_ex_vendor_add_data_cs~suppress_taxi_tabstrips.
*
    DATAcode   TYPE not_used_taxi_fcodes_tab,
          code_l LIKE LINE OF code.
*
    IF i_bukrs IS INITIAL.
      code_l 'ZTAB1'.
      APPEND code_l TO code.
*
      e_not_used_taxi_fcodes code.
    ENDIF.
*
  ENDMETHOD.

De la parte de Custo dejo aquí la pantalla de la SPRO en castellano.

jueves, 2 de julio de 2015

Leyendo fichero de la AL11 con caracter extraño # (hashtag).

Un compañero, Joan Zenon, tenía un problema al leer con OPEN DATA SET un fichero que tiene en el servidor. Tanto con la AL11 como al leer en el programa tenía carácter # al final. Estas cosas son por el fin de carro o fin de línea, pero intentado reemplazar con las constantes de la clase cl_abap_char_utilities no acababa de encontrar cual era. 

Al final lo ha solucionado con la función SCP_REPLACE_STRANGE_CHARS. Por defecto pone el punto (.) porque es 46 el valor que tiene el parámetro REPLACEMENT, si ponemos 32 deja un espacio.

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.