Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Search Help Exfit for Material

Former Member
0 Kudos
140

Hi,

Scenario:

in the F4 dropdown for material, I have added a new elementary search help which will search a laterial based on material description(makt-maktx)/basic material(mara-wrkst)/size & dimension(mara-groes).

Requirement:

I need to add one more field in my search help "Global Search". In this field whatever has been entered has to be searched in all the tree fields mentioned above. For eg.

If i enter "valve" in my global search field, then 'valve' should be searched in makt-maktx & mara-wrkst & mara-groes and should give me the total result.

Solution Lead:

I created a search help exit and inside that I found out that I have to write my code under:

IF CALLCONTROL-STEP = 'SELECT'.

-


Now Im not able to figure out how to write the code inside IF CALLCONTROL-STEP = 'SELECT'.

Please help.

Regards,

Shobhit

1 ACCEPTED SOLUTION

Former Member
0 Kudos
81

Hi!

Say you've define input parameter PARAM for your search help. Then you should proceed as follows:

IF callcontrol-step = 'SELECT'.

DATA:

param_val TYPE ddshiface-value.

CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'

EXPORTING

parameter = 'PARAM'

  • OFF_RESULT = 0

  • LEN_RESULT = 0

  • FIELDNAME = ' '

IMPORTING

value = param_val

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

  • SELOPT_TAB =

  • RESULTS_TAB =

CHANGING

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

parameter_unknown = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DATA:

it_hitlist TYPE STANDARD TABLE OF z_your_hitlist_structure.

IF param_val IS INITIAL.

*TODO: fill it_hitlist correspondingly

ELSE.

*TODO: fill it_hitlist correspondingly too

ENDIF.

IF sy-subrc = 0.

callcontrol-step = 'DISP'.

ELSE.

callcontrol-step = 'EXIT'.

ENDIF.

CALL FUNCTION 'F4UT_RESULTS_MAP'

  • EXPORTING

  • SOURCE_STRUCTURE =

  • APPLY_RESTRICTIONS = ' '

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

source_tab = it_hitlist

CHANGING

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

illegal_structure = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

Regards,

Maxim.

2 REPLIES 2

Former Member
0 Kudos
82

Hi!

Say you've define input parameter PARAM for your search help. Then you should proceed as follows:

IF callcontrol-step = 'SELECT'.

DATA:

param_val TYPE ddshiface-value.

CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'

EXPORTING

parameter = 'PARAM'

  • OFF_RESULT = 0

  • LEN_RESULT = 0

  • FIELDNAME = ' '

IMPORTING

value = param_val

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

  • SELOPT_TAB =

  • RESULTS_TAB =

CHANGING

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

parameter_unknown = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DATA:

it_hitlist TYPE STANDARD TABLE OF z_your_hitlist_structure.

IF param_val IS INITIAL.

*TODO: fill it_hitlist correspondingly

ELSE.

*TODO: fill it_hitlist correspondingly too

ENDIF.

IF sy-subrc = 0.

callcontrol-step = 'DISP'.

ELSE.

callcontrol-step = 'EXIT'.

ENDIF.

CALL FUNCTION 'F4UT_RESULTS_MAP'

  • EXPORTING

  • SOURCE_STRUCTURE =

  • APPLY_RESTRICTIONS = ' '

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

source_tab = it_hitlist

CHANGING

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

illegal_structure = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

Regards,

Maxim.

0 Kudos
81

Hi Maxim,

No one else could have helped me better!!!

Thanks a lot!!!

Shobhit