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

ALV Report Problem

Former Member
0 Likes
1,543

Hi All,

I have a ALV Grid Report. when i execute the report, it shows the output..but somewhere it don't show the full description of fields...like materi....in place of material..

what is the problem in it..

plz tell....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,525

Check the field catalouge for material.

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-seltext_m = 'Material'.

wa_fieldcat-just = 'L'.

wa_fieldcat-no_zero(1) = 'X'.

wa_fieldcat-outputlen = 20.

wa_fieldcat-tabname = 'IT_EXCEL'.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

Amit.

Edited by: Jony on May 27, 2008 11:16 AM

15 REPLIES 15
Read only

Former Member
0 Likes
1,525

Hi Prince,

While preparing fieldcat pass value for all there

seltext_m

seltext_l.

This will solve your issue.

Thanks,

Arun

Read only

Former Member
0 Likes
1,526

Check the field catalouge for material.

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-seltext_m = 'Material'.

wa_fieldcat-just = 'L'.

wa_fieldcat-no_zero(1) = 'X'.

wa_fieldcat-outputlen = 20.

wa_fieldcat-tabname = 'IT_EXCEL'.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

Amit.

Edited by: Jony on May 27, 2008 11:16 AM

Read only

0 Likes
1,525

Hi Dear,

Thanks for reply...i think ur answer is correct but i have few changes in my report...plz tell me where i can change in it...

Code.....

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

REPORT ZAK_COQA LINE-SIZE 175 .

TABLES : MARA, T001L, MARD, MBEW.

TYPE-POOLS: SLIS.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR, " Material No.

WERKS LIKE MARD-WERKS, " Plant

LGORT LIKE MARD-LGORT,

LABST LIKE MARD-LABST,

SALK3 LIKE MBEW-SALK3,

END OF ITAB.

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

DATA : W_CONTAINER TYPE SCRFNAME VALUE 'CL_GRID',

W_CPROG TYPE LVC_S_LAYO,

G_REPID LIKE SY-REPID,

W_SAVE TYPE C,

W_EXIT TYPE C,

CL_GRID TYPE REF TO CL_GUI_ALV_GRID,

CL_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

IT_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV,

WA_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE ,

LAYOUT TYPE SLIS_LAYOUT_ALV,

COL_POS LIKE SY-CUCOL ,

ALVFC TYPE SLIS_T_FIELDCAT_ALV.

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

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME.

SELECT-OPTIONS: MATNR FOR MARA-MATNR, " Material No.

WERKS FOR T001L-WERKS, " Plant

LGORT FOR T001L-LGORT.

SELECTION-SCREEN END OF BLOCK A.

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

PERFORM FILL_CATALOG1 USING:

'MATNR' 'ITAB' 'MATERIAL NUMBER',

'WERKS' 'ITAB' 'PLANT',

'LGORT' 'ITAB' 'STORAGE LOCATION',

'LABST' 'ITAB' 'QUANTITY',

'SALK3' 'ITAB' 'AMOUNT'.

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

SELECT AMATNR BWERKS BLGORT BLABST INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM MARA AS A INNER JOIN MARD AS B ON AMATNR = BMATNR

WHERE A~MATNR IN MATNR

AND B~WERKS IN WERKS

AND B~LGORT IN LGORT.

LOOP AT ITAB.

SELECT SALK3 FROM MBEW INTO (ITAB-SALK3) WHERE MATNR = ITAB-MATNR.

MODIFY ITAB INDEX SY-TABIX TRANSPORTING SALK3.

ENDSELECT .

ENDLOOP.

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

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'ZAK_COQA'

IS_LAYOUT = LAYOUT

IT_FIELDCAT = IT_FLD_CATALOG

I_DEFAULT = 'X'

I_SAVE = 'A'

TABLES

T_OUTTAB = ITAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

&----


*& Form FILL_CATALOG1

&----


  • text

----


  • -->P_FIELDNAME text

  • -->P_REF_TABLE text

  • -->P_SCRTEXT text

----


FORM FILL_CATALOG1 USING P_FIELDNAME TYPE ANY

P_REF_TABLE TYPE ANY

P_SCRTEXT TYPE ANY.

CLEAR : WA_FLD_CATALOG.

WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.

WA_FLD_CATALOG-TABNAME = P_REF_TABLE.

WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.

WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.

WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.

APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.

ENDFORM. " fill_catalog1

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

Plz tell.....

Edited by: Prince Kumar on May 27, 2008 3:00 PM

Read only

0 Likes
1,525

hi

you can do changes like shown below ---

FORM FILL_CATALOG1 USING P_FIELDNAME TYPE ANY

P_REF_TABLE TYPE ANY

P_SCRTEXT TYPE ANY.

CLEAR : WA_FLD_CATALOG.

WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.

WA_FLD_CATALOG-TABNAME = P_REF_TABLE.

WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.

WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.

WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.

-->WA_FLD_CATALOG-OUTPUTLEN = 10.

APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.

hope it helps..

Reward if useful.

Regards

Megha Sharma

Read only

0 Likes
1,525

Hi Megha Sharma,

Thanks Dear...My problem Solved Now.. Thanks once again...

Read only

0 Likes
1,525

Hi Megha Sharma,

I have 1 more problem in this thread that when i download this executed data in to excel sheet, it don't show my required format, means not showing description complete in EXCEL..only showing complete after execute in sap not in excel.

Plz help...

Read only

Former Member
0 Likes
1,525

try assigning the sel_l field in the field catalog for the field which is for the display of long text.

Rgds,

Stck

Read only

Former Member
0 Likes
1,525

Hi

Set the flag of layout.

fld_alv_layout-colwidth_optimize = 'X'.

Regards

Raja.

Read only

former_member156446
Active Contributor
0 Likes
1,525

check the field catalog


l_fieldcat-outputlen = 10. "give it as much as u want...

Read only

Former Member
0 Likes
1,525

hi,

add one more field in your layout.

layout_colwidth-optimize = 'X'.

This optimizes the column width to ensure that the content is displayed completely.

if u define this layout field than no need to define any kind of field catalog that defines a field length like seltext_l , seltext_m etc.

reward if helpful.

Read only

Former Member
0 Likes
1,525

I have a little bit problem here.

Read only

Former Member
0 Likes
1,525

Hi,

Increase the output length and check.


gs_fieldcat-outputlen  = ' '. "Increase it by existing number

Thanks,

Sriram Ponna.

Read only

0 Likes
1,525

Dear,

U r right but i mean from EXCEL....

When i executing report..showing correct description but when i downloading it into EXCEL not showing complete... it break description...

Plz Tell..

Edited by: Prince Kumar on May 27, 2008 5:21 PM

Read only

Former Member
0 Likes
1,525

Hi

remove fld_alv_layout-colwidth_optimize = 'X'. U should get.

Venkat

Read only

0 Likes
1,525

Hi,

But i have not used fld_alv_layout-colwidth_optimize = 'X'. statement.

Where it is in my code...plz tell...

Edited by: Prince Kumar on May 27, 2008 5:55 PM