Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Good day!

Let's talk about Note 2372704, 2381903 - Romania, LC 394 declaration October 2016 Reporting

What is the purpose of ODN? I presume the answer is: ‘None knows(exactly) or none told us(exactly)’ Probably we are just the followers of what we have been told to do. We all know that in time community solves most things. And what times can't solve, you have to solve yourself and share it.
Technical postulate: ODN is designed to generate from SNRO object OFN_YR depending on  BKPF-BLART a sequential number which is stored in BKPF-XBLNR_ALT.
Further report SE38: /CEECV/ROFI_394_2016 (short RODN) generates XML file, where BKPF-XBLNR_ALT is provided in discrete intervals in segment serieFacturi. In generated XML file by RODN in segment serieFacturi for tip = 2 last number of interval NrF = BKPF-XBLNR_ALT and first number of interval NrI = BKPF-XBLNR_ALT. According to note 2381903, in RODN when BKPF-XBLNR_ALT is null you may choose to fill in generated XML file in segment serieFacturi this way NrF = BKPF-BELNR. XML file screen capture is provided in ODN XML blog here.

Let's move forward. To understand how it works you need enhanced tools.
Are you interested in? I will assume your answer is "yes".
How is this done?

  • If BKPF documents are already created one must use SE38: /CEECV/ROFI_ODN_GENERATOR (short PODN). The selection screen is very simple with a simple output. The logic of BKPF-BLART, ODN customizing and generation of BKPF-XBLNR_ALT is done by the core functionality SE37: /CEECV/ROFI_GENERATE_ODN (short FODN).

  • New created BKPF documents from any module: FI, SD, MM, etc get a generated number in BKPF-XBLNR_ALT using the same FODN.

How should look an enhanced ODN report?

  • It should have more flexible selections: document number, posting date.

  • It should have more functions to fill XBLNR_ALT: fill with BKPF-AWKEY or bypassing BLART by indicating Number group (V_1ANUMGR1) in selection screen.

The code of enhanced report PODN (ZPODN: Z_CEECV_ROFI_ODN_GENERATOR) and short instructions are provided here.

Finally, if you lucky and all sales invoices are created only with tcode VF01 and on printed invoices the number of invoice is VBRK-VBELN, then probably it is not required any customizing of SNRO. Probably all you have to do for already posted and printed invoices is to assign BKPF-XBLNR_ALT = BKPF-AWKEY where BKPF-AWTYP equal ‘VBRK’.  How to do this? You have to execute ZPODN with solution /S2.

Probably you still have special cases to deal with such as Cancellations and Reversals. Therefore when customizing of SM30: /CEECV/ROFI_TIPF is not enough, you can handle exceptions with a custom SM30: ZBKPF_TIPF and a custom SE38: Z_CEECV_ROFI_394_2016, a modified copy of /CEECV/ROFI_394_2016. Files are provided here.

Let's move forward, because life is not as simple as issuing law after law each month. What if VBRK documents create BKPF documents only with BKPF-BLART = 'RV' and one have to use more SNRO intervals of object OFN_YR based one some complex criteria (more then BKPF-BLART)?
You have to clone in SM30:V_T003 additional dummy  BLART = {'R1','R2','R3'} from RV and do all customizing for ODN. Then with enhanced report run solution  / S3.
What about generating a specific ODN of {R1','R2','R3'} during creation of VBRK (tcode: VF01) based on complex criteria?

  • You have to find a way to pass to FODN expression IV_BKPF-BLART = 'R1'.  To do that you have to create an enhancement at the beginning of FODN, Menu: Edit/Enhancement Operations/Create Enhancement.

  • All the calculations may be done with a substitution (Tcode: OBBH), Call point = 1 (Document header). To access VBRK use (SAPMV60A)XVBRK[], for VBRP use (SAPMV60A)XVBRP[].

  • The result of all calculations in substitution may be stored for instance in BKPF-XREF1_HD = 'R1'. Then in enhancement of FODN make it work IV_BKPF-BLART = BKPF-XREF1_HD.

Remember, tools are provided only to play with them in test system, therefore in production system you have to use standard solution.

To browse and modify XML you may use free tool from Microsoft:

Do you have now a better understanding of ODN and more ideas? Share them.

Enjoy it!
Sergiu Iatco
Labels in this area