BasicSetup
BasicSetup
Consulting
Please keep in mind that consulting issues (like mapping or proxy issues) fall outside the scope of SAP
Active Global Support under the SAP maintenance agreement. You can find further details in SAP Note
83020. Any problem with the implementation of the basic solution is considered to be a consulting issue.
Please ensure you implement your own error handling logic when required.
Excluded in the delivery of the basic solution is the entire subsequent process for the eDocument. As a
consequence the documents in the cockpit (Transaction EDOC_RESUBMIT) only show that they have been
created.
In order to implement other process steps subsequent eDocument statuses need to be updated. To do this
you can implement the method TRIGGER of BAdI EDOC_INTERFACE_CONNECTOR, defined in
enhancement spot ES_EDOCUMENT to call your customer-specific solution.
CASE iv_interface_id.
WHEN '/EDOESGETSTATUS1'.
WHEN '/EDOESVOID1'.
WHEN OTHERS.
ENDCASE.
CASE iv_interface_id.
WHEN '/EDOESGETSTATUS1'.
WHEN '/EDOESVOID1'.
WHEN OTHERS.
Copyright/Trademark
ENDCASE.
ENDIF.
Some hints on how to implement such BAdI method is described in SAP Note 2002415 step 2.
In following sections you will find instructions on how to trigger other process steps including status changes.
1.1. Submit the eDocument for Registration and optionally attaching XML generated
Resubmit report (transaction EDOC_RESUBMIT) allows requesting registration from the Government
entities. For that purpose a button is included:
The BAdI method TRIGGER will be called with parameter IV_INTERFACE_ID not populated .
The eDocument status can be changed to “SENT - Sent to Interface” by calling method
COMMUNICATE_PROCESS_STEP of class CL_EDOCUMENT with parameter IV_PROCESS_STEP =
‘SENDEDOC’. In same method call, the XML message sent to Government entity can be linked in
EDOCUMENT table as described in SAP Note 2002415 step 2.
Once the response from the Government is received, the eDocument status can be changed to “REGP –
Registered by Government entity” by calling method COMMUNICATE_PROCESS_STEP of class
CL_EDOCUMENT with parameter IV_PROCESS_STEP = ‘GOV_RESP’.
IF iv_test_mode = abap_false.
TRY.
Copyright/Trademark
* If the registration was successful, update the eDocument status
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'GOV_RESP'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
iv_variant = 'REGP' ). “Registered by Gov.entity
ENDTRY.
ENDIF.
Resubmit report (transaction EDOC_RESUBMIT) allows cancelling an eDocument. For that purpose a
menu option is included: “EDocument > Cancel eDocument”.
If the Invoice has already been registered by the Government entity then to get the cancellation of the
Invoice a Voiding request has to be sent.
When pressing the ‘Cancel’ menu option, if the Invoice has already been registered by the Government
entity, a popup will be displayed to enter the Voiding reason and then the BAdI method TRIGGER will be
called with parameter IV_INTERFACE_ID = '/EDOESVOID1'.
The eDocument status can be changed to “VOIR – Voiding Requested (4200)” by calling method
COMMUNICATE_PROCESS_STEP of class CL_EDOCUMENT with parameter IV_PROCESS_STEP =
‘VOID_RESP’.
IF iv_test_mode = abap_false.
ENDIF.
The Government requires sending a separate request to obtain the Invoice status after sending the
original request for the Invoice registration.
Resubmit report (transaction EDOC_RESUBMIT) allows requesting the Invoice status from the
Copyright/Trademark
When pressing the button, the BAdI method TRIGGER will be called with parameter IV_INTERFACE_ID
= '/EDOESGETSTATUS1'.
The eDocument status can be changed to “REGP - Registered (1200)”, “REGR - Registered at RCF
(1300)”, ”RECO - Obligation to pay recog.(2400)”, “PAID – Paid (2500)”, “REJE – Rejected (2600)”,
“VOIR - Voiding Requested (4200)”, “VOIA - Voiding Accepted (4300)”, “VOIJ - Voiding Rejected (4400)”
or “VOID - Voided (3100)” by calling method COMMUNICATE_PROCESS_STEP of class
CL_EDOCUMENT with parameter IV_PROCESS_STEP = ‘STATUS_RES’.
IF iv_test_mode = abap_false.
ENDIF.
2.1. Submit the eDocument for Signing and optionally attaching XML generated
Resubmit report (transaction EDOC_RESUBMIT) allows sending a request for signature to your
interface. For that purpose a button is included:
The BAdI method TRIGGER will be called with parameter IV_INTERFACE_ID not populated .
The eDocument status can be changed to “SENT - Sent to Interface for signing” by calling method
COMMUNICATE_PROCESS_STEP of class CL_EDOCUMENT with parameter IV_PROCESS_STEP =
‘SENDEDOC’. In the same method call, the XML message to be signed can be linked in EDOCUMENT
table as described in SAP Note 2002415 step 2.
Once the signed request is received, the eDocument status can be changed to “SIGN – Signed” by
calling method COMMUNICATE_PROCESS_STEP of class CL_EDOCUMENT with parameter
IV_PROCESS_STEP = ‘SIGN_RESP’. In the same method call, the signed XML message can be linked
in EDOCUMENT table.
Copyright/Trademark
[Generate the XML message in the local variable lv_xml]
IF iv_test_mode = abap_false.
TRY.
[Process the signing response from your interface and store the signed XML message in the
local variable lv_xml]
ENDTRY.
ENDIF.
Resubmit report (transaction EDOC_RESUBMIT) allows cancelling an eDocument. For that purpose a
menu option is included: “EDocument > Cancel eDocument”.
If the Invoice has already been registered by the Government entity then to get the cancellation of the
Invoice a Voiding request has to be sent.
When pressing the ‘Cancel’ menu option, if the Invoice has already been registered by the Government
entity, a popup will be displayed to enter the Voiding reason and then the BAdI method TRIGGER will be
called with parameter IV_INTERFACE_ID = '/EDOESVOID1'.
The eDocument status can be changed to “VOIR – Voiding Requested (4200)” by calling method
COMMUNICATE_PROCESS_STEP of class CL_EDOCUMENT with parameter IV_PROCESS_STEP =
‘VOID_RESP’.
IF iv_test_mode = abap_false.
Copyright/Trademark
EXPORTING
iv_process_step = 'VOID_RESP'
iv_interface_guid = 'CUSTOM_XML' ). “(or use any other non-
“empty ID that you prefer)
ENDIF.
Resubmit report (transaction EDOC_RESUBMIT) allows downloading the signed XML message so it can
be uploaded in the Website of the corresponding Government entity. For that purpose a button is
included:
When the signed XML message is downloaded, the status of the eDocument is automatically updated to
‘DOWN’.
After that, you can use this Resubmit report to update the Invoice status. For that purpose a button is
included:
When pressing the button, the BAdI method TRIGGER will be called with parameter IV_INTERFACE_ID
= '/EDOESGETSTATUS1'.
The eDocument status can be changed to “REGP - Registered (1200)”, “REGR - Registered at RCF
(1300)”, ”RECO - Obligation to pay recog.(2400)”, “PAID – Paid (2500)”, “REJE – Rejected (2600)”,
“VOIR - Voiding Requested (4200)”, “VOIA - Voiding Accepted (4300)”, “VOIJ - Voiding Rejected (4400)”
or “VOID - Voided (3100)” by calling method COMMUNICATE_PROCESS_STEP of class
CL_EDOCUMENT with parameter IV_PROCESS_STEP = ‘STATUS_RES’.
IF iv_test_mode = abap_false.
[Implement your own logic to determine (or to enter) the new Invoice status ‘REGP’, ‘REGR’,
‘RECO’, ‘PAID’, ‘REJE’, ‘VOIR’, ‘VOIA’, ‘VOIJ’ or ‘VOID’]
ENDIF.
Alternatively, instead of implementing your own logic to determine the new Invoice status, you can leave
the local variable lv_var empty in order to use the standard functionality to manually enter the
registration number or the new Invoice status. In this case, when the exporting parameter iv_variant is
blank then:
a) If the current eDocument status is ‘DOWN’ (downloaded) then a popup is displayed to enter the
Registration number and the Receipt Date:
Copyright/Trademark
The Registration number is stored in the eDocument table and the eDocument status is
automatically updated to ‘REGP’.
b) If the current eDocument status is ‘REGP’ (registered) then a popup is displayed to enter the
Invoice status:
The eDocument status will be updated according to the selected option (‘PAID’ if the Invoice has
been paid or ‘REJE’ if it has been rejected).
c) If the current eDocument status is ‘VOIR’ (Voiding Requested) then a popup is displayed to
enter the Voiding request status:
The eDocument status will be updated according to the selected option (‘VOID’ if the Voiding
request has been accepted, or back to the previous status if it has been rejected).
Copyright/Trademark