2007 Mar 22 4:32 AM
how to attach dynamic search help?
2007 Mar 22 4:35 AM
chk this
REPORT ZTEST_F4HELP .
*---Report with selection screen and to display the list of
* possible entries for field 'B' as per the value in field 'A'.
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
2007 Mar 22 11:25 AM
once we get the value for one of the fields how do we get the value for the other field onthe basis of the first value entered with the help of a search help?
2007 Mar 22 4:38 AM
hi,
creating dynamic search help means the f4 help will come on the context bases.
that will achieved with two function modules.
1. F4IF_INT_TABLE_VALUE_REQUEST Display internal table as search help (documented in SAP)
2.F4IF_*_VALUE_REQUEST
u will provide the search help on the field dynamically dependi9ng on progrem context.
2007 Apr 05 7:56 AM
Hi
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_field-low.
PERFORM search_help_fieldname .
FORM search_help_field .
DATA: BEGIN OF itab_field OCCURS 0,
required fields.
END OF itab_field.
Selection query for HitList.(Which values you want to show in the Search Help)
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'fieldname'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_field'
value_org = 'S'
TABLES
value_tab = itab_field
return_tab = t_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
READ TABLE itab_charg INDEX 1. "transporting field
IF sy-subrc EQ 0.
MOVE itab_field-fieldTO s_field-low.
ENDIF.
ENDIF.
ENDFORM.
In this way we can handle the Search Help.
plz reward pts if helpful.
Regards,
vijay
2007 Apr 05 7:58 AM
Hi Nisha,
Creating dynamic search help means the f4 help will come on the context bases.
that will achieved with two function modules.
1. F4IF_INT_TABLE_VALUE_REQUEST Display internal table as search help (documented in SAP)
2.F4IF_*_VALUE_REQUEST
u will provide the search help on the field dynamically depending on program context.
REPORT ZTEST_F4HELP .
*---Report with selection screen and to display the list of
possible entries for field 'B' as per the value in field 'A'.
parameters: p_vbeln type vbak-vbeln,
p_posnr type vbap-posnr.
at selection-screen on value-request for p_posnr.
data: begin of help_item occurs 0,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
end of help_item.
data: dynfields type table of dynpread with header line.
dynfields-fieldname = 'P_VBELN'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11.
read table dynfields with key fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
importing
output = p_vbeln.
select posnr matnr arktx into table help_item
from vbap
where vbeln = p_vbeln.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = help_item.
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Apr 05 8:35 AM
Hi,
This code will help u.
TYPES : BEGIN OF ty_mat,
mtart TYPE mara-mtart,
mbrsh TYPE mara-mbrsh,
maktx TYPE makt-maktx,
meins TYPE mara-meins,
END OF ty_mat.
DATA: it_mat TYPE STANDARD TABLE OF ty_mat WITH HEADER LINE,
it_bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE,
it_errrec TYPE STANDARD TABLE OF ty_mat WITH HEADER LINE.
DATA: v_file TYPE string,qid TYPE apqi-qid.
DATA: l_subrc LIKE sy-subrc,l_mstring(480).
PARAMETERS: p_file TYPE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM f4_help.
FORM f4_help .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
DYNPRO_NUMBER = SYST-DYNNR
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
.
ENDFORM. " f4_help
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |