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

search help exit

Former Member
0 Likes
1,052

Hi,

I have a search help and it contains a search help exit. Now someone wants me to add a new field as import parameter and with the value of the parameter I have to search information within the code of the exit.

I don´t know how to transfer the value to the search help exit. Can someone explain ??

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
977

In the SE11 add the import parameter. In the search help exit whatever value you are entering it will come in the changing parameter SHLP of the user exit.

Take that value and select data and pass the final data to RECORD_TAB.

Check the sample code of EXIT:

FUNCTION zspa_es_insp_shelp_exit.

*"----


""Local interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCR_TAB_T

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR_T

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


IF callcontrol-step = 'SELECT'.

CLEAR: i_sel, wa_sel, ws_date_from, ws_date_to, ws_year,

r_inspdt, i_inst, i_inst_name, i_final, wa_inst,

wa_inst_name, wa_final.

REFRESH: i_sel, i_inst, i_inst_name, i_final, r_inspdt.

ENDIF.

IF callcontrol-step = 'DISP'.

i_sel[] = shlp-selopt[].

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'DATE_FROM'.

IF sy-subrc = 0.

ws_date_from = wa_sel-low.

ENDIF.

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'DATE_TO'.

IF sy-subrc = 0.

ws_date_to = wa_sel-low.

ENDIF.

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'YEAR'.

IF sy-subrc = 0.

ws_year = wa_sel-low.

ENDIF.

IF NOT ws_date_from IS INITIAL AND

NOT ws_year IS INITIAL.

PERFORM go_back_years USING ws_date_from

CHANGING ws_date_from.

IF NOT ws_date_to IS INITIAL.

PERFORM go_back_years USING ws_date_to

CHANGING ws_date_to.

r_inspdt-sign = c_i.

r_inspdt-option = c_bt.

r_inspdt-low = ws_date_from.

r_inspdt-high = ws_date_to.

APPEND r_inspdt.

ELSE.

r_inspdt-sign = c_i.

r_inspdt-option = c_eq.

r_inspdt-low = ws_date_from.

APPEND r_inspdt.

ENDIF.

SELECT aanlage asparte avstelle bzzinspdt

INTO TABLE i_inst

FROM eanl AS a INNER JOIN zeanl AS b

ON aanlage EQ banlage

WHERE b~zzinspdt IN r_inspdt.

IF sy-subrc = 0.

SELECT vstelle str_erg2 INTO TABLE i_inst_name

FROM evbs

FOR ALL ENTRIES IN i_inst

WHERE vstelle = i_inst-vstelle.

LOOP AT i_inst INTO wa_inst.

wa_final-date_from = ws_date_from.

wa_final-date_to = ws_date_to.

wa_final-year = ws_year.

wa_final-anlage = wa_inst-anlage.

READ TABLE i_inst_name INTO wa_inst_name WITH KEY

vstelle = wa_inst-vstelle.

IF sy-subrc = 0.

wa_final-str_erg2 = wa_inst_name-str_erg2.

ENDIF.

wa_final-last_insp_date = wa_inst-zzinspdt.

PERFORM inspdt_plus_years USING wa_inst-zzinspdt

CHANGING wa_final-next_inst_date.

APPEND wa_final TO i_final.

CLEAR: wa_final, wa_inst, wa_inst_name.

ENDLOOP.

LOOP AT i_final INTO wa_final.

record_tab-string = wa_final.

APPEND record_tab.

CLEAR wa_final.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

CALL FUNCTION 'F4UT_OPTIMIZE_COLWIDTH'

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

CHANGING

shlp = shlp

callcontrol = callcontrol.

ENDFUNCTION.

Hi,

I have a search help and it contains a search help exit. Now someone wants me to add a new field as import parameter and with the value of the parameter I have to search information within the code of the exit.

I don´t know how to transfer the value to the search help exit. Can someone explain ??

Thanks a lot.

4 REPLIES 4
Read only

Former Member
Read only

Former Member
0 Likes
978

In the SE11 add the import parameter. In the search help exit whatever value you are entering it will come in the changing parameter SHLP of the user exit.

Take that value and select data and pass the final data to RECORD_TAB.

Check the sample code of EXIT:

FUNCTION zspa_es_insp_shelp_exit.

*"----


""Local interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCR_TAB_T

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR_T

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


IF callcontrol-step = 'SELECT'.

CLEAR: i_sel, wa_sel, ws_date_from, ws_date_to, ws_year,

r_inspdt, i_inst, i_inst_name, i_final, wa_inst,

wa_inst_name, wa_final.

REFRESH: i_sel, i_inst, i_inst_name, i_final, r_inspdt.

ENDIF.

IF callcontrol-step = 'DISP'.

i_sel[] = shlp-selopt[].

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'DATE_FROM'.

IF sy-subrc = 0.

ws_date_from = wa_sel-low.

ENDIF.

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'DATE_TO'.

IF sy-subrc = 0.

ws_date_to = wa_sel-low.

ENDIF.

READ TABLE i_sel INTO wa_sel WITH KEY shlpfield = 'YEAR'.

IF sy-subrc = 0.

ws_year = wa_sel-low.

ENDIF.

IF NOT ws_date_from IS INITIAL AND

NOT ws_year IS INITIAL.

PERFORM go_back_years USING ws_date_from

CHANGING ws_date_from.

IF NOT ws_date_to IS INITIAL.

PERFORM go_back_years USING ws_date_to

CHANGING ws_date_to.

r_inspdt-sign = c_i.

r_inspdt-option = c_bt.

r_inspdt-low = ws_date_from.

r_inspdt-high = ws_date_to.

APPEND r_inspdt.

ELSE.

r_inspdt-sign = c_i.

r_inspdt-option = c_eq.

r_inspdt-low = ws_date_from.

APPEND r_inspdt.

ENDIF.

SELECT aanlage asparte avstelle bzzinspdt

INTO TABLE i_inst

FROM eanl AS a INNER JOIN zeanl AS b

ON aanlage EQ banlage

WHERE b~zzinspdt IN r_inspdt.

IF sy-subrc = 0.

SELECT vstelle str_erg2 INTO TABLE i_inst_name

FROM evbs

FOR ALL ENTRIES IN i_inst

WHERE vstelle = i_inst-vstelle.

LOOP AT i_inst INTO wa_inst.

wa_final-date_from = ws_date_from.

wa_final-date_to = ws_date_to.

wa_final-year = ws_year.

wa_final-anlage = wa_inst-anlage.

READ TABLE i_inst_name INTO wa_inst_name WITH KEY

vstelle = wa_inst-vstelle.

IF sy-subrc = 0.

wa_final-str_erg2 = wa_inst_name-str_erg2.

ENDIF.

wa_final-last_insp_date = wa_inst-zzinspdt.

PERFORM inspdt_plus_years USING wa_inst-zzinspdt

CHANGING wa_final-next_inst_date.

APPEND wa_final TO i_final.

CLEAR: wa_final, wa_inst, wa_inst_name.

ENDLOOP.

LOOP AT i_final INTO wa_final.

record_tab-string = wa_final.

APPEND record_tab.

CLEAR wa_final.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

CALL FUNCTION 'F4UT_OPTIMIZE_COLWIDTH'

TABLES

shlp_tab = shlp_tab

record_tab = record_tab

CHANGING

shlp = shlp

callcontrol = callcontrol.

ENDFUNCTION.

Read only

0 Likes
977

Hurra !!

I have overseen the table SHLP.

Thanks

Read only

0 Likes
977

hello pls can somebody post me the implementattion of

form go_back_years

regards

sas