SOLMAN – Mail Forms Custom Enhancement Guide

How to add new fields in Mail Forms?

SOLMAN is an extremely strong framework. Many group use it for documentation and venture arranging. Numerous client use it for transport and change the executives framework as well. In one of our past articles, we told the best way to make a custom Fiori Application for change the board in SOLMAN. SOLMAN – Mail Forms Custom Enhancement Guide.

Today, we will investigate the Mail Structures which is utilized in the episode the executives region. In this instructional exercise, SOLMAN – Mail Forms Custom Enhancement Guide, we will figure out how to add another uniquely documented in MailForm Trait classification for Quality setting.

What are Mail Forms? SOLMAN – Mail Forms Custom Enhancement Guide..

Allow me to attempt to make sense of it in as straightforward sentences as could be expected. In SOLMAN framework we make Episode or Ticket for the client demands. Whenever occurrence is made or changed in the framework there is a programmed mail that will be set off. This notice is finished with the assistance of mail structures.

Who gets the mail from SOLMAN? (SOLMAN – Mail Forms Custom Enhancement Guide)

All the stakeholders of the particular incident/ticket are supposed to receive the mail. In short the below users receive the mail:

  1. Message processor
  2. Contact person
  3. Reported by

What is the t-code to create Incident in SOLMAN?

SM_CRM is the exchange utilized for making Occurrences.

Contingent upon the SOLMAN settings, SM_CRM Arrangement Supervisor IT Administration The board will open in SAP GUI meeting or it will open in discrete page connect in web pioneer (chrome or other default internet browsers).

Once the incident is created, it would look like below.

Mail will be delivered to concern person or team.

Example of a real mail for the generated incident.

Mail will be set off in above design.

In any case, clients are an alternate variety of human. They would as a rule be not happy with what the standard SAP give. For our situation, the business necessity was to have arrangement to send Long Message Log with the verifiable refreshed toward the finish of the mail.

Specialists all through the world flourish due to improvement and customization demands like this. We want to thank our clients for such learning and working open doors. . I’m not kidding around.

An example log of the episode.

However, arrangement isn’t straight forward.

For ABAP designers, the sky is the limit. You put a necessity, you would get an answer. In some cases the plan is enhanced and smooth while on occasion the engineers take a filthy course to meet the business need.

For our situation, we can accomplished this by utilizing Mail Structures with some ABAP improvements.

Accepting, we have finished our improvement. The occurrence alarms after complete of the change would like beneath with expansion of Text log (Long portrayal).

Have patience.  I will show you step by step, how to enhance the Mail Forms in SOLMAN.

Step 1

For our model, the custom field is added for Characteristic Setting “Administration Solicitation Ascribes”.

This Assistance Solicitation Ascribes utilizes administrations Quality Classification “SRQ Standard Credits”.

SRQ Standard Credits thusly utilizes the standard construction “CRMS_SRQM_GEN_FIELDS”.

In the design CRMS_SRQM_GEN_FIELDS, add the expected fields utilizing add structure.

We made the attach structure ZZCRM_SRQM_TEXT_LOG with area ZSTRING and information type String to acknowledge long text values.

Step 2

Once the required field is added to the structure CRMS_SRQM_GEN_FIELDS, go to the t-code SM_CRM.

In the left panel, click on Service Operations (highlighted above).

Now click on Mail Forms and Search for Mail Form ID.

For our case, we are accomplishing for Z_MESSAGE_PROCESSOR. Select the Mail Structure ID you need to improve.

Presently we want to add the custom field at the necessary spot. To add the new spot holder, click on Property as displayed beneath.

In the following screen look for our field, yet here we can’t track down specialized name. We really want to look through in view of the portrayal we provided for the information component. For us the field mark is “Text Log”.

Select the field with Text Log and snap on Supplement button.

Place the new field at the ideal situation as shown beneath.

Step 3

The construction and position of new field is finished. Presently we really want to execute the BADI: “CRM_IM_ADD_DATA_BADI”. This BADI works for Keep up with Extra Credits for Mail Structures Characteristic Settings. It is channel subordinate, so we really want to choose required Property Setting and Type.

In the Property Setting select Assistance Solicitation and Type SQM.

Execute the BADI.

In the strategy CRM_IM_BPSELE, We want to compose our rationale to change the qualities to populate long text values for Text Log.

