2006 Jun 19 6:31 AM
Hi All,
I want to attach the search help to a input parameter programmmitically.Means I have no search for its data element.Can anyone have some code how to attach search help only programmiticallly in reports.
Thanks
Harpreeet
2006 Jun 19 6:36 AM
Copy and paste this code.change the table name as per your table name.
REPORT zhelp .
TABLES : ztable.
PARAMETERS : p_name(10) TYPE c.
DATA : BEGIN OF itab OCCURS 0,
name TYPE znames,
code TYPE zcodes,
END OF itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
SELECT name code
FROM ztable
INTO TABLE itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_NAME'
value_org = 'S'
TABLES
value_tab = itab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Hi All,
I want to attach the search help to a input parameter programmmitically.Means I have no search for its data element.Can anyone have some code how to attach search help only programmiticallly in reports.
Thanks
Harpreeet
2006 Jun 19 6:35 AM
hi singh,
check the below link..
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
Also check for the demo programs at the transaction <b>ABAPDOCU</b>.
Cheers,
Abdul Hakim
Mark all useful answers..
2006 Jun 19 6:36 AM
Copy and paste this code.change the table name as per your table name.
REPORT zhelp .
TABLES : ztable.
PARAMETERS : p_name(10) TYPE c.
DATA : BEGIN OF itab OCCURS 0,
name TYPE znames,
code TYPE zcodes,
END OF itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
SELECT name code
FROM ztable
INTO TABLE itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_NAME'
value_org = 'S'
TABLES
value_tab = itab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
2006 Jun 19 6:38 AM
just copy and paste check..
<i>tables: t001.
data: begin of it001 occurs 0,
bukrs type t001-bukrs,
butxt type t001-butxt,
ort01 type t001-ort01,
land1 type t001-land1,
end of it001.
select-options s_bukrs for t001-bukrs.
initialization.
select bukrs butxt ort01 land1 into table it001 from t001
where land1 = 'US'.
sort it001 ascending by bukrs.
delete adjacent duplicates from it001 comparing bukrs.
at selection-screen on value-request for s_bukrs-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BUKRS'
dynprofield = 'S_BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = it001.
start-of-selection.</i>
2006 Jun 19 6:43 AM
Hi harpreet,
1. There are two important things :
a) F4IF_INT_TABLE_VALUE_REQUEST
b) AT SELECTION-SCREEN ON VALUE-REQUEST FOR FIELDNAME.
2. just copy paste in new program.
3.
REPORT ABC.
*----
DATA : BEGIN OF ITAB OCCURS 0,
UNAME LIKE USR01-BNAME,
END OF ITAB.
data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .
data : RETURN_wa LIKE DDSHRETVAL .
*----
PARAMETERS : A(12) TYPE C.
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.
ITAB-UNAME = 'U01'. APPEND ITAB.
ITAB-UNAME = 'U02'. APPEND ITAB.
ITAB-UNAME = 'U03'. APPEND ITAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ITAB-UNAME'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'A'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = ITAB
FIELD_TAB = FTAB
RETURN_TAB = return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
break-point.
regards,
amit m.
2006 Jun 19 6:51 AM
Hi Singh,
Please check this standard FM :
<b>Text</b>:
F4 help for fields that are only known at runtime
<b>Functionality</b>:
This module permits the implementation of the standard help for a screen field whose reference to the ABAP Dictionary is only known at runtime.
If u know the search help name, u can even directly pass that.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = TABLE
FIELDNAME = FIELD
SEARCHHELP = ' '
SHLPPARAM = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = DISPLAY
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
RETURN_TAB = LT_RETURN
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
ENDIF.
Hope this will help u in some way.
2006 Jun 19 6:53 AM
Hi,
Hope this sample code will help you..
DATA: BEGIN OF it_compcode OCCURS 0,
zcomp_code LIKE zfpr_role_backup-zcomp_code,
END OF it_compcode.
CONSTANTS:c_retfield1 TYPE dfies-fieldname VALUE 'ZCOMP_CODE',
c_dynfield1 TYPE help_info-dynprofld VALUE 'P_COMPCD'.
PARAMETERS: p_compcd LIKE zfpr_role_hier-zcomp_code.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_compcd.
PERFORM populate_f4_compcode.
&----
*& Form populate_f4_compcode
&----
text
----
FORM populate_f4_compcode .
SELECT zcomp_code
FROM zfpr_role_hier
INTO TABLE it_compcode.
IF sy-subrc = 0.
SORT it_compcode BY zcomp_code.
DELETE ADJACENT DUPLICATES FROM it_compcode COMPARING zcomp_code.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = c_retfield1
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = c_dynfield1
value_org = 'S'
TABLES
value_tab = it_compcode
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.
ENDFORM. " populate_f4_compcode
Thanks,
Pramod
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |