Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SCMS_TEXT_TO_BINARY only one column

former_member1379176
Participant
0 Kudos
1,103

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

1 ACCEPTED SOLUTION

Paulo_Vantini
Participant
0 Kudos
365

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.

4 REPLIES 4

Paulo_Vantini
Participant
0 Kudos
366

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.

0 Kudos
365

Thanks, but that won't work because lv_string is not type compatible with any internal table.

0 Kudos
365

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.

0 Kudos
365

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.