Fundamentally, we want to change the inward table CT_ATT_VALUES. This interior table have two fields:

  • Name (which holds the names of the additional field via the Post office Structures id).
  • Esteem (which holds the upsides of the fields).

We really want to adjust this table just for the CTT_ATT_VALUES-NAME = “CRMS_SRQM_GEN_FIELDS-ZZTEXT_LOG”.

Then alter the CTT_ATT_VALUES-VALUES = “with regarded required data”.

As may be obvious, field Worth Information Type is STRING, this is the explanation while making custom field for Text Log we have involved String as Information Type. You may be enticed to utilize roast 255 and it could work. However, you actually risk shortening the characters assuming they surpass.

Since Text Logs are free texts, it is the most secure wagered to utilize STRING.

How to modify internal table CT_ATT_VALUES?

We want to Circle at CT_ATT_VALUES. As referenced before, we really want to change just for the TEXT LOG field “CRMS_SRQM_GEN_FIELDS-ZZTEXT_LOG”.

Underneath code bit can be utilized for reference.

Throughout the entire the Text (Text Log subtleties) we have perused utilizing FM “CRM_DNO_READ_ORDER_TEXT”.

We really want to pass GUID of the Item id (only Occurrence number).

We can get GUID from table TABLE: CRMD_ORDERADM_H

Then loop at LT_ALLTEXTS (which holds the long text).

Here we have added Text Log just for SU01 (Answer), SU99 (Depiction), SUSO (Arrangement). You might investigate and check what different codes you might get for the Text Log.

To peruse the text we really want to utilize the amazingly popular FM”READ_TEXT” and pass Text ID, Language, Name, Item.

These values are readily available in LT_ALLTEXTS.
LT_ALLTEXTS-STXH-TDID
LT_ALLTEXTS-STXH-TDNAME,
Object will be CRM_ORDERH.
Language you know. 

Recover the Text Id depiction from table TTXIT

For Text ID portrayal kindly check underneath screen shot.

Circle the LT_LINE recovered from READ_TEXT FM and alter the CT_ATT_VALUES-Worth.

At the point when we use string all values will be imprinted in single line like underneath.

In any case, you don’t need a grouped passage. You need space and great organization.

How to format the string values?

To stay away from this, we utilize the order Connect and Isolated BY CL_ABAP_CHAR_UTILITIES=>CR_LF. Don’t bother referencing, this order makes new line (it is like return, enter key).

After using CL_ABAP_CHAR_UTILITIES=>CR_LF, the paragraph looks better.

Complete Code:

