2016 Jan 24 4:36 PM
We are in the process of rolling out SAP to quite a few countries:
For some countries it is a legal requirement that E-Invoice must be accompanied with a Legal Document Number, otherwise no E-Invoice must be dispatched.
- One of the issues that we are having is how to initiate 'Output Determination Procedure' in the billing document only 'After' a legal document number in a localized table is updated.
- For example, for Greece, after the creation of the billing document, a legal document number is written to a localized table as part of the Hellenization process. This is a legal requirement that cannot be bypassed.
To generate this number the user runs "Manually" a localized Transaction "After" the billing document is generated.
- So the ideal solution will be that as soon as the Local Table is updated in the above step with the Legal Document Number, the program creates an 'Event'. The event will then start the 'Outbound Determination Procedure' in the billing document. This will retrieve the condition record for the E-Invoice and generate the INVOIC IDOC containing the Legal Document Number.
- I know of the Function Module SWE_EVENT_CREATE that may be used to create an event, but being a Functional Consultant and not an ABAP Programmer, I do not know how the function works an whether it would fulfil our requirements.
An idea on how we can achieve the solution?
Your help is much appreciated!
Thank you,
Shariar
2016 Jan 24 5:30 PM
Hello
Please find below my thought process.
Thanks
Nabheet
Hello
Please find below my thought process.
Thanks
Nabheet
2016 Jan 24 5:30 PM
Hello
Please find below my thought process.
Thanks
Nabheet
2016 Jan 24 6:29 PM
Thank you for your reply!
There are two points that I need to comment on, with regards to your reply:
1- Yes, You are correct The legal document number must be generated manually. This is a business requirement and regards a Localization transaction that the user executes manually and cannot be automated.
2 - In order to avoid sending the E-Invoice when the billing document is first created and does not contains the Legal Document Number, we are obliged to attach a 'requirement' (VOFM routine) to the output type (e.g. Output Type ZB00) that checks the availability of the Legal Document Number. As this is not present when the billing document is created, No output record is created in the first place in the NAST Table (i.e. Due to the absence of the Legal Document Number, ZB00 is simply ignored).
You may have assumed that, due to lack of the Legal Document Number, the output condition record (e.g. ZB00) may have ended up with the error status. This is not the case! No error is generated and ZB00 is simply ignored during the Output Determination Procedure.
I think the solution will be that once the user creates the Legal Document Number, the 'output determination procedure' is "re-initiated".
Since this time the Legal Document Number is present, the requirement attached to ZB00 is fulfilled and the record for ZB00 is written to the Nast Table and processed. This then leads to the generation of the E-Invoice.
The question is how to do this. Your further comments are appreciated.
Regards,
Shariar
2016 Jan 25 4:28 AM
Hello Shariar
Yes you can trigger the output type directly by using function module WFMC_MESSAGE_SINGLE for new message to be triggered via program of manual generation of legal document. You can call this FM inside the Legal program report directly.
thanks
Nabheet
2016 Jan 28 5:45 PM
Thank you for your reply! It has been food for though for several days now!
As our original requirement has been to include the Legal Document number in the Invoicing IDOC (Legal requirement) and as this number is only generated at a later time slot after the creation of the Billing Document, I am thinking of the following:
1 - Set up an condition record (e.g. for Output Type: ZB00) with Transmission Medium as "special function".
2 - The Special Function Points to a Z-Program that calls SAP standard function module for creating an event (e.g. SWE_EVENT_CREATE).
Note: A check is put in place to only create the event if the legal document number is present!!
3- The event is linked to the Function Module WFMC_SINGLE_MESSAGE responsible for processing the NAST Record.
4 - When creating the output condition record for ZB00, even though the Output Condition Record points to Z-Program (Step 1 above), the partner type in the Condition Record will be LS and Partner Number will be the Logical System in the ALE Distribution Model which is needed for the EDI Communication.
5- The dispatch time in the condition record is '1' and Not '4'.
The logic should then work as follow:
- When saving the billing document, the output condition record is saved in the NAST Table but NOT Processed, due to the dispatch time 1 as defined in step 5 above.
- A scheduled job at the end of the day runs to process the Output Type ZB00.
- The Z-Program attached to the ZB00 Output Type checks 1st to see if the Legal Document Number is present as this is a legal requirement. If not, it aborts the processing of the NAST Entry and proceeds to the next entry.
- If the legal Document Number is present it "creates" the Event which calls WFMC_SINGLE_MESSAGE Function.
- The above Function Module then does the actual Processing of the ZB00 record entry in NAST. It retrieves the Partner Number from the ZB00 condition record and creates and dispatches the INVOIC IDOC.
The above design should then make sure that INVOIC is only dispatched if the Legal Document Number is available, otherwise no IDOC is generated which is what we want.
Can you please let me have your thoughts on the above design?
It is much appreciated!
Regards,
Shariar
2016 Jan 28 10:32 PM
Didn't read the whole thing, but if it's a country wide legal requirement - isn't there a standard solution developed by SAP already? Have you checked the SAP notes?
I might be wrong but it suspiciously looks like you might be reinventing the bicycle here or doing some unnecessary customization...
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |