09-21-2007 12:59 PM
hi frds ..
how to create a drop down list box and how to enter datas in the list box ..
pari..
09-21-2007 1:04 PM
09-21-2007 1:04 PM
09-21-2007 1:06 PM
Hi Pari,
Code your program with the following logic :
here is few info about vrm_values :
type-pools : vrm.
types:
*-- Single Value in Value Set
begin of vrm_value,
key(40) type c,
text(80) type c,
end of vrm_value,
*-- Table of Values
vrm_values type vrm_value occurs 0 .
vrm_values is one of the parameters of type vrm_value in VRM_SET_VALUES function module .
Use VRM_SET_VALUES is the function module to get input help .
fill the values to be displayed in an itab and pass the values to the FM parameter VALUES .
module create_drop_down_box_material output.
select matnr from mara
into table l_tab_mara_matnr
where matkl = 'ZPMBMAT'.
if not l_tab_mara_matnr[] is initial.
select maktx from makt
into l_tab_collect_maktx_frm_db-material_descr
for all entries in l_tab_mara_matnr
where matnr = l_tab_mara_matnr-material_no.
append l_tab_collect_maktx_frm_db.
endselect.
endif.
loop at l_tab_collect_maktx_frm_db into l_wa_collect_maktx_frm_db.
l_wa_mat_descr-key = l_wa_collect_maktx_frm_db-material_descr.
append l_wa_mat_descr to l_tab_mat_descr.
endloop.
name = 'ZCOT_PPT_DTLS-MATERIAL_DESCR'.
call function 'VRM_SET_VALUES'
exporting
id = name
values = l_tab_mat_descr
exceptions
id_illegal_name = 1
others = 2.
free: l_tab_mat_descr,l_tab_collect_maktx_frm_db.
endmodule. " create_drop_down_box_material OUTPUT
refer this site.
Thanks,
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
09-21-2007 1:07 PM
hi,
Hi,
Please check the modified code
TYPE-POOLS :vrm.
DATA:i_natio TYPE vrm_values,
w_natio LIKE LINE OF i_natio.
w_natio-key = 'ABC'. "<< Append your 6 values here
w_natio-text = 'TEST ABC'.
APPEND w_natio TO i_natio.
w_natio-key = 'CDE'.
w_natio-text = 'TEST CDE'.
APPEND w_natio TO i_natio.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'I_IT0002-NATIO'
values = i_natio
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
thanks
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
09-21-2007 1:08 PM
hi,
assign <b>listbox</b> value in <b>drop down</b> in <b>attributes</b> of that element.
then in screen flow logic
PROCESS ON VALUE-REQUEST.
FIELD <b>ifmtp-form_type</b> MODULE fm_drop.
ifmtp-form_type - field which is listbox.
<b>MODULE fm_drop INPUT.</b>
CLEAR ifmtp.
REFRESH ifmtp.
ifmtp-form_type = 'C'.
APPEND ifmtp.
ifmtp-form_type = 'F'.
APPEND ifmtp.
ifmtp-form_type = 'H'.
APPEND ifmtp.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FORM_TYPE'
value_org = 'S'
TABLES
value_tab = ifmtp.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>ENDMODULE.</b> " fm_drop INPUT
and in top module u have to declare like this.
DATA : BEGIN OF ifmtp OCCURS 0,
form_type LIKE zform_track_mast-form_type,
END OF ifmtp.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
09-21-2007 1:08 PM
Hi,
select Input/Output Field and then in its attributes selct listbox.
then use call function VRM_SET_VALUES
and TYPE-POOLS vrm.
DATA values TYPE vrm_values WITH HEADER LINE.
IF init is initial.
SELECT * FROM scarr.
values-text = scarr-carrname.
values-key = scarr-carrid.
APPEND values.
ENDSELECT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'SBOOK-CARRID'
values = 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.
ENDIF.