2012 May 28 10:22 AM
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.
2012 May 28 10:46 AM
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
2012 May 28 10:33 AM
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
2012 May 28 10:35 AM
How I can calling the search help, and how can do it setting parameters?
2012 May 28 10:43 AM
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.
2012 May 28 10:44 AM
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,
2012 May 28 10:46 AM
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
2012 May 28 12:27 PM
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:
2012 May 28 12:41 PM
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,
2012 May 28 12:49 PM
I think that it is the same than my code. Anyway, I just prove it and the result is the same.
2012 May 28 1:11 PM
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,
2012 May 28 1:23 PM
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"
2012 May 28 1:28 PM
try to fill the two other columns VALTABNAME and VALFIELD.
Regards,
Raymond
2012 May 28 1:47 PM
2012 May 28 1:53 PM
2012 May 28 1:59 PM
2012 May 28 2:13 PM
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
2012 May 28 4:12 PM
I don't why this field was equal to 'X':
Clear F4FIELD and work.
I don't know why, but...
Thank you everybody!