cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying a row by default in ALV table

Former Member
0 Kudos

Hi all,

I have created an alv table in which i have to display a row by default. I have set all the fields of the table as editable.

Also I have created the total calculation for the amount field by using the aggregation method, I want to displat the total grid also to be displayed by default.

How can I set that value?? Please give some suggestions.

Thanks in advance,

Nalla.B

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nalla,

You want to display default values in alv? I am not getting your requrement exactly?

Cheers,

Kris.

Former Member
0 Kudos

hai all,

I want to display an empty row by default also the total yellow colour grid has to be displayed.

That total grid is now displaying only when i sort any of the coloumn in the lv display. I want it to be displayed by default.

Pls give some suggestions.

Thanks in advance,

Nalla.B

Former Member
0 Kudos

Hi Nalla,

we have append row by default in alv. check that and

Write your code in WDDOINIT method to display row by default.

Cheers,

Kris.

Former Member
0 Kudos

hi kisnas,

I have used set_append_row_allowed(). . But am not getting the row. once i click on the append or insert button only am getting a now row. By the time of wddoinit itself i want a row and the total grid to be displayed.

pls help.

thanks.

nalla.B

sahai
Contributor
0 Kudos

i guess you are not putting any values to the internal table while binding it....kindly check it if not try putting blank values in the table and only then you will be able to get an empty row....

i will be able to help you more if you tell me that why you require such thing ? and also what are your attributes and nodes involved here

Regards,

Sahai.s

Former Member
0 Kudos

Hi Nalla,

As you know you should call the agregation methode for displaying the total row :

  
DATA : alv_config_table  TYPE REF TO cl_salv_wd_config_table.
DATA : lr_field TYPE REF TO cl_salv_wd_field.
alv_config_table->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).
lr_field =  alv_config_table->if_salv_wd_field_settings~get_field( 'CARRIED' ) . "The column name for which total needs 
lr_field->if_salv_wd_aggr~create_aggr_rule( aggregation_type =  if_salv_wd_c_aggregation=>aggrtype_total ).

OK, i guess this is done in a specific methode 'METHODE_ALV' for the ALV settings.

Row by default :

Try to populate a line in your internal table, and bind it to the reference context of the ALV in WDDOINIT.

and call the METHODE_ALV

Sum row :

Check if you are implementing a methode that intercept the ON_DATA_CHECK event, if yes try to recall the METHODE_ALV.

> The aggregation methode must be recalled.

Best regards.

Former Member
0 Kudos

Hi Jricos/shagi,

I have used append initial line to statment anow i am getting an empty row.

I have used that aggregate function in my wddoinit method.

A, also using a method called data check where am using data check event.

SO pls tell me how can i call that wddoint method in this data check method.

Pls give some suggestion.

Thanks for ur help.

Nalla B

sahai
Contributor
0 Kudos

hi,

you can call the method if it is declared in component controller.

wd_comp_controller->method()

the above statement will get the control to the method .

Regards,

Sahai.s

vishesh_malik
Participant
0 Kudos

Hi Nalla,

Per my knowledge you cannot call hook methods i.e. WDDOINIT, WDDOMODIFY using controller but you canwrite your code accordingly like if you want to call your check method first then call it from WDDOINIT or if you want to change config of ALV first then write that part first . Also, you can write required code in INIT and then write remaining code inside WDDOMODIFY method. But here you want to execute your code only once so use IF FIRST_TIME = ABAP_TRUE. write your code ENDIF , inside WDDOMODIFY.

Hope it wil help!

Vishesh

sahai
Contributor
0 Kudos

can you explain more clearly ......