2007 Aug 04 10:33 AM
i m creating a ztable in which i have a field like pernr. In maintaing that table i want that a f4 help containing pernr , ename should be displayed on the screen for entering the data. pls tell how to do it.......
i m creating a ztable in which i have a field like pernr. In maintaing that table i want that a f4 help containing pernr , ename should be displayed on the screen for entering the data. pls tell how to do it.......
2007 Aug 04 3:10 PM
Hi
Create a search help for PERNR using PA0002 infotype and attach to that screen field PERNR
see this and do accordingly
See the following ex:
TYPES: BEGIN OF TY_MBLNR,
MBLNR LIKE MKPF-MBLNR,
END OF TY_MBLNR.
DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-low.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
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.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-low.
ENDIF.
Go through the test program.
REPORT Ztest_HELP .
TABLES : MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_MATNR(10) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR
FROM MARA
INTO TABLE ITAB
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATERIAL NUMBER'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Aug 04 3:14 PM
Hi,
You need to write the code in POV(Process on Value Request) to Trigger the user Defined F4 help for a field
chk this demo program
DEMO_DYNPRO_F4_HELP_MODULE
Look at the below link
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
Regards
2007 Aug 05 8:01 AM
Please find the following code for your help.
Change the according to your table and field name.
& -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_UNIQUE.
SELECT UNIQ_RES_NO
FROM zproject_res INTO CORRESPONDING FIELDS OF TABLE ITAB_HELP
where flag = 'Z'.
SORT ITAB_HELP BY UNIQ_RES_NO .
DELETE ADJACENT DUPLICATES FROM ITAB_HELP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'UNIQ_RES_NO'
PVALKEY = ' '
DYNPPROG = 'ZRPSTRESVSLIP'
DYNPNR = '1000'
DYNPROFIELD = 'P_UNIQUE'
STEPL = 0
WINDOW_TITLE = ' '
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = itab_help
FIELD_TAB =
RETURN_TAB =
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.
& -
create it from SE11.
enter search help
and create elementary
enter description and below Table name
and the fields
see the doc
1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
3)An elementary search help defines the standard flow of an input help.
4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
pls go through this for search help creation
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
Reward Points if it is Useful.
2007 Aug 06 4:42 AM
"Check table'For example you have Employee master table & Employee Transaction
'table.When ever an employee Transacts we need to check whether that employee exists , so we can refer to the employee master table.
This is nothing but a Parent & Child relationship . Here data can be maintained at client level , no development involved.
As per DBMS what we call foregin key table, is called as check table in SAP.
There is 1 more important Difference in Value Table and Check Table is that:
1. The contents of the check will be used as an input help(F4 Help) for a particular field on which a check table is assigned.
But the contents of Value Table are never used in Input Help.
The Heirarchy which decides from where to used the Input Help is:
1. Input help defined explicitly in ABAP Program or Dialog Module.
2. Input Help Attached to the referenced Database Table field.
3. Using the contents of Check Table as an input help if neither (1) or (2) help are there.
4. Input help from Fixed value or Value range given in Domain.
so goto your ztable .... in change mode place the cursour in the PERNR field .. press the Foreign key relation ...in the Dialog box put pa0001 table name as Check table and select the PERNR field .
press enter save, Activate ..
now see in the check table relation exsist for the field PERNR .
Now you can execute your program as using :
" Parameter : pernr for ztable-pernr .reward points if itis usefull.....
Girish
2007 Aug 12 3:36 PM
create a search helps for the fields(primary keys). And use that search help in report where required.
sample code.
data: lf_mtnr type zmatnr.
select-options: so_matnr for lf_mtnr matchcode object 'zhelp'.