‎2008 Jan 16 2:58 PM
hi,
i have created a simple alv where selection screen is as follows.
SELECT-OPTIONS : s_doc FOR vbak-vbeln OBLIGATORY DEFAULT '4000' TO '5050',
date FOR vbak-erdat DEFAULT '19970102' TO '20071231'.
i haven't defined any search help yet when the program is run, i do get it. why?
i suspect a part of the validation to be doing the trick. it's
FORM validate.
IF s_doc-low GE 'A' AND s_doc-low LE 'Z'.
MESSAGE 'PLEASE ENTER THE CORRECT SALES DOCUMENT NUMBER' TYPE 'E'.
ELSEIF s_doc-high GE 'A' AND s_doc-high LE 'Z'.
MESSAGE 'PLEASE ENTER THE CORRECT SALES DOCUMENT NUMBER' TYPE 'E'.
ELSE.
SELECT SINGLE vbak~vbeln
INTO vbak-vbeln
FROM vbak INNER JOIN vbap ON vbakvbeln = vbapvbeln
WHERE vbakvbeln IN s_doc AND vbakerdat IN date.
IF sy-subrc NE 0.
MESSAGE 'PLEASE ENTER VALID INPUT' TYPE 'E'.
ENDIF.
ENDIF.
ENDFORM. "validate
is it associated somehow with it? if yes/ no, please explain.
‎2008 Jan 17 8:39 AM
Hi,
Try this code. You wont get search help.
TYPES: BEGIN OF ty_test,
vbeln TYPE vbeln,
erdat TYPE erdat,
END OF ty_test.
DATA ls_vbak TYPE ty_test.
SELECT-OPTIONS : s_doc FOR ls_vbak-vbeln OBLIGATORY DEFAULT '4000' TO
'5050',
date FOR ls_vbak-erdat DEFAULT '19970102' TO '20071231'.
Reason: VBAK has search help assigned to ERDAT and VBELN. Goto VBAK table in SE11. Click on Entry help /check. you will find where the search help is assigned.
Reward points if useful
Regards,
Niyaz
‎2008 Jan 16 3:04 PM
Hi Arindam,
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.
kindly reward if helpful.
cheers,
hema.
‎2008 Jan 16 3:05 PM
Hi,
it doesn't seem to me that this form changes itself into a search help. It would be more usual that the reference fields for each of the select-options have search helps as well.
By the way, what field have you got a search help in?
I hope it helps. Best regards,
Alvaro
‎2008 Jan 16 3:05 PM
Hi,
check this link u will know why?
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm
Regards
‎2008 Jan 16 3:06 PM
Hi arindam
Its not a trick nor magic.. VBELN have a search help that is already provided by SAP, so it is getting triggered when you hit an F4. SAP provided its own search helps for primary key fields like MATNR, VBPA-partners etc.
at the data element level you can see the search help name.
‎2008 Jan 17 8:30 AM
‎2008 Jan 17 8:37 AM
Hi,
just as JackandJay says, SAP gives you a standard search help for VBAK-VBELN, because in the definition of table VBAK, field VBELN has a check table VBUK. So every time you reference field VBAK-VBELN, SAP will show an automatic search help which searches values from table VBUK.
In the case of field ERDAT, SAP automatically gives you a search field for EVERY field of type date. So you don't have to program it yourself if you don't want to.
I hope this helps. Best regards,
Alvaro
‎2008 Jan 17 8:39 AM
hi jackandjay,
vbeln is a primary field and so may be SAP provides search help for that. but how does it come automatically in my selection screen and that too for a non primary field such as erdat.
‎2008 Jan 17 8:39 AM
Hi,
Try this code. You wont get search help.
TYPES: BEGIN OF ty_test,
vbeln TYPE vbeln,
erdat TYPE erdat,
END OF ty_test.
DATA ls_vbak TYPE ty_test.
SELECT-OPTIONS : s_doc FOR ls_vbak-vbeln OBLIGATORY DEFAULT '4000' TO
'5050',
date FOR ls_vbak-erdat DEFAULT '19970102' TO '20071231'.
Reason: VBAK has search help assigned to ERDAT and VBELN. Goto VBAK table in SE11. Click on Entry help /check. you will find where the search help is assigned.
Reward points if useful
Regards,
Niyaz
‎2008 Jan 17 9:25 AM
Hi,
For vbelen the search help comes from the SE11 search help associated with it.
erdat is of type 'DATS' which will by deafault give a date selection option.
Regards,
Renjith Michael.
‎2008 Jan 17 2:13 PM