简体   繁体   English

在 SAP 中下载文件时不要修剪

[英]Don't trim when downloading file in SAP

SAP has trim for downloaded files but I need to add spaces at the end of the string and download the file with these spaces. SAP 对下载的文件进行了修剪,但我需要在字符串的末尾添加空格并使用这些空格下载文件。

I tried to add dash character at the end of the string and then translate the dash characters with space.我试图在字符串的末尾添加破折号,然后用空格翻译破折号。

My code block is;我的代码块是;

gt_data-line = 'XXX'.
lv_basamak = STRLEN( gt_data-line ).  "result : 3

CONCATENATE gt_data-line '------' INTO gt_data-line RESPECTING BLANKS. 
TRANSLATE gt_data-line USING '- '.

lv_basamak = STRLEN( gt_data-line ).  "result : 9

But when I download the file there is not any space at the end of the string.但是当我下载文件时,字符串末尾没有任何空格。

What can I do for adding spaces?我可以做什么来添加空格?

Look into the class CL_GUI_FRONTEND_SERVICES with method GUI_DOWNLOAD .使用方法GUI_DOWNLOAD查看CL_GUI_FRONTEND_SERVICES类。 Convert your content to a binary string ( convert to xstring or table of xstring ) and download as binary ( filetype = 'BIN' ).将您的内容转换为二进制字符串(转换为 xstring 或 xstring 表)并下载为二进制文件( filetype = 'BIN' )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM