‎2010 Apr 20 12:44 PM
Hi All,
I want a search help such as If I enter a warehouse number on my screen then search help for storage bins should have that warehouse number populated in selection dialog.
I guess i have to write some code in search help exit if CALLCONTROL-STEP = 'PRESEL'.
But I am not able to set the warehouse value to parameter.
Does any one have done something like this?
Thanks in Advance,
Shailly
‎2010 Apr 20 1:19 PM
Yup, you should do like this
"in search help exit function
DATA wa_shlp_selopt LIKE LINE OF shlp-selopt.
"change default value before dialog box with value selection appears
IF callcontrol-step = 'PRESEL'.
wa_shlp_selopt-shlpname = 'TRDIR'.
wa_shlp_selopt-shlpfield = 'NAME'.
wa_shlp_selopt-sign = 'I'.
wa_shlp_selopt-option = 'CP'.
wa_shlp_selopt-low = 'Z*'.
APPEND wa_shlp_selopt TO shlp-selopt.
wa_shlp_selopt-shlpname = 'TRDIR'.
wa_shlp_selopt-shlpfield = 'NAME'.
wa_shlp_selopt-sign = 'I'.
wa_shlp_selopt-option = 'CP'.
wa_shlp_selopt-low = 'Y*'.
APPEND wa_shlp_selopt TO shlp-selopt.
"skip the dialog box
callcontrol-step = 'SELECT'.
ENDIF.
Regards
Marcin
‎2010 Apr 20 1:19 PM
Yup, you should do like this
"in search help exit function
DATA wa_shlp_selopt LIKE LINE OF shlp-selopt.
"change default value before dialog box with value selection appears
IF callcontrol-step = 'PRESEL'.
wa_shlp_selopt-shlpname = 'TRDIR'.
wa_shlp_selopt-shlpfield = 'NAME'.
wa_shlp_selopt-sign = 'I'.
wa_shlp_selopt-option = 'CP'.
wa_shlp_selopt-low = 'Z*'.
APPEND wa_shlp_selopt TO shlp-selopt.
wa_shlp_selopt-shlpname = 'TRDIR'.
wa_shlp_selopt-shlpfield = 'NAME'.
wa_shlp_selopt-sign = 'I'.
wa_shlp_selopt-option = 'CP'.
wa_shlp_selopt-low = 'Y*'.
APPEND wa_shlp_selopt TO shlp-selopt.
"skip the dialog box
callcontrol-step = 'SELECT'.
ENDIF.
Regards
Marcin
‎2010 Apr 20 1:57 PM
‎2010 Apr 20 1:45 PM
Hi Shailly,
I don#t know if that will be the best option for you, but you can make use of the abap program event at value request for your parameter_id.
What you need is to insert a similar code like the one below:
at selection-screen on value-request for p_param
select fielda fieldb from storage bin table into gi_warehouse_bin
where warehouse = warehouse parameter.
delete adjacent duplicates from gi_zzdez comparing all fields.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = space
dynpprog = 'REPORT_NAME'
dynpnr = '1000'
dynprofield = 'P_BIN'
window_title = 'Text'
value_org = 'S'
tables
value_tab = gi_warehouse_bin
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.
Cheers,
Florin