2005 Nov 18 6:06 AM
Hi,
I have a requirement where i have to insert a F4 help for setheader-rvalue(business sector).
I have declared a select option for rvalue on the selection screen.
I have written a code like
*data declaration
DATA: w_setnr LIKE rgsbs-setnr.
CONSTANTS: c_rvalue LIKE rgsmh-field VALUE 'RVALUE',
c_table LIKE rgsmh-table VALUE 'SETHEADER'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_rvalue-low.
PERFORM search_group_value USING s_rvalue-low c_rvalue.
form search_group_value using group
fieldname.
DATA: w_searchfield LIKE RGSBS-searchfld.
Display group possible entries.
w_searchfield = group.
CALL FUNCTION 'K_GROUP_SELECT'
EXPORTING
field_name = fieldname
searchfld = w_searchfield
table = c_table
IMPORTING
set_name = w_setnr
EXCEPTIONS
no_set_picked = 1
OTHERS = 2.
group = w_setnr(24).
endform. " search_group_value
when i go to the selection screen when i press f4 on rvalue it displays as * instead of the value from setheader table.
Kindly let me know how to use FM: 'K_GROUP_SELECT'.
Regards
Yamini.A
Hi,
I have a requirement where i have to insert a F4 help for setheader-rvalue(business sector).
I have declared a select option for rvalue on the selection screen.
I have written a code like
*data declaration
DATA: w_setnr LIKE rgsbs-setnr.
CONSTANTS: c_rvalue LIKE rgsmh-field VALUE 'RVALUE',
c_table LIKE rgsmh-table VALUE 'SETHEADER'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_rvalue-low.
PERFORM search_group_value USING s_rvalue-low c_rvalue.
form search_group_value using group
fieldname.
DATA: w_searchfield LIKE RGSBS-searchfld.
Display group possible entries.
w_searchfield = group.
CALL FUNCTION 'K_GROUP_SELECT'
EXPORTING
field_name = fieldname
searchfld = w_searchfield
table = c_table
IMPORTING
set_name = w_setnr
EXCEPTIONS
no_set_picked = 1
OTHERS = 2.
group = w_setnr(24).
endform. " search_group_value
when i go to the selection screen when i press f4 on rvalue it displays as * instead of the value from setheader table.
Kindly let me know how to use FM: 'K_GROUP_SELECT'.
Regards
Yamini.A
2005 Nov 18 6:08 AM
Hi,
See this code............
*******************
*----
at selection-screen on value-request for s_pernr-low.
*----
perform get_values changing s_pernr-low.
*----
at selection-screen on value-request for s_pernr-high.
*----
perform get_values changing s_pernr-high.
&----
*& Form get_values
&----
text
----
-->P_S_PERNR_LOW text
----
FORM get_values CHANGING P_S_PERNR.
refresh t_itab.
clear t_return.
select pernr from zfdmr_records into table t_itab.
delete adjacent duplicates from t_itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'PERNR'
PVALKEY = ' '
DYNPPROG = sy-cprog
DYNPNR = sy-dynnr
DYNPROFIELD = 'ZFDMR_RECORDS-PERNR'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = 'F'
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = t_itab
FIELD_TAB =
RETURN_TAB = t_return
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.
READ TABLE t_return INDEX 1.
p_s_pernr = t_return-fieldval.
ENDFORM. " get_values
I hope this will help you.
If your is solved with this award points and close thread.
Thanks.
2005 Nov 18 6:27 AM
Hi Yamini,
Check these links.
http://www.geocities.com/victorav15/sapr3/abapfun.html#co
http://www.geocities.com/victorav15/sapr3/examples/kgrsel.txt
Kindly reward points if it helps.
2005 Nov 18 6:35 AM
2005 Nov 18 6:44 AM
HI,
if you want to display values for a particular field you can go for 'F4IF_INT_TABLE_VALUE_REQUEST'
the fuction module which you mentioned it is giving some different values SET_NAME, CLASS_NAME,SET_TITLE,TABLE_NAME,SETID
if this are the things you are looking for then just pass the field_name and table. that's it.
it's working fine for me if i send those two things.
regards,
manohar
2005 Nov 18 6:54 AM
Hi Yamini ,
Try this sample code for F4 help
Use the FM 'F4IF_INT_TABLE_VALUE_REQUEST'
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
clear t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 's_begru'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
*read table t_return index 1.
s_begru-low = t_return-FIELDVAL.Regards
Beena
2005 Nov 18 6:58 AM
Manoharsairam Kavuri
can u explain me how it worked for you...because i am not able to populate the values by passing field name and table name
i gave the table name as setheader and the fieldname as rvalue(K_GROUP_SELECT).
Regards
Yamini.A
2005 Nov 18 8:44 AM
Hi,
I am in enterprise version.
I executed the below code.It is working fine for me.
parameters: p_kstar like t800s-setnr.
at selection-screen on value-request for p_kstar.
CALL FUNCTION 'K_GROUP_SELECT'
EXPORTING
field_name = 'KSTAR '
IMPORTING
SET_NAME = p_kstar
EXCEPTIONS
NO_SET_PICKED = 02.
CASE SY-SUBRC.
WHEN 1. MESSAGE S003(GR).
WHEN 2. MESSAGE S004(GR).
ENDCASE.
2005 Nov 18 9:03 AM
2005 Nov 19 6:37 AM
two key things you have missed:
1. you need to pass CLASS (this determines which set you are calling - for example 0101 is for cost center groups -this value you can get from talbe SETCLS)
2. the importing parameter set_name should be mapped to your screen field (s_rvalue-low).
Hope this helps.
Regards
Raja
2005 Nov 20 3:29 AM
Do not forget to add this for s_rvalue-high as well. Otherwise, the F4 will not be available for the second field in the select option (and in the extension).
CONSTANTS: c_rvalue_low LIKE rgsmh-field VALUE 'S_RVALUE-LOW',
c_rvalue_high LIKE rgsmh-field VALUE 'S_RVALUE-HIGH'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_rvalue-low.
PERFORM search_group_value USING s_rvalue-low c_rvalue_low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_rvalue-high.
PERFORM search_group_value USING s_rvalue-high c_rvalue_high.
Cheers,
Bhanu