Sunday, December 31, 2017

How to Change ALV Standard toolbar button text in SAP ABAP

Scenario : As per the requirement we need to display SAP ALV standard tool bar export button text as 'SAVE EXCEL' .By default the button text is 'Export'.

Solution :

All ALV standard toolbar buttons (Function Codes ) are available in SAP standard internal table

e_object->mt_toolbar.

here e_object is the one of the importing parameter of ALV TOOLBAR Event ( Toolbar Event : where we add customizing buttons to the ALV standard toolbar using the same internal table).

Customizing the standard text display :

In side the ALV Toolbar event handler , write the below mentioned piece of code .

LOOP AT e_object->mt_toolbar ASSIGNG <fieldsymbol>.

   IF <fieldsymbol>-function EQ '&MB_EXPORT' .  " (&MB_EXPORT is the FCODE of export                                                                                                button)
 
   <fieldsymbol>-text  = 'SAVE EXCEL' .   "User's customizing text

 ENDIF.
ENDLOOP.


Sunday, December 10, 2017

How to Increase length of Selection Texts ( Parameter/Select-options ) display text in sap ABAP


Limitation :

 If you declare any Selection screen elements (Parameter or Select - options ) , Corresponding displaying we will provide it in Selection texts.

Path -- GOTO --> Text Elements --> Selection Texts.

Ex :  SELECTION-SCREEN BEGIN OF BLOCK b1.
        PARAMETERS : p_rad1 RADIO BUTTON GROUP g1,
                                     p_rad2  RADIO BUTTON GROUP g1.

       SELECTION-SCREEN BEGIN OF BLOCK b1.

Here corresponding Display text of Radio buttons will provide in Selection Texts.But the Maximum length we can provide is 30.

But here in my requirement i need to provide display text as 40 for p_rad1 Radio Button . By using Selection texts , it's not possible.

Solution : 

       SELECTION-SCREEN BEGIN OF BLOCK b1.
       SELECTION-SCREEN BEGIN OF LINE.
       PARAMETERS : p_rad1 RADIO BUTTON GROUP g1.
       SELECTION-SCREEN COMMENT (50) text-001 FOR FIELD p_rad1.
       SELECTION-SCREEN END OF LINE.
       PARAMETERS :   p_rad2  RADIO BUTTON GROUP g1.
       SELECTION-SCREEN BEGIN OF BLOCK b1.


Maintain display text for text-001.

Path : GOTO-->Text Elements --> Text Symbols.