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

problem in alv fieldcat function

Former Member
0 Likes
1,145

data: begin of it_mara occurs 100,

matnr LIKE mara-matnr,

ernam LIKE mara-ernam,

ersda LIKE mara-ersda,

mtart LIKE mara-mtart,

end of it_mara.

-


i am using the above mentioned int tab.

the following function is returning an error which states that ..

"The ABAP program lines are wider than the internal table."

-


i_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = i_repid

I_INTERNAL_TABNAME = 'IT_MARA'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = i_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = int_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

plz suggest how this problem can be resolved ..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,106

Hi,

Try commenting I_PROGRAM_NAME = i_repid and pass your internal table to I_STRUCTURE_NAME and comment I_INCLNAME .

Could you please provide your declaration of fieldcat.

Thanks,

Sriram Ponna.

Message was edited by:

Sriram Ponna

10 REPLIES 10
Read only

Former Member
0 Likes
1,106

Hi,

can u provide me the select staement which is filling the internal table IT_MARA.

as wellas the Field cataolg u cretaed.

Rvert back.

Regards,

naveen

Read only

0 Likes
1,106

hi naveen,

plz find the req. statements :

data: int_fcat type slis_t_fieldcat_alv.

select matnr ernam ersda mtart into table it_mara from marav where matnr in matnr.

-- where matnr value is coming from the selection screen.

Read only

0 Likes
1,106

Hi,

Can u just modify mara to marav, just its a suggetsion and not sure whether its really gonna work or not.

begin of ---

matnr LIKE marav-matnr,

ernam LIKE marav-ernam,

ersda LIKE marav-ersda,

mtart LIKE marav-mtart,

Moreover can u provide how u defined fieldcatalog.

ex: col_pos

field_name

sel_text.

Revrt back.

Regards,

naveen

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,106

There is no problem with your code provided itab definition is in the main source of the program, so how do you define int_fcat ?

Use :

  TYPE-POOLS : slis.
  DATA int_fcat TYPE slis_t_fieldcat_alv.

Regards

Read only

Former Member
0 Likes
1,107

Hi,

Try commenting I_PROGRAM_NAME = i_repid and pass your internal table to I_STRUCTURE_NAME and comment I_INCLNAME .

Could you please provide your declaration of fieldcat.

Thanks,

Sriram Ponna.

Message was edited by:

Sriram Ponna

Read only

Former Member
0 Likes
1,106

Hi

use the function module LVC_FIELDCATALOG_MERGE

here for the exporting parameter i_structure_name , you should pass the 'MARA' and from the changing table (field catalog table) int_fcat, you should choose the required fields you want to display.

here is the example for it :

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'CNVMBTTABLES'

CHANGING

ct_fieldcat = p_lt_fct

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE e369(cnv_mbt_46).

ENDIF.

LOOP AT p_lt_fct INTO ls_fct.

CASE ls_fct-fieldname.

WHEN 'TABNAME'.

ls_fct-edit = 'X'.

ls_fct-key = 'X'.

MODIFY p_lt_fct FROM ls_fct.

ENDCASE.

ENDLOOP

Hope u understood this, if u have any doubts revert back to me

Regards,

Prasant

*reward if useful

Read only

Former Member
0 Likes
1,106

Hi

see this small program so that you can understand very well

REPORT Z_TEST_ALV_MERGE.

Tables : Mara,makt.

type-pools: slis.

data: FEILDCAT type slis_t_fieldcat_alv.

data : begin of itab occurs 0,

MATNR like mara-matnr,

ERSDA like mara-ersda,

PSTAT like mara-pstat,

MTART like mara-mtart,

MAKTx like makt-maktx,

end of itab.

data: I_REPID like sy-repid.

I_REPID = sy-repid.

select * from mara into corresponding fields of itab.

select * from makt into corresponding fields of itab where matnr =

itab-matnr.

append itab.

endselect.

endselect.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = I_REPID

I_INTERNAL_TABNAME = 'ITAB'

I_INCLNAME = I_REPID

CHANGING

CT_FIELDCAT = FEILDCAT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

IT_FIELDCAT = FEILDCAT

TABLES

T_OUTTAB = IT

reward if useful

Read only

Former Member
0 Likes
1,106

Hi,

You can check this link

And make sure that your program line size should be less than 72 characters.

Thanks,

Sriram Ponna.

Message was edited by:

Sriram Ponna

Read only

0 Likes
1,106

hi all,

thnx the problem is nw resloved .. i had to change the i_program_name from sy-repid to the actual program name.

Read only

Former Member
0 Likes
1,106

Hi Ritika,

I also faced same problem,...what you have to do is, check coding length >72 and adjust according whole program.

My suggestion is to aviod using FM 'REUSE_ALV_FIELDCATALOG_MERGE'.

Let me know if your not getting

Thanks!

Brunda