Wednesday, February 16, 2011

Abap Multiple Table Popup Search Help

If you are SAP abaper, might be you have exprienced to create a search help. A standard process which does not involved any programming where you can created it through SE11 . This implementation might be easier if only involved one or two table.How about multiple table popup search help ?  you might be face this problem if you are required to create a search help which involve more table relationship.

image credit to : http://wiki.sdn.sap.com

you can used this function F4IF_INT_TABLE_VALUE_REQUEST, which is used to display ABAP internal table as an SAP Search Help. To use the code you can refer as below example. The steps:
  1. write select statement to select data from multiple table and stored into aninternal table.
  2. determine one field to be a retrieved field, example date.
  3. call the function F4IF_INT_TABLE_VALUE_REQUEST and set a proper value.
form get_searchhelp_data.
clear itshpo.
select
e~ebeln
d~txz01
e~aedat
into table itshpo
from proj as a
inner join prps as b on b~psphi = a~pspnr
inner join afvc as c on c~projn = b~pspnr
inner join eban as d on d~banfn = c~banfn
inner join ekko as e on e~ebeln = d~ebeln
where a~pspid = pspid.

if sy-subrc = 0.
sort itshpo.
delete adjacent duplicates from itshpo.
endif.
endform.
perform show_searchhelp_popopwin tables itshpo using ‘ZPSCHED33-ZPOSIA’ ‘ AEDAT’.
form show_searchhelp_popopwin tables p_tab
using value(screenfield)
retfield.
call function ‘F4IF_INT_TABLE_VALUE_REQUEST’
exporting
retfield = retfield “‘AEDAT’”field from int table whose         value   will be returned
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = screenfield
value_org = ‘S’
tables
value_tab = p_tab”internal table whose values will be shown.
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
endform.

0 comments:

Post a Comment