2005 Aug 05 2:42 PM
Hi all,
I have 2 select options.i want to get the f4 help for the second select option based on the entry of first select option.
ex: first select option is <b>customer number</b>
and second is <b>purchase order no</b>.
if enter some value in customer select option .
based on this i need to get f4 search for the purchase orders.
thanks in advance
kiran
2005 Aug 05 2:49 PM
This sample uses parameters instead of select-options, but you get the idea here.....
report zrich_0002 .
parameters: p_kunnr type vbak-kunnr,
p_bstkd type vbkd-bstkd.
at selection-screen on value-request for p_bstkd.
data: begin of help_bstkd occurs 0,
bstkd type vbkd-bstkd,
end of help_bstkd.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_KUNNR'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_KUNNR'.
select bstkd into corresponding fields of table help_bstkd
from vbak
inner join vbkd
on vbak~vbeln = vbkd~vbeln
where vbak~kunnr = p_kunnr.
delete adjacent duplicates from help_bstkd comparing bstkd.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BSTKD'
dynprofield = 'P_BSTKD'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_bstkd.
In this case, user must hit enter after entering the customer number and before hitting F4 on PO number.
Regards,
Rich Heilman
I've been playing with it for a while, I don't think that it is going to work they you want it to by using the DYNPRO_VALUES_READ. I think that you going to have to force the user to hit enter after they enter the customer number and before the F4 dropdown for po number.
Regards,
Rich Heilman
2005 Aug 05 2:49 PM
This sample uses parameters instead of select-options, but you get the idea here.....
report zrich_0002 .
parameters: p_kunnr type vbak-kunnr,
p_bstkd type vbkd-bstkd.
at selection-screen on value-request for p_bstkd.
data: begin of help_bstkd occurs 0,
bstkd type vbkd-bstkd,
end of help_bstkd.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_KUNNR'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_KUNNR'.
select bstkd into corresponding fields of table help_bstkd
from vbak
inner join vbkd
on vbak~vbeln = vbkd~vbeln
where vbak~kunnr = p_kunnr.
delete adjacent duplicates from help_bstkd comparing bstkd.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BSTKD'
dynprofield = 'P_BSTKD'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_bstkd.
In this case, user must hit enter after entering the customer number and before hitting F4 on PO number.
Regards,
Rich Heilman
2005 Aug 05 3:19 PM
Hai Rich,
I need for select-options but not for parameters.in parameters we have only one value,but in select-options we have more values .
regards
kiran
2005 Aug 05 3:29 PM
I thought maybe you would go by my example and make the parameters as select-options. Turns out, its even easier for select-options.
report zrich_0002 .
tables: vbak, vbkd.
select-options: s_kunnr for vbak-kunnr,
s_bstkd for vbkd-bstkd.
at selection-screen on value-request for s_bstkd-low.
perform help_bstkd.
at selection-screen on value-request for s_bstkd-high.
perform help_bstkd.
*---------------------------------------------------------------------*
* FORM help_bstkd *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form help_bstkd.
data: begin of help_bstkd occurs 0,
bstkd type vbkd-bstkd,
end of help_bstkd.
select bstkd into corresponding fields of table help_bstkd
from vbak
inner join vbkd
on vbak~vbeln = vbkd~vbeln
where vbak~kunnr in s_kunnr.
delete adjacent duplicates from help_bstkd comparing bstkd.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BSTKD'
dynprofield = 'S_BSTKD'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_bstkd.
endform.
Please remember to award points for helpful answers. Thanks.
Regards,
Rich Heilman
2005 Aug 05 3:57 PM
Hi rich,
its working fine .but how to read the dynpro values.please send me code for DYNP_VALUES_READ function module.becoz i was struck up there.iam unable to read the values that i enter in the select option customer as i said earlier.
with regard
kiran
2005 Aug 05 4:00 PM
2005 Aug 05 4:11 PM
2005 Aug 05 4:31 PM
2005 Aug 05 4:39 PM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |