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

Former Member
0 Likes
1,485

Moderator message: please use a meaningful subject in future

Hi,

I am displaying 5 fields in ALV report where heading of all 5 fields are like

1. Purchase Order

2. SES Number

3. PO Type

4. GR Date

5. Invoice Amount

But in report i could see only first 10 characters of heading..i.e,

Instead of "Purchse Order" it is displaying "Purchase O'..first 10 charaters. How to display complete heading ...

Structure LVC_S_FCAT

Short Description ALV control: Field catalog

Please help

Edited by: ABAPer 007 on Dec 15, 2009 4:02 PM

Edited by: Matt on Dec 15, 2009 11:50 AM

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,447

Hello,

Are you populating the fieldcat table using LVC_FIELDCATALOG_MERGE or manually populating the fieldcat?

Please clarify.

BR,

Suhas

Moderator message: please use a meaningful subject in future

Hi,

I am displaying 5 fields in ALV report where heading of all 5 fields are like

1. Purchase Order

2. SES Number

3. PO Type

4. GR Date

5. Invoice Amount

But in report i could see only first 10 characters of heading..i.e,

Instead of "Purchse Order" it is displaying "Purchase O'..first 10 charaters. How to display complete heading ...

Structure LVC_S_FCAT

Short Description ALV control: Field catalog

Please help

Edited by: ABAPer 007 on Dec 15, 2009 4:02 PM

Edited by: Matt on Dec 15, 2009 11:50 AM

12 REPLIES 12
Read only

Former Member
0 Likes
1,447

Hi,

Increase outputlen option in the field catalog.


wa_fc-outputlen = '30'.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,448

Hello,

Are you populating the fieldcat table using LVC_FIELDCATALOG_MERGE or manually populating the fieldcat?

Please clarify.

BR,

Suhas

Read only

Former Member
0 Likes
1,447

Hi,

Directly populating IT_FIELDCATALOG.... Not used MERGE.

if we increase outpuit length field values will be restricted to 30 characters......

Read only

anversha_s
Active Contributor
0 Likes
1,447

Hi,

You can use below fields in the struture fieldcatalog.

fieldcatalog-seltext_m   = 'Purchase Order'.
fieldcatalog-seltext_l   = 'Purchase Order'.
fieldcatalog-seltext_s   = 'Purchase Order'.

Rgds

Anversha

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,447

Hello,

In the structure LVC_S_FCAT you have the field SCRTEXT_L. This is the longest column name that is allowed in the fieldcat (40 chars).

In your fieldcat you have to pass the values as:

ST-FIELDCAT-SCRTEXT_L = 'Purchase Order'.
ST-FIELDCAT-COLDDICTXT = 'L'.

Try this & check.

BR,

Suhas

Read only

Former Member
0 Likes
1,447

anversha,

i did the same...Ok to be more specific to question, how can we tell SAP which label to use. As u specifed thr are 3 labels short, medium and long...s/m is now using short..how to tell it to use Medium or long. evenif u give more than 10 char in short like fieldcatalog-seltext_s = 'Purchase Order' only 10 characters will be displayed.

Read only

Former Member
0 Likes
1,447

U r a genius...

Read only

anversha_s
Active Contributor
0 Likes
1,447

Hi,

do like this.

fieldcatalog--reptext    = 'Purchase Order'.
 fieldcatalog-seltext_l   = 'Purchase Order'.
 fieldcatalog-outputlen   = 30.

if u gave the field

gd_layout-colwidth_optimize = 'X',

then remove 'X' and put

space.

Rgds

Anversha

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,447

>

> U r a genius...

Unfortunately i am not. Spending time in SDN forums makes you learn a few smart tricks of the trade ...

Cheers,

Suhas

Read only

Former Member
0 Likes
1,447

Hi,

Mention the field length as below.

*-- Filling catalogue with
  PERFORM fill_catalogue USING:

*  Column  O/P field         Length    Desc
      1     'TELNR'          17      text-a01,
      2     'INV_DATE'       13      text-a02,
      3     'PERNR'          15      text-a03,
      4     'NAME'           40      text-a04,
      5     'KOSTL'          14      text-a05,
      6     'AMTTOPAY'       12      text-a06,
      7     'VAT'            10      text-a07,
      8     'COMMTAX'        15      text-a08,
      9     'USRID'          17      text-a09,
     10     'EXPAMT'         14      text-a10,
     11     'EXPVAT'         11      text-a11,
     12     'EXPCOMMTAX'     16      text-a12,
     13     'SALARYPERD'     18      text-a13,
     14     'SALARYAMT'      23      text-a14.

*&---------------------------------------------------------------------*
*& Form Name      : Fill_catalogue                                     *
*&---------------------------------------------------------------------*
*& Description    : Populating the Field Catalogue                     *
*&---------------------------------------------------------------------*
*& Parameters     : FP_COL_POS   ---> Column Position                  *
*&                  FP_FIELD     ---> Field name                       *
*&                  FP_LEN       ---> Field length                     *
*&                  FP_SELTEXT_L ---> Field Description                *
*&---------------------------------------------------------------------*
FORM fill_catalogue USING  fp_col_pos
                           fp_field
                           fp_len
                           fp_seltext_l.

*-- Local data declaration
  DATA: lws_fieldcat TYPE slis_fieldcat_alv.

*-- Set FieldCatalog Attributes
  lws_fieldcat-col_pos       = fp_col_pos.
  lws_fieldcat-fieldname     = fp_field.
  lws_fieldcat-seltext_l     = fp_seltext_l.
  lws_fieldcat-outputlen     = fp_len.

*-- Update FieldCatalog Table
  APPEND lws_fieldcat  TO  int_fieldcat.
  CLEAR  lws_fieldcat.
ENDFORM.                    " fill_catalogue

Texts refer to the text symbols maintained for the ALV header.

Regards,

Amit

Edited by: AMIT BISHT on Dec 15, 2009 11:53 AM

Read only

matt
Active Contributor
0 Likes
1,447

Moderator message: please use a meaningful subject in future

Read only

Former Member
0 Likes
1,447

Hi,

Define the layout and pass the following parameteras 'X'.


   wa_layout- colwidth_optimize = 'X'.

It will automatically take care of the field length.

No need to give output length =XXXX.

Giving colwidth_optimize ='X'. is the best practices.

Regards,

Pravin