cancel
Showing results for 
Search instead for 
Did you mean: 

F4 Help for Characteristics

Former Member
0 Kudos

Hi Experts,

I have created a characteristic 'Department' and when I assign the table 'T527O' in the Value tab it gives an error " Check table T527O has too many key fields".

In the error it says that "Check tables with more than one key field are not supported. However,

if you enter a function module for checking values, you can refer to any check table in your own coding."

I am able to see one radio button called "Function Module" when I click on Other Value Check on Value tab, but do not know how to use that.

Could anyone please guide me in this.

My requirement is:

1. create a characteristic called department.

2. link it to a class,

3. while creating a document in CV01N the f4 help should be available in department field.

Thanks & Regards

Rajiv Roshan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

A function module is where you get an ABAP programmer to create a customer download linked to a table. He saves it as a function module and you add it there. When the person presses F4 it calls the function module and gives the user the drop down.

Former Member
0 Kudos

Thanks for the reply.

But if this was the case I would have not raised the question. I have created a function module as specified in the F1 help, but still the value is not coming.

Thanks & Regards

Rajiv Roshan

Former Member
0 Kudos

Hello Rajiv,

You must create & assign Function modules as mentioned in the documentation:

http://help.sap.com/saphelp_erp60_sp/helpdata/en/ec/62a9bb416a11d1896d0000e8322d00/content.htm

Regards

Surjit

Former Member
0 Kudos

Hi,

I have already done this and also assigned it to the characteristics, but then also I am not getting the F4 help in CV01N transaction.

Please send the code if you have any.

Thanks & Regards

Rajiv Roshan

Answers (3)

Answers (3)

Former Member
0 Kudos

FUNCTION Z_PRCTR_CHECK_F4.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(CHARACT_NO) LIKE CABN-ATINN

*" VALUE(CHARACT) LIKE CABN-ATNAM

*" VALUE(DISPLAY) LIKE RMCLF-KREUZ DEFAULT SPACE

*" VALUE(ADDITIONAL_VALUES) LIKE CABN-ATSON DEFAULT SPACE

*" VALUE(MULTIPLE_VALUES) LIKE RCTMV-ATLIS DEFAULT SPACE

*" VALUE(LANGUAGE) LIKE SY-LANGU DEFAULT SY-LANGU

*" VALUE(DISPLAY_WITH_LANGUAGE) LIKE RMCLF-KREUZ DEFAULT SPACE

*" TABLES

*" VALUES STRUCTURE RCTVALUES

*" EXCEPTIONS

*" CANCELLED_BY_USER

*"----


*This function is used in a characteristic to provide an F4 search using a common search help.

*Fill the first three constants as instructed and as needed for the specific characteristic.

*Note that a function without the '_F4' is created for the check and entered in the characteristic.

*Read the help documentation on the characteristic function field for full explanation.

  • data definition ------------------------------------------------------

CONSTANTS: c_SHLPNAME TYPE SHLPNAME VALUE 'ENTER SEARCH HELP NAME HERE ALL CAPS',

c_shlpfield TYPE DDSHLPSFLD VALUE 'ENTER INPUT FIELD NAME HERE ALL CAPS',

c_conv_routine TYPE RS38L_FNAM VALUE 'ENTER FUNCTION MODULE NAME OF CONVERSION ROUTINE IF NEEDED, OR CLEAR THIS VALUE',

del(1) TYPE c VALUE 'D',

ins(1) TYPE c VALUE 'I'.

DATA: indx TYPE i,

interface_wa like ddshiface,

rc TYPE sy-subrc,

anln1 TYPE anln1,

return_tab TYPE TABLE OF DDSHRETVAL,

shlp TYPE SHLP_DESCR.

FIELD-SYMBOLS: <int> TYPE ddshiface,

<ret> TYPE DDSHRETVAL.

  • Get search help data container.

CALL FUNCTION 'F4IF_GET_SHLP_DESCR'

EXPORTING

SHLPNAME = c_SHLPNAME "Enter the Search help name here

SHLPTYPE = 'SH'

IMPORTING

SHLP = shlp.

  • Mark the relevant field to be returned.

LOOP AT shlp-interface ASSIGNING <int>

WHERE shlpfield = c_shlpfield. "Enter the field to be exported.

<int>-valfield = 'X'.

ENDLOOP.

  • Call the search help dialogue.

CALL FUNCTION 'F4IF_START_VALUE_REQUEST'

EXPORTING

SHLP = shlp

MAXRECORDS = 500

MULTISEL = multiple_values

IMPORTING

RC = rc

TABLES

RETURN_VALUES = return_tab.

  • Remove any old selected values

LOOP AT values.

indx = sy-tabix.

READ TABLE return_tab WITH KEY fieldval(30) = values-value ASSIGNING <ret>.

IF sy-subrc <> 0.

values-status = del.

MODIFY values INDEX indx.

ENDIF.

ENDLOOP.

  • Add the new values.

LOOP AT return_tab ASSIGNING <ret>.

IF c_conv_routine IS NOT INITIAL.

CALL FUNCTION c_conv_routine

EXPORTING

input = <ret>-fieldval(30)

IMPORTING

OUTPUT = values-value

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

ELSE.

values-value = <ret>-fieldval(30).

ENDIF.

values-status = ins.

APPEND values.

ENDLOOP.

ENDFUNCTION.

Former Member
0 Kudos

Thanx. This is what I'm looking for.

Regards

Pawel

mtremblay-savard
Participant
0 Kudos

Thanks a lot! This is the perfect answer!

Best regards,
Max

Former Member
0 Kudos

Hi Karl,

    Need your help. Have a requirement where I have to modify the F4 results in CG02. I have created the *_F4 FM and it is returning values. But instead of coming as a pop up window like a normal F4 the values are appearing in a single row in separate columns. Do you have any idea what is it that I am missing in my code?

Thanks,

Anumeha

Former Member
0 Kudos

Thanks for the answers.

Former Member
0 Kudos

Hi,

First create a function module according to the F1 documentation with import and export parameters as suggested for example: Z_EXAMPLE_CHAR.

Create a Second function module according to the F1 documentation with import and export parameters as suggested for example: Z_EXAMPLE_CHAR_F4.

Inside your CT04 Other values select function module and place Z_EXAMPLE_CHAR inside field. This will automatically call the F4 module when F4 is pressed. Note that the names must be exactly the same for both FM's except for the F4 at end. The parameters that are export with your value are Value and Values.