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 - doubt

Former Member
0 Kudos

Hi Experts

I am using the FM for F4 help inwhich i done a query also.

When i put F4, it populates all the values from the database, But my requirement is when i put the F4, it needs to populate the restrictions screen first, from there only i will put input selection.

How to do it, pls help me on this.

Regards

Rajaram

12 REPLIES 12

Former Member
0 Kudos

Hi

for that filed do like this

before writing t his code my parameter is also done same after writing t his it had given only values which satisfy my condition

TYPES : 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******************

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.

              .

<b>Rewar di fusefull</b>

0 Kudos

But in your program when i put F4 its not asking any values yar.

0 Kudos

HI

no its working , ok place cursor in S_OBJID and press F4

it will show values only related to that condition mentioned

other wise do one thing write code for your requirment and try it ,it works fine

<b>Reward if usefull</b>

0 Kudos

This is the coding part which i done for Search help FM to the field.

When i put F4, its populating all the values directly, but i want first the restriction screen. help me pls.

DATA: BEGIN OF si_itab2 OCCURS 10 ,

BUKRS LIKE VBRK-BUKRS,

VBELN LIKE VBRK-VBELN,

STCEG LIKE VBRK-STCEG,

KUNAG LIKE VBRK-KUNAG,

ERDAT LIKE VBRK-ERDAT,

FKDAT LIKE VBRK-FKDAT,

FKART LIKE VBRK-FKART,

AUBEL LIKE VBRP-AUBEL,

END OF si_itab2.

  • CLEAR : RETURN , DYNFIELDS , DYNMAP.

REFRESH : return , dynfields , dynmap , fieldtab.

SELECT * FROM VBRK

INTO CORRESPONDING FIELDS OF TABLE si_itab2.

LOOP AT si_itab2.

SELECT SINGLE AUBEL FROM VBRP

INTO (si_itab2-AUBEL)

WHERE VBELN = si_itab2-VBELN.

MODIFY si_itab2.

CLEAR : si_itab2.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'VBELN'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'VBRK-VBELN'

value_org = 'S'

display = 'F'

TABLES

value_tab = si_itab2

return_tab = return

dynpfld_mapping = dynmap

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.

READ TABLE return WITH KEY fieldname = 'VBRK-VBELN' .

REFRESH : dynfields.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

APPEND dynfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynfields

EXCEPTIONS

OTHERS = 8.

0 Kudos

HI

this an event level you have to call that function module under event

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

and give proper way like i had shown you above

0 Kudos

No i have done this in dialog programming actually.

Former Member
0 Kudos

Hi,

This can be done using Search help parameters. While creating Search help, it asks for Search help parameters. Specify your restriction parameters in that.

Thanks,

Kulwant Singh

former_member386202
Active Contributor
0 Kudos

Hi,

Goto SE11 display that search help and in dialog behavior tab set ur dialog type as dialog with value restriction. It will work

Regards,

Prashant

0 Kudos

Hi Prashant

But am using search help FM yar, i have not created the serch help, now how can i do this.

Regards

Rajaram

Former Member
0 Kudos

Hi

<b>Attaching a search help to a field</b>

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.

<b>Attaching a search help to a table field</b>

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.

<b>Attaching a search help to a data element</b>

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.

<b>Attaching a search help to a screen element</b>

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.

<b>Rewar dif usefull</b>

0 Kudos

Hi Naresh

Thanks for your valuable replies, but my requirement is,

When i putting the F4, its taking so much time to populate all the values,

and its Maximum Hit is 500,

We can avoid this problem by 2 ways,

1, we should reduce the maximum hit, if so, how to reduce this, pls tell me, i dont know this.

2. Initially i need to open the restriction window not the data window.

how to do this, i hope u r getting me clearly.

Regards

Rajaram

0 Kudos

Hi

1, we should reduce the maximum hit, if so, how to reduce this, pls tell me, i dont know this.

this can be done by select query , if write the select query properly ,eans perfect way then it will be ok to retrive data

2. Initially i need to open the restriction window not the data window.