Skip to Content
author's profile photo Former Member
Former Member

sort in tabcontrol

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 07:56 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2005 at 08:48 AM

    Hi Ambi,

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

    regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 12:10 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2005 at 12:26 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 03:08 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.