Application Development and Automation 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: 
Read only

F4 help using elementary search help

Former Member
0 Likes
1,532

Hi experts,

I have created a report which has 3 input parameters

PARAMETERS: p_cid   TYPE   zdrcityid,

                         p_cname TYPE   zdrcityname,

                         p_ccode TYPE   zdrcitycode.

I have provided elementary search help(ZSHCITY) for p_cid using the module as shown below

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

   EXPORTING

     tabname                   = 'ZDRCITY'

     fieldname                 = 'ID'

    SEARCHHELP                = 'ZSHCITY'

*   SHLPPARAM                 = ' '

    DYNPPROG                  = SY-REPID

    DYNPNR                    = SY-DYNNR

    DYNPROFIELD               = 'P_CID'

*   STEPL                     = 0

*   VALUE                     = ' '

*   MULTIPLE_CHOICE           = ' '

*   DISPLAY                   = ' '

*   SUPPRESS_RECORDLIST       = ' '

*   CALLBACK_PROGRAM          = ' '

*   CALLBACK_FORM             = ' '

*   CALLBACK_METHOD           =

*   SELECTION_SCREEN          = ' '

* IMPORTING

*   USER_RESET                =

  TABLES

    RETURN_TAB                = li_ddshretval

* EXCEPTIONS

*   FIELD_NOT_FOUND           = 1

*   NO_HELP_FOR_FIELD         = 2

*   INCONSISTENT_HELP         = 3

*   NO_VALUES_FOUND           = 4

*   OTHERS                    = 5

           .

I the reset fields i.e p_cname and p_ccode to be filled automatically when the user selects value from the search help on F4.

Please help with this problem...

1 ACCEPTED SOLUTION
Read only

Ruediger_Plantiko
Active Contributor
0 Likes
996

Satish,

for an update of concomitant parameters by a search help, you proceed as follows:

  • In your search help zshcity, declare all these fields as export parameters
  • Define a DDIC structure, say ZZCITYDATA with the components (i.e. cityid, cityname, citycode)
  • Double-click on the cityid field of your structure, press "Search help for field"
  • In the appearing popup, define the "Search help Attachment". This is the mapping of the F4 parameter names with the components of your structure. Map all three parameters you are interested in.
  • Save and Activate.

Now, in your report, define

parameters: p_cid type zzcitydata-cityid,

                  p_cname type zzcitydata-cityname,

                  p_ccode type zzcitydata-citycode.

That's it. The system will automatically provide an F4 help for p_cid, and after selecting a city, the concomitant fields p_cname and p_ccode will be filled automatically. No extra code necessary in your report.

Regards,

Rüdiger

3 REPLIES 3
Read only

Former Member
0 Likes
996

Hi Satish D R,

Use AT SELECTION SCREEN OUTPUT for ur issue...

For example...

AT SELECTION-SCREEN OUTPUT.

select single zdrcityname zdrcitycode

from table zdrcity

into (pc_name, pc_code)

where id = p_cid.

This will satisfy ur requirement...

Reward points if helpful

Read only

Ruediger_Plantiko
Active Contributor
0 Likes
997

Satish,

for an update of concomitant parameters by a search help, you proceed as follows:

  • In your search help zshcity, declare all these fields as export parameters
  • Define a DDIC structure, say ZZCITYDATA with the components (i.e. cityid, cityname, citycode)
  • Double-click on the cityid field of your structure, press "Search help for field"
  • In the appearing popup, define the "Search help Attachment". This is the mapping of the F4 parameter names with the components of your structure. Map all three parameters you are interested in.
  • Save and Activate.

Now, in your report, define

parameters: p_cid type zzcitydata-cityid,

                  p_cname type zzcitydata-cityname,

                  p_ccode type zzcitydata-citycode.

That's it. The system will automatically provide an F4 help for p_cid, and after selecting a city, the concomitant fields p_cname and p_ccode will be filled automatically. No extra code necessary in your report.

Regards,

Rüdiger

Read only

Former Member
0 Likes
996

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

     exporting

       retfield                    = 'ID'

       dynpprog                = sy-repid

       dynpnr                    = sy-dynnr

       dynprofield              = 'P_ID'

       value_org                = 'S'

     tables

       value_tab                = lt_dep    "Table for Primary Selection

       dynpfld_mapping     = lt_fields "Table containing field that are to be auto filled

     exceptions

       parameter_error       = 1

       no_values_found      = 2

       others                     = 3.


Here lt_fields is of type dselc. Then add the fields you want to auto-fill.