‎2007 May 13 3:52 PM
hi
parameters : lifnr like lfa1-lifnr.
for the above stmt without using pov or matchcode object how can we provide F4 help
‎2007 May 13 3:55 PM
Write down the code under
at selection on request event,then you will get F4 Value.
Reward Points if it is helpful.
Thanks
Seshu
‎2007 May 14 6:24 AM
Hi Jyothsna,
There are different ways of giving F4 help for <i><b>PARAMETERS</b></i> statement without <i><b>MATCHCODE</b></i> objects.
1. In the <i><b>PARAMETERS</b></i> statement use a field, whose data element has F4 help.
2. Use the following code -
<i>AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LIFNR.
Get the F4 help list
PERFORM LIFNR_F4VAL.</i>
Here in PERFORM, write the logic of fetching the data from the LFA1 table for the given input parameters. To read the dynpro values, use following function module.
<i>* Get the value of all parameters for select query
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = LT_DYNPFIELDS.
SELECT query for getting the required data into LT_PROC internal table</i>
And finally, the output of select query display on screen as F4 help using following function module -
<i>* Get the F4 values
REFRESH GT_RVAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = '<b>DATA ELEMENT FOR THE F4 Field</b>'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
VALUE_ORG = 'S'
TABLES
VALUE_TAB = LT_PROC
RETURN_TAB = GT_RVAL
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get the value for the Selected value from F4 List
READ TABLE GT_RVAL INTO GS_RVAL INDEX 1.
IF SY-SUBRC EQ 0.
MOVE GS_RVAL-FIELDVAL TO P_LIFNR-LOW.
ENDIF.</i>
Hope this sort out your issue.
PS If the answer solves your query, plz close the thread by rewarding each reply.
Regards
‎2007 May 15 3:23 PM
Hi,
parameters : lifnr like lfa1-lifnr.
with this statement already you are getting F4 help, exactly what is your doubt
the above field data element is already have F4 help you need not to create.
if F4 help not available fields you must create Matchcode object or POV.
Regards
Ganesh
‎2007 May 15 4:02 PM
Hi Jyothsna,
if you go to se11 and check this filed you will find that there is a search help assigned to this field..
so you need not handle f4 explicitly..
even, parameters : lifnr type lifnr will also have the f4 help....
if there is no serach help attached to the field , declaring it using the like will help sometimes...like in case of vbeln..
Regards,
Vidya.
‎2007 May 17 11:35 AM
Hi Jyostsna,
Can you plz mark your queries as Solved & by rewarding appropriate points, close the thread if they solved your queries.
Regards
‎2007 May 18 1:12 PM
‎2007 May 21 10:27 AM
hi,
use AT SELECTION-SCREEN ON VALUE-REQUEST FOR filedname.
use Fm 'F4IF_INT_TABLE_VALUE_REQUEST'
check the below coding.
REPORT ZKSS_F4.
tables: mara,dfies.
data: begin of it_table occurs 0,
matkl like mara-matkl,
desc like mara-ernam,
end of it_table.
data : LT_FIELDS TYPE TABLE OF DFIES,
LS_FIELD TYPE DFIES.
parameter: zintid like mara-matkl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR zintid.
DATA: l_prgnam TYPE sy-repid, " For program name
l_dynpnr TYPE sy-dynnr, " For screen number
l_dynprofield TYPE help_info-dynprofld, " For field name.
l_retfield TYPE dfies-fieldname. " For retfield.
refresh it_table. " to avoid repetation of field values
clear : l_prgnam,
l_dynpnr,
l_dynprofield,
l_retfield.
l_prgnam = sy-cprog.
l_dynpnr = sy-dynnr.
l_dynprofield = 'zintid'.
l_retfield = 'matkl'.
it_table-matkl = 'ZF117A'.
it_table-desc = 'Po data'.
append it_table.
clear it_table.
it_table-matkl = 'ZF117B'.
it_table-desc = 'Po Invoices'.
append it_table.
clear it_table.
it_table-matkl = 'ZF117C'.
it_table-desc = 'Fi Invoices'.
append it_table.
CLEAR LS_FIELD.
LS_FIELD-FIELDNAME = 'MATKL'.
LS_FIELD-INTLEN = 20.
LS_FIELD-LENG = 20.
LS_FIELD-OUTPUTLEN = 20.
*LS_FIELD-SCRTEXT_S = 'helo'.
*LS_FIELD-SCRTEXT_M = 'matno'.
*LS_FIELD-SCRTEXT_L = LS_FIELD-FIELDNAME.
LS_FIELD-REPTEXT = 'Interfaceid Desc'.
APPEND LS_FIELD TO LT_FIELDS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'MATKL'
PVALKEY = ' '
DYNPPROG = l_prgnam
DYNPNR = l_dynpnr
DYNPROFIELD = 'MATKL'
STEPL = 0
WINDOW_TITLE = WINDOW_TITLE
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB = MARK_TAB
IMPORTING
USER_RESET = USER_RESET
TABLES
value_tab = it_table
FIELD_TAB = LT_FIELDS
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING = DYNPFLD_MAPPING
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
clear LT_FIELDS.
example 2:
TABLES: mara, makt.
DATA mat LIKE mara-matnr.
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
END OF itab.
DATA : BEGIN OF btab OCCURS 0,
maktx LIKE makt-maktx,
END OF btab.
DATA : return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS: so_matnr FOR mara-matnr,
so_maktx FOR makt-maktx.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_matnr-low.
PERFORM matnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_matnr-high.
PERFORM matnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_maktx-low.
PERFORM maktx.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_maktx-high.
PERFORM maktx.
&----
*& Form matnr
&----
FORM matnr.
REFRESH itab.
SELECT matnr FROM mara INTO TABLE itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR '
dynprofield = 'P_MATNR '
dynpprog = sy-repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = itab
return_tab = return.
mat = return-fieldval.
UNPACK mat TO mat.
so_matnr = return-fieldval.
REFRESH return.
CLEAR return.
ENDFORM. "matnr
&----
*& Form maktx
&----
FORM maktx.
REFRESH btab.
SELECT maktx FROM makt INTO TABLE btab WHERE matnr = mat AND spras =
sy-langu.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MAKTX'
dynprofield = 'SO_MAKTX '
dynpprog = sy-repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = btab
return_tab = return.
so_maktx = return-fieldval.
REFRESH return.
CLEAR return.
ENDFORM. "maktx