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: 

Different values in a list box for each row of the table control...

kowong
Participant
0 Kudos
200

Dear Experts,

Is it possible to populate different values for each row in a listbox inside a table control ?

Example,

Row 1 in the the table contains A, B & C

Row 2 in the same table contains C, D & E

If yes, How?

yes i am using

call function 'VRM_SET_VALUES'

exporting

id = i_name

values = i_list.

Thank you .

Message was edited by:

Kokwei Wong

Message was edited by:

Kokwei Wong

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos
68

Hi,

Try to use fm


  call function 'VRM_SET_VALUES'
    exporting
      id     = i_name
      values = i_list.

aRs

Former Member
0 Kudos
68

Hi all,

I too have the same requirement.

i tried like this but the values are not getting populated in text box. please give your ideas.

loop at itab.

select vbeln from ZSD_PS_BLAWB into ZSD_PS_BLAWB-vbeln

where BLAWBNO = itab-BLAWBNO and

BLAWBDT = itab-BLAWBDT and

CTRNO = itab-CTRNO.

if sy-subrc = 0.

index = 1.

list3-key = index.

list3-text = ZSD_PS_BLAWB-vbeln.

append list3 to list2.

index = index + 1.

endif.

endselect.

clear index.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'ITAB-VBELN'

VALUES = list2

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.

modify itab.

endloop.

Thanks in advance.

Former Member
0 Kudos
68

Hi Wong,

this is code example for listbox

TYPE-POOLS vrm .
 
DATA: lt_vrm_values TYPE TABLE OF vrm_value.
DATA: wa_vrm_values TYPE vrm_value.
 
PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
 
INITIALIZATION.
  wa_vrm_values-key = 'Key1'.
  wa_vrm_values-text = 'Value1'.
  APPEND wa_vrm_values TO lt_vrm_values.
 
  wa_vrm_values-key = 'Key2'.
  wa_vrm_values-text = 'Value2'.
  APPEND wa_vrm_values TO lt_vrm_values.
 
  wa_vrm_values-key = 'Key3'.
  wa_vrm_values-text = 'Value3'.
  APPEND wa_vrm_values TO lt_vrm_values.
 
AT SELECTION-SCREEN OUTPUT.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id              = 'P_LIST'
            values          = lt_vrm_values
       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.

To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.

Manas M.

P.S.: This is very easy question, you should use search ...