‎2007 Jul 13 2:20 PM
Hallo all,
i can not how this search help exit pass the value from record_tab to search help fields. I saw that record_tab hold the values in one string field but how to pass in the search help to trwo different field. For example in search help i have
pr_type and description , but this is stored in one field in record_tab.So i have to use some other function to split the values. Is somebody knows which fm i can use?
Full points for helpful answers!!!
‎2007 Jul 13 8:13 PM
hi,
Here is a search help exit I created. You can use the code as reference.
f<b>unction Z_SHLP_BATCH_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
*"----
data: l_record like line of record_tab,
l_records like record_tab occurs 0,
l_interface like line of shlp-interface,
l_selopt like LINE OF shlp-SELOPT,
l_name TYPE SHLPNAME,
wa_shlp TYPE SHLP_DESCR.
data: l_sf_type type tdsftype,
l_sf_name type tdsfname,
l_fp_runtime type tdsfmtype,
l_type_req type tdsftype,
l_idx like sy-tabix.
DATA : i_mchb TYPE TABLE OF mchb,
wa_mchb LIKE LINE OF i_mchb,
i_mard TYPE TABLE OF mard,
wa_mard LIKE LINE OF i_mard.
DATA : v_matnr TYPE matnr_d,
l_matnr TYPE matnr_d,
v_werks TYPE werks_d,
l_werks TYPE werks_d.
DATA : BEGIN OF i_final OCCURS 0,
matnr TYPE matnr_d,
werks TYPE werks_d,
charg TYPE charg_d,
lgort TYPE lgort_d,
clabs TYPE labst,
END OF i_final.
DATA : l_dynpro TYPE STANDARD TABLE OF DYNPREAD.
READ TABLE shlp_tab INTO wa_shlp INDEX 1.
l_name = wa_shlp-SHLPNAME.
case callcontrol-step.
when 'SELONE'. " before selection screen
when 'SELECT'. " before selection
REFRESH i_mchb.
when 'DISP'. " before selected data is displayed
Extract the material number and plant from the interface
read table shlp-SELOPT into l_selopt WITH key shlpfield = 'MATNR'.
l_matnr = l_SELOPT-low.
CLEAR l_SELOPT.
READ TABLE shlp-SELOPT INTO l_SELOPT WITH key shlpfield = 'WERKS'.
l_werks = l_SELOPT-low.
CLEAR l_SELOPT.
select data from MCHB table to put as output.
SELECT *
FROM mchb
INTO TABLE i_mchb
WHERE matnr = v_matnr
AND werks = v_werks.
if NOT i_mchb[] IS INITIAL.
LOOP AT i_mchb INTO wa_mchb.
MOVE-CORRESPONDING wa_mchb to i_final.
APPEND i_final.
CLEAR : wa_mchb,
i_final.
ENDLOOP.
call function 'F4UT_RESULTS_MAP'
TABLES
shlp_tab = shlp_tab
source_tab = i_final
record_tab = record_tab
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
others = 1.
endif.
CLEAR : wa_item,
wa_input1,
WA_FGINPUT.
when others.
endcase.
endfunction.</b>