METHOD if_ex_crm_im_add_data_badi~crm_im_bpsele.
   DATA : lt_alltexts TYPE comt_text_textdata_t.
    DATA : lv_id     TYPE thead-tdid,
          lv_lang   TYPE  thead-tdspras VALUE 'EN',
          lv_name   TYPE thead-tdname,
          lv_object TYPE  thead-tdobject VALUE 'CRM_ORDERH',
          lt_line   TYPE TABLE OF tline, 
          lv_string TYPE string,
          lv_string2 TYPE string,
          lv_string3 TYPE string.
 
 *--> loop the ct_att_values will have all the fields whhich described in mailforms
     LOOP AT ct_att_values ASSIGNING FIELD-SYMBOL(<line>).
 **** change the value for the long text(CRMS_SRQM_GEN_FIELDS-ZZTEXT_LOG) field and modify the values with required data ****
       CASE <line>-name.
         WHEN 'CRMS_SRQM_GEN_FIELDS-ZZTEXT_LOG'.
 
 *--> Get the HEADER GUID from table CRMD_ORDERADM_H based on CRMS_SRQM_GEN_FIELDS-CRM_SRQM_NUMBER(OBJECT ID)
      READ TABLE ct_att_values INTO DATA(ls_att_value) WITH KEY name = 'CRMS_SRQM_GEN_FIELDS-CRM_SRQM_NUMBER'.
      IF sy-subrc = 0.
      SELECT SINGLE guid FROM crmd_orderadm_h INTO @DATA(lv_guid)
       WHERE object_id = @ls_att_value-value.
 
 *--> get the order text id from FM
      CALL FUNCTION 'CRM_DNO_READ_ORDER_TEXT'
        EXPORTING
         iv_header_guid          = lv_guid
       IMPORTING
         et_alltexts             = lt_alltexts.
 *--> LT_ALLTEXT will contain all the text ids which maintained in incident
      LOOP AT lt_alltexts ASSIGNING FIELD-SYMBOL(<fs_alltexts>).
 *--> Add text ids values only for the SU01(REPLY) SU99(DESCRIPTION) SUSO(SOLUTION)
       IF <fs_alltexts>-stxh-tdid = 'SU01' OR <fs_alltexts>-stxh-tdid = 'SU99' OR <fs_alltexts>-stxh-tdid = 'SUSO'.
 
        lv_id   = <fs_alltexts>-stxh-tdid.
        lv_name = <fs_alltexts>-stxh-tdname.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            client                        = sy-mandt
            id                            = lv_id
            language                      = lv_lang
            name                          = lv_name
            object                        = lv_object
          TABLES
            lines                         = lt_line
         EXCEPTIONS
           id                            = 1
           language                      = 2
           name                          = 3
           not_found                     = 4
           object                        = 5
           reference_check               = 6
           wrong_access_to_archive       = 7
           OTHERS                        = 8.
        IF sy-subrc <> 0.
 * Implement suitable error handling here
        ENDIF.
 *--> Get the Text ID description from TTXIT tables
        SELECT SINGLE tdtext FROM ttxit INTO @DATA(lv_desc)
         WHERE tdspras  = @lv_lang
           AND tdobject = @lv_object
           AND tdid     = @<fs_alltexts>-stxh-tdid.
 
 *--> Date
        CONCATENATE <fs_alltexts>-stxh-tdfdate+6(2) <fs_alltexts>-stxh-tdfdate+4(2) <fs_alltexts>-stxh-tdfdate+0(4)
                    INTO DATA(lv_date) SEPARATED BY '.'.
 *--> Time
        CONCATENATE <fs_alltexts>-stxh-tdftime+0(2) <fs_alltexts>-stxh-tdftime+2(2) <fs_alltexts>-stxh-tdftime+4(2)
                    INTO DATA(lv_time) SEPARATED BY ':'.
 *--> Date Time User
        CONCATENATE lv_date lv_time <fs_alltexts>-stxh-tdfuser
                    INTO DATA(lv_date_user) SEPARATED BY space.
 
        CONCATENATE lv_desc lv_date_user INTO lv_string SEPARATED BY cl_abap_char_utilities=>cr_lf.
        LOOP AT lt_line INTO DATA(ls_line).
          CONCATENATE lv_string2 ls_line-tdline INTO lv_string2 SEPARATED BY cl_abap_char_utilities=>cr_lf.
        ENDLOOP.
        CONCATENATE <line>-value lv_string lv_string2 INTO <line>-value SEPARATED BY cl_abap_char_utilities=>cr_lf.
        lv_string3 = '------------------------------------------------------------------------------------------------------'.
        CONCATENATE <line>-value lv_string3 INTO <line>-value SEPARATED BY cl_abap_char_utilities=>cr_lf.
 
        REFRESH lt_line.
        CLEAR : lv_string, lv_string2, lv_string3, ls_line, lv_desc, lv_id,
                lv_name, lv_date_user, lv_string2, lv_date, lv_time.
        ENDIF.
       ENDLOOP. 
      ENDIF.
        ENDCASE. 
     ENDLOOP. 
   ENDMETHOD.

That is all there is to it. You are finished. Presently request that you entrepreneur make the occurrence and get the Message Sign in the email. Advise them to send an appreciation mail for you to your detailing administrator. Remember to exhibit this improvement in your quarterly execution audit meeting with your supervisor. This improvement isn’t no problem. Truly.

On a serious note, I needed to work a few late evenings to make it happen. It could look basic currently in the wake of going through this article. In any case, accept me, it wasn’t so much that that simple when it was relegated to me.

I have attempted to place every one of the subtleties in this instructional exercise. However, assuming you actually feel somewhat unsure, go ahead and put your inquiries in the remarks area. I will try to answer to every single question.

YOU MAY LIKE THIS

ABAP Development Environment in the Cloud

Mastering the Future of SAP Development

Introduction to ABAP on Cloud

WhatsApp WhatsApp us