‎2008 Aug 18 7:51 PM
I have defined:
Data: objtxt like solisti1 occurs 0 with header line.
I want to concatenate two words with like ten spaces in between and move it to obtxt. How cam I do that ?
For ex:
Usserid......................z998iis
But when I use concatenate even with spaces in between it concatnates the two words. I can I maintains spaces between these words when concatenating and moving in the field
Regards,
Rajesh.
‎2008 Aug 18 8:00 PM
Here is one way.
Data: objtxt like solisti1 occurs 0 with header line.
CONCATENATE 'Userid' '##########' 'z998iis' into objtxt.
replace '##########' in objtxt with space.But you might want to also look into using HTML to format the output of your email. It would be easier than trying to line all this up. Here is an example of using HTML in your email body. In your case, you can use a <table> tag to set up some columns with the appropriate spacing.
report zrich_0002.
data: maildata like sodocchgi1.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
mailtxt = '<html>'.
append mailtxt.
mailtxt = '<body>'.
append mailtxt.
mailtxt
= '<a href="http:\\www.sap.com" target="_blank">SAP Hyperlink</a> '.
append mailtxt.
mailtxt = '</body>'.
append mailtxt.
mailtxt = '</html>'.
append mailtxt.
mailrec-receiver = 'putyourmailaddresshere'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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.Regards,
Rich Heilman
‎2008 Aug 18 7:54 PM
Try like this instead of the concatenate:
objtxt+0(20) = 'User ID'.
objtxt+20(12) = 'z998iis'.
Regards,
Naimesh Patel
‎2008 Aug 18 8:00 PM
Here is one way.
Data: objtxt like solisti1 occurs 0 with header line.
CONCATENATE 'Userid' '##########' 'z998iis' into objtxt.
replace '##########' in objtxt with space.But you might want to also look into using HTML to format the output of your email. It would be easier than trying to line all this up. Here is an example of using HTML in your email body. In your case, you can use a <table> tag to set up some columns with the appropriate spacing.
report zrich_0002.
data: maildata like sodocchgi1.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
mailtxt = '<html>'.
append mailtxt.
mailtxt = '<body>'.
append mailtxt.
mailtxt
= '<a href="http:\\www.sap.com" target="_blank">SAP Hyperlink</a> '.
append mailtxt.
mailtxt = '</body>'.
append mailtxt.
mailtxt = '</html>'.
append mailtxt.
mailrec-receiver = 'putyourmailaddresshere'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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.Regards,
Rich Heilman
‎2008 Aug 18 8:07 PM
Else try this way
types : begin of t1,
field1(10) type c,
field2(10) type c,
field3(10) type c.
types : end of t1.
data : wa_t1 type t1.
move 'User id' to wa_t1-field1.
move 'zxxxxxx' to wa_t1-field3.
move wa_t1 to objtxt.
a®
‎2008 Aug 18 8:08 PM
‎2008 Aug 18 8:16 PM
else try this way
data : field(30) type c.
concatenate 'test ' 'test1' into field respecting blanks.
a®