jueves, 14 de diciembre de 2023

Función para saber la impresora por defecto del usuario.

  DATAp_imp TYPE nast-ldest.

    CALL FUNCTION 'ADS_GET_PRINTER_DEFAULTS'
      EXPORTING
        bname      sy-uname
      IMPORTING
        sname      p_imp
*       LNAME      =
*       PRINT_IMMEDIATELY        =
*       DELETE_AFTER_PRINT       =
      EXCEPTIONS
        wrong_user 1
        OTHERS     2.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

viernes, 4 de agosto de 2023

Dump al verificar los errores del AIF (/AIF/ERR)

Al ejecutar la transacción /n/AIF/ERR o incluso al ir a ver los mensajes de Aplicación o Interfase desde el EDOC_COCKPIT me daba dump con la siguiente indicación:

    If the error occurs in a non-modfied SAP program, you might be able to

    find a solution in the SAP Notes system. If you have access to the SAP

    Notes system, check there first using the following keywords:

    "RAISE_EXCEPTION"

    "CL_ABAP_TYPEDESCR=============CP" bzw. CL_ABAP_TYPEDESCR=============CM002

    "DESCRIBE_BY_NAME"

    or

    "CL_ABAP_TYPEDESCR=============CP" TYPE_NOT_FOUND

    or

    "/AIF/ERROR_HANDLING_TRANS" "TYPE_NOT_FOUND"

He visto en el método DESCRIBE_BY_NAME de la clase CL_ABAP_TYPEDESCR que precisamente estaba tratando la tabla ZEDOAIFIDXREQ (parámetro p_name) y esta tabla no existe. Así que la he creado siquiendo los pasos de 2027186 - eDocument: AIF Setup. Ha funcionado.