Application Development and Automation 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: 
Read only

create listbox program

Former Member
0 Likes
516

how create listbox program in ABAP?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
495

Hi,

Try with this:

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.

VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.

APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

START-OF-SELECTION.

WRITE: / 'PARAMETER:', PS_PARM.

Regards,

Bhaskar

4 REPLIES 4
Read only

Former Member
0 Likes
495

Hi,

Your requirement is to display the values in listbox instead of f4 help?.if that is the requirement you can change the field attribute in screen painter to listbox.hop this will solve your issue.

reward points if helpful.

Read only

Former Member
0 Likes
496

Hi,

Try with this:

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.

VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.

APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

START-OF-SELECTION.

WRITE: / 'PARAMETER:', PS_PARM.

Regards,

Bhaskar

Read only

Former Member
0 Likes
495

Hi Suresh,

in initialization of the program you can do this.

use the function module where the 'P_REAS' is the paramter name and the i_paramname contains the values.

*Use function module to get a drop down

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'P_REAS'

values = i_paramname.

Award points if found useful

Regards,

Divakar Goud

Read only

mohammed_moqeeth
Active Participant
0 Likes
495

Hi Suresh,

<b><u>For your kind reference, please refer the below example:</u></b>

<b>report zlistbox.

type-pools: vrm.

data: it_val type vrm_values,

w_line like line of it_val.

parameters p_bukrs like t001-bukrs as listbox

visible length 25 obligatory.

initialization.

select bukrs butxt from t001 into (w_line-key, w_line-text).

append w_line to it_val.

check p_bukrs is initial.

p_bukrs = w_line-key.

endselect.

at selection-screen output.

call function 'VRM_SET_VALUES'

exporting

id = 'P_BUKRS'

values = it_val.

end-of-selection.

write: / 'Company Code:', p_bukrs.</b>

<b><u>You can check the following links for your kind reference:</u></b>

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

There was also a discussion on this topic sometime back in this forum, which you might find interesting -

<i><b>Reward points for all useful answers....

Cheers !

Moqeeth.</b></i>