‎2007 Jan 31 5:37 AM
Hi SDN's
i have a filed on the selection screen of a report,which is customised data element.
How do i activate the F4 for that field?
Regards
Pratyusha
‎2007 Jan 31 5:40 AM
Which data you want to display in F4... is it from a standard table field? or you want your own FIXED data to be displayed?
‎2007 Jan 31 5:42 AM
Return dynpro values
The following code shows the syntax of the FM 'DYNP_VALUES_UPDATE'.
*Internal table to store dy dynpro fields and values
DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.
DATA: l_stepl LIKE sy-stepl.
REFRESH dynpfields.
CLEAR dynpfields.
dynpfields-fieldname = 'SCREENFIELD1-COL1'. "Screen field name
dynpfields-fieldvalue = 10. "New value
dynpfields-stepl = l_stepl. "Step loop for table controls
APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'SAPLBDT_GMGR' "Program name
dynumb = '0270' "Screen number
TABLES
dynpfields = dynpfields
EXCEPTIONS
OTHERS = 0.If you want to create ur own values from a table
<b>F4IF_INT_TABLE_VALUE_REQUEST</b> Display internal table as search help (documented in SAP)
Hope this helps.
‎2007 Jan 31 5:42 AM
Hi,
Hi make sure that the object that you use after SELECT-OPTIONS: obj for var1 is typed properly. Either type it to a table filed for which there is a search help assignment or type it to a dataelement whose domain has a value table. Else you can directly use MATCH CODE OBJECT with a search help if you what search help can be used.
Regards,
Sesh
‎2007 Jan 31 5:47 AM
SELECT-OPTIONS : S_PTYPE FOR ztab-ptype.
at selection-screen on value-request for S_PTYPE-low.
*code for dynamic f4 help.
at selection-screen on value-request for S_PTYPE-high.
*code for dynamic f4 help
‎2007 Jan 31 5:47 AM
hi,
chk this sample report
REPORT ztest_f4.
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
selection-screen begin of block b1 with frame title text-001 .
selection-screen begin of line.
PARAMETERS: P_BUKRS type T001-BUKRS.
selection-screen comment 30(20) BUTXT for field p_bukrs.
selection-screen end of line.
selection-screen end of block b1.
at selection-screen output.
if butxt is initial.
select single butxt into butxt
from t001
where bukrs = p_bukrs.
endif.
at selection-screen on value-request for p_bukrs.
call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
tabname = 'T001'
fieldname = 'BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
tables
return_tab = return
exceptions
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
others = 5.
read table return with key fieldname = 'P_BUKRS'.
* Add it back to the dynpro.
dynfields-fieldname = return-retfield.
dynfields-fieldvalue = return-fieldval.
append dynfields.
* Get the company code from db and add to dynpro
data: xt001 type t001.
clear xt001.
select single * into xt001
from t001
where bukrs = return-fieldval.
dynfields-fieldname = 'BUTXT'.
dynfields-fieldvalue = xt001-butxt.
append dynfields.
* Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.Rgds
Anver