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: 

"Yes and no" option in a drop- down list

Former Member
0 Kudos

Hi Gurus ,

I need to design a selection screen with a input parameter .

This must be a drop-down list with the options Yes and No .

And the end user must be able to choose any one .

Can you please give me the Statement and the coding related to this .

I would definitely reward points .

Thanks ,

S.Roseline .

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

go through the following code...

REPORT Z8VIJAY_LIST_BOX.

----


  • T Y P E - P O O L S D E C L E R A T I O N

----


TYPE-POOLS : VRM. "VALUE REQUEST MANAGER.

----


  • T A B L E S D E C L E R A T I O N

----


TABLES: PERNR. "Standard Selections for HR Master Data Reporting

----


  • I N T E R N A L T A B L E D E C L E R A T I O N S

----


DATA : IT_DT TYPE STANDARD TABLE OF VRM_VALUE WITH HEADER LINE.

----


  • W O R K A R E A

----


DATA : WA_DT TYPE VRM_VALUE.

************************************************************************

  • S E L E C T I O N S C R E E N

************************************************************************

PARAMETERS : EMP_ST TYPE CHAR4 AS LISTBOX VISIBLE LENGTH 20 .

AT SELECTION-SCREEN OUTPUT.

*---for emp sta 0....

WA_DT-KEY = '1'.

WA_DT-TEXT = '0'.

APPEND WA_DT TO IT_DT.

*-for emp sta 1-

WA_DT-KEY = '2'.

WA_DT-TEXT = '1'.

APPEND WA_DT TO IT_DT.

*-for emp sts 3-

WA_DT-KEY = '3'.

WA_DT-TEXT = '3'.

APPEND WA_DT TO IT_DT.

*-for set the values-

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'EMP_ST'

VALUES = IT_DT[].

*****in the same way you can create for the drop down for yes or no.........

****do reward if usefull

vijay

3 REPLIES 3

gopi_narendra
Active Contributor
0 Kudos

PARAMETER : p_flag AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

* Declarations for the Drop Down
data: NAME  type VRM_ID,
      LIST  type VRM_VALUES,
      VALUE like line of LIST.

      VALUE-KEY = 'YES'.
      value-text = 'Yes'.
      append VALUE to LIST.

      VALUE-KEY = 'NO'.
      value-text = 'No'.
      append VALUE to LIST.
    
    NAME = 'P_FLAG'.

    call function 'VRM_SET_VALUES'
      exporting
        ID     = NAME
        VALUES = LIST.
    clear LIST.

Regards

Gopi

0 Kudos

Hi,

Create a Domain and there add Fixed Values as YES and NO.

This is useful as you can translate it into different laguages.

Hardcoding in the code is not advised.

So create a domain, create a data element for the domain and then use this for your dropdown's TYPE.

Regards,

Sesh

Former Member
0 Kudos

Hi,

go through the following code...

REPORT Z8VIJAY_LIST_BOX.

----


  • T Y P E - P O O L S D E C L E R A T I O N

----


TYPE-POOLS : VRM. "VALUE REQUEST MANAGER.

----


  • T A B L E S D E C L E R A T I O N

----


TABLES: PERNR. "Standard Selections for HR Master Data Reporting

----


  • I N T E R N A L T A B L E D E C L E R A T I O N S

----


DATA : IT_DT TYPE STANDARD TABLE OF VRM_VALUE WITH HEADER LINE.

----


  • W O R K A R E A

----


DATA : WA_DT TYPE VRM_VALUE.

************************************************************************

  • S E L E C T I O N S C R E E N

************************************************************************

PARAMETERS : EMP_ST TYPE CHAR4 AS LISTBOX VISIBLE LENGTH 20 .

AT SELECTION-SCREEN OUTPUT.

*---for emp sta 0....

WA_DT-KEY = '1'.

WA_DT-TEXT = '0'.

APPEND WA_DT TO IT_DT.

*-for emp sta 1-

WA_DT-KEY = '2'.

WA_DT-TEXT = '1'.

APPEND WA_DT TO IT_DT.

*-for emp sts 3-

WA_DT-KEY = '3'.

WA_DT-TEXT = '3'.

APPEND WA_DT TO IT_DT.

*-for set the values-

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'EMP_ST'

VALUES = IT_DT[].

*****in the same way you can create for the drop down for yes or no.........

****do reward if usefull

vijay