‎2007 Feb 26 11:29 AM
Hi SDN,
I have two fields in my selection screen in Module pool.
F1
F2
I have a F4 help to the field F2.I want to restrict the output of F4 help of the F2 with the values entered in F1.How to do this?
I have written my help request for field F2 in PROCESS ON VALUE-REQUEST.
I am not able to get the value of the field F1 in my PROCESS ON VALUE-REQUEST for F2.
‎2007 Feb 26 1:23 PM
hi Niranjan,
Please use the following logic in event PROCESS ON VALUE-REQUEST for F2.
DATA: BEGIN OF DYNPFIELDS OCCURS 3.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
DATA: G_DYNNR LIKE SY-DYNNR,
DYNAME LIKE D020S-PROG.
G_DYNNR = SY-DYNNR.
DYNAME = SY-REPID.
DYNPFIELDS-FIELDNAME = 'F1'.
APPEND DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = DYNAME "G_REPID
DYNUMB = G_DYNNR
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8.
read table dynpfields index 1.
select <field> from <table name> into itab_F2 where
<field> = dynfields-fieldvalue.
" use the internal table itab_F2 to populate F4
" for field F2, using fm "F4IF_INT_TABLE_VALUE_REQUEST
Hope this helps,
Sajan Joseph.
‎2007 Feb 26 11:34 AM
hi Niranjan,
Please use function module DYNP_VALUES_READ to get the value of F1, in the event PROCESS ON VALUE-REQUEST for F2.
sample code:
DATA: BEGIN OF DYNPFIELDS OCCURS 3.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
DATA: G_DYNNR LIKE SY-DYNNR,
DYNAME LIKE D020S-PROG.
G_DYNNR = SY-DYNNR.
DYNAME = SY-REPID.
MOVE 'SEL_TAB-LOW' TO DYNPFIELDS-FIELDNAME.
APPEND DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = DYNAME "G_REPID
DYNUMB = G_DYNNR
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8. Hope this helps.
Sajan Joseph.
‎2007 Feb 26 11:47 AM
hi do like this...
first put the required data(data gainst F1) into an ITAB consist of only one field (F2) and pass into FM as follows...
module create_dropdown_box input.
SELECT werks FROM t001w iNTO table itab_plant.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ZGKPF-PLANT'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = itab_plant
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.
endmodule. " create_dropdown_box INPUT
‎2007 Feb 26 11:50 AM
Hi,
I am using a select query inside my Process on value-request for the field F2.In this query i am using the value of F1 in where clause.I am not getting the value of f1.How to get the value?
‎2007 Feb 26 11:42 AM
Use field chain on these fields in PAI and as the first statement in process on value request.
The field F1 value would be available after you use field statement.
Reward points.....
Regards,
Guru
‎2007 Feb 26 11:59 AM
Hi Niranjan,
Check the following code
parameter: p_1 type c,
p_2 type c.
At selection-screen on p_1.
p_2 = 'TEST'.
* or you can write the select statement
Hope this helps.
regards,
kinshuk
‎2007 Feb 26 1:23 PM
hi Niranjan,
Please use the following logic in event PROCESS ON VALUE-REQUEST for F2.
DATA: BEGIN OF DYNPFIELDS OCCURS 3.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
DATA: G_DYNNR LIKE SY-DYNNR,
DYNAME LIKE D020S-PROG.
G_DYNNR = SY-DYNNR.
DYNAME = SY-REPID.
DYNPFIELDS-FIELDNAME = 'F1'.
APPEND DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = DYNAME "G_REPID
DYNUMB = G_DYNNR
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8.
read table dynpfields index 1.
select <field> from <table name> into itab_F2 where
<field> = dynfields-fieldvalue.
" use the internal table itab_F2 to populate F4
" for field F2, using fm "F4IF_INT_TABLE_VALUE_REQUEST
Hope this helps,
Sajan Joseph.
‎2007 Feb 26 1:44 PM
Hi Niranjan,
1) Create a<b> SEARCH HELP.</b>
2) In the search help put both of your fields in <b>Search Help Parameter</b>.
Put the Field F1 as Importing and Field F2 as Exporting help parameter.
3) Write a <b>SEARCH HELP EXIT</b> function module which selects the vale for
Field F2 based on import help parameter F1.
4) Attach this search help to the Dataelement of F2 Field.
The above steps is useful only when you have field F2's dataelement as Customer Made.
Thanks and regards,
Ravi.
‎2007 Feb 26 2:01 PM
Hello niranjan
I had the same problem.
After call function module for f1 u just read table t_return and set value of variable f1 = t_return-field_val.
and then for f2 u can use this value.
reward points if useful.