Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters Comments

former_member231368
Participant
0 Kudos

Hi all,

i have a requirement like,

in my selection screen, input field is company code,once i enter the company code i want to display the company code description in the selection screen.

5 REPLIES 5

Former Member
0 Kudos

Hi,

It is possible. Create a label field next to your text field of company code and make it invisisble in the settings. In your PBO event if the company code is not empty then populate the label with the text value. The PBO would get triggered everytime 'ENTER' is pressed.

former_member156446
Active Contributor
0 Kudos

[Dynamic Parameter Texts in Selection Screen|http://help-abap.blogspot.com/2009/04/dynamic-parameter-texts-in-selection.html]

Former Member
0 Kudos

Hello,

Check this sample


selection-screen begin of line.
parameters: p_comp type t001-bukrs.
selection-screen comment  6(20) text.
selection-screen end of line.


at selection-screen output.

select single butxt
into text
from t001
where bukrs = p_comp.

Vikranth

venkat_o
Active Contributor
0 Kudos

Hello Setty, <li>Try the below code which works only when you enter company code and press ENTER.

DATA: BEGIN OF it_t001 OCCURS 0,
        bukrs TYPE t001-bukrs,
        butxt TYPE t001-butxt,
      END OF it_t001.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:bukrs TYPE t001-bukrs.
PARAMETERS:butxt TYPE t001-butxt.
SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'BUTXT'.
      screen-input = '0'.
      screen-output = '1'.
      screen-display_3d = '0'.
      MODIFY SCREEN.
      CLEAR  screen.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN.
  SELECT SINGLE butxt FROM t001 INTO CORRESPONDING FIELDS OF it_t001 WHERE bukrs = bukrs.
  butxt = it_t001-butxt.
Thanks Venkat.O

venkat_o
Active Contributor
0 Kudos

<li>The below program works when you press ENTER after giving company code and also works when u press F4 and selecting company code.


REPORT ztest_notepad.
DATA: BEGIN OF it_t001 OCCURS 0,
        bukrs TYPE t001-bukrs,
        butxt TYPE t001-butxt,
      END OF it_t001.
DATA:i_return_tab TYPE STANDARD TABLE OF ddshretval,
     w_return_tab LIKE LINE OF i_return_tab.
DATA:w_dynpfields TYPE dynpread,
    i_dynpfields LIKE STANDARD TABLE OF dynpread.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:bukrs TYPE t001-bukrs.
PARAMETERS:butxt TYPE t001-butxt.
SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'BUTXT'.
      screen-input = '0'.
      screen-output = '1'.
      screen-display_3d = '0'.
      MODIFY SCREEN.
      CLEAR  screen.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN.
  SELECT SINGLE butxt FROM t001 INTO CORRESPONDING FIELDS OF it_t001 WHERE bukrs = bukrs.
  butxt = it_t001-butxt.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR bukrs.
  IF it_t001[] IS INITIAL.
    SELECT bukrs butxt
     FROM t001
    INTO TABLE it_t001.
  ENDIF.
  "Function module for F4 help
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'BUKRS'   "field name on f4 help window
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'BUKRS' "Screen field name
      value_org   = 'S'
    TABLES
      value_tab   = it_t001
      return_tab  = i_return_tab.
  READ TABLE i_return_tab INTO w_return_tab INDEX 1.
  bukrs = w_return_tab-fieldval.
  READ TABLE it_t001 INTO it_t001 WITH KEY bukrs = bukrs.
  IF sy-subrc = 0.
    w_dynpfields-fieldname    = 'BUTXT'.
    w_dynpfields-fieldvalue   = it_t001-butxt.
    APPEND w_dynpfields TO i_dynpfields.
    CLEAR w_dynpfields.
    "DYNP_VALUES_UPDATE
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname     = sy-repid
        dynumb     = sy-dynnr
      TABLES
        dynpfields = i_dynpfields.
  ENDIF.
Thanks Venkat.O