Application Development 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: 

Getting error message in F4 help

0 Kudos

Hi Exports,

I m facing a issue in F4 help, F4 help is coming correctly, when I want to search the items in that F2 function is not working..

when I click on down arrow at customer field I m getting following error

"Field- F0002 is not defined in the ABAP dictionary"

bellow is my code and screen shot

     SORT LT_INVOICE_F4 BY INVCE KUNNR.

     DELETE ADJACENT DUPLICATES FROM LT_INVOICE_F4

       COMPARING INVCE KUNNR.

     CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

       EXPORTING

*       DDIC_STRUCTURE         = ' '

         RETFIELD               = 'INVCE'

*       PVALKEY                = ' '

         DYNPPROG               = LV_DYNAME

         DYNPNR                 = LV_DYNUMB

         DYNPROFIELD            = LV_DYNPFLD

*       STEPL                  = 0

*       WINDOW_TITLE           =

*       VALUE                  = ' '

         VALUE_ORG              = 'S'

*       MULTIPLE_CHOICE        = ' '

*       DISPLAY                = ' '

*       CALLBACK_PROGRAM       = ' '

*       CALLBACK_FORM          = ' '

*       MARK_TAB               =

*     IMPORTING

*       USER_RESET             =

       TABLES

         VALUE_TAB              = LT_INVOICE_F4

*       FIELD_TAB              =

         RETURN_TAB             = LT_RETURN

*       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.

     READ TABLE LT_RETURN INTO LW_RETURN INDEX 1.

   IF SY-SUBRC = 0.

      P_INVOIC = LW_RETURN-FIELDVAL.

   ENDIF.

Thanks in advance

19 REPLIES 19

raymond_giuseppi
Active Contributor
0 Kudos

Could you post the definition of internal table LT_INVOICE_F4.

Regards,

Raymond

0 Kudos

Hi Raymond..

Thanks for quick reply

following is the definition of LT_INVOICE_F4

TYPES : BEGIN OF TY_INVOICE_F4,

             INVCE TYPE ZFI_BILL-INVCE,

             KUNNR TYPE ZFI_BILL-KUNNR,

         END OF TY_INVOICE_F4.

DATA : LT_INVOICE_F4 TYPE TABLE OF TY_INVOICE_F4.

0 Kudos

Try to replace ZFI_BILL-KUNNR with data element KUNNR in itab definition, or give the definition of ZFI_BILL table/structure.

Regards,

Raymond

0 Kudos

Hi

in ur  case it is searching kunnr in dictionary but u have not given

according to sap standard

give  data : like this kunnr type kna1-kunnr

      or

kunnr type kunnr

0 Kudos

Dear,

use kunnr type kna1-kunnr.

0 Kudos

Hi Srinivas & Bharat,

Thanks for your prompt response.

I tried with KUNNR TYPE KNA1-KUNNR

then also it is not working..

Is there any other way to rectify my problem.

0 Kudos

Hi

Create an elementary search help based on based on your fields

ZFI_BILL-INVCE,

ZFI_BILL-KUNNR,

then call the search help which can solve your problem.

0 Kudos

Hi,

I've tried something similar with KUNNR TYPE KUNNR and the is no down arrow on the customer field, even though instinctively this seems to be the right way to define it.

However, going back to your original definition and the error it generates, the message is triggered from function module DD_SHLP_GET_HELPMETHOD and has two variable parts, a table name and a field name.  In your screen shot only the field name part of the message is populated (F0002), the table name is missing.

This would suggest that the problem is somewhere in the definition of the table ZFI_BILL.  You could try to debug DD_SHLP_GET_HELPMETHOD or post the definition of ZFI_BILL here.

Regards,

Nick

0 Kudos

Dear,

Please send me your full code.

Aashish28
Contributor
0 Kudos

Hiii,

        Just do one thing - in your z table field ZFI_BILL-KUNNR assign  Explicit search help  DEBI or make foreign key relationship. 

