0% found this document useful (0 votes)
10 views

Code 2

The document describes how to retrieve the value of a field in a table and call a function to request help for that field value. Field symbols and references are used to access and assign values. The function is called, passing parameters like the table and field names, and the value is returned and assigned if found.

Uploaded by

Bharat Bhushan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Code 2

The document describes how to retrieve the value of a field in a table and call a function to request help for that field value. Field symbols and references are used to access and assign values. The function is called, passing parameters like the table and field names, and the value is returned and assigned if found.

Uploaded by

Bharat Bhushan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

data: wa_tab like line of gt_data,

lt_fcat type lvc_t_fcat,


ls_fieldcat type lvc_s_fcat,
l_tabname type dd03v-tabname,
l_fieldname type dd03v-fieldname,
l_help_valu type help_info-fldvalue,
lt_bad_cell type lvc_t_modi,
lp_wa type ref to data.

field-symbols: <l_field_value> type any,


<ls_wa> type any.

gt_bad_cells = et_bad_cells.
g_row_id = es_row_no-row_id.

call method sender->get_frontend_fieldcatalog


importing
et_fieldcatalog = lt_fcat.

read table gt_data index es_row_no-row_id into wa_tab.


create data lp_wa like line of gt_data.
assign lp_wa->* to <ls_wa>.
<ls_wa> = wa_tab.

read table lt_fcat


with key fieldname = e_fieldname into ls_fieldcat.
move ls_fieldcat-ref_table to l_tabname.
move ls_fieldcat-fieldname to l_fieldname.
assign component ls_fieldcat-fieldname
of structure wa_tab
to <l_field_value>.

write <l_field_value> to l_help_valu.

assign <ls_wa> to <gs_outtab>.


call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
tabname = l_tabname
fieldname = l_fieldname
display = e_display
callback_program = sy-repid
value = l_help_valu
selection_screen = abap_true
tables
return_tab = lt_f4.

if sy-subrc <> 0.
* Do Nothing
endif.

read table lt_f4 reference into data(lr_return) with key fieldname = ls_fieldcat-
fieldname.
if sy-subrc is initial.
<l_field_value> = lr_return->fieldval.
endif.

You might also like