‎2008 Mar 18 6:21 AM
Hi,
I need to have a drop down input/output field. For that I have given a name like YHRTM_LEAVE-ATEXT in screen painter. Here YHRTM_LEAVE is table and ATEXT is a field. I have maintained the possible values in ATEXT domain to avail the drop down values.
In PAI, I need to access YHRTM_LEAVE-ATEXT . But only YHRTM_LEAVE value appears only while debugging.
Could anybody help me to achieve my requirement.
Thanks
jey
‎2008 Mar 18 10:09 AM
hi,
u have to write this on screen flow logic after PAI...
PROCESS ON VALUE-REQUEST.
FIELD ifmtp-form_type MODULE fm_drop.
MODULE fm_drop INPUT.
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.
ENDMODULE. " fm_drop INPUT
here ifmtp-form_type is my field which i have taken as listbox
DATA : BEGIN OF ifmtp OCCURS 0,
form_type LIKE zform_track_mast-form_type,
END OF ifmtp.
‎2008 Mar 18 10:21 AM
Hi,
I am looking for Drop Down not F4 help. Hence I can't use this FM.
‎2008 Mar 18 10:23 AM
‎2008 Mar 18 10:43 AM
‎2008 Mar 18 10:56 AM
hi,
my field name is ifmtp-form_type
and u have to use FM..
Edited by: Dhwani shah on Mar 18, 2008 11:57 AM
‎2008 Mar 18 11:24 AM
This is an alternative option to using Domain.
I use this method to customize the dropdown/listbox available to a field.
Here I retrieve from a custom table to fill the values, however, you can read DD07T to obtain the Domain Values.
This code retrieves a value from DD07T.
SELECT SINGLE ddtext INTO p_value
FROM dd07t
WHERE domname = 'ZDROPTYPE'
AND ddlanguage = sy-langu
AND domvalue_l = p_key.
IF sy-subrc NE 0.
p_value = 'Undefined'.
This is different code to retrieve from custom table and display.
TYPE-POOLS vrm.
DATA: " Letter Name Restrict List
rletname_field TYPE vrm_id,
rletname_result TYPE STANDARD TABLE OF vrm_value,
rletname_val LIKE LINE OF rletname_result.
In the PBO routine
REFRESH rletname_result.
SELECT letterid letterdesc
INTO TABLE rletname_result
FROM zlmetext
WHERE relid = base_relid
AND appl = base_appl.
* Field name to assign drop down values
rletname_field = 'BASE_RLETTER'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = rletname_field
values = rletname_result
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
You must, in the screen painter attribute screen make the Dropdown option = Listbox.
Additionally, on the attribute screen on the Program tab, you must make the Value list (under Entry Help) = 'A'.
‎2008 Mar 18 11:37 AM
I got the drop down box refferred by a data dictionary table field. Its appearing very well. But the issue is that I am unable to access the value I selected.
For instance, say there is a table named TABLE1. It has two field; FIELD1 and FIELD2. FIELD1 is the key in this table. FIELD2 has got some value in Domain level. So I created a drop down field as TABLE1-FIELD2. I have got the drop down value from the table.
But the issue is when I access TABLE1-FIELD2 in PAI. It has no value.
Only TABLE1 has the codes I mentioned in Domain level. You could ask me then why don't you use it easily. But I could see the value only during debugging not in the program.
In the program I haven't defined TABLE1 anywhere. So I can't access the code. If I tried to define TBALE1, it says already you have defined.Its something strange.
‎2008 Mar 18 11:42 AM
ok,
so u having drop down list in table control?
u need to take drop down field of different internal table...
Edited by: Dhwani shah on Mar 18, 2008 12:46 PM
‎2008 Mar 18 11:49 AM
‎2008 Mar 18 11:57 AM
The dropdown process will only return the key of your table. You will need to READ TABLE table1 WITH KEY FIELD1 = (screen field name of dropdown). You will then have access to FIELD2 information.
‎2008 Mar 19 4:48 AM
Thanks for the input Paul. But it says Internal table is not defined. I like to highlight one thing here.
During debugging, I am able to see the value : (
When I tried to define as an internal table, it says you can't re-deinfe TABLE1-FIELD2 even though I defined lik
data: TABLE1 like standard table of TABLE1 with header line.
Edited by: Jey on Mar 19, 2008 10:22 AM