11-27-2012 11:38 AM
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.
11-28-2012 5:28 AM
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-28-2012 5:07 AM
11-28-2012 5:34 AM
11-28-2012 5:28 AM
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-28-2012 5:45 AM
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.
11-28-2012 7:27 AM
Have you defined w/SelColumn value as "workarea used for tablecontrol data-marked" ?
Regards, Vinod
11-28-2012 8:17 AM
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
11-28-2012 8:38 AM
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
11-28-2012 11:45 AM
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.
11-28-2012 12:40 PM
Have you added the OK_CODE also? Not sure if that will change anything.
11-28-2012 4:07 PM
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
11-28-2012 9:42 AM
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 INPUTreport 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