SAP Knowledge Base Article - Public

3514640 - Enhancement to Date discrepancies in México eDocument Cockpit app

Symptom

System shows different time in field >fecha< from XML file in eDocument Cockpit app.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Access eDocument Cockpit app
  2. Select the related document
  3. Display > XML
  4. Compare values maintained in XML field >fecha< and 'fecha creacion' field in eDocument Cockpit app.

Cause

The current system shows the time in UTC time zone, while XML file shows local time.

Resolution

Use in-app extensibility to apply a workaround that will allow to include a custom field that can be used to reflect the local time.

The Content provided below is just a proof of concept and you are entitled to use this proof of concept as example. The Content is provided “AS IS” with no warranties or indemnities of any kind. No maintenance or support is provided for this Content. Please make sure to test this workaround in your development and test system before deciding to move to production system. The workaround uses approved cloud extensibility techniques and is content lifecycle compliant.

Use BadIn eDocument Custom Fields (UI) to create a custom field using key user extensibility and display it in the eDocument Cockpit, ensuring that it is updated with the time in Mexico when the eDocuments are created. Please refer to the steps below to complete this process:

  1. Access Custom Fields app

  2. Create a Custom Field (for Time and one for date) under the business context of Document Compliance for the user interface option document list and filter.
  3. Implement Business AddIn Logic to show the fields on the UI
    • Go to the custom logic app and choose the business context EDOCUMENT and implement the logic for EDOC_CUSTOM_FIELDS_UI_CLOUD(eDocument Custom Fields (UI))
    • Provide a logic like the one below. This is just a sample code.
  4. Adapt UI for custom naming
    • While in the eDocument Cockpit, click on the user initials at top right corner and Adapt UI to create a custom flavour in which you can change the column name as well.

  5. Implement Business AddIn Logic to update the value
    • Go to the custom logic app and choose the business context EDOCUMENT and implement the logic for EDOC_CUSTOM_FIELDS_CLOUD
    • Provide a logic like the one below. This is just a sample code. You can update it to meet your need or to make it dynamic. This logic reads the created time and subtracts 6 hours to arrive at Mexico time which is then stored in the custom field.

    DATA lv_mexico_timestamp TYPE timestamp.
    DATA(lo_timestamp_util) = cl_abap_timestamp_util=>get_instance( ).
    DATA strProcess TYPE String.
    cl_ble_trace_writer=>write_info_message( ' ' && process ).

    IF process = 'MXINVOICE' or process = 'MXPAYMENT'.
    lv_mexico_timestamp = source_data-accounting_header-cpudt && source_data-accounting_header-cputm.

    ELSEIF process = 'MXDELN'. cl_ble_trace_writer=>write_info_message( 'Time is: ' && source_data-delivery_header-erzet ).
    lv_mexico_timestamp = source_data-delivery_header-erdat && source_data-delivery_header-erzet.
    ENDIF.

    IF ( not lv_mexico_timestamp is INITIAL ).
    lo_timestamp_util->tstmp_add_seconds(
    EXPORTING
    iv_timestamp = lv_mexico_timestamp
    iv_seconds = -21600
    RECEIVING rv_timestamp_new = DATA(lv_new_timestamp)
    ).

    CONVERT TIME STAMP lv_new_timestamp TIME ZONE ''
    INTO DATE data(lv_date) TIME data(lv_time).

    custom_fields-yy1_zsma_createdon_edo = lv_date.
    custom_fields-yy1_zdlaltertimezone_edo = lv_time.
    ENDIF.

  6. Final UI
    • On creating an outgoing invoice and/or an incoming payment you can see this BAdIn executed so that the custom field is populated with the time in Mexico.

    • Please note that this custom time/field is only displayed on the eDocument Cockpit UI. This doesn’t affect the time reported in the XML created by the system for eDocument.

The approach taken here is to create a custom field using key user extensibility and to show it in the eDocument Cockpit such that it is updated with the time in Mexico when the eDocuments are created. The BAdln only works when the document is created, so cannot add (update) dates to documents already created before this BAdln was created. This workaround works at creation time only.

This workaround was implemented to a customer only doing business in and out of Mexico (using eDocument Cockpit in Mexico only) without any other country that requires eDocument Cockpit in the landscape.

See Also

Keywords

EDOC_CUSTOM_FIELDS_UI_CLOUD, eDocument Custom Fields (UI), fecha creacion, fecha, eDocument Cockpit, Mexico, date, time, UTC, time zone. , KBA , CA-GTF-CSC-EDO-MX , Document Compliance Mexico , Problem

Product

SAP S/4HANA Cloud Public Edition all versions