This website is not affiliated with, sponsored by, or approved by SAP AG.

Custom DME - No config

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Custom DME - No config

Postby PyroHiroshi » Tue Apr 29, 2014 4:16 am

A client is using TEMSE_SCHREIBEN to write data to the buffer for download through FDTA.

The problem is that the download results in trailing spaces or blanks in the file and the bank won't accept it.

TEMSE_SCHREIBEN requires a char field to be passed to it.

I've tried changing the DCP user-parameter to the different codepages but none appear to exclude trailing spaces. I thought at one point it was because of the Carriage Return and Linefeed character being at the end of the line that the codepage believes that spaces are not trailing so I put it in front (which meant I have a blank line at the top of the file - but just for a test) and the trailing spaces are still there.

If you go to FDTA and look at the file contents then it's clear that the trailing spaces (Here replaced with a # to indicate a null value) are not there.

I've tried using a string variable but that just crashes the program.

I'm thinking now, that the only way I'll be able to do this is but redefining a field symbol for every line.

Any suggestions?
PyroHiroshi
 
Posts: 2
Joined: Tue Apr 29, 2014 4:07 am

Re: Custom DME - No config

Postby PyroHiroshi » Tue Apr 29, 2014 4:37 am

I actually just got it working funny enough. I've been sitting with this problem for weeks.

The solution that I used was to dynamically create a character field for each string being passed. Here's the code snippet.

Code: Select all
      FIELD-SYMBOLS <cdata> TYPE ANY.
      DATA: l_len TYPE NUM03,
            r_cdata TYPE REF TO DATA.

      LOOP AT itab_string.
        lv_string = itab_string-file_data.
        SHIFT lv_string RIGHT deleting TRAILING space.
        SHIFT lv_string LEFT deleting LEADING space.
        CONCATENATE lv_string lv_cr lv_lf INTO lv_string.
        l_len = STRLEN( lv_string ).
        CREATE DATA r_cdata TYPE c LENGTH l_len.
        ASSIGN r_cdata->* TO <cdata>.
        <cdata> = lv_string.
        PERFORM temse_schreiben USING <cdata>.
      ENDLOOP.
PyroHiroshi
 
Posts: 2
Joined: Tue Apr 29, 2014 4:07 am

Re: Custom DME - No config

Postby Gothmog » Tue Apr 29, 2014 5:12 am

Couldn't you just pass the relevant characters, like this:
Code: Select all
      FIELD-SYMBOLS <cdata> TYPE ANY.
      DATA: l_len TYPE i.

      LOOP AT itab_string.
        lv_string = itab_string-file_data.
        SHIFT lv_string RIGHT deleting TRAILING space.
        SHIFT lv_string LEFT deleting LEADING space.
        CONCATENATE lv_string lv_cr lv_lf INTO lv_string.
        l_len = STRLEN( lv_string ).
        PERFORM temse_schreiben USING lv_string(l_len).
      ENDLOOP.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.