2006 Aug 14 2:26 PM
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.
2006 Aug 14 2:41 PM
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.
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.
2006 Aug 14 2:36 PM
Hi,
Check the SAP help.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm
Regards
vijay
2006 Aug 14 2:41 PM
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.
2006 Aug 14 2:46 PM
2009 Feb 02 8:40 AM
hello pls can somebody post me the implementattion of
form go_back_years
regards
sas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |