Creating Email Content Using SO10 Objects And Text Symbols

Transcription

Creating Email Content UsingSO10 Objects and Text SymbolsApplies to:SAP ECC 6.0. For more information, visit the ABAP homepage.SummaryThe article describes the benefits of SO10 objects in comparison to text symbols.Author:Bijal ParmarCompany: Larsen & Toubro Infotech LimitedCreated on: 9 September 2009Author BioBijal Parmar is a Software Consultant in Larsen & Toubro Infotech Limited. She has threeyears of SAP experience. She has worked extensively in ABAP, APO, Workflow and VisualComposer.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com1

Creating Email Content Using SO10 Objects and Text SymbolsTable of ContentsOverview. 3Text Symbols . 3SO10 . 4Create the SO10 Object. 5Reading the SO10 Object . 7Advantages of SO10 objects . 9Transport Requests of SO10 objects . 10Summary . 12Related Content . 13Copyright . 13SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com2

Creating Email Content Using SO10 Objects and Text SymbolsOverviewThe article describes the benefits of using the SO10 objects.Mostly, we tend to use text symbols for the following Business Scenarios:1. Display Messages to user2. Send Emails from the program.The text of message or email content is stored in text symbols. The body of the email is coded using the textsymbols or SO10 objects.Advantage is: It prevents hard coding of text in the code.Maintain text at a central locationPrograms can be made language independentTranslations can be maintained for the target languagesText Symbols Text Symbols can be created in all programs.A text symbol is a named data object that is generated when you start the program from the texts inthe text pool of the ABAP program. It always has the data type C. Its field length is that of the text inthe text pool.Text symbols, along with the program title, list headings, and selection texts, belong to the textelements of a program. Text elements allow you to create language-independent programs. Any textthat the program sends to the screen can be stored as a text element in a text pool. Different textpools can be created for different languages. When a text element is changed or translated, there isno need to change the actual program code. Text elements in an ABAP program are stored in theABAP EditorThe text symbol can be created as below.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com3

Creating Email Content Using SO10 Objects and Text Symbols Note: The maximum length can be set to 132 characters only.For creating the email content, we concatenate the text symbols and fill the internal table to emailsending function module.SO10 Using transaction SO10, we can create objects to maintain texts.Unlike text symbols, SO10 objects do not have a maximum length defined. Hence it is possible tomaintain text in form of paragraphs too.When sending emails programmatically, there is a need to create the email content. The emailcontent must be language independent. Hence it is recommended to avoid using hard coding in thecode.Based on the login language the email must be sent in the same language.For example:Dear Supplier – EnglishSehr geehrter Lieferant – GermanSAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com4

Creating Email Content Using SO10 Objects and Text SymbolsCreate the SO10 Object Go to transaction SO10. Enter text name and language. Maintain Text in English.Enter Email Text and Save it Go to transaction SO10. Enter text name and language. Maintain Text in GermanSAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com5

Creating Email Content Using SO10 Objects and Text Symbols.Enter Email Text and Save it Thus we have created the SO10 objects. Thus the entire email content can be maintained here.Note: When you save it, no transport request is created. We have to create a Transport request for itseparately. This method is covered in later sections.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com6

Creating Email Content Using SO10 Objects and Text SymbolsReading the SO10 ObjectOnce you have created the SO10 object, we can call it in the program using the function module“READ TEXT”.Input is:ID: ST - Standard textLANGUAGE: User login languageNAME: SO10 object nameOBJECT: TEXTOutput: The lines table is populated with text.Pass this text to the internal table of Email sending function module.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com7

Creating Email Content Using SO10 Objects and Text SymbolsSAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com8

Creating Email Content Using SO10 Objects and Text SymbolsAdvantages of SO10 objectsSO10 is a preferred option as compared to text symbols Large amount of text can be stored in SO10 objects.The SO10 objects can be maintained in required languages easily.SO10 objects are easy to maintain. Since they can be separately modified using the SO10transactions.Text elements may disturb the formatting of email text when language changes.When Language is Chinese the spacing between words must be maintained properly. Incase we usetext symbols and try to concatenate two words separating single space. The same when convertedto Chinese is difficult to read.For example, When the language is EnglishDear Sir,The Purchase Order is created in the system. Please take necessary actionThanks and Regards,Supplier Portal When the language is 问,供应商门户SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com9

Creating Email Content Using SO10 Objects and Text SymbolsTransport Requests of SO10 objects When you save the SO10 objects, no transport request is created.We have to create a Transport request for it separately. This method is is described belowGo to SE10, Click on createCreate Workbench requestGive Short descriptionSAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com10

Creating Email Content Using SO10 Objects and Text SymbolsA Transport request number is generated- Main Request and it contains a sub task.Click on sub task, and then go to Request/Task in Menu- Change typeSelect Development/CorrectionSAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com11

Creating Email Content Using SO10 Objects and Text SymbolsNow, double click on Main Request, Add the entry as given below.SummaryThus, we have understood the SO10 transaction. The benefits of using the SO10 objects and also theprocess of creating transport requests for it.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com12

Creating Email Content Using SO10 Objects and Text SymbolsRelated Long Textshttp://help.sap.com/saphelp /frameset.htmFor more information, visit the ABAP homepage.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com13

Creating Email Content Using SO10 Objects and Text SymbolsDisclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.SAP COMMUNITY NETWORK 2009 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BOC - boc.sap.com14

Creating Email Content Using SO10 Objects and Text Symbols Applies to: SAP ECC 6.0. For more information, visit the ABAP homepage. Summary The article describes the benefits of SO10 objects in comparison to text symbols. Author: Bijal Parmar Company: Larsen & Toubro Infotech Limited Created on: 9 September 2009 Author Bio Bijal Parmar is a Software Consultant in Larsen & Toubro Infotech .