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

SO_DOCUMENT_SEND_API1

Former Member
0 Likes
560

Hi All,

I am trying to mail a report from spool as an HTML attachment. The report looks fine in spool. But in the attachment all the "ULINE' s are getting split into two lines. This happens only with ULINE 's . All other characters are appearing correctly. Also the problem is only in 4.7, this same mail attachment is working fine in 4.6c .Have any one come across such an issue? If so please help.

Regards,

Hari.

3 REPLIES 3
Read only

Former Member
Read only

Former Member
0 Likes
398

Hi,

Thanks for the reply. But i am already doing this. And i am getting the mail also(with the html attachment). But my problem is that the ulines are getting split into two lines. My report line size is 132, when i reduce that the lines are coming correctly. The funny part is that all other lines are coming correctly with line size 132. Only the "ULINES" have a problem. That too , the same attachment is working fine in 4.6c.The code i am using is as below.

report ZZTESTHKB.

PARAMETER: p_email1 LIKE somlreci1-receiver

obligatory.

start-of-selection.

new-page print on list name 'List' new-section line-size 132.

write: /50 'DISTRIBUTOR MANAGEMENT SYSTEM ',

117 'Time: ', sy-uzeit(2) no-gap,

':' no-gap, sy-uzeit+2(2) no-gap.

Uline /1(132) no-gap.

write: /' Quote/Line Nbr Part Number QTY',

50 'Ship Date', 68 'Resale Standard Special',

107 'Reduction Claim '.

write: /69 'Price Buy Price Buy Price',

107 'in Price Amount'.

  • Uline no-gap.

Uline /1(32).

new-page print off.

data: pl like sopcklsti1 occurs 0 with header line.

data: spool_number like TSP01-RQIDENT, doctyp like SOODK-OBJTP.

data: rep like soli occurs 0 with header line. "Email Error Report lines

data docdat like sodocchgi1.

spool_number = sy-spono.

CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'

EXPORTING

RQIDENT = spool_number

IMPORTING

REAL_TYPE = doctyp

TABLES

BUFFER = rep

EXCEPTIONS

NO_SUCH_JOB = 1

JOB_CONTAINS_NO_DATA = 2

SELECTION_EMPTY = 3

NO_PERMISSION = 4

CAN_NOT_ACCESS = 5

READ_ERROR = 6

TYPE_NO_MATCH = 7

OTHERS = 8.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • EMAIL Subject Line.

move 'S&D Credit Detail Report' to docdat-obj_descr.

pl-body_start = 1.

pl-body_num = 0.

pl-doc_type = 'RAW'.

pl-obj_descr = 'Att descrp fld'.

pl-transf_bin = ' '.

append pl.

DATA LC TYPE SY-TABIX.

data: receivers like somlreci1 occurs 0 with header line.

data: dum like soli occurs 0 with header line.

data: cont like soli occurs 0 with header line.

describe table rep lines lc.

  • the spool report attachment

move: 1 to pl-head_start,

0 to pl-head_num,

'X' to pl-transf_bin.

pl-body_start = 1.

pl-body_num = lc.

pl-doc_type = doctyp.

move: 'S&D Credit Detail Attach' to pl-obj_descr.

append pl.

move p_email1 to receivers-receiver.

search receivers-receiver for '@'.

if sy-subrc = 0.

move 'U' to receivers-rec_type. " An internet address.

else. move 'B' to receivers-rec_type. " An SAP Office address

endif.

append receivers.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

DOCUMENT_DATA = docdat

COMMIT_WORK = 'X' "0001

TABLES

PACKING_LIST = pl

OBJECT_HEADER = dum

CONTENTS_BIN = rep

CONTENTS_TXT = cont

RECEIVERS = receivers

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8.

submit rsconn01 with mode = 'INT' and return.

Regards,

Hari.

Read only

0 Likes
398

you might check OSS note ..

It seems in 4.7 there is an option for showing the mail text in SapScript Editor ( By default ) unlike 4.6C.

Not sure if that has any effect...

Cheers,

Ram