2008 Mar 18 8:57 AM
Hello,
I have a search help with a function call inside. I am just using a search help to get all the logic so that I do not need to implement a dynpro popup.
I am getting up to five different values now in the selopt-table. Since fm can not handle multiple values I have the following coding:
IF callcontrol-step = 'SELECT'.
LOOP AT shlp-selopt INTO ls_shlp_selopt
WHERE ( shlpfield = 'COUNTRY'
OR shlpfield = 'STATE'
OR shlpfield = 'ZIPCODE'
OR shlpfield = 'CITY'
OR shlpfield = 'COUNTY' )
AND ( sign <> 'I'
OR option <> 'EQ' ).
callcontrol-step = 'PRESEL'.
MESSAGE i651(56) DISPLAY LIKE 'E'.
EXIT.
ENDLOOP.
ENDIF.That works fine but may confuse the user (because first he can enter multiple values and afterwards they are forbidden. Is it possbile to remove the multiple selection button from the sh? Maybe in the PRESEL step?!
Thanks for you help,
Marcus
2008 Mar 30 10:07 PM
Hello Marcus
The following sample report ZUS_SDN_CALL_SEARCHHELP shows how to switch between single and multiple selection for a search help.
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_CALL_SEARCHHELP
*&
*&---------------------------------------------------------------------*
*& Thread: Disable multiple selection in search help
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="786400"></a>
*&---------------------------------------------------------------------*
REPORT zus_sdn_call_searchhelp.
TYPE-POOLS: abap, shlp.
DATA: gs_shlp TYPE shlp_descr,
gt_retval TYPE STANDARD TABLE OF ddshretval.
parameters:
p_multi as CHECKBOX DEFAULT ' '.
START-OF-SELECTION.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'DEBIA'
* SHLPTYPE = 'SH'
IMPORTING
shlp = gs_shlp.
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = gs_shlp
* DISPONLY = ' '
* MAXRECORDS = 500
multisel = p_multi
* CUCOL = SY-CUCOL
* CUROW = SY-CUROW
* IMPORTING
* RC =
TABLES
return_values = gt_retval.
END-OF-SELECTION.
Now if you look under the hood of the second function module you see how the switch is done internally:
FUNCTION F4IF_START_VALUE_REQUEST.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(DISPONLY) LIKE DDSHF4CTRL-DISPONLY DEFAULT ' '
*" VALUE(MAXRECORDS) LIKE DDSHF4CTRL-MAXRECORDS DEFAULT 500
*" VALUE(MULTISEL) LIKE DDSHF4CTRL-MULTISEL DEFAULT ' '
*" VALUE(CUCOL) LIKE SY-CUCOL DEFAULT SY-CUCOL
*" VALUE(CUROW) LIKE SY-CUROW DEFAULT SY-CUROW
*" EXPORTING
*" VALUE(RC) LIKE SY-SUBRC
*" TABLES
*" RETURN_VALUES STRUCTURE DDSHRETVAL
*"----------------------------------------------------------------------
DATA CALLCONTROL LIKE DDSHF4CTRL.
DATA: OCXINTERFACE LIKE DDSHOCXINT.
DATA: HELP_INFOS LIKE HELP_INFO.
CALLCONTROL-DISPONLY = DISPONLY.
CALLCONTROL-MAXRECORDS = MAXRECORDS.
CALLCONTROL-MULTISEL = MULTISEL. " switch single/multiple selection
CALLCONTROL-CUCOL = CUCOL.
CALLCONTROL-CUROW = CUROW.
CALLCONTROL-OCX_OFF = ' '.
...
Regards
Uwe
Hello,
I have a search help with a function call inside. I am just using a search help to get all the logic so that I do not need to implement a dynpro popup.
I am getting up to five different values now in the selopt-table. Since fm can not handle multiple values I have the following coding:
IF callcontrol-step = 'SELECT'.
LOOP AT shlp-selopt INTO ls_shlp_selopt
WHERE ( shlpfield = 'COUNTRY'
OR shlpfield = 'STATE'
OR shlpfield = 'ZIPCODE'
OR shlpfield = 'CITY'
OR shlpfield = 'COUNTY' )
AND ( sign <> 'I'
OR option <> 'EQ' ).
callcontrol-step = 'PRESEL'.
MESSAGE i651(56) DISPLAY LIKE 'E'.
EXIT.
ENDLOOP.
ENDIF.That works fine but may confuse the user (because first he can enter multiple values and afterwards they are forbidden. Is it possbile to remove the multiple selection button from the sh? Maybe in the PRESEL step?!
Thanks for you help,
Marcus
2008 Mar 30 10:07 PM
Hello Marcus
The following sample report ZUS_SDN_CALL_SEARCHHELP shows how to switch between single and multiple selection for a search help.
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_CALL_SEARCHHELP
*&
*&---------------------------------------------------------------------*
*& Thread: Disable multiple selection in search help
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="786400"></a>
*&---------------------------------------------------------------------*
REPORT zus_sdn_call_searchhelp.
TYPE-POOLS: abap, shlp.
DATA: gs_shlp TYPE shlp_descr,
gt_retval TYPE STANDARD TABLE OF ddshretval.
parameters:
p_multi as CHECKBOX DEFAULT ' '.
START-OF-SELECTION.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'DEBIA'
* SHLPTYPE = 'SH'
IMPORTING
shlp = gs_shlp.
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = gs_shlp
* DISPONLY = ' '
* MAXRECORDS = 500
multisel = p_multi
* CUCOL = SY-CUCOL
* CUROW = SY-CUROW
* IMPORTING
* RC =
TABLES
return_values = gt_retval.
END-OF-SELECTION.
Now if you look under the hood of the second function module you see how the switch is done internally:
FUNCTION F4IF_START_VALUE_REQUEST.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(DISPONLY) LIKE DDSHF4CTRL-DISPONLY DEFAULT ' '
*" VALUE(MAXRECORDS) LIKE DDSHF4CTRL-MAXRECORDS DEFAULT 500
*" VALUE(MULTISEL) LIKE DDSHF4CTRL-MULTISEL DEFAULT ' '
*" VALUE(CUCOL) LIKE SY-CUCOL DEFAULT SY-CUCOL
*" VALUE(CUROW) LIKE SY-CUROW DEFAULT SY-CUROW
*" EXPORTING
*" VALUE(RC) LIKE SY-SUBRC
*" TABLES
*" RETURN_VALUES STRUCTURE DDSHRETVAL
*"----------------------------------------------------------------------
DATA CALLCONTROL LIKE DDSHF4CTRL.
DATA: OCXINTERFACE LIKE DDSHOCXINT.
DATA: HELP_INFOS LIKE HELP_INFO.
CALLCONTROL-DISPONLY = DISPONLY.
CALLCONTROL-MAXRECORDS = MAXRECORDS.
CALLCONTROL-MULTISEL = MULTISEL. " switch single/multiple selection
CALLCONTROL-CUCOL = CUCOL.
CALLCONTROL-CUROW = CUROW.
CALLCONTROL-OCX_OFF = ' '.
...
Regards
Uwe
2008 Mar 31 10:37 AM
Hi Uwe,
that did not directly help. Because I already have a search help exit and don't know how to use a report there.
But with the help of you comment I found the parameter callcontrol-multisel. Unfortunately setting this to space did not help. But a where used list showed me this example:
CALL FUNCTION 'F4UT_SUPPRESS_SELECT_OPTIONS'
EXPORTING
parameter = 'my_fieldname'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
parameter_unknown = 1
OTHERS = 2.... and that helped me in the presel step.
Strange.. but this does not working in WD-ABAP. But that I'll clarify with the WD-guys.
Thank you for showing me the right path, even if this was not your motivation.
Marcus
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |