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

Regarding Table control

Hi,

I am developing a program using dialog programming. I have a table control, and I want to use some rows as uneditable. The purpose of this, user can see some records that have entered before, and user should not change before data, but should enter new data. So, I need that I want to make uneditable some rows. Is it possible?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jun 07, 2007 at 11:11 AM

    Hi,

    Sure you can do some rows as uneditable.You should have some condition to satisfy.Based on the condition you can set that in PBO module inside loop endloop in flow logic.

    PROCESS BEFORE OUTPUT.

    LOOP AT it_t001l INTO x_t001l

    WITH CONTROL tc

    CURSOR tc-current_line.

    MODULE tc_get_lines.

    *&SPWIZARD: MODULE TC_CHANGE_FIELD_ATTR

    ENDLOOP.

    MODULE tc_get_lines OUTPUT.

    g_tc_lines = sy-loopc.

    IF tc-current_line = 3.

    LOOP AT SCREEN.

    IF screen-group1 = 'TCFL'.

    screen-input = '0'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    ENDMODULE. "TC_GET_LINES OUTPUT

    Here screen group 'TCFL' has to be set for all the table control fields.Her i have set the 3rd row as display only.

    Message was edited by:

    Vigneswaran S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2007 at 11:07 AM

    Hi Azad,

    Double click the Screen fields. One POP up will come.

    Select Screen Atttributes -> Programs -> Input -> Not Possible.

    Thanks.

    Reward If Helpful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks viji..

      but it cant be possible..because itshould be disabled on the bases of rows in internal table..

      the already existing in the table shud come under disable and blank rows shud be insertable.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2007 at 11:41 AM

    Hi,

    Yes, u can make some rows uneditable. Assume you have 5 rows and you can make the 6th row editable for the user and the 5 rows to be noneditable.Refer to the code below. the logic followed is: when u display some records u can append an empty record to your internal table from which u will be populating the table control and in the PBO u can loop at the tbale control and modify the screen. Refer to the code below.

    DATA:col TYPE cxtab_column.

    MODULE user_command_9000 INPUT.

    CASE ok-code.

    WHEN 'DISP'.

    SELECT mandt

    empid

    depno

    empname

    eaddress

    INTO TABLE gt_mod

    FROM ztrch_module.

    CLEAR GT_MOD.

    APPEND GT_MOD.

    ENDMODULE. " USER_COMMAND_9000 INPUT

    MODULE status_9000 OUTPUT.

    SET PF-STATUS 'TEST'.

    SET TITLEBAR 'TITLE'.

    DESCRIBE TABLE gt_mod LINES SY-TFILL.

    TABL_CTRL-LINES = SY-TFILL.

    IF OK-CODE = 'DISPLAY'.

    LOOP AT TABL_CTRL-COLS INTO COL.

    LOOP AT GT_MOD.

    COL-SCREEN-INPUT = '0'.

    IF GT_MOD-EMPID = ' '.

    COL-SCREEN-INPUT = '1'.

    ENDIF.

    MODIFY TABL_CTRL-COLS FROM COL.

    ENDLOOP.

    ENDLOOP.

    ENDIF.

    ENDMODULE. " STATUS_9000 OUTPUT

    Reward points if it was useful.

    Regards,

    Hema.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 07, 2007 at 11:14 AM

    hi..

    It is possible to make some rows to editable and some rows to display only.Refer to the demo program <b>demo_dynpro_tabcont_loop_at</b> for changing properties of screen fields. You can change the fields using a condition like "if sy-tabix gt 5." to modify fields from 6th row.

    regards,

    veeresh

    Add a comment
    10|10000 characters needed characters exceeded

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.