2009 Nov 10 6:16 AM
Hi Experts,
I Make One Alv Report,It works Fine and Display 40 colums.i create one Button on Application Tool Bar. User select any
colum from 40 colum and Press Button and user wants to see that colum in sorting and based upon that sorting ,he wants sub total for different records.
how can find that selected colum in USER_COMMAND.
Please give any read statement to read fieldcatlog of slected colum.
Thanks.
Hi Experts,
I Make One Alv Report,It works Fine and Display 40 colums.i create one Button on Application Tool Bar. User select any
colum from 40 colum and Press Button and user wants to see that colum in sorting and based upon that sorting ,he wants sub total for different records.
how can find that selected colum in USER_COMMAND.
Please give any read statement to read fieldcatlog of slected colum.
Thanks.
2009 Nov 10 6:29 AM
Hi
check the example below code to get an idea..
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_pf_status_set = 'SET_PFALV'
i_callback_user_command = 'USER_COMMAND1'
it_fieldcat = t_fieldcat
it_events = t_events
TABLES
t_outtab = t_outtab
EXCEPTIONS
program_error = 0.
now jus write a subroutine USER_COMMAND1 remember this routine is called dynamically u no need to write perform user_command1.
in selfield u can find ur selected table value
FORM user_command1 USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield. "#EC CALLED
CHECK sy-subrc = 0.
CASE ucomm.
WHEN '&IC1'.
CASE selfield-sel_tab_field.
WHEN 'T_BALANCE-MATNR'.
Call Transcation MM01.
WHEN 'T_BALANCE-STOCK'.
Call Transaction MMBE.
...
.
.
ENDCASE.
endform.
2009 Nov 10 7:04 AM
Hi dasaradha ramayya,
In ALV when user clicks on any selected column, user command will be '&IC1'.
You can define any action based upon this function code.
For ex :
FORM user_command USING u_ucomm LIKE sy-ucomm us_selfield TYPE slis_selfield.
sort it_vbak by vbeln.
CASE u_ucomm.
WHEN '&IC1'.
CLEAR wa_event.
READ TABLE it_vbak INTO wa_vbak INDEX us_selfield-tabindex.
if sy-subrc ne 0.
message i006 with 'sorry there is no items for this orders'(014).
endif.
ENDCASE.
Hope the information is helpful,
Regards,
Kittu
2009 Nov 13 4:46 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |