You are on page 1of 5

Resolving the truncation of multi-byte characters in DMEE File

Overview: The document explains how to modify the output length of the lines in the file to handle the truncation of multi byte Chinese characters in DMEE output file. Target readers: Technical and functional consultants having knowledge of Data Medium Exchange Engine (DMEE). 1. Introduction DMEE stands for Data Medium Exchange Engine. A data medium exchange (DME) is a data exchange file which is used to send payment information of an enterprise to banks or tax authority. Basically these files contain financial data which can be in flat file or xml file format. Different File formats can be created for different countries and banks as per their requirement, which replaces conventional ABAP programs. DME engine provides various layouts and readymade way to create flat or XML files for external systems. It provides speed and flexibility over conventional ABAP programs. Files can be modified based on country and regulations. The system can trigger the creation of a DME file from the payment program. Tcode is: DMEE Configuration can be done through Tcode: FBZP

Click on pmnt methods in country. Then Inside you can find the details about country, payment method and Description.

Double click on relevant country and corresponding Name. It will lead to next screen. There in format, name of created DMEE tree can be given and as per the requirement Format Supplement is chosen as shown below:

Then double clicking on Format will lead to below screen. There Code page can be given as per country specific File format. As here code Page 8400 is chosen for Chinese (In F4 code page can be seen corresponding to Simplified Chinese).

Resolving the truncation of multi-byte characters in DMEE File


...Previous

2. Implementation of the logic to resolve the issue of truncation. Here we will look how can we handle the issue of truncation of multi byte characters (e.g. Chinese characters), which are appearing in DMEE output file. For this issue we can search a suitable BADI and there we can create our implementation and put the code as per requirement. Issue: While developing DMEE tree for china because of the presence of multi byte characters in the format. The length counted by the standard SAP is incorrect and results in the improper output file (truncation of last field in all lines). Solution:

BADI Defination name: DMEE_BADI_01 Method name: MODIFY_OUTPUT_FILE In respective Implementation give the name of DMEE tree in attributes and in Interface give IF_EX_DMEE_BADI_01. Now Logic can be put as follows: CLASS cl_abap_char_utilities DEFINITION LOAD. CONSTANTS: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal tab. IF flt_val = ' Give the name of DMEE tree created' (This is to put filter only one specific DMEE tree) LOOP AT c_output_tab INTO l_wa_tab. l_v_ind = sy-tabix.

In case multiple docs posted for same vendor or customer then only one record is generated by the DMEE tree summing all the amounts but Badi is called forever line resulting in increasing length every time, to avoid it the line length and imported length found in c_output_tab(if already modified) can be compared So to make it run only once for all the items. l_v_len1 = STRLEN (l_wa_tab-line). IF l_v_len1 = l_wa_tab-length. SPLIT l_wa_tab-line AT c_tab INTO l_v_tc l_v_no l_v_acc_no l_v_acc_num l_v_name l_v_bank l_v_exch l_v_purpose l_v_remark l_v_amt l_v_doc. IF sy-subrc = 0. l_v_len = STRLEN (l_v_name) + STRLEN (l_v_bank) + STRLEN (l_v_purpose). l_wa_tab-length = l_wa_tab-length + l_v_len. MODIFY c_output_tab FROM l_wa_tab INDEX l_v_ind TRANSPORTING length. ENDIF. ENDIF. ENDLOOP. ENDIF. ENDMETHOD.

This is how such issues can be countered successfully. 3. How to Debug: To debug DMEE, program can be very handy SAPFPAYM (Tcode FBPM). Below is the screen, here you need to give the inputs as shown below...

After this you can debug the DMEE program

You might also like