Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Search Help for standard field not working

Former Member
0 Kudos
449

Hi Gurus,

I have 3 fields con my screen: Contract Object(PSOBKEY), Business Partner Number(PARTNER) and Date. The Search Helps for PARTNER and Date are working, but the one for PSOBKEY is not. I must say at first I didn't create search helps for any of these fields, I supposed they were already created because they're standards.

My code is like this:

SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME TITLE text-b02.

SELECT-OPTIONS:

P_CONT FOR ZPSPERMISOSH-PSOBKEY OBLIGATORY NO-EXTENSION NO INTERVALS,

P_INT FOR ZPSPERMISOSH-PARTNER OBLIGATORY NO-EXTENSION NO INTERVALS,

P_FEC FOR ZPSPERMISOSH-ZFINICN NO-EXTENSION NO INTERVALS,

SELECTION-SCREEN END OF BLOCK b20.

Table ZPSPERMISOSH has these fields:

Field Data Element Data Type

MANDT MANDT CLNT 3 0 Client

PSOBKEY PSOBKEY_PS CHAR 20 0 Identification Key for Contract Object

PARTNER BU_PARTNER CHAR 10 0 Business Partner Number

ZFINICN ZCH_FINICN DATS 8 0

I try creating a search help for PSOBKEY with the next code, but it does not work either:

FORM p_help_p_cont USING p_p_cont.

DESCRIBE TABLE t_pcont LINES n.

IF n EQ 0.

t_fields-fieldname = 'PSOBKEY'.

t_fields-tabname = 'ZPSPERMISOS'.

t_fields-selectflag = 'X'.

APPEND t_fields.

CLEAR t_fields.

SELECT PSOBKEY FROM ZPSPERMISOS

INTO TABLE t_pcont.

SORT t_pcont BY pcont.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

cucol = 10

curow = 1

tabname = 't_pcont'

fieldname = 'pcont'

IMPORTING

select_value = p_p_cont

TABLES

fields = t_fields

valuetab = t_values.

ENDFORM. " p_help_p_cont

Table ZPSPERMISOS has data. I hope you can help me. Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
320

Table name and field name should be in upper case.

7 REPLIES 7

Former Member
0 Kudos
320

Hi ,

Can you pass these in upper case & try :-

tabname = 'T_PCONT'
fieldname = 'PCONT'

Regards

Abhii

Former Member
0 Kudos
321

Table name and field name should be in upper case.

0 Kudos
320

Hi, I try upper case but nothing happen. This is all my code by far, I hope you can help me:

DATA: BEGIN OF T_PCONT OCCURS 0,

PCONT LIKE ZPSPERMISOS-PSOBKEY,

END OF T_PCONT.

DATA: BEGIN OF T_FIELDS OCCURS 0.

INCLUDE STRUCTURE help_value.

DATA END OF T_FIELDS.

DATA: BEGIN OF T_VALUES OCCURS 0,

VALUE(60) TYPE c.

DATA: END OF T_VALUES.

DATA: N TYPE i.

SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME TITLE text-b02.

SELECT-OPTIONS:

P_CONT FOR ZPSPERMISOSH-PSOBKEY OBLIGATORY NO-EXTENSION NO INTERVALS,

P_INT FOR ZPSPERMISOSH-PARTNER OBLIGATORY NO-EXTENSION NO INTERVALS,

P_FEC FOR ZPSPERMISOSH-ZFINICN NO-EXTENSION NO INTERVALS,

P_RAZ FOR ZPSPERMISOSH-ZRAZONFINIC NO-EXTENSION NO INTERVALS.

SELECTION-SCREEN END OF BLOCK b20.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT-LOW.

PERFORM P_HELP_P_CONT USING P_CONT-LOW.

&----


*& Form P_HELP_P_CONT

&----


FORM P_HELP_P_CONT USING P_P_CONT.

DESCRIBE TABLE T_PCONT LINES N.

IF N EQ 0.

T_FIELDS-FIELDNAME = 'PSOBKEY'.

T_FIELDS-TABNAME = 'ZPSPERMISOS'.

T_FIELDS-SELECTFLAG = 'X'.

APPEND T_FIELDS.

CLEAR T_FIELDS.

SELECT PSOBKEY FROM ZPSPERMISOS

INTO TABLE T_PCONT.

SORT T_PCONT BY PCONT.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

CUCOL = 10

CUROW = 1

TABNAME = 'T_PCONT'

FIELDNAME = 'PCONT'

IMPORTING

SELECT_VALUE = P_P_CONT

TABLES

FIELDS = T_FIELDS

VALUETAB = T_VALUES.

ENDFORM. " P_HELP_P_CONT

Edited by: J. Garibaldi on Nov 25, 2009 11:14 AM

Edited by: J. Garibaldi on Nov 25, 2009 11:16 AM

0 Kudos
320

Hi,

Why not use the FM f4if_int_table_value_request'

0 Kudos
320

Change AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT-LOW

by AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT.

Provide help on P_CONT and not P_CONT-LOW.

Check this, your issue will be resolved.

0 Kudos
320

Thanks a lot for your help, but I have found the error by myself. I had one line missing before the FM:

T_VALUES[ ] = T_PCONT[ ].

With this the FM read all the values from the internal table and show them like a search help. =D

Edited by: J. Garibaldi on Nov 25, 2009 11:59 AM

Former Member
0 Kudos
320

Solved by myself.