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

Handle text using list box in dialog program

Former Member
0 Likes
1,745

hi,

I am working on dialog program , Created two fileds , one is list box type I/O field and another is i/O field which displays text based on value selected in list box.

Please provide any inf how to Handle text using list box value in dialog program.

thanks

11 REPLIES 11
Read only

Former Member
0 Likes
1,703

Hi,

Lets say field1 is your list box and field2 is the text field do like below:



PAI
chain.
 field field1.
 field field2 module get_value.
endchain.

module get_value input.
 select field2 from....<<<<Get field2 value based on field1 value entered on the screen and assign it to field2 here
endmodule.

Regards,

Himanshu

Read only

0 Likes
1,703

Hi Himansu,

I tried as per logic which you given, its not triggering

is anywhere i want to wirtie in POV event.

Here My requirement is under list box i am getting values, and beside creted one field type i/o where it displays text of vlaue selected in listbox.

Thanks

Read only

0 Likes
1,703

Hi Himanshu,

I kept this code in POV, then i am not getting list box values.

Thanks,

Read only

0 Likes
1,703

Hi,

I am already getting list of values under this field, but i am whne I am selecting value from list box, i am unable to print text in beside field.

Thanks

Read only

0 Likes
1,703

PROCESS AFTER INPUT.

field EDEVICED-Textfield module get_value.

MODULE GET_VALUE INPUT.

select single ezwg_info into EDEVICED-Textfield table it_ezwg

from h_ezwg where ZWGRUPPE = EDEVICED-ZWGRUPPE.

endmodule.

Read only

0 Likes
1,703

sorry

PROCESS AFTER INPUT.

field EDEVICED-Textfield module get_value.

MODULE GET_VALUE INPUT.

select single ezwg_info into EDEVICED-Textfield

from h_ezwg where ZWGRUPPE = EDEVICED-ZWGRUPPE.

endmodule.

Read only

venkat_o
Active Contributor
0 Likes
1,703

Hi, <li>Check the screen to know how to set I/O field to set as listbox.[ dropdown box picture|http://2.bp.blogspot.com/_O5f8iAlgdNQ/Sm7RBrqfjcI/AAAAAAAAFaU/RateViiVqrU/s1600-h/drop_down-754481.JPG] <li>in the above screen we need to set FctCode for the dropdown box field so that when you select value from the dropdown box PAI event is triggered. <li>screen flow logic like below

PROCESS BEFORE OUTPUT.
 MODULE values_into_dropdown.
 FIELD g_bukrs.
FIELD g_text.

PROCESS AFTER INPUT.
 FIELD g_bukrs.
FIELD g_text MODULE get_bukrs_txt.
<li>Logic to fill Dropdown field with values.
PROGRAM  sapmztest_dropdown.
DATA: g_bukrs TYPE t001-bukrs.
*&---------------------------------------------------------------------*
*&      Module  VALUES_INTO_DROPDOWN  OUTPUT
*&---------------------------------------------------------------------*
MODULE values_into_dropdown OUTPUT.
 TYPE-POOLS:vrm.
 DATA:
       field     TYPE  vrm_id,
       it_values TYPE  vrm_values,
       wa_values LIKE LINE OF it_values.
 DATA: t001 TYPE t001 OCCURS 0 WITH HEADER LINE.
 IF it_values[] Is INITIAL.
   SELECT * FROM t001 INTO TABLE t001 UP TO 10 ROWS.
   LOOP AT t001.
     wa_values-key  = t001-bukrs.
     wa_values-text = t001-butxt.
     APPEND wa_values TO it_values.
     CLEAR  wa_values.
   ENDLOOP.
 ENDIF.
 field = 'G_BUKRS'.
 CALL FUNCTION 'VRM_SET_VALUES'
   EXPORTING
     ID     = FIELD
     values = it_values.

ENDMODULE.                 " VALUES_INTO_DROPDOWN  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  get_bukrs_txt  INPUT
*&---------------------------------------------------------------------*
MODULE get_bukrs_txt INPUT.
read table it_t100 into wa_t100 with key bukrs = g_bukrs.
g_text = t001-butxt.
ENDMODULE.                 " VALUES_INTO_DROPDOWN  INPUT
I hope that it helps you. Thanks Venkat.O

Read only

Former Member
0 Likes
1,703

Hi Venkat,

fctcode field is disable for I/O field ( Listbox).

thanks

Read only

Former Member
0 Likes
1,703

hi Venkat,

I tried with Fct code , no use.

any other method.

Thanks

Read only

Former Member
0 Likes
1,703

Hi ,

once I create a field on the screen, it showing list of values under listbox , Here my requirement is added one more field beside listbox field where it shows text corresponding value of listbox.

Thanks.

Read only

Former Member
0 Likes
1,703

Hi,

Anyways you are getting the values in the list box. Once the user selects the listbox value, get the corresponding text and move that text to the screen filed which is next to your list box field. You can incorporate this code in the POV of the screen.(where the list box is)

Hope this will help you.

Regards,

Smart Varghese