Application Development 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: 

sort in tabcontrol

Former Member
0 Kudos

Hey

i want more information about tablecontrol.

In tablecontrol at screen.

1.want to display tablecontrol retriving value from table zmw0001.

i dont know how to do this.

2- how to do sort option in tablecontrol.

3-if select particular row from tabctrl and click the appl toolbar push button,

Record in tabcontrol has to be updated.

could you pls give me idea to do this.

if you reference material to do pls refer me.

ambichan.

6 REPLIES 6

Former Member
0 Kudos

Hi Ambi,

Start transaction ABAPDOCU and find the table control demo programs (ABAP user dialogs -> Screens -> Complex Screen elements).

You should find enough information to get started!

Regards,

John.

andreas_mann3
Active Contributor
0 Kudos

Hi Ambi,

pls look at report <b>RSDEMO_TABLE_CONTROL</b>

regards Andreas

Former Member
0 Kudos

Hai,

regarding SORT in table control.

should i have to select INPUT MODE option while installing Table control wizard to get SORT Function work

with it.

because i saw demo working fine but in my program

i am not able to work it.

can you please give idea or peace of code as like continue from tab control wizard.

ambichan.

andreas_mann3
Active Contributor
0 Kudos

Hi Ambi,

here's the code from RSDEMO_TABLE_CONTROL

WHEN 'SORT'.

DATA: FLDNAME(100),HELP(100).

READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY "table control

SELECTED = 'X'.

SPLIT COL-SCREEN-NAME AT '-' INTO HELP FLDNAME.

SORT SDYN_ITAB BY (FLDNAME). "your itab

...

regards Andreas

Former Member
0 Kudos

i have create tabcontrol using wizard

and it creates like this automatically.

TYPES: BEGIN OF T_ZTABCTRLOBJ,

TRKORRNUM LIKE ZMW0001-TRKORRNUM,

CLIENT LIKE ZMW0001-CLIENT,

IMPORTDAY LIKE ZMW0001-IMPORTDAY,

CONVERTFILENAME LIKE ZMW0001-CONVERTFILENAME,

TRANSNO LIKE ZMW0001-TRANSNO,

EXETIMING LIKE ZMW0001-EXETIMING,

PRETRKORRNUM LIKE ZMW0001-PRETRKORRNUM,

IMPRETURNCODE LIKE ZMW0001-IMPRETURNCODE,

STATUS LIKE ZMW0001-STATUS,

HOLD LIKE ZMW0001-HOLD,

MEMO LIKE ZMW0001-MEMO,

JOBNAME LIKE ZMW0001-JOBNAME,

JOBCOUNT LIKE ZMW0001-JOBCOUNT,

UDATE LIKE ZMW0001-UDATE,

UTIME LIKE ZMW0001-UTIME,

FLAG,

END OF T_ZTABCTRLOBJ.

  • INTERNAL TABLE FOR TABLECONTROL 'ZTABCTRLOBJ'

DATA: G_ZTABCTRLOBJ_ITAB TYPE T_ZTABCTRLOBJ OCCURS 0,

G_ZTABCTRLOBJ_WA TYPE T_ZTABCTRLOBJ,

G_ZTABCTRLOBJ_COPIED.

  • DECLARATION OF TABLECONTROL 'ZTABCTRLOBJ' ITSELF

CONTROLS: ZTABCTRLOBJ TYPE TABLEVIEW USING SCREEN 0300.

  • LINES OF TABLECONTROL 'ZTABCTRLOBJ'

DATA: G_ZTABCTRLOBJ_LINES LIKE SY-LOOPC.

DATA: TABIX LIKE ZTABCTRLOBJ-CURRENT_LINE.

DATA WA TYPE CXTAB_COLUMN.

AT PAI

WHEN 'SORT'.

DATA: FLDNAME(100),HELP(100).

READ TABLE G_ZTABCTRLOBJ_ITAB-COLS INTO WA WITH KEY SELECTED = 'X'.

SPLIT COL-SCREEN-NAME AT '-' INTO HELP FLDNAME.

SORT G_ZTABCTRLOBJ_ITAB BY (FLDNAME). (i matched ur code with my code

but i am not sure its correct. it gives error during compilation.)

IT SAYS "G_ZTABCTRLOBJ_ITAB IS A TABLE WITHOUT A HEADERLINE AND THEREFORE HAS

NO COMPONENT CALLED 'COLS'"

ambichan.

0 Kudos

COLS is an internal table within your table control, i.e:

ZTABCTRLOBJ-COLS

Your read statement is trying to find COLS within your data table G_ZTABCTRLOBJ_ITAB.

In Andreas's code you will see:

READ TABLE <b>TABLE_CONTROL</b>-COLS INTO COL WITH KEY SELECTED = 'X'.

Let us know how it goes.