‎2006 Feb 15 10:27 AM
Hello everyone i am new to ABAP could you plz help me
Which <b>call function</b> is to be used for getting F4 help.There are many call functions and which is the best one.Give examples
‎2006 Feb 15 10:48 AM
Hello Rajath,
There are many ways to do this.This link gives you list of call functions.
http://www.geocities.com/victorav15/sapr3/abapfun.html
I have recently worked with this and i used
"TMP_GUI_FILE_OPEN_DIALOG" this call function.
DATA W_STRING TYPE STRING.
DATA ITAB LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
PARAMETERS: dataset(132) lower case.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = ITAB
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*************************************
READ TABLE ITAB.
IF SY-SUBRC = 0 .
DATASET = ITAB-FILENAME.
REFRESH ITAB.
CLEAR ITAB.
ENDIF.
IF DATASET IS NOT INITIAL.
W_STRING = DATASET.
ENDIF.
Hope this may help you.
regards,
Srikanth.
‎2006 Feb 15 10:31 AM
I always use the function F4IF_FIELD_VALUE_REQUEST.
example (get a partner from table BUT000 😞
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'BUT000'
fieldname = 'PARTNER'
SEARCHHELP = ' '
SHLPPARAM = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
SELECTION_SCREEN = ' '
IMPORTING
USER_RESET =
TABLES
return_tab = return_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Message was edited by: Timo Wendt
‎2006 Feb 15 10:32 AM
F4 help shows you the possible entry help...
For table fields it shows the list of entries from foreign key check or attached search help.
You can assign a F4 help to a field if you want like this.
DATA itab LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : fname(128).
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = itab
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB.
WRITE itab-FILENAME.
ENDLOOP.
‎2006 Feb 15 10:33 AM
Hi,
Try out :'HELP_VALUES_GET_WITH_TABLE'
Chk these links for creating search helps:
http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm
http://help.sap.com/saphelp_46c/helpdata/EN/cf/21ee2b446011d189700000e8322d00/content.htm
http://www.sap-img.com/abap/attach-a-search-help-to-the-screen-field.htm
Best Regards,
Anjali
‎2006 Feb 15 10:34 AM
Each FM has its own purpose.
Use this FM to get the file name.
(on presentation server)
call function 'F4_FILENAME'
importing
file_name = p_pcfile.
‎2006 Feb 15 10:35 AM
Hi,
Here is the sample code.Kindly reward points by clicking the star on the left of reply,if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
‎2006 Feb 15 10:42 AM
Hi ,
The following code will attach custom F4 help to fields.
TYPES : BEGIN of strhelp,
vbeln type vbrk-vbeln,
fkdat type vbrk-fkdat,
end of strhelp.
data : itabhelp type table of strhelp.
data : v_sy_repid type sy-repid,
v_sy_dynnr type sy-dynnr.
load-of-program.
move sy-repid to v_sy_repid.
move sy-dynnr to v_sy_dynnr.
Create a selection screen field say s_vbeln for vbrk-vbeln.
Then write code similar to the following.
At selection-screen on value-request for s_vbeln-low.
select vbeln fkdat from vbrk into table itabhelp.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'VBELN' (this field will be returned when f4 is pressed )
dynprog = v_sy_repid
dynpnr = v_sy_dynnr
dynprofield = 'S_VBELN-LOW'
value_org = 'S'
tables
value_tab = itabhelp
(when F4 is presses values in table itabhelp will be displayed)
Hope this helps you .
Regards,
Kavitha
‎2006 Feb 15 10:43 AM
hi Rajath,
you can use MATCHCODE OBJECT to get the F4 helps for any field.. it is not mandatory to call a Function..
for example..
parameters : p_vbeln like vbak-vbeln MATCHCODE OBJECT vmva.this will give you the relevant seach help..
regards
satesh
‎2006 Feb 15 10:44 AM
Hi,
Use the FM : F4IF_INT_TABLE_VALUE_REQUEST, in F4 selection , if we want to show specific fields , this would be useful for that case.
example :
DATA: BEGIN OF li_anlage OCCURS 0,
anlage TYPE anlage,
sparte TYPE sparte,
vstelle TYPE vstelle,
END OF li_anlage.
DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
SELECT anlage sparte vstelle
FROM eanl
INTO TABLE li_anlage
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ANLAGE'
dynpnr = sy-dynnr
dynpprog = sy-repid
dynprofield = 'EANL-ANLAGE'
value_org = 'S'
TABLES
value_tab = li_anlage
return_tab = li_ret_tab
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.
Laxman
‎2006 Feb 15 10:48 AM
Hello Rajath,
There are many ways to do this.This link gives you list of call functions.
http://www.geocities.com/victorav15/sapr3/abapfun.html
I have recently worked with this and i used
"TMP_GUI_FILE_OPEN_DIALOG" this call function.
DATA W_STRING TYPE STRING.
DATA ITAB LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
PARAMETERS: dataset(132) lower case.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = ITAB
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*************************************
READ TABLE ITAB.
IF SY-SUBRC = 0 .
DATASET = ITAB-FILENAME.
REFRESH ITAB.
CLEAR ITAB.
ENDIF.
IF DATASET IS NOT INITIAL.
W_STRING = DATASET.
ENDIF.
Hope this may help you.
regards,
Srikanth.
‎2006 Feb 15 11:31 AM
This may help you .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE = 'select a file '
DEFAULT_EXTENSION = 'TXT'
DEFAULT_FILENAME = 'ASSIGN5.TXT'
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = ITAB
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE ITAB INDEX 1.
DATASET = ITAB-FILENAME.
WRITE DATASET.
‎2006 Feb 15 12:35 PM