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

statement construction

Former Member
0 Likes
351

HI,

here i am converting the internal table to xstring and from xstring to table to enable my function module to take more than 255 char.

i am getting error at bolded statement.

all together is my idea is right to pass more than 255 char to fm SO_DOCUMENT_SEND_API1

DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,

t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,

t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,

t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,

t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,

w_cnt TYPE i,

w_sent_all(1) TYPE c,

w_doc_data LIKE sodocchgi1,

gd_error TYPE sy-subrc,

gd_reciever TYPE sy-subrc.

DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0

WITH HEADER LINE.

TYPES: Begin of it_attach,

field1(3000),

end of it_attach.

DATA : IT_XSTRING type XSTRING.

DATA : IT_TEXT type table of it_attach with header line.

DATA: contents_hex TYPE solix_tab with header line.

Form send_file_as_email_attachment.

CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'

IMPORTING

BUFFER = IT_XSTRING

TABLES

TEXT_TAB = IT_TEXT.

CALL FUNCTION 'SCMS_STRING_TO_FTEXT'

EXPORTING

TEXT = IT_XSTRING

TABLES

FTEXT_TAB = contents_hex.

<b>READ TABLE contents_hex INDEX w_cnt.

w_doc_data-doc_size =

( w_cnt - 1 ) * 255 + STRLEN( contents_hex ).</b>

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
317

try using cl_bcs class for email which is more flexible than the FM

check out this code sample using cl_bcs class

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a61...

Regards

Raja

1 REPLY 1
Read only

athavanraja
Active Contributor
0 Likes
318

try using cl_bcs class for email which is more flexible than the FM

check out this code sample using cl_bcs class

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a61...

Regards

Raja