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: 

Urgently need Help

Former Member
0 Kudos

Hai all,

To send mail with csv format

i am using 'SO_NEW_DOCUMENT_ATT_SEND_API1' this function module , my problem is data is sending but format is not correct i mean in internal table there are 5 records it is displaying continuesly in first line, not going to second or third.. line.

please help me.

Naga

3 REPLIES 3

Former Member
0 Kudos

Hi Naga,

Whenever you are using the Function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send the email,you will have to use the offsets. You will have to divide the contents of your mail into different lines and append them inside a loop possibly.

For example:

************************************************************

*CONTENT OF THE EMAIL TO BE SENT

************************************************************

line1 = 'Please note that '.

line2 = wa_bdate-vorna.

line3 = wa_bdate-nachn.

line4 = ' will be 65 years on '.

line50(4) = wa_bdate-gbdat4(4).

date = line5+2(2).

month = line5+0(2).

year = wa_bdate-gbdat+0(4) + 65.

CONCATENATE date month year INTO line5 SEPARATED BY '.'.

line6 = '.Please complete the Retirement Procedure.'.

CONCATENATE line1 line2 line3 line4 line5 line6 INTO gwa_obj_cnt

SEPARATED BY space.

APPEND gwa_obj_cnt TO gi_obj_cnt.

CLEAR gwa_obj_cnt.

DESCRIBE TABLE gi_obj_cnt LINES entries.

READ TABLE gi_obj_cnt INDEX entries.

gwa_document_data-doc_size = ( entries - 1 ) * 255 + STRLEN( gi_obj_cnt

).

I hope I have tried to answer your query to the best of my knowledge.

If in case you need any further clarifications,Please let me know.

Regards,

Puneet Jhari.

Former Member
0 Kudos

Hi use the code like this

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

document_data = docdata

put_in_outbox = 'X'

commit_work = 'X'

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

tables

packing_list = objpack

object_header = objhead

contents_bin = objbin

contents_txt = objtxt

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

receivers = reclist

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

.

if sy-subrc <> 0.

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

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

endif.

commit work and wait .

thanks

vivekanand

Former Member
0 Kudos

Hi,

plz refer following code...

two internal tabeles defined it_main and it_tab.

it_tab only to get the data from internal table it_main and put the seperator in data..

CONSTANTS:

con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,

con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.

data: -


-


START-OF-SELECTION.

PERFORM data_retrieve.

form data_retrieve

LOOP AT it_tab INTO wa_tab.

CONCATENATE 'DATE' 'TIME' 'REQUEST'

'CLIENT' 'OWNER' 'IMPLEMENTER'

'SHORT TEXT' 'STATUS'

INTO wa_tab SEPARATED BY con_tab.

CONCATENATE con_cret wa_tab INTO wa_tab.

APPEND wa_tabTO it_tab.

endloop.

loop at------.

wa_main-request wa_main-client

wa_main-owner wa_main-implntr

wa_main-stxt wa_main-status

INTO wa_attach SEPARATED BY con_tab.

CONCATENATE con_cret wa_attach INTO wa_tab.

APPEND wa_tab TO it_tab.

endloop.

hope this code will help u..