0 Kudos

Hi all,

Following screen shot is my table definition, can you please check it

0 Kudos

Hiii,

        Just Check Entry help/check tab of my table : -  here i make foreign key relationship with kna1 or you can assign C_KUNNR OR DEBI as explicit search help also .

Just do same as your table : -

0 Kudos

Hi Ashish,

I can't change my table.. because already it is in production. My Functional people are not ready me to change in the table. So is there any other way .. I m ready to change my table definition in my logic.. but already I tried it but it is not working.. is there any other way..

0 Kudos

Hiii,

        Than as @ told  fill FIELD_TAB use  fm  - DDIF_FIELDINFO_GET and fill your FIELD_TAB and pass it .

0 Kudos

Hi Ashish,

I tried as per your suggestion, following is the code

   DATA lv_table TYPE DDOBJNAME.

     lv_table = 'zfi_bill'.

   CALL FUNCTION 'DDIF_FIELDINFO_GET'

     EXPORTING

       TABNAME              = lv_table

*     FIELDNAME            = ' '

      LANGU                = SY-LANGU

*     LFIELDNAME           = ' '

*     ALL_TYPES            = ' '

*     GROUP_NAMES          = ' '

*     UCLEN                =

*   IMPORTING

*     X030L_WA             =

*     DDOBJTYPE            =

*     DFIES_WA             =

*     LINES_DESCR          =

    TABLES

      DFIES_TAB            = lt_field_tab

*     FIXED_VALUES         =

*   EXCEPTIONS

*     NOT_FOUND            = 1

*     INTERNAL_ERROR       = 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.

     SORT LT_INVOICE_F4 BY INVCE KUNNR.

     DELETE ADJACENT DUPLICATES FROM LT_INVOICE_F4

       COMPARING INVCE KUNNR.

     CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

       EXPORTING

*       DDIC_STRUCTURE         = ' '

         RETFIELD               = 'INVCE'

*       PVALKEY                = ' '

         DYNPPROG               = LV_DYNAME

         DYNPNR                 = LV_DYNUMB

         DYNPROFIELD            = LV_DYNPFLD

*       STEPL                  = 0

*       WINDOW_TITLE           =

*       VALUE                  = ' '

         VALUE_ORG              = 'S'

*       MULTIPLE_CHOICE        = 'X'

*       DISPLAY                = ' '

*       CALLBACK_PROGRAM       = ' '

*       CALLBACK_FORM          = ' '

*       MARK_TAB               =

*     IMPORTING

*       USER_RESET             =

       TABLES

         VALUE_TAB              = LT_INVOICE_F4

         FIELD_TAB              = lt_field_tab

         RETURN_TAB             = LT_RETURN

*       DYNPFLD_MAPPING        = fmap

*     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.

In f4 hep it returns all my table fields but I need to only 2 fields (i.e. document number and customer number ) in F4 help .. can you please correct my code

0 Kudos

Hiii,

         Just give field name also along with table name  and call it 2 times by making subroutine .

1) for INVCE

2) for KUNNR

append  lt_field_tab which is return parameter of DDIF_FIELDINFO_GET fm to FIELD_TAB both having same structure DFIES.

append lt_field_tab to FIELD_TAB one by one .

****************************************************

make subroutine  for below or call it 2 times

DATA lv_table TYPE DDOBJNAME,

         lv_field  type DFIES-FIELDNAME,

     lv_table = 'zfi_bill'.

   CALL FUNCTION 'DDIF_FIELDINFO_GET'

     EXPORTING

       TABNAME              = lv_table

*     FIELDNAME            = lv_field

      LANGU                = SY-LANGU

*     LFIELDNAME           = ' '

*     ALL_TYPES            = ' '

*     GROUP_NAMES          = ' '

*     UCLEN                =

*   IMPORTING

*     X030L_WA             =

*     DDOBJTYPE            =

*     DFIES_WA             =

