‎2014 Jun 19 5:21 AM
Hi,
I wonder is there any way to initial parameters display name without using SELECTION TEXT in TEXT ELEMENTS?
I want to do this because every time i copy my codes to others places i have to rewrite the display name in selection text.
‎2014 Jun 19 6:51 AM
Hi,
You need to place the logic to assign text to labels at the Initialization of the screen. For selection screen, place the logic in the event INITIALIZATION.
suppose the screen elements are P_BUKRS and P_PLANT so the code will be like as following :
INITIALIZATION.
%_P_BUKRS_%_APP_%-TEXT = 'Company Code'.
%_P_PLANT_%_APP_%-TEXT = 'Plant'.
Similarly, you can change text of other parameters by replacing parameter name in
%_[parameter name]_APP_%-TEXT
and assigning the required label text to it.
Regards,
Ashish
‎2014 Jun 19 5:41 AM
Hi Vong ,
If you tick mark Dictionary ref. in selection text , it will automatically accept text defined for that element.
Other way will be if copy a program , then it will copy its selection text also.
Regards,
Yogendra Bhaskar
‎2014 Jun 19 6:44 AM
Hi,
you can use SELECTION-SCREEN COMMENT 2(10) text-001 FOR FIELD fieldname.
By using this you can add your own text to field. At runtime you can use at selection screen output to pass your own text element name.
Regards,
Sivaganesh
‎2014 Jun 19 7:28 AM
This cannot apply to all parameter.i believe it only work on button and radio button.
‎2014 Jun 19 6:51 AM
Hi,
You need to place the logic to assign text to labels at the Initialization of the screen. For selection screen, place the logic in the event INITIALIZATION.
suppose the screen elements are P_BUKRS and P_PLANT so the code will be like as following :
INITIALIZATION.
%_P_BUKRS_%_APP_%-TEXT = 'Company Code'.
%_P_PLANT_%_APP_%-TEXT = 'Plant'.
Similarly, you can change text of other parameters by replacing parameter name in
%_[parameter name]_APP_%-TEXT
and assigning the required label text to it.
Regards,
Ashish
‎2014 Jun 19 7:47 AM
Hi ,
Another option is to use FUNCTION 'SELECTION_TEXTS_MODIFY'
Code:
PARAMETERS: p_sndr_1 TYPE adsmtp-smtp_addr .
SELECTION-SCREEN SKIP .
PARAMETERS: p_rcpn_1 TYPE adsmtp-smtp_addr .
PARAMETERS: p_rcpn_2 TYPE adsmtp-smtp_addr .
INITIALIZATION.
PERFORM at_initialization .
FORM at_initialization .
DATA: it_seltexts TYPE TABLE OF rsseltexts .
DATA: st_seltexts LIKE LINE OF it_seltexts .
st_seltexts-name = 'P_SNDR_1' .
st_seltexts-kind = 'P' .
st_seltexts-text = 'Sender mail ' .
APPEND st_seltexts TO it_seltexts .
st_seltexts-name = 'P_RCPN_1' .
st_seltexts-kind = 'P' .
st_seltexts-text = 'Recipient mail 1 ' .
APPEND st_seltexts TO it_seltexts .
st_seltexts-name = 'P_RCPN_2' .
st_seltexts-kind = 'P' .
st_seltexts-text = 'Recipient mail 2 ' .
APPEND st_seltexts TO it_seltexts .
CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
EXPORTING
program = sy-cprog
TABLES
seltexts = it_seltexts
EXCEPTIONS
program_not_found = 1
program_cannot_be_generated = 2
OTHERS = 3.
ENDFORM . "at_initialization
*----------------------------------------------------------------------*
Regards.