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

ravi_sirigiri
Participant
0 Likes
893

Hi,

if a column in an alv is not a table field like in a table we will have 'Quantity' and 'Price' fields but not the 'TotPrice' field so if we calculate the totprice(Quantity * Price) and add in our internal table, how will i get the name of this column as TotPrice in alv and its subtotals and totals.

Pls do the needful asap.

Regards,

Ravi

Hi,

if a column in an alv is not a table field like in a table we will have 'Quantity' and 'Price' fields but not the 'TotPrice' field so if we calculate the totprice(Quantity * Price) and add in our internal table, how will i get the name of this column as TotPrice in alv and its subtotals and totals.

Pls do the needful asap.

Regards,

Ravi

5 REPLIES 5
Read only

hymavathi_oruganti
Active Contributor
0 Likes
793

u have to give the name in fieldacatalog like below.

fieldcat-fieldname = 'TOTPRICE'

FIELDCAT-SELTEXT_M = 'TOT_PRICE'.

FIELDCAT-COL_POS = COL_POS.

FIELDCAT-OUTPUTLEN = OUTPUTLEN.

APPEND FIELDCAT TO FIELDCAT.

1. THE FIELDCAT IS VERY IMPORTANT. WHAT EVER SELTEXT U GIVE IN FIELDCATALOG APPEARS IN THE O/P OF ALV.

2. U NEED TO BUILD FIELDCAT AND PASS IT TO REUSE_ALV fn module.

3. <b>there is no rule that fieldcat fields should be there in either database table or even internal table.</b>

Read only

0 Likes
793

Hi Hymavathi Oruganti,

thanks very much.

Ravi

Read only

Former Member
0 Likes
793

Hi Ravi,

You have to manually set the name of this column as Tot Price, by modifying the fieldcatalog.you have to move the name to SELTEXT_L Of your fieldcatalog.

Regards,

Raghavendra

Read only

Former Member
0 Likes
793

hi Ravi,

if the field is present in the itab..

you can use the fieldcatalogue to display these options..

for eg.

tempcat-fieldname = <tot_price>.
*for display of heading
  tempcat-seltext_l = 'Total Price'.
  tempcat-ddictxt = 'L'.
*for total
  tempcat-do_sum = 'X'.
APPEND TEMPCAT TO FIELDCAT .

for <b>subtotal use it_sort of type slis_t_sortinfo_ALV.</b>

regards

satesh

Read only

0 Likes
793

Hi Satesh,

Thanks. It is working.

Regards,

Ravi