Application Development 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: 

help for using FM SO_NEW_DOCUMENT_ATT_SEND_API1

Former Member
0 Kudos

hi ,...

i need help in putting a new line in the attachment which can be sent by using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.

for a quick reference please check out program:RSSOAPIS

and let me know as to how can i add a new line in the attach file

2 REPLIES 2

anversha_s
Active Contributor
0 Kudos

hi,

chk this sample.

chk this code

DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.

DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.

DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.

DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.

DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.

DATA: doc_chng LIKE sodocchgi1.

&----


*& Form f_send_mail

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_send_mail .

*store the vendor name, vendor email id , employee name and employee

*email id in the internal table int_crb

  • Creation of the document to be sent

CLEAR doc_chng.

REFRESH objpack.

REFRESH objhead.

REFRESH reclist.

REFRESH objtxt.

  • File Name

doc_chng-obj_name = 'SHIPMENT'.

  • Mail Subject

CONCATENATE 'Shipment Document No.' int_crb_mail-shipdocnum

'Cleared.'

INTO doc_chng-obj_descr SEPARATED BY ' '.

<b>* Mail Contents

objtxt-line = 'Hi,'.

APPEND objtxt.

objtxt-line = ' '.

APPEND objtxt.

CONCATENATE 'Shipment Document Number ' int_crb_mail-shipdocnum

' cleared for move.' INTO objtxt-line SEPARATED BY ' '.

APPEND objtxt.

objtxt-line = ' '.

APPEND objtxt.

CLEAR objtxt.

objtxt-line = 'Regards '.

APPEND objtxt.

objtxt-line = ' '.

APPEND objtxt.

objtxt-line = 'SAP '.

APPEND objtxt.

CLEAR objtxt.

APPEND objtxt.

DESCRIBE TABLE objtxt LINES tab_lines.

READ TABLE objtxt INDEX tab_lines.

doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(

objtxt ).

  • Creation of the entry for the compressed document

CLEAR objpack-transf_bin.

objpack-head_start = 1.

objpack-head_num = 0.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'RAW'.

APPEND objpack.</b>

  • Completing the recipient list

  • target recipent

CLEAR reclist.

reclist-receiver = int_crb_mail-empperid. "employee email ID

"wf_empperid.

reclist-express = 'X'.

reclist-rec_type = 'U'.

APPEND reclist.

  • copy recipents

CLEAR reclist.

reclist-receiver = int_crb_mail-smtp_addr."vendor email id

reclist-express = 'X'.

reclist-rec_type = 'U'.

reclist-copy = 'X'.

APPEND reclist.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = doc_chng

TABLES

packing_list = objpack

object_header = objhead

  • contents_bin = objbin

contents_txt = objtxt

receivers = reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

COMMIT WORK.

SUBMIT rsconn01

WITH mode = 'INT'

WITH output = ' '

AND RETURN.

ENDFORM. " f_send_mail

regards,

anversha.

if hlped mark points

Former Member
0 Kudos

Hi,

Check internal table objtxt .It contains data .You can add new line by appending in the same internal table.

Thanks.

Mark points if helpful.