2014 May 02 7:22 PM
Hi Experts,
I am trying to convert an internal table to binary so I can email it. I am trying right now to use the FM SCMS_TEXT_TO_BINARY, but it only outputs the first column, regardless of the internal table structure or its contents. Is there something about the parameters that needs to be a certain way, or is there a newer and/ or better way to do this. I need to be able to convert any internal table to binary to email as an excel attachment using CL_BCS methods.
Thanks,
Zack
2014 May 02 7:57 PM
Hi Zack,
try using method string_to_solix from class cl_bcs_convert, pass the internal table as the lv_string parameter. For more information check out he example bcs_example_7.
Regards.
2014 May 02 7:57 PM
Hi Zack,
try using method string_to_solix from class cl_bcs_convert, pass the internal table as the lv_string parameter. For more information check out he example bcs_example_7.
Regards.
2014 May 02 9:08 PM
Thanks, but that won't work because lv_string is not type compatible with any internal table.
2014 May 02 9:30 PM
Zack,
it is possible to manually loop the internal table to a work area and concatenate the entries into the lv_string parameter. When you want a new line you have to use cl_bcs_convert=>gc_crlf and when you want a new column you have to use command cl_bcs_convert=>gc_tab.
you can define constants for those commands and then use it to build.
Example:
CONCATENATE v_lstring text-015 c_new_column
text-016 c_new_column
c_new_line INTO v_lstring.
CONCATENATE v_lstring wa_x-z c_new_column
wa_x-y c_new_column
c_new_line INTO v_lstring.
Hope that helps.
2014 May 05 4:44 PM
Got it,thanks. Before I had posted I had tried converting the to string and then passing it to method cl_bcs_convert=>string_to_solix but was obviously having trouble in the output due to the need for the constants for setting each row and column.