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

select-options..

Former Member
0 Likes
673

Hi,

I declared a variable like this.

data: wa_stat type abc-xyz.

select-options: p_stat for wa_status OBLIGATORY.

Now I want to assign 5 values(Like Pending,rejected,approved etc) for the variable p_stat .

How to do that??

Points will be awarded for the useful answers.

Thanks,

Priya.

7 REPLIES 7
Read only

Former Member
0 Likes
653

Use the FM : VRM_SET_VALUES.

This creates a drop down list with the values u needed. write this at the initialistaion event.

for ex :

value-text = 'Background Processing'.

value-key = 'N'.

APPEND value TO list.

*A for foreground

value-text = 'Foreground Processing'.

value-key = 'A'.

APPEND value TO list.

*E for error processing

value-text = 'Error Processing'.

value-key = 'E'.

APPEND value TO list.

*call the function module to set the value and id

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

clear list.

Regards

Pratyu

Read only

suresh_datti
Active Contributor
0 Likes
653

Use this code..


initialization.
p_stat-sign = 'I'.
p_stat-option = 'EQ'.
p_stat-low = 'Pending'.
append p_stat.
p_stat-low = 'Rejected'.
append p_stat.
p_stat-low = 'Approved'.
append p_stat.
p_stat-low = 'Processed'.
append p_stat.
p_stat-low = 'Completed'.
append p_stat.

~Suresh

Read only

0 Likes
653

Hi,

I want to display all the values in a dropdown list. And I want to choose what ever I want.

I tried your code.Its displaying only first option.

Read only

0 Likes
653

hi priya plz try my code this works for ur requirement as the FM creates a drop down list with the values appended in the LIST

Read only

0 Likes
653

Hi Prathu Usha,

I tried Like this.

data:

wa_status type zest1940_sfa_sta-status,

select-options: p_stat for wa_status OBLIGATORY.

perform z_prepare_list_box.(IN INITIALISATION)

Form z_prepare_list_box .

data: wa_stat type vrm_id,

list type vrm_values,

value like line of list.

clear list. refresh list.

wa_stat = 'P_STAT'.

clear value.

value-key = value-text = 'PENDING'. append value to list.

value-key = value-text = 'COMPLETE'. append value to list.

value-key = value-text = 'REJECTED'. append value to list.

value-key = value-text = 'INCOMPLETE'. append value to list.

value-key = value-text = 'IN REVIEW'. append value to list.

value-key = value-text = 'APPROVED'. append value to list.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = wa_stat

values = list.

p_stat = ' '.

endform. " z_prepare_list_Box

But it's not working for me.

Read only

Former Member
0 Likes
653

Hi,

On INITIALIZATION add code like this:


Clear: p_stat .
p_stat-SIGN = 'I'.
p_stat -OPTION = 'EQ'.
p_stat-LOW = 'PENDING'.
APPEND p_stat.

Clear: p_stat .
p_stat-SIGN = 'I'.
p_stat -OPTION = 'EQ'.
p_stat-LOW = 'rejected'.
APPEND p_stat.

Continue with all your value for p_stat.

Regards,

Read only

Former Member
0 Likes
653

Priya,

INITIALIZATION.

p_stat-sign = 'I'.

p_stat-option = 'EQ'.

p_stat-low = 'Pending'.

append p_stat.

p_stat-low = 'Rejected'.

append p_stat.

p_stat-low = 'Approved'.

append p_stat.

p_stat-low = 'Processed'.

append p_stat.

p_stat-low = 'Completed'.

append p_stat.

don't forget ot reward if useful....