cancel
Showing results for 
Search instead for 
Did you mean: 

Search Help MAT1

Former Member
0 Kudos

Hi ABAP Guru's -

My requirement goes like: I have a Zfield pointing to dataelement MATNR in a screen.. When the user hits F4 I want to bring up the search help for MATNR but take him directly to "Material by material type" tab and default the "Material Type" value.. How can I do this??

Nice to have function is to eliminate all the other tabs and show just "Material by material type"..

Please help ASAP..

Regards

Sudhakar

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

how to do this when you have no select options or parameters?

in my case we've defined a custom search help with WERKS and some additional fields (lets say CUSTF1, ..., ...)

in our application we have a field for MARC-WERKS on main dynpro and CUSTF1 on a subscreen

currently when someone performs the F4 help all values are shown

instead of restricting the output only to values for given MARC-WERKS

since the field names of importing parameter of our search help (WERKS)

and the field on dynpro are equal i would assume that this would work automatically

but somehow it seems something is going wrong

ideas?

hymavathi_oruganti
Active Contributor
0 Kudos

MAT1T is the search help for material by material type.

with the declaration of parameters statement itself u can give like this

parameters: zmat like matnr match-code object MAT1T.

former_member125661
Contributor
0 Kudos

Create a new search help ZMAT1 in SE11 as follows.

Search help parameter LPOS SPOS Data Elmnt Def Value

MTART 1 1 MTART 'TRAD'

MAKTG 2 2 MAKTG

SPRAS 3 3 SPRAS

MATNR 4 4 MATNR

Give selection method as M_MAT1T and

Dialog with Value restriction. No search help exit is needed. Save and activate the search help. Attach the search help to your field(ZMATNR) in Se 11. To do this, select your field in se 11, Click on Go-> Search Help->For field and give the search help name that you just created. This is eliminate all the unwanted search help fields when u pres F4. Hope this helps

LucianoBentiveg
Active Contributor
0 Kudos

In the dinpro, in the attributes of field you have 'Search Help', put this the search help that you want to use. To determine the search help to use, go to SE11 in search help put MAT1 and F7, then go to the tab "included search helps", with doeble click you can navigate to find the right one.

Good Luck.

vinod_gunaware2
Active Contributor
0 Kudos

<b>POPUP_GET_VALUES_USER_HELP</b> Dialog box for requesting values, call of user exits (import parameters FORMNAME and PROGRAMNAME) and help (import parameters F1_FORMNAME and F1_PROGRAMNAME, F4_FORMNAME and F4_PROGRAMNAME)

<b>F4IF_FIELD_VALUE_REQUEST</b> F4 help for fields that are only known at runtime Standard F4 help for a Data Dictionary help

<b>F4IF_INT_TABLE_VALUE_REQUEST</b> F4 help also returning the value to be displayed in internal table

<b>HELP_VALUES_GET</b> Popup to display default F4 help values for a table field

<b>HELP_VALUES_GET_NO_DD_NAME</b> Standard popup to display F4 help values for a table field as internal table with additional columns (all fields should be active Data Dictionary table fields). Allow selection for each column. (obsolete since 4.0)

<b>TRANSFER_NAMES_TO_FIELDS</b> Prepare formatted internal table to use as parameter of HELP_VALUES_GET_NO_DD_NAME

<b>POPUP_WITH_TABLE_DISPLAY</b> Popup to display internal table

tables: t001w.

DATA: lc_werks LIKE t001w-werks,

ltab_fields LIKE help_value OCCURS 0 with header line,

BEGIN OF ltab_values OCCURS 0,

feld(40) TYPE c,

END OF ltab_values.

*-- Set up fields to retrieve data

ltab_fields-tabname = 'T001W'.

ltab_fields-fieldname = 'WERKS'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

ltab_fields-tabname = 'T001W'.

ltab_fields-fieldname = 'NAME1'.

ltab_fields-selectflag = space.

APPEND ltab_fields.

*-- Fill values

select * from t001w.

ltab_values-feld = t001w-werks.

append ltab_values.

ltab_values-feld = t001w-name1.

append ltab_values.

endselect.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'WERKS'

tabname = 'T001W'

title_in_values_list = 'Select a value'

IMPORTING

select_value = lc_werks

TABLES

fields = ltab_fields

valuetab = ltab_values

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

regards

vinod

Former Member
0 Kudos

Is this a report program or a dialog/module program?

In the report program, all you have to do is define the parameter or select-option as follows.


  PARAMETERS: p_matnr LIKE mara-matnr MATCHCODE OBJECT mat1t.
  SELECT-OPTIONS: s_matnr FOR mara-matnr MATCHCODE OBJECT mat1t.

In a module program, just enter 'MAT1T' in the 'Search help' attribute of the field.

Srinivas