Interfaces for Messaging-System Actions
The messaging system can perform the following actions in the SAP back-end system, which are described below:
Activate and deactivate contingency on business-place level
Set the messaging-system status in the NF-e/CT-e Monitor
Request electronic fiscal document data
Note
The SAP back-end system assumes an NF-e/CT-e message reaches the authorities once it has successfully been sent to the messaging system. The messaging system must not change the content of the message or switch an electronic fiscal document (NF-e/CT-e) received from the back end to contingency, as this would lead to an inconsistency of data between the back end and the tax authorities.
The messaging system can activate and deactivate contingency in the SAP back-end system on business-place level. This is possible via the remote-enabled NF-e: Switch Contingency Mode On
(J_1B_NFE_CONTINGENCY_SET
) function module.
In the interface, the messaging system must specify the fields LAND1, BUKRS, and BRANCH. The field REGIO must remain initial. In addition, it should be specified for which document model (55 for NF-e or 57 for CT-e) the contingency must be activated for. The messaging system may select or deselect the indicator AS_OUT. The back end interprets this indicator. If it is set, the back end switches to contingency for any subsequent document posting. The indicator can be automatically deactivated through the messaging system or manually by a user with the required authorization profile (see Activating Contingency Processing for Business Place).
If the messaging system remotely calls the function module J_1B_NFE_CONTINGENCY_SET
, note that the importing parameter IV_FIRE_COMMIT
must be set to X.
The NF-e Monitor displays a messaging-system status. The messaging system can set the following status values in the back end by means of the xNFe sets NF-e Status in Back End
(J_1B_NFE_SET_STATUS_IN_BACKEND
) function module:
Message Type |
Status Description |
|---|---|
A |
Request for authorization received by MS |
B |
Cancellation request received by MS |
C |
Skipping request received by MS |
G |
Error from MS: Request cannot be sent to authorities |
V |
Internal validation error returned from MS |
D |
Error from MS: Data inconsistency between ERP and MS |
Note
Once the messaging-system status has been set for a message, this means that the message has arrived at the messaging system. From this moment on, the processor can no longer resend the respective message requesting authorization, cancellation, or skipping. The processor can only request cancellation again for a document that has been rejected by the tax authorities and accepted in the Monitor (the system communication status in the Monitor is 8).
The messaging system can request NF-e/CT-e data from the back end using the NF-e: Messaging System Requests Data
(J_1B_NFE_MS_REQUESTS_DATA
) function module. The following request type is supported:
Request Type |
Request Description |
|---|---|
1 |
Send complete NF-e/CT-e data |