Автор Тема: Как передать параметр для сравнения в средство поиска?..  (Прочитано 17485 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн knopix

  • Newbie
  • *
  • Сообщений: 34
  • Репутация: +5/-0
  • YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Здравствуйте...

Подскажите, пожалуйста, как передать параметр-ограничение "по умолчанию" в элементарное средство поиска для сравнения. Например, для БЕ я ограничение сделал со знаком "=" (SET PARAMETER ID 'BUK' field TXT6.), а как быть, если нужно поставить ограничения для проверки вхождения даты в интервал, то есть с опциями выбора "<=" и ">="?
« Последнее редактирование: Февраль 07, 2011, 09:02:17 am от knopix »

Оффлайн Uukrul

  • SAP ECC 6.0 Ehp(*)
  • Administrator
  • Epic Member
  • *****
  • Сообщений: 3 809
  • Репутация: +47/-0
  • Пол: Мужской
  • YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • Sapforum.BIZ
Ну экран ваш похоже, значит надо рисовать ручной вызов средства поиска с заполнением всех необходимых вам структур. Пример постараюсь найти и выложить. А так как вы вызов делаете, это просто работают SET/GET параметры.

Ну посмотрел еще, короче если вы хотите использовать другие значения кроме равно, то нужно делать не только свой код поиска, но и функциональный модуль который будет обрабатывать значения. Вот из справки типа как это делать есть ФМ с примером и документацией:
Цитировать
You can change the behavior of search helps with a search help exit.  Copy the SAP supplied function module F4IF_SHLP_EXIT_EXAMPLE.  This module is well documented (for a change!), but here are some highlights:
TABLE parameters:
 SHLP_TAB - contains information about the search help fields and structures.   
 RECORD_TAB – contains the hit list.
CHANGING parameters:
 SHLP – additional information about the parameters. (Deep structure)
 CALLCONTROL – instructions for controlling the search help process.

Callcontrol-step:  This field is set by the system and can be changed by your code.  The function module will be called once for each step of the process, with some conditional exceptions noted below.
SELONE –  before selecting an elementary search help.
PRESEL1 – after selecting an elementary search help.
PRESEL –  before sending the dialog box for restricting values.
SELECT - before selecting the values.
DISP - before displaying the hit list.
RETURN -  set by your code if one hit was found during selection.
RETTOP – follows RETURN if called from a collective search help
EXIT – set by your code.  Terminates the search help process
CREATE - if the user selects the function “Create new values".

1.  SELONE

Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This timepoint can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps.

Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. You may not change the next timepoint.

The timepoint is not accessed again if another elementary search help is to be selected during the dialog.

2.  PRESEL1

After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT at this timepoint in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).

3.  PRESEL

Before sending the dialog box for restricting values. This timepoint is suitable for predefining the value restriction or for completely suppressing or copying the dialog.

4.  SELECT

Before selecting the values. If you do not want the default selection, you should copy this timepoint with a search help exit. DISP should be set as the next timepoint.

5.  DISP

Before displaying the hit list. This timepoint is suitable for restricting the values to be displayed, e.g. depending on authorizations.

6.  RETURN (usually as return value for the next timepoint)

The RETURN timepoint should be returned as the next step if a single hit was selected in a search help exit.

It can make sense to change the F4 flow at this timepoint if control of the process sequence of the Transaction should depend on the selected value (typical example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.

7.  RETTOP

You only go to this timepoint if the input help is controlled by a collective search help. It directly follows the timepoint RETURN. The search help exit of the collective search help, however, is called at timepoint RETTOP.

8.  EXIT (only for return as next timepoint)

The EXIT timepoint should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.

9.  CREATE

The CREATE timepoint is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.

The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.

10. APP1, APP2, APP3

If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these timepoints are introduced. They are accessed when the user presses the corresponding pushbutton.

« Последнее редактирование: Февраль 07, 2011, 08:02:36 pm от Uukrul »

xiponk

  • Гость
Спасибо большое за ответ.

P.S. извините, что не по теме, но не нашёл куда написать. Не могу зайти под своей учёткой. Ввожу пароль - пишет "неверный". Пытаюсь задать новый по ссылке - "Неправильный код активации".

Оффлайн Uukrul

  • SAP ECC 6.0 Ehp(*)
  • Administrator
  • Epic Member
  • *****
  • Сообщений: 3 809
  • Репутация: +47/-0
  • Пол: Мужской
  • YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • Sapforum.BIZ
You are not allowed to view links. Register or Login
P.S. извините, что не по теме, но не нашёл куда написать. Не могу зайти под своей учёткой. Ввожу пароль - пишет "неверный". Пытаюсь задать новый по ссылке - "Неправильный код активации".
Ну я сбросил вам на почту новый пароль попробуйте зайти с ним и потом смените его на свой.

Оффлайн knopix

  • Newbie
  • *
  • Сообщений: 34
  • Репутация: +5/-0
  • YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
В общем, я сделал так:

Создал свой ФМ 'Z_SHLP_EXIT_WL', его прописал в search help exit средства поиска. В ФМе:

Код: You are not allowed to view links. Register or Login
  IF CALLCONTROL-STEP = 'PRESEL'.

    SELOPT-SHLPNAME = SHLP-SHLPNAME.
    SELOPT-SHLPFIELD = 'BEGDA'.
    SELOPT-SIGN = 'I'.
    SELOPT-OPTION = 'LE'.
    SELOPT-LOW = TXT7.
    SELOPT-HIGH = ' '.

    APPEND SELOPT TO SHLP-SELOPT.

    SELOPT-SHLPNAME = SHLP-SHLPNAME.
    SELOPT-SHLPFIELD = 'ENDDA'.
    SELOPT-SIGN = 'I'.
    SELOPT-OPTION = 'GE'.
    SELOPT-LOW = TXT7.
    SELOPT-HIGH = ' '.

    APPEND SELOPT TO SHLP-SELOPT.

    EXIT.
  ENDIF.

Вроде, работает  :)

Оффлайн Uukrul

  • SAP ECC 6.0 Ehp(*)
  • Administrator
  • Epic Member
  • *****
  • Сообщений: 3 809
  • Репутация: +47/-0
  • Пол: Мужской
  • YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • Sapforum.BIZ
Ну чтобы не рисовать каждый раз свой вызов метода обработки для кода поиска, я как-то давно сделал универсальный ФМ для работы с кодами поиска, который и использую во всех программах где надо вызвать код поиска не совсем со стандартным поведением: You are not allowed to view links. Register or Login

Sapforum.Biz