[go: up one dir, main page]

0% found this document useful (0 votes)
90 views8 pages

BasicSetup

This document provides guidance on customizing the basic eDocument solution in SAP. It discusses: 1) Implementing additional process steps by updating eDocument statuses using BAdI triggers. 2) Examples of submitting documents, requesting voids, and getting status updates by calling API methods and changing statuses. 3) The document scopes out consulting support and notes customers are responsible for their own implementations and error handling.

Uploaded by

MarioCubo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views8 pages

BasicSetup

This document provides guidance on customizing the basic eDocument solution in SAP. It discusses: 1) Implementing additional process steps by updating eDocument statuses using BAdI triggers. 2) Examples of submitting documents, requesting voids, and getting status updates by calling API methods and changing statuses. 3) The document scopes out consulting support and notes customers are responsible for their own implementations and error handling.

Uploaded by

MarioCubo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SAP Note 2080683

eDocument Spain: Additional Information to the


Basic Solution (Custom Implementation)

Consulting

© 2014 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Please
see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices. Some software products marketed by SAP SE and its distributors contain proprietary software
components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be liable for errors
or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products
and services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein.
This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may
be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on
these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Basic solution Set-Up
These settings are relevant for the basic solution of eDocument.

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.

eDocument Process Handling

The eDocument is created by Standard.

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.

See sample coding below.

IF io_edocument->ms_edocument-process = 'ESWSINV'. “Web service process

CASE iv_interface_id.

WHEN '/EDOESGETSTATUS1'.

[see section 1.3 for more details]

WHEN '/EDOESVOID1'.

[see section 1.2 for more details]

WHEN OTHERS.

[see sections 1.1 for more details]

ENDCASE.

ELSEIF io_edocument->ms_edocument-process = 'ESINV'. “Manual process

CASE iv_interface_id.

WHEN '/EDOESGETSTATUS1'.

[see section 2.3 for more details]

WHEN '/EDOESVOID1'.

[see section 2.2 for more details]

WHEN OTHERS.

[see sections 2.1 for more details]

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. Web service Process

In this scenario the eDocument Process has the value ‘ESWSINV’

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’.

See sample coding below.

DATA: ld_data TYPE REF TO data.


DATA: lv_xml TYPE xstring.

[Generate the XML message in the local variable lv_xml]

IF iv_test_mode = abap_false.

TRY.

GET REFERENCE OF lv_xml INTO ld_data.

[Send the registration request to the Government entity]

* If the sending was successful, update the eDocument status and


* export and store the XML message to the eDocument table
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'SENDEDOC'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
id_data = ld_data ).

[Process the registration response from the Government entity]

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.

1.2. Send a Voiding request to the Government entity

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’.

See sample coding below.

IF iv_test_mode = abap_false.

[Send the Voiding request to the Government entity]

[Process the response from the Government entity]

* If the response was successfully received and processed, update the


* eDocument status
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'VOID_RESP'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
iv_variant = 'VOIR' ). ”Voiding requested

ENDIF.

1.3. Get Invoice Status from the Government entity

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

Government entity. For that purpose a button is included:

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’.

See sample coding below.

IF iv_test_mode = abap_false.

[Send the get status request to the Government entity]

[Process the status response from the Government entity]

* If the response was successfully received and processed, update the


* eDocument status
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'STATUS_RES'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
iv_variant = lv_var ). ”with lv_var = ‘REGP’, ’REGR’, ‘RECO’
“‘PAID’, ‘REJE’, ‘VOIR’, ‘VOIA’, ‘VOIJ’, ‘VOID’

ENDIF.

2. Manual Download/Upload Process

In this scenario the eDocument Process has the value ‘ESINV’

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.

See sample coding below.

DATA: ld_data TYPE REF TO data.


DATA: lv_xml TYPE xstring.

Copyright/Trademark
[Generate the XML message in the local variable lv_xml]

IF iv_test_mode = abap_false.

TRY.

GET REFERENCE OF lv_xml INTO ld_data.

[Send the request for signature to your interface]

* If the sending was successful, update the eDocument status and


* export and store the XML message to the eDocument table
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'SENDEDOC'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
id_data = ld_data ).

[Process the signing response from your interface and store the signed XML message in the
local variable lv_xml]

* If the signing was successful, update the eDocument status


GET REFERENCE OF lv_xml INTO ld_data.
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'SIGN_RESP'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
id_data = ld_data ).

ENDTRY.

ENDIF.

2.2. Handling a Voiding request

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’.

See sample coding below.

IF iv_test_mode = abap_false.

* Update the eDocument status to Voiding Requested (VOIR)


io_edocument->communicate_process_step(

Copyright/Trademark
EXPORTING
iv_process_step = 'VOID_RESP'
iv_interface_guid = 'CUSTOM_XML' ). “(or use any other non-
“empty ID that you prefer)

ENDIF.

2.3. Update Invoice Status

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’.

See sample coding below.

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’]

* If a status has been determined, update the eDocument


* status
io_edocument->communicate_process_step(
EXPORTING
iv_process_step = 'STATUS_RES'
iv_interface_guid = 'CUSTOM_XML' “(or use any other non-
“empty ID that you prefer)
iv_variant = lv_var ). ”with lv_var = ‘REGP’, ’REGR’, ‘RECO’
“‘PAID’, ‘REJE’, ‘VOIR’, ‘VOIA’, ‘VOIJ’, ‘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

You might also like