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: 

Hi

Former Member
0 Kudos

Hi gurus,

I created a match code object/search help for the required field. but i am getting only the values but not the description for that respective field. how to get that short text. its very urgent.

the table i used if s063 and fields are fegrp, fecod , surcod , urgrp. (i created each match code obj for the field as user req)

thanks

sankar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sankar,

create a dynamic f4 help. that has more control.

chk this sample

codetables: mara, makt.

data: begin of itab occurs 0,

matnr like mara-matnr,

end of itab.

data : begin of btab occurs 0,

maktx like makt-maktx,

end of btab.

data mak like makt-maktx.

DATA : return like ddshretval occurs 0 with header line.

data: begin of dynpfields occurs 0.

include structure dynpread.

data: end of dynpfields.

parameters: p_matnr like mara-matnr,

p_maktx like makt-maktx.

Initialization.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

REFRESH ITAB.

SELECT matnr FROM mara INTO TABLE ITAB.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MATNR '

dynprofield = 'P_MATNR '

dynpprog = sy-REPID

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = ITAB

return_tab = return.

select single maktx from makt into mak where matnr = return-fieldval.

p_matnr = return-fieldval.

refresh return.

clear return.

move 'P_MAKTX' to dynpfields-fieldname.

move mak to dynpfields-fieldvalue.

append dynpfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

.

IF sy-subrc 0.

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

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

ENDIF.

refresh return.

clear return.[/code]

Plzz reward if it is useful,

Mahi.

2 REPLIES 2

Former Member
0 Kudos

Hi Sankar,

create a dynamic f4 help. that has more control.

chk this sample

codetables: mara, makt.

data: begin of itab occurs 0,

matnr like mara-matnr,

end of itab.

data : begin of btab occurs 0,

maktx like makt-maktx,

end of btab.

data mak like makt-maktx.

DATA : return like ddshretval occurs 0 with header line.

data: begin of dynpfields occurs 0.

include structure dynpread.

data: end of dynpfields.

parameters: p_matnr like mara-matnr,

p_maktx like makt-maktx.

Initialization.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

REFRESH ITAB.

SELECT matnr FROM mara INTO TABLE ITAB.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MATNR '

dynprofield = 'P_MATNR '

dynpprog = sy-REPID

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = ITAB

return_tab = return.

select single maktx from makt into mak where matnr = return-fieldval.

p_matnr = return-fieldval.

refresh return.

clear return.

move 'P_MAKTX' to dynpfields-fieldname.

move mak to dynpfields-fieldvalue.

append dynpfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

.

IF sy-subrc 0.

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

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

ENDIF.

refresh return.

clear return.[/code]

Plzz reward if it is useful,

Mahi.

Former Member
0 Kudos

hi

Attaching a search help to a field

A search help can influence the behavior of a field when the input help is called. The search help must be assigned to the field in order to do this. You have the following options for this assignment:

Attach search help to a data element / table or structure field / screen field / check table.

Conventionally search helps are attached to table fields or data elements. We shall see the same.

Attaching a search help to a table field

Choose the field name, click on search help tab and

provide the name of the search help.

A search help is attached to a field of a table or structure in the maintenance transaction for this table/structure, analogously to attaching to a table. You must assign the interface parameters of the search help to any fields of the table/structure. The search field must be assigned to an EXPORT parameter of the search help at this time.

Attach the search help to the table field

The search help ZSTRAVELAG_NAME is therefore directly attached to the field AGENCYNUM of table ZSTRAVELAG.

Attaching a search help to a data element

Provide the search help name and the parameter name

under the further characteristics tab of the data element.

If the input help of a field is defined by its data element, no further screen fields can be used in the input help.

Also note that the input F4 help would be available wherever the data element is used.

Attaching a search help to a screen element

A search help can be directly assigned to a screen field in two ways.

The name of the search help must be entered in the Screen Painter in the Attributes for the field in the field Search help.

The name of the search help can be defined for selection screens in ABAP reports in the PARAMETERS or SELECT-OPTIONS statement directly following the supplement MATCHCODE OBJECT.

However, input help is only available for this particular screen.

In this case, the search help is only available for this screen.

IF YOU WANT TO ATTCH A SERACH HELP TO THE SCREEN FILED THIS IS THE CODE

codeTYPES : BEGIN OF ST_OBJID_SH,

OTYPE TYPE HRP1000-OTYPE,

OBJID TYPE HRP1000-OBJID,

END OF ST_OBJID_SH.

DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.

DATA : WA_OBJID_SH TYPE ST_OBJID_SH.

***********SELECTION SCREEN DESIGN***********************

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .

SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .

SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B1.

**********END OF SELECTION SCREEN DESIGN*****************

*********VALIDATION FOR SCREEN FIELDS********************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.

IF S_OBJID IS NOT INITIAL.

SELECT OTYPE OBJID FROM HRP1000

INTO TABLE IT_OBJID_SH

WHERE OTYPE = 'D'.

IF SY-SUBRC EQ 0.

SEARCH HELP FOR QUALIFICATION.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

DDIC_STRUCTURE = ' '

RETFIELD = 'OBJID'

PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_OBJID'

STEPL = 0

WINDOW_TITLE =

VALUE = ' '

VALUE_ORG = 'S'

MULTIPLE_CHOICE = ' '

DISPLAY = ' '

CALLBACK_PROGRAM = ' '

CALLBACK_FORM = ' '

MARK_TAB =

IMPORTING

USER_RESET =

TABLES

VALUE_TAB = IT_OBJID_SH

FIELD_TAB =

RETURN_TAB = RETURN_TAB

DYNPFLD_MAPPING =

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.

ENDIF.[/code]

REWARD IF USEFULL