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

list box in module pool programming

former_member125931
Active Participant
0 Likes
586

Hi All,

In Module pool program I given drop down for a field,

drop down list is comming but not holding the values in the field,

below is my code in PBO.

 type-pools: vrm.

  data: begin of itab occurs 0,
        field(10) type c,
        end of itab.

  data: ivrm_values type vrm_values.
  data: xvrm_values like line of ivrm_values.
  data: name type vrm_id.

  name = 'ITAB-FIELD'.


  refresh i_ltak.
  select LGNUM BNAME from ltak
    into table i_ltak2.

  delete adjacent duplicates from i_ltak2.

  loop at i_ltak2 into wa_ltak2.

    xvrm_values-key = wa_ltak2-lgnum.
    xvrm_values-text = wa_ltak2-bname.
    append xvrm_values to ivrm_values.

    call function 'VRM_SET_VALUES'
      EXPORTING
        id     = name
        values = ivrm_values.

thanks n regds,

sree,

4 REPLIES 4
Read only

Former Member
0 Likes
553

Hi Sree,

is your FM 'VRM_SET_VALUES' is with in the loop.....? or out side....?

and do below.

loop at i_ltak2 into wa_ltak2.
 
    xvrm_values-key = wa_ltak2-lgnum.
    xvrm_values-text = wa_ltak2-bname.
    append xvrm_values to ivrm_values.
 endloop.

    call function 'VRM_SET_VALUES'
      EXPORTING
        id     = 'NAME'    "See this
        values = ivrm_values.

i have done below.

* This fm will get the values from the list box of DEVICEID field
  CALL FUNCTION 'VRM_GET_VALUES'
    EXPORTING
      id            = 'deviceid'
    IMPORTING
      values        = lt_values    " even it is not the expor parameter...it will work..
   EXCEPTIONS
     id_not_found   = 1
     OTHERS         = 2.
  IF sy-subrc NE 0.
*   No sy-subrc check required.
  ENDIF.

for me it works.

Thanks!

Edited by: Prasanth on Apr 13, 2009 7:07 PM

Read only

Former Member
0 Likes
553

You can try with the below function module also.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'NAME'

tables

value_tab = ivrm_values

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

if sy-subrc <> 0.

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

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

endif.

Regards,

Aswin.

Read only

Former Member
0 Likes
553

Hi Sree,

Call the FM 'VRM_SET_VALUES' after the loop at i_ltak2 instead of calling with in the loop.

Hope this helps!!!

Regards,

Hemanth

Read only

Former Member
0 Likes
553

HI...

Goto to se51 in ur form painter..

select ur field and double click on it..

In the attributes window...select the listbox in dropdown field.

And Use the below shown FM as per ur requirement---

DATA : BEGIN OF VALUE ,

FRMNM TYPE PINPF-FRMNM,

END OF VALUE .

DATA : VTAB LIKE TABLE OF VALUE ,

VAL LIKE LINE OF VTAB .

CLEAR VTAB .

MOVE 'YES' TO VAL-FRMNM .

APPEND VAL TO VTAB .

CLEAR VAL .

MOVE 'NO' TO VAL-FRMNM .

APPEND VAL TO VTAB .

CLEAR VAL .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'FRMNM'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'ZSTORES-MODVATE'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = VTAB

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC 0.

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

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

ENDIF.