08-28-2008 12:46 PM
Hi,
I need to sort the column when clicked on the column name,
but what its function code, clicking on the columns, I do not know and on which column the user clicked?
How can I do such a thing?
Thanks.
deniz.
08-28-2008 12:52 PM
Hi Toprak,
Use GET CURSOR FIELD w_field.
At LINE-SELECTION.
GET CURSOR FIELD w_field.
IF w_field EQ 'SPFLI-CARRID'.
SORT t_spfli BY carrid.
perform display.
ELSEIF w_field EQ 'SPFLI-CONNID'.
SORT t_spfli BY connid.
perform display.
ELSEIF w_field EQ 'SPFLI-CITYFROM'.
SORT t_spfli BY cityfrom.
perform display.
ELSEIF w_field EQ 'SPFLI-CITYTO'.
SORT t_spfli BY cityto.
perform display.
ENDIF.
FORM display.
Loop at t_spfli.
Write:/ t_spfli-carrid,
t_spfli-connid,
t_spfli-cityfrom,
t_spfli-cityto.
Endloop.
ENDFORM.
With luck,
Pritam.
08-28-2008 1:14 PM
Thanks,
however there is a misunderstanding.
I am not asking the item columns, I need to know the column header.
Assume:
Name Surname
John NASH
Jack SHEPHARD
...
...
I need to know which column header, here Name or Surname, and just one click I mean.
When clicked on NAME itself, not on John or Jack, it should be sorted ascending or if sorted asc then at later click be sorted desc.
Thanks.
08-28-2008 1:19 PM
You can try PA30 trans code to understand better.
Write pa30 and then use F4 please to find a pernr through Name surname etc.
Here try to get more data, so please enter something like
A* into surname field or something else.
Now click on surname or name etc, you see that it is sorted with just one click.
Please try this, I mean that.
Thanks.
08-28-2008 1:34 PM
Hi,
for that first check if the sy-lilli value contains the line number of the header... then get the cursor position.
regards
padma
08-28-2008 12:53 PM
Using GET CURSOR you can get that
GET CURSOR FIELD <FIELDNAME> VALUE VALUE.
<FIELDNAME> will tell you on which field you clicked
08-28-2008 12:54 PM
Hi,
i have not tried..i am giving my openion if it helps you try it.
take the parameter id for all the columns of that report.
before looping that table capture all the parameter id's of fields in that tbale.
then in the case stmt...based on that parameter id...you can sort the table and loop it.
Regards,
venkat