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: 
Read only

Field catalog not creating in program

former_member219850
Participant
0 Likes
1,522

DATA: BEGIN OF GT_ZKOTG603 OCCURS 0,

         FNAME(100),

         LNAME(100),

         MANDT LIKE ZKOTG603-MANDT,

         KAPPL LIKE ZKOTG603-KAPPL,

         KSCHL LIKE ZKOTG603-KSCHL,

         VKORG LIKE ZKOTG603-VKORG,

         VTWEG LIKE ZKOTG603-VTWEG,

         KUNNR LIKE  ZKOTG603-KUNNR,

         ZZSPART LIKE ZKOTG603-ZZSPART,

         DATBI   LIKE ZKOTG603-DATBI,

         DATAB LIKE ZKOTG603-DATAB,

         END OF GT_ZKOTG603.

DATA : "GT_zkotg603 TYPE STANDARD TABLE OF TY_TABLE WITH HEADER LINE,

         GT_FIELDCAT  TYPE SLIS_T_FIELDCAT_ALV,

         GS_LAYOUT    TYPE SLIS_LAYOUT_ALV,

         GV_REPID1    LIKE TRDIR-NAME,

         GV_REPID     LIKE SY-REPID.

  PARAMETERS : S_KUNNR LIKE ZKOTG603-KUNNR,

               S_VKORG LIKE ZKOTG603-VKORG,

               S_VTWEG LIKE ZKOTG603-VTWEG,

               S_ZZSPAT LIKE ZKOTG603-ZZSPART.

GT_ZKOTG603-FNAME = 'DARSHAN'.

GT_ZKOTG603-LNAME = 'PANCHAL'.

SELECT * FROM ZKOTG603

                      WHERE KUNNR = S_KUNNR

                        AND VKORG = S_VKORG

                        AND VTWEG = S_VTWEG.

*                       AND ZZSPART = S_ZZSPAT.

     IF SY-SUBRC = 0.

           GT_ZKOTG603-KSCHL = ZKOTG603-KSCHL .

           GT_ZKOTG603-ZZSPART = ZKOTG603-ZZSPART.

            GT_ZKOTG603-VKORG = 'ABCD'.

            GT_ZKOTG603-VTWEG = 'XYZ'.

           APPEND GT_ZKOTG603.

         ENDIF.

       ENDSELECT.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  EXPORTING

    I_PROGRAM_NAME               = GV_REPID

    I_INTERNAL_TABNAME           = 'GT_ZKOTG603'

*   I_STRUCTURE_NAME             = 'TY_TABLE'

*   I_CLIENT_NEVER_DISPLAY       = 'X'

    I_INCLNAME                   = GV_REPID1

*   I_BYPASSING_BUFFER           =

*   I_BUFFER_ACTIVE              =

   CHANGING

     CT_FIELDCAT                  = GT_FIELDCAT

  EXCEPTIONS

    INCONSISTENT_INTERFACE       = 1

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

1 ACCEPTED SOLUTION
Read only

rajkumarnarasimman
Active Contributor
0 Likes
1,483

Hi Darshan,

Use the following code.


"Program Name

GV_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  EXPORTING

   I_PROGRAM_NAME               = GV_REPID

    I_INTERNAL_TABNAME           = 'GT_ZKOTG603'

    I_INCLNAME                   = GV_REPID

  I_BYPASSING_BUFFER           = 'X'

   CHANGING

     CT_FIELDCAT                  = GT_FIELDCAT

  EXCEPTIONS

    INCONSISTENT_INTERFACE       = 1

    PROGRAM_ERROR                = 2

OTHERS                       = 3

Kindly check whether the Field catalog is generating, else check the SY-SUBRC value, that lead us to know the exception.

Regards

Rajkumar Narasimman

12 REPLIES 12
Read only

Former Member
0 Likes
1,483

Hi,

Have you checked if it giving any exceptions?

Thanks

KH

Read only

0 Likes
1,483

yes,

sy-subrc = 1

SY-MSGID :- 0K

SY-MSGTY :- A

SY-MSGNO : - 530

Field catalog not found

Read only

0 Likes
1,483

Hi,

Check the below link which addresses solution to your prob.

dump in ALV

Thanks

KH

Read only

rajkumarnarasimman
Active Contributor
0 Likes
1,484

Hi Darshan,

Use the following code.


"Program Name

GV_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  EXPORTING

   I_PROGRAM_NAME               = GV_REPID

    I_INTERNAL_TABNAME           = 'GT_ZKOTG603'

    I_INCLNAME                   = GV_REPID

  I_BYPASSING_BUFFER           = 'X'

   CHANGING

     CT_FIELDCAT                  = GT_FIELDCAT

  EXCEPTIONS

    INCONSISTENT_INTERFACE       = 1

    PROGRAM_ERROR                = 2

OTHERS                       = 3

Kindly check whether the Field catalog is generating, else check the SY-SUBRC value, that lead us to know the exception.

Regards

Rajkumar Narasimman

Read only

0 Likes
1,483

HI Rajkumar ,


Did the same but its not working..


Field catalog is not creating...


sy-subrc = 1

SY-MSGID :- 0K

SY-MSGTY :- A

SY-MSGNO : - 530

Field catalog not found...

Read only

0 Likes
1,483

Hi Darshan,

Try to use below code.

data: lv_internal_tale type SLIS_TABNAME value 'GT_ZKOTG603'.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

   exporting

     i_program_name                    = sy-repid

     i_internal_tabname                 = lv_internal_table

     i_inclname                             = sy-repid

    changing

      ct_fieldcat                             = GT_FIELDCAT[]

exceptions

   inconsistent_interface               = 1

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

reagrds.

Praveer.

Read only

venuarun
Active Participant
0 Likes
1,483

Hi Darshan,

Please check that the whether field cat is building or no that in debugging.

Pass the structure name also in the Function module.

With Regards

Arun VS

Read only

0 Likes
1,483

I am checking in debugger,,

field catalogue is not creating..

Read only

venuarun
Active Participant
0 Likes
1,483

Hi Darshan,

Can you pass the structure name to the function module and check it.

With Regards

Arun VS

Read only

archanapawar
Contributor
0 Likes
1,483

Hi Darshan,

You need to define below fields with Like instead as below. I am not sure what exactly you need to populate in these fields.


         FNAME(100),

         LNAME(100),

Read only

Former Member
0 Likes
1,483

Hi Darshan,

     The structure name you are passing must be created in SE11. In your case TY_TABLE must be present in Data dictionary. Try and create it in data dictionary using SE11 Tocde and check it.

Hope this will help you.

Regards,

Sneha.

Read only

0 Likes
1,483

thanks for you reply,