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: 

Table control problem

former_member224444
Participant
0 Kudos
167

Hi Guru's,

I have a table control in which i have two fileds 'DEPTID' and 'DESCRIPTION', i have ticked w/ SelColumn checkbox for the table control to select the row of the table control.  I have got the fields of the table control from program.  But  i can see First letter of Deptid is missing and First letter of description is concatenated with deptid. If i remove the tick of w/SelColumn from the attributes window of table control, it is coming correctly. Please help me in solving the issue.

Regards,

Rithika.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
121

Have you added line selector column in underlying structure of table control ? The same column should be mentioned against the option w/Selcolumn. 

Regards, Vinod

11 REPLIES 11

kaushalya
Active Participant
0 Kudos
121

Have u tried adjusting the width of the columns?

0 Kudos
121

Yes, i adjusted the columns but still problem is there.

Former Member
0 Kudos
122

Have you added line selector column in underlying structure of table control ? The same column should be mentioned against the option w/Selcolumn. 

Regards, Vinod

0 Kudos
121

Dear Vinod,

This is the table control structure am using in my program with line selector column 'marked':

data: begin of it_dep OCCURS 0,
       marked,
       deptid type zdeptid,
       deptdesc type zdeptdesc,
        end of it_dep.

Following is the screen shot of my table control in screen in which i have marked w/SelColumn and assingned a field to it.

But still my problem is there in the output

Pls help me in solving this.

Regards,

Rithika.

0 Kudos
121

Have you defined w/SelColumn value as "workarea used for tablecontrol data-marked" ?

Regards, Vinod

0 Kudos
121

I can't get you what you are saying, but as per my understanding i created internal table for table control with header line not work area.

Regards

Rithika

0 Kudos
121

Can you change the Internal table as below and check?

data: begin of it_dep OCCURS 0,
       deptid type zdeptid,
       deptdesc type zdeptdesc,

       marked,
        end of it_dep.

Thanks,

Shambu

0 Kudos
121

Dear Shambu,

Thanks,  its working now. But another problem is coming, when i select a row in table control,  value 'X' is not coming in the 'Marked' column. Please help in solving this.

Regards,

Rithika.

0 Kudos
121

Have you added the OK_CODE also? Not sure if that will change anything.

0 Kudos
121

please read my code i thing you get your solution table update & delete provide you but

just add what ever code you want there any code in when condition

Former Member
0 Kudos
121

PLEASE FOLLOW THE CODE SPECIALLY MODIFY CODE

report ZTESTM.
TYPE-POOLS: vrm.
CONTROLS tbl TYPE TABLEVIEW USING SCREEN '0100'.
TYPES : BEGIN OF ty_final,
           flag(1),
           srno     TYPE i,
         END OF ty_final.

DATA : it_final  TYPE STANDARD TABLE OF ty_final,
        wa_final TYPE ty_final,
count  TYPE I.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.

endmodule.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Module  UPDATE_TABLE_MODIFY  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module update_table_modify input.

   CLEAR : count.

   DESCRIBE TABLE it_final LINES COUNT.
   IF tbl-current_line NE COUNT AND
      tbl-current_line GE COUNT.
     APPEND wa_final TO it_final.
   ELSE.
     MODIFY it_final FROM wa_final INDEX tbl-current_line.
   ENDIF.

   CLEAR wa_final.
endmodule.                 " UPDATE_TABLE_MODIFY  INPUT
report ZTESTM.
TYPE-POOLS: vrm.
CONTROLS tbl TYPE TABLEVIEW USING SCREEN '0100'.
TYPES : BEGIN OF ty_final,
           flag(1),
           srno     TYPE i,
         END OF ty_final.

DATA : it_final  TYPE STANDARD TABLE OF ty_final,
        wa_final TYPE ty_final,
count  TYPE I.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.
CASE SY-UCOMM.

  WHEN 'DELETE'.

      DELETE IT_FINAL WHERE FLAG = 'X'."SELECTED VALUES in TABLE CONTEROL DELETE IS COMMAND assign on it

  ENDCASE.



endmodule.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Module  UPDATE_TABLE_MODIFY  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module update_table_modify input.

   CLEAR : count.

   DESCRIBE TABLE it_final LINES COUNT.
   IF tbl-current_line NE COUNT AND
      tbl-current_line GE COUNT.
     APPEND wa_final TO it_final.
   ELSE.
     MODIFY it_final FROM wa_final INDEX tbl-current_line.
   ENDIF.

   CLEAR wa_final.
endmodule.                 " UPDATE_TABLE_MODIFY  INPUT

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.

   LOOP AT IT_FINAL INTO WA_FINAL WITH CONTROL tbl

                           CURSOR tbl-CURRENT_LINE.

   ENDLOOP.

PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.
     LOOP AT IT_FINAL.
     CHAIN.
     FIELD WA_FINAL-flag.
     FIELD WA_FINAL-srno.
*** Modify Table According to User Requirement

     MODULE UPDATE_TABLE_MODIFY ON CHAIN-REQUEST.

     ENDCHAIN.
    ENDLOOP.

SCREENN CODE