Monday, March 5, 2018

Renaming Selection Text of Fields on Selection Screen

Here is a little tricks for you to change the name of the field text label in selection screen.
A Simple Case Requirement when you can handle 2 types of documents like Sales Document and Billing Document, then you want to change the label of the VBELN into sales/billing according the the selection of a radio button you have chosen. Well you can simply follow the following steps:

  1. Define Seltext table and workarea
    
        DATA it_seltexts TYPE TABLE OF rsseltexts.
        DATA wa_seltexts TYPE rsseltexts. 
    
    
  2. You can set a new selection text for several fields by inserting the record into it_seltexts table
    
         wa_seltexts-kind = ' '. "Type of the field P/S (Parameters /Select Options)
         wa_seltexts-name = ' ' "Name of the field
         wa_seltexts-text = ' '. "Seletion text of the field
         INSERT wa_seltexts INTO TABLE it_seltexts.
    
    
  3. Finally, Call modify function to execute the changes according the it_seltexts table
    
         CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
           EXPORTING
             program  = sy-repid
           TABLES
             seltexts = it_seltexts
     *           EXCEPTIONS
     *       PROGRAM_NOT_FOUND                 = 1
     *       PROGRAM_CANNOT_BE_GENERATED       = 2
     *       OTHERS   = 3
           .
         IF sy-subrc <> 0.
        ENDIF. 
    
    

Thursday, January 11, 2018

Turn on default MS Word Editor in Smartforms SAP S/4HANA

If you are here, means that you encountered the slow performance when opening the text editor on smartforms, on the previous SAP ECC 6.0 System, you can apply Note OSS 2221815_2221815 – SAPscript Legacy Text Editor , and then change the preference on rscpseteditor program.


However, since you are using SAP S/4 Hana, you cannot do this anymore, regardless if you are using SAP GUI 7.4 or 7.5. you need some extra configuration a.k.a. Enhancement. How is it done?



  1. Go to SE24
  2. Open Class CL_COS_UTILITIES 
  3. Go to method IS_S4H
  4. Create an enhancement at the end of the method
  5. Insert the following code
  6. IF SY-TCODE = 'SMARTFORMS' OR SY-TCODE = 'SE71'.
      RV_IS_S4H = abap_false.
    ENDIF.
    
    
    
The method is used by SAP to check whether the system is S/4 HANA or not, hence the enhancement tricks SAP GUI to tell that it is not S/4 HANA System when you open/use TCODE SMARTFORMS or SE71