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_NEW_DOCUMENT_SEND_API1 with standard text

Former Member
0 Likes
1,061

Hi,

I'm trying to use FM SO_NEW_DOCUMENT_SEND_API1 to send an email. This works fine. What I would like to do is use standard text defined in SO10 for the body of the email. This way the email wording can be changed by the business without transports. The problem I have is the FM does not convert the SO10 standard text formatting. IE in the email body the text appears as in the SO10 editor with formatting - example:

  • ,,<CB>How to reprint your statement after it is ...

I would like the text to be converted as when you use Print preview to display the standard text - and don't loose formatting like Bold etc.

I have tried various combinations for call FM SO_NEW_DOCUMENT_SEND_API1 but no luck.

Please help.

thx

Carel

Hi,

I'm trying to use FM SO_NEW_DOCUMENT_SEND_API1 to send an email. This works fine. What I would like to do is use standard text defined in SO10 for the body of the email. This way the email wording can be changed by the business without transports. The problem I have is the FM does not convert the SO10 standard text formatting. IE in the email body the text appears as in the SO10 editor with formatting - example:

  • ,,<CB>How to reprint your statement after it is ...

I would like the text to be converted as when you use Print preview to display the standard text - and don't loose formatting like Bold etc.

I have tried various combinations for call FM SO_NEW_DOCUMENT_SEND_API1 but no luck.

Please help.

thx

Carel

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
923

Hi,

If you are using READ_TEXT to get the standard text in LINES internal (table tab) that contains all print and special characters. You need to find these special characters thru programatically and replace with space.

I don't find any other function module to remove these special characters.

May be the following code will help you

gc_spl(20) type c value '!@#$%....'

if string CA gc_spl.

string+0(sy-fdpos) = space.

endif.

Read only

0 Likes
923

Thanks for that idea but the point is NOT to loose the formatting. Just as SAP converts the standard text formatting using the style assigned to this standard text in print preview, I want to keep (convert) the sapscript format of (tline) to rtf or similar that is compatible with email. I thought that th FM SO_NEW_DOCUMENT_SEND_API1 handles these convertions but are unable to get it set up properly.

Read only

0 Likes
923

Hi,

May be try with class CL_BCS


    document = cl_document_bcs=>create_document(
                                  i_type    = 'RAW'
                                  i_text    = text
                                  i_length  = '11'
                                  i_subject = 'attachment...' ).

Here under create_document method parametr I_TYPE have the following values


ALI   ABAP list document
ARC   Archive object (image)
BCS   External Document Storage
BIN   Binary document
DLI   Distribution list
EXT   PC document    "<<<<<<<<
FAX   Fax
FOL   Folder
GRA   SAP Business Graphics
OBJ   Business object
OFO   Object folder
OTF   OTF document   "<<<<<<<<
R3I   IDoc
RAW   SAP editor document
SCR   SAPscript document
URL   Link to Internet/Intranet
WIM   Work item
XXL   Document for list viewer

But i am not 100% sure aboute this

Read only

0 Likes
923

The FM have the same parameter as this called - DOCUMENT_TYPE. It has the same list of input values as you listed in your reply. Hence I still think that the FM can do this convertion but I am missing something when call the FM.