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

Former Member
0 Likes
700

how to attach dynamic search help?

how to attach dynamic search help?

6 REPLIES 6
Read only

Former Member
0 Likes
564
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.
Read only

0 Likes
564

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?

Read only

Former Member
0 Likes
564

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.

Read only

Vijay
Active Contributor
0 Likes
564

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

Read only

Former Member
0 Likes
564

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

Read only

Former Member
0 Likes
564

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