‎2006 Aug 08 7:35 AM
hi to all,
i had two fields namely(vbpa-pernr)i.e customs representative (ZG) and service representative(ZQ).
for these two fields i want to add a F4 option based on
search by partner function and select the data for input.
hi
i create a search help with two fields PERNR,PARVW but the values in PERNR is displaying 00000 while clicking the f4 option.
please help me in this regard.
thanks
sun
Message was edited by: sun deep
Message was edited by: sun deep
‎2006 Aug 08 7:43 AM
Hi,
You have to create the Custom Search help and attach it to the Custom fields.
Since it is the Combination of Partner function and Pernr.
Regards
vijay D T T.
‎2006 Aug 08 7:53 AM
Hello,
Try this code:
It reads value from first parameter and based on that select values for second parameter.
Regards,
Naimesh
REPORT ZTEST_NP_1.
DATA: HELPVAL1 LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE .
DATA: VALUE_TAB LIKE PDTASK-OTEXT OCCURS 2 WITH HEADER LINE.
DATA: VALUE LIKE FEBMKA-BANKN,
GIVEN_VALUE LIKE HELP_INFO-FLDVALUE.
DATA: IT_T005T LIKE T005T OCCURS 0 WITH HEADER LINE,
IT_T002T LIKE T002T OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN: BEGIN OF BLOCK BLK1 WITH FRAME TITLE ABC.
PARAMETERS: P_SPRAS LIKE T002T-SPRAS,
P_LAND1 LIKE T005T-LAND1.
SELECTION-SCREEN: END OF BLOCK BLK1.
INITIALIZATION.
ABC = 'Selection Criteria:'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAND1.
PERFORM VALUE_REQUEST_LAND1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SPRAS.
PERFORM VALUE_REQUEST_SPRAS.
&----
*& Form VALUE_REQUEST_land1
&----
FORM VALUE_REQUEST_LAND1.
*---- Reading the Screen values.
DATA: LT_DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
LV_DYNAME LIKE D020S-PROG,
LV_DYNUMB LIKE D020S-DNUM.
*-------Append field which you want to read from the screen
LV_DYNAME = SY-REPID.
LV_DYNUMB = SY-DYNNR.
LT_DYNPFIELDS-FIELDNAME = 'P_SPRAS'.
APPEND LT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = LV_DYNAME
DYNUMB = LV_DYNUMB
TABLES
DYNPFIELDS = LT_DYNPFIELDS.
SELECT * FROM T005T
INTO TABLE IT_T005T
WHERE SPRAS = P_SPRAS.
REFRESH: HELPVAL1, VALUE_TAB.
CLEAR: HELPVAL1, VALUE_TAB, GIVEN_VALUE, VALUE.
*---- Append field name for the columns in the help popup
HELPVAL1-TABNAME = 'T005T' .
HELPVAL1-FIELDNAME = 'LAND1' .
HELPVAL1-SELECTFLAG = 'X' . " will return the value on the screen
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
HELPVAL1-TABNAME = 'T005T' .
HELPVAL1-FIELDNAME = 'LANDX' .
HELPVAL1-SELECTFLAG = ' ' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
LOOP AT IT_T005T.
VALUE_TAB = IT_T005T-LAND1.
APPEND VALUE_TAB.
VALUE_TAB = IT_T005T-LANDX.
APPEND VALUE_TAB.
ENDLOOP.
GIVEN_VALUE = P_LAND1.
CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
EXPORTING
DISPLAY = SPACE
GIVEN_VALUE = GIVEN_VALUE
IMPORTING
SELECT_VALUE = VALUE
TABLES
FIELDS = HELPVAL1
VALUETAB = VALUE_TAB.
IF NOT VALUE IS INITIAL.
P_LAND1 = VALUE. " Assing value to the parameter
ENDIF.
ENDFORM. " VALUE_REQUEST_land1
&----
*& Form VALUE_REQUEST_SPRAS
&----
FORM VALUE_REQUEST_SPRAS.
REFRESH: HELPVAL1, VALUE_TAB.
CLEAR: HELPVAL1, VALUE_TAB, GIVEN_VALUE, VALUE.
HELPVAL1-TABNAME = 'T002T' .
HELPVAL1-FIELDNAME = 'SPRSL' .
HELPVAL1-SELECTFLAG = 'X' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
HELPVAL1-TABNAME = 'T002T' .
HELPVAL1-FIELDNAME = 'SPTXT' .
HELPVAL1-SELECTFLAG = ' ' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
SELECT * FROM T002T
INTO TABLE IT_T002T
WHERE SPRAS = SY-LANGU.
LOOP AT IT_T002T.
VALUE_TAB = IT_T002T-SPRSL.
APPEND VALUE_TAB.
VALUE_TAB = IT_T002T-SPTXT.
APPEND VALUE_TAB.
ENDLOOP.
GIVEN_VALUE = P_SPRAS.
CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
EXPORTING
DISPLAY = SPACE
GIVEN_VALUE = GIVEN_VALUE
IMPORTING
SELECT_VALUE = VALUE
TABLES
FIELDS = HELPVAL1
VALUETAB = VALUE_TAB.
IF NOT VALUE IS INITIAL.
P_SPRAS = VALUE.
ENDIF.
ENDFORM. " VALUE_REQUEST_SPRAS
‎2006 Aug 08 7:53 AM
1. If u cud query the same from a database table its cool, otherwise u need to write the retrieval code in a search help exit.
Which is a FM that retrieves data as per you requirement
the FM has following local interfaces :
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCR
*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
U cud search the forum for search help exits for more informations.
2. Another way cud be using FM
F4IF_INT_TABLE_VALUE_REQUEST
and populate the value_tab table parameter data programatically. And call this FM in the At selection screen event of the selection screen element.
Regards
Alok Pathak
‎2006 Aug 08 7:55 AM
Hi,
you have to create the Elementary search help.
just check this SAP help to create the elementary Search help.
http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm
Regards
vijay
‎2006 Aug 08 7:55 AM
Hi,
You may use: the At Selection-screen on help-request event and write a query in it to fetch the required values into an internal table.
Then, use the FM: F4IF_INT_TABLE_VALUE_REQUEST to return the value selecetd from the F4 pop-up screen.
Regards
Subbu
‎2006 Aug 08 7:56 AM
hi
good
go thruogh these links which ll help you to create the f4 search help for any field.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm
thanks
mrutyun
‎2006 Aug 08 8:07 AM
Hi Sundeep,
First you will have to create an elimentary search help in SE11, you can adjust the parameters and values by settinf LPOS and SPOS, after this creation is done in selection screen ,for the select option for which you using this Search help you'll have to give select-options so_newsearch for tab-val MATCHCODE OBJECT new_serch_help.