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: 
Read only

merging cells

Former Member
0 Likes
651

Hi,

i am writing email application which sends mail to the distribution list as xls attachment.

i have got more than 255 row length so made my line chunks of 255 and then passing to so_api1 fm.

i am able to get the output with row length more than 255. but merging two cells here. i mean in my code text-015 and text-016 are coming in single cell.

How to overcome this?

FORM build_xls_data_table .

class cl_abap_char_utilities definition load.

constants:

con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,

con_cret type c value cl_abap_char_utilities=>CR_LF.

CLEAR it_attach.

CONCATENATE text-006 text-018 text-007 text-008 text-009 text-010

text-011 text-012 text-013 text-020 text-014 text-015

into it_attach

SEPARATED BY con_tab.

CONCATENATE con_cret it_attach INTO it_attach.

APPEND it_attach.

CONCATENATE text-016 text-017 text-019 text-021 text-022 text-023

text-024 text-025 text-026

into it_attach

SEPARATED By con_tab.

APPEND it_attach.

5 REPLIES 5
Read only

Former Member
0 Likes
590

Hi Nihi,

Try these two codes:

1) CLEAR it_attach.

CONCATENATE text-006 text-018 text-007 text-008 text-009 text-010

text-011 text-012 text-013 text-020 text-014 text-015

into it_attach

SEPARATED BY con_tab.

CONCATENATE con_cret it_attach INTO it_attach.

APPEND it_attach.

CLEAR: it_attach.

CONCATENATE text-016 text-017 text-019 text-021 text-022 text-023

text-024 text-025 text-026

into it_attach

SEPARATED By con_tab.

APPEND it_attach.

2) If above code does not work then ti amy be coming due to following code:

CONCATENATE con_cret it_attach INTO it_attach.

Just comment it or try using this also in second code before appending text-016 inot table.

Ashven

Read only

0 Likes
590

i tried all options. but no use.

any other suggestions!

if i use CONCATENATE con_cret it_attach INTO it_attach in second line this line will be treated as separate line in my out put. so, itz of no use.

Read only

0 Likes
590

Hi Nihi,

I dont know how..Cos I made an excel sheet and sent in the same manner and send the excel sheet as an attachment in one of my object..

If nothing is working out..

Lets try to put a Piping symbol '|' to represent as the end of row symbol. And concatenate at the end of text-015.

Try this out and see it works or not.

Thanks,

Mayank

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
590

Hi,

Just check the below code.

CLEAR it_attach.

CONCATENATE text-006 text-018 text-007 text-008 text-009 text-010

text-011 text-012 text-013 text-020 text-014 text-015 <b>space</b>

into it_attach

SEPARATED BY con_tab.

CONCATENATE con_cret it_attach INTO it_attach.

APPEND it_attach.

CONCATENATE text-016 text-017 text-019 text-021 text-022 text-023

text-024 text-025 text-026

into it_attach

SEPARATED By con_tab.

APPEND it_attach.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
590

Hi,

If your program is not unicode checked[program attributes,unicode active is not checked],you can use the follg.

CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode

con_tab TYPE x VALUE '09'. "OK for non Unicode

If your program is unicode active,

class cl_abap_char_utilities definition load.

constants:

con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,

con_cret type c value cl_abap_char_utilities=>CR_LF.

CONCATENATE text-006 text-018 text-007 text-008 text-009 text-010

text-011 text-012 text-013 text-020 text-014 text-015

into it_attach

SEPARATED BY con_tab.

CONCATENATE con_cret it_attach INTO it_attach.

APPEND it_attach.

CONCATENATE text-016 text-017 text-019 text-021 text-022 text-023

text-024 text-025 text-026

into it_attach

SEPARATED By con_tab.

<b>CONCATENATE con_cret it_attach INTO it_attach.</b>

APPEND it_attach.

Check this link.

http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm

Jayanthi Jayaraman