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: 

ALV

Former Member
0 Kudos

Hi,

I am trying to create a FM which will handle all the things that are required to create an ALV Grid report.

I will be supplying the data(header data, layout, field catalogue and the actual data to be displayed) required for the FM thru tables.

The function module is working fine when ever I try to use the standard tables like MARA/VBAP etc.., but its failing if I pass any internal table. For this I am using the FM REUSE_ALV_FIELDCATALOG_MERGE to create the catalogue, but the program is going for dump. Can anybody help me in this regard.

Regards,

Ganesh Prasanna

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi Ganesh,

i got it, there are lines in your program(which you are passing) is more than 72 chars length, try to reduce them by making them to two lines instead of one big line code.

then it won't dump.

check it.

Regards

vijay

14 REPLIES 14

hymavathi_oruganti
Active Contributor
0 Kudos

u try to pass the internal table name to the structure field of fieldcatalog merge as it is, means, if it is declared as capital letters , then give like that as it is.

0 Kudos

Hi,

I did the same but its failing. one more thing is I coded the whole logic used in the FM in an sample program there its working fine. But when I moved the same to code to the FM its going for dump.

Ganesh Prasanna

0 Kudos

then, dont copy and paste the fn module from any program, just delete the whole fn module and call it again and check once again the name of the internal table is same.

former_member188685
Active Contributor
0 Kudos
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
  <b> I_PROGRAM_NAME               = sy-repid</b>
  <b> I_INTERNAL_TABNAME           = 'ITAB'</b>
   <b>I_INCLNAME                   = sy-repid</b>
  changing
    ct_fieldcat                  = IT_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.

the above code in BOld is must,

Regards

vijay

0 Kudos

FUNCTION YGTEST.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(STRUC_TYPE) TYPE DD02L-TABNAME OPTIONAL

*" VALUE(PROGRAM_NAME) LIKE SY-REPID OPTIONAL

*" VALUE(ITABNAME) TYPE SLIS_TABNAME OPTIONAL

*" VALUE(INCLUDE_NAME) LIKE TRDIR-NAME OPTIONAL

*" TABLES

*" OUTTAB

*"----


data : fieldcat type SLIS_T_FIELDCAT_ALV,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = PROGRAM_NAME

I_INTERNAL_TABNAME = ITABNAME

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = PROGRAM_NAME

CHANGING

ct_fieldcat = 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.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

I_CALLBACK_USER_COMMAND = 'USER_COMMAND_L'

IT_FIELDCAT = fieldcat

I_SAVE = 'A'

TABLES

T_OUTTAB = outtab.

ENDFUNCTION.

This is my FM code. Correct me if I am doing anything wrong.

0 Kudos

itabname should be given in single quotes

0 Kudos

CALL FUNCTION 'YGTEST'

EXPORTING

  • STRUC_TYPE =

PROGRAM_NAME = id

ITABNAME = 'itab'

INCLUDE_NAME = id

TABLES

outtab = ITAB .

This is how I call the FM in my program.

itab is declared in small letters only.

0 Kudos

hi write 'itab' as 'ITAB'

when u give a standard object in single quotes then always use capital letters otherwise error will come

regards..

Madan Gopal

Former Member
0 Kudos

An exception occurred. This exception is dealt with in more detail below. The exception, which is assigned to the class 'CX_SY_READ_SRC_LINE_TOO_LONG', was neither caught nor passed along using a RAISING clause, in the procedure "K_KKB_FIELDCAT_MERGE" "(FUNCTION)".

Since the caller of the procedure could not have expected this exception to occur, the running program was terminated. The reason for the exception is: You tried to read the program "YGALVTEST" from the database. The READ REPORT statement allows you to copy a program's source code into an internal table. The lines of source code must not be longer than the width of the internal table. The internal table is 72 characters wide. The source code line is 87 wide.

ABOVE IS THE ERROR ANALYSIS WHICH I GOT WHEN I EXECUTED THE PROGRAM IN WHICH I HAVE CALLED MY FM.

former_member188685
Active Contributor
0 Kudos

Hi Ganesh,

i got it, there are lines in your program(which you are passing) is more than 72 chars length, try to reduce them by making them to two lines instead of one big line code.

then it won't dump.

check it.

Regards

vijay

0 Kudos

Hi vijay,

I dont have any code with line size greater than 72.

Just now I checked the whole code.

Regards,

Ganesh

0 Kudos

while calling 'REUSE_FIELDCATLOG_MERGE' as u copied and pasted above , i observe that u havent put ITABNAME in quotes, pls check once

0 Kudos

Hi Ganesh,

ok in the program you don't have a code lines more than 72 chars. but you may have comment lines more than 72 chars. once we faced the same issue.

may be comment line is more

**************************"this is more than 72check it

Regards

vijay

Regards

vijay

0 Kudos

Hi Ganesh,

In ur FM u r calling 'REUSE_ALV_LIST_DISPLAY' , in that change the sy-repid to PROGRAM_NAME and check out

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = <b>PROGRAM_NAME</b>

I_CALLBACK_USER_COMMAND = 'USER_COMMAND_L'

IT_FIELDCAT = fieldcat

I_SAVE = 'A'

TABLES

T_OUTTAB = outtab.

ENDFUNCTION.