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

Problem Faced when using VRM Values - Urgent

Former Member
0 Likes
1,356

Hi Friends

I m facing a Unique problem when using the Function Module "VRM_SET_VALUES".

The Values i m selecting from the database have the Key and the Description field both having the same value.

like KEY = "A"

Text = "A"

in such cases only one of the value ie only the KEY is appearing in the list box and the text is not appearing.

This is creating a problem since for some fields the key and the value are different so the listbox looks odd with some some single values and some lines having 2 values.

Can you please help me on this issue.

2 REPLIES 2
Read only

Former Member
0 Likes
1,041

Hi,

You can show only one set of values in list box not both at a time.

TYPE-POOLS : vrm. "Value Request Manager

PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.

INITIALIZATION.

PERFORM f4_value_request.

START-OF-SELECTION.

WRITE P_TEST.

&----


*& Form f4_value_request

&----


  • text

----


FORM f4_value_request.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'January'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'February'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'March'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'April'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '5'.

l_value-text = 'May'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '6'.

l_value-text = 'June'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '7'.

l_value-text = 'July'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '8'.

l_value-text = 'August'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '9'.

l_value-text = 'September'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '10'.

l_value-text = 'October'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '11'.

l_value-text = 'November'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '12'.

l_value-text = 'December'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'P_TEST'.

p_test = '1'. "this is to set the default value of the list box.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request

Also refer the following thread.

Edited by: Velangini Showry Maria Kumar Bandanadham on May 8, 2008 9:50 AM

Read only

0 Likes
1,041

Hi Friend,

Thanks for the reply.

But this is not the problem i m facing is not about how to use VRM Values.

Following is the Code that I have written

type-pools: vrm.

data: vrm_value type VRM_VALUE,

vrmtable type VRM_VALUES.

Parameter: p_list(2) TYPE c as LISTBOX VISIBLE LENGTH 12.

INITIALIZATION.

clear vrm_value.

vrm_value-key = 'A'.

vrm_value-text = 'A'.

APPEND vrm_value to vrmtable.

vrm_value-key = 'B'.

vrm_value-text = 'BB'.

APPEND vrm_value to vrmtable.

vrm_value-key = 'C'.

vrm_value-text = 'CC'.

APPEND vrm_value to vrmtable.

vrm_value-key = 'D'.

vrm_value-text = 'D'.

APPEND vrm_value to vrmtable.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'P_LIST'

values = vrmtable

  • EXCEPTIONS

  • ID_ILLEGAL_NAME = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

The output when i display comes like below in the list

A

B BB

C CC

D

I m Not able to Understand why for the First Row only A and last row only D is coming. while for others both text and the key is coming.

This is coming only when the Key and the Text of VRM Value table is same. This makes the List look very Odd