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.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image