*     LINES_DESCR          =

    TABLES

      DFIES_TAB            = lt_field_tab

*     FIXED_VALUES         =

*   EXCEPTIONS

*     NOT_FOUND            = 1

*     INTERNAL_ERROR       = 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.

Hope this will solve your problem

0 Kudos

Hi Ashish,

As per your suggestion I change the logic, but in F4 help data is coming worng..

customer numbers are coming in the place of document numbers. Can you please check it once

   LV_FIELD = 'INVCE'.

   PERFORM FIELD_TAB TABLES LT_FIELD

                     USING LV_FIELD.

   READ TABLE LT_FIELD INTO LW_FIELD

   INDEX 1.

   APPEND LW_FIELD TO LT_FIELD_TAB.

   CLEAR LW_FIELD.

   LV_FIELD = 'KUNNR'.

   PERFORM FIELD_TAB TABLES LT_FIELD

                     USING LV_FIELD.

   READ TABLE LT_FIELD INTO LW_FIELD

   INDEX 1.

   APPEND LW_FIELD TO LT_FIELD_TAB.

   SORT LT_INVOICE_F4 BY INVCE KUNNR.

   DELETE ADJACENT DUPLICATES FROM LT_INVOICE_F4

     COMPARING INVCE KUNNR.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

*       DDIC_STRUCTURE         = ' '

       RETFIELD               = 'INVCE'

*       PVALKEY                = ' '

       DYNPPROG               = LV_DYNAME

       DYNPNR                 = LV_DYNUMB

       DYNPROFIELD            = LV_DYNPFLD

*       STEPL                  = 0

*       WINDOW_TITLE           =

*       VALUE                  = ' '

       VALUE_ORG              = 'S'

*       MULTIPLE_CHOICE        = 'X'

*       DISPLAY                = ' '

*       CALLBACK_PROGRAM       = ' '

*       CALLBACK_FORM          = ' '

*       MARK_TAB               =

*     IMPORTING

*       USER_RESET             =

     TABLES

       VALUE_TAB              = LT_INVOICE_F4

       FIELD_TAB              = LT_FIELD_TAB

       RETURN_TAB             = LT_RETURN

*       DYNPFLD_MAPPING        = fmap

*     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.

   READ TABLE LT_RETURN INTO LW_RETURN INDEX 1.

   IF SY-SUBRC = 0.

     P_INVOIC = LW_RETURN-FIELDVAL.

   ENDIF.

*----------------------------------------------------------*

FORM FIELD_TAB  TABLES   LT_FIELD

                            "Insert correct name for <...>

                 USING    P_LV_FIELD TYPE DFIES-FIELDNAME.

   DATA LV_TABLE TYPE DDOBJNAME.

   LV_TABLE = 'ZFI_BILL'.

   CALL FUNCTION 'DDIF_FIELDINFO_GET'

    EXPORTING

     TABNAME              = LV_TABLE

     FIELDNAME            = P_LV_FIELD

     LANGU                = SY-LANGU

*     LFIELDNAME           = ' '

*     ALL_TYPES            = ' '

*     GROUP_NAMES          = ' '

*     UCLEN                =

*   IMPORTING

*     X030L_WA             =

*     DDOBJTYPE            =

*     DFIES_WA             =

*     LINES_DESCR          =

   TABLES

     DFIES_TAB            = LT_FIELD

*     FIXED_VALUES         =

*   EXCEPTIONS

*     NOT_FOUND            = 1

*     INTERNAL_ERROR       = 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.

ENDFORM.                    " FIELD_TAB

0 Kudos

HIii,

       Just debug your code ..... refresh your table and workarea....... see your return_tab you will get 2 rows and your are reading by index 1 just check it again ..... instead of that you can do DYNPFLD_MAPPING for filling the value in fields ..... .

raymond_giuseppi
Active Contributor
0 Kudos

If nothing else works, as SAP does not like your table definition, you should fill the FIELD_TAB parameter...

Regards,

Raymond