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: 

Show a standard SEARCH HELP using import parameters

Former Member
0 Kudos
3,706

Hi. I have the standard search help H_T503Z:

When execute with this import parameters:

This is the result:

Can I call this search help in a report, passing the parameters MOLGA and PERKS to show the same than this last image?

If I associate directly the search help to the field in the dynpro, it shows me all of possible entries, without any filters and without the fields of the top. I want show the final screen with a specific MOLGA and PERSK.

The functionality must be the same than in the infotype 0001:

PERSG is "1" and the MOLGA of this PERNR is "10", and the result is the same:

Thanks.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
728

You could call any search help and add your selection in the allowed input parameter :

- In top include add a type-pools: shlp.

- Call FM F4IF_FIELD_VALUE_REQUEST

- Fill parameters callback_program and callback_form with the caller program name and a form name

- Define the form with this signature

form formname  tables   record_tab structure seahlpres

                 changing shlp type shlp_descr_t

                          callcontrol like ddshf4ctrl.

- In the form update the internal table SHLP-INTERFACE (list if input parameters) with your selection. (subfield VALUE)

This works for every parameter, even if not associated to a memory id.

Regards,

Raymond

16 REPLIES 16

former_member209920
Active Participant
0 Kudos
728

Hi

Before calling the search help, set parameter 'MOL' to your value i.e. '10' and 'PRG' to your value i.e. '1'.

You can set it at .Selection screen output. or at .on value request'.

Regards,

ManuB

0 Kudos
728

How I can calling the search help, and how can do it setting parameters?

0 Kudos
728

Hi

I guess you are making a Z report.

You can give Match Code with parameters. Or assign search help on value request using FM 'F4IF_FIELD_VALUE_REQUEST'

For parameter setting

  SET PARAMETER ID: 'CAR' FIELD carrier,

                    'CON' FIELD connection.

former_member282968
Contributor
0 Kudos
728

Dear Adrain,

You can achive this by implementing search help exit.

Please check the thread below on how to create search help-exit

http://wiki.sdn.sap.com/wiki/display/Snippets/Implementing+Search+Help+Exits

With regards,

raymond_giuseppi
Active Contributor
0 Kudos
729

You could call any search help and add your selection in the allowed input parameter :

- In top include add a type-pools: shlp.

- Call FM F4IF_FIELD_VALUE_REQUEST

- Fill parameters callback_program and callback_form with the caller program name and a form name

- Define the form with this signature

form formname  tables   record_tab structure seahlpres

                 changing shlp type shlp_descr_t

                          callcontrol like ddshf4ctrl.

- In the form update the internal table SHLP-INTERFACE (list if input parameters) with your selection. (subfield VALUE)

This works for every parameter, even if not associated to a memory id.

Regards,

Raymond

0 Kudos
728

Thaks. But it doesn't works completly fine:

My call of FM:

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

  EXPORTING

    tabname                   = 'PA9201'

    fieldname                 = 'PERSK'

   SEARCHHELP                = 'H_T503Z'

   CALLBACK_PROGRAM          = sy-repid

   CALLBACK_FORM             = 'PERSK_VALUE_REQUEST'.

And the callback form:

FORM persk_value_request  TABLES   record_tab STRUCTURE seahlpres

                 CHANGING shlp TYPE shlp_descr_t

                          callcontrol LIKE ddshf4ctrl.

  DATA: ls_interface TYPE ddshiface.

  LOOP AT shlp-interface INTO ls_interface.

    IF ls_interface-shlpfield = 'PERSG'.

      ls_interface-value = '1'.

      MODIFY shlp-interface FROM ls_interface.

    ELSEIF ls_interface-shlpfield = 'MOLGA'.

      ls_interface-value = '10'.

      MODIFY shlp-interface FROM ls_interface.

    ENDIF.

  ENDLOOP.

ENDFORM.

When execute, the SHLP structure does complete correctly (I suppose):

But show this:

It didn't took into account the MOLGA, only the PERSG, and didn't shown the two fields in top than show the standard one:

0 Kudos
728

Dear Adrain,

Use the code as given below.This will work.

Data: ls_interface type DDSHIFACE.

loop at shlp-INTERFACE INTO ls_interface.

case ls_interface-shlpfield.
when 'MOLGA'.
ls_interface-VALUE = '10'.
MODIFY shlp-INTERFACE FROM ls_interface TRANSPORTING value.
when 'PERSG'.
ls_interface-VALUE = '1'.
MODIFY shlp-INTERFACE FROM ls_interface TRANSPORTING value.
endcase.

endloop.

With regards,

0 Kudos
728

I think that it is the same than my code. Anyway, I just prove it and the result is the same.

0 Kudos
728

Dear Adrain,

I have successfully done the functionality which you have posted above but using search help exit and it is working just fine.In the FM of the screen exit I have coded as given in my previous post.

Its always better to use Case statement for performance and in modify statement if "transporting" not used other values may get modified.

With regards,

0 Kudos
728

Then I don't know what I'm doing wrong.

I have a modulpool (of a custom infotype), and in the screen of the field wich need the search help (p9201-persk), I put this:

PROCESS ON VALUE-REQUEST.

  FIELD p9201-persk MODULE persk_match_code.

And in the module, the FM call. And the callback_form like your code.

I don't know what you mean with "using search help exit"

0 Kudos
728

try to fill the two other columns  VALTABNAME and VALFIELD.

Regards,

Raymond

0 Kudos
728

Dear Adrain,

Please check the screen-shots:

With regards,

0 Kudos
728

Remains the same...

0 Kudos
728

Values in Debugg mode:

With regards,

0 Kudos
728

I tried a small test report, data were filtered

REPORT zsearchelp.

TYPE-POOLS: shlp.

TABLES: t503z.

DATA: return_tab TYPE TABLE OF ddshretval WITH HEADER LINE,

      gv_repid TYPE sy-repid.

gv_repid = sy-repid.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

  EXPORTING

    tabname          = 'T503Z'

    fieldname        = 'PERSK'

    searchhelp       = 'H_T503Z'

    multiple_choice  = ' '

    callback_program = gv_repid

    callback_form    = 'F4CALLBACK'

  TABLES

    return_tab       = return_tab

  EXCEPTIONS

    OTHERS           = 1.

FORM f4callback TABLES   record_tab STRUCTURE seahlpres

                 CHANGING shlp TYPE shlp_descr_t

                          callcontrol LIKE ddshf4ctrl.

  DATA: ddshiface TYPE ddshiface.

  LOOP AT shlp-interface INTO ddshiface.

    CASE ddshiface-shlpfield.

      WHEN 'MOLGA'.

        ddshiface-valtabname = 'T503Z'.

        ddshiface-valfield   = 'MOLGA'.

        ddshiface-value      = '06'.

        MODIFY shlp-interface FROM ddshiface.

      WHEN 'PERSG'.

        ddshiface-valtabname = 'T503Z'.

        ddshiface-valfield   = 'PERSG'.

        ddshiface-value      = '1'.

        MODIFY shlp-interface FROM ddshiface.

    ENDCASE.

  ENDLOOP.

ENDFORM.

Regards,

Raymond

0 Kudos
728

I don't why this field was equal to 'X':

Clear F4FIELD and work.

I don't know why, but...

Thank you everybody!