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: 

need a drop down list for cost center group

Former Member
0 Kudos

Hello,

I need to add the cost center group selection option to my program. I have added it to the selection options of my program and I would like to have a drop down list on this field. I have looked at the t-code KS13 and I am thinking that this is what I need. I am not sure if this is a search help or something else. if this is a search help, is it possible to use the same search help in my program? can some please let me know how I would do this in my program? possibly a code example?

thanks in advance for the help.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

How about something like this?



report zrich_0001.

tables: kmas_d.

select-options s_kostls for kmas_d-kostl_set .

at selection-screen on value-request for s_kostls-low.

  call function 'K_GROUP_SELECT'
       exporting
            class            = '0101'
            field_name       = 'KOSTL'
       importing
*            class_name       =
            set_name         = kmas_d-kostl_set
*            set_title        = kmas_d-settxt_kst
*            table_name       =
          exceptions
            no_set_picked    = 1
            others           = 2.


  s_kostls-low = kmas_d-kostl_set.

Regards,

RIch Heilman

4 REPLIES 4

Former Member
0 Kudos

PARAMETER: p_sostat(15) TYPE c AS LISTBOX VISIBLE LENGTH 16,

name = 'p_sostat'.

CLEAR sostatlist[].

value-text = text-101. "'Open'(101).

value-key = '1'.

APPEND value TO sostatlist.

value-text = text-102. "'On Hold'(102).

value-key = '2'.

APPEND value TO sostatlist.

value-text = text-103. "'Drop/Pull'(103).

value-key = '3'.

APPEND value TO sostatlist.

value-text = text-104. "'Pending'(104).

value-key = '4'.

APPEND value TO sostatlist.

value-text = text-105. "'Floor'(105).

value-key = '5'.

APPEND value TO sostatlist.

value-text = text-106. "'Kitted'(106).

value-key = '6'.

APPEND value TO sostatlist.

value-text = text-107. "'Packed'(107).

value-key = '7'.

APPEND value TO sostatlist.

value-text = text-108. "'PGI'(108).

value-key = '8'.

APPEND value TO sostatlist.

value-text = text-109. "'EDI Error'(109).

value-key = '9'.

APPEND value TO sostatlist.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = sostatlist.

Pawan_Kesari
Active Contributor
0 Kudos

REPORT zpwtest .

PARAMETERS : p_k TYPE kmas_d-kostl_set .


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_k .


  CALL FUNCTION 'K_GROUP_SELECT'
       EXPORTING
            field_name    = 'KOSTL'
       IMPORTING
            set_name      = p_k
       EXCEPTIONS
            no_set_picked = 1
            OTHERS        = 2.

  IF sy-subrc <> 0.
  ENDIF.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

How about something like this?



report zrich_0001.

tables: kmas_d.

select-options s_kostls for kmas_d-kostl_set .

at selection-screen on value-request for s_kostls-low.

  call function 'K_GROUP_SELECT'
       exporting
            class            = '0101'
            field_name       = 'KOSTL'
       importing
*            class_name       =
            set_name         = kmas_d-kostl_set
*            set_title        = kmas_d-settxt_kst
*            table_name       =
          exceptions
            no_set_picked    = 1
            others           = 2.


  s_kostls-low = kmas_d-kostl_set.

Regards,

RIch Heilman

0 Kudos

Rich,

this is exactly what I was looking for.

added to my program and it is working great.

thanks for the quick help