04-13-2010 8:10 AM
Dear All,
I am still unable find the solution for my following problem
Table control has 9 columns and 4 of them r input column. Initially all columns are display only. When the user
click Create Record, it should copy 2 columns data to the next row and remaing 4 columns should be input
enabled.
I have got a CREA button, the moement I press it, all the 4 columns a input enabled and working fine. But
the first 2 columns it should copy the data from the previous row and should get displayed which
is not happening.
Please help.
Regards,
Ankith
04-13-2010 12:49 PM
Hi, Harsha,
I couldn't make it out till now, though i saw this much earlier
The below code can be implemented both in PBO and PAI but if in PAI after the LOOP and ENDLOOP of PAI
and if it is in PBO then before the LOOP at itab with control Tc and Endloop,
case ok_code.
when 'CREA'
describe table itab lines tc-lines." This give the total number of records
read table itab into tmp_wa index tc-lines." The tmp_wa contains last row of the itab.
This means you also have copied the 2 columns from previous row.
data : line type sy-index.
line = tc-lines + 1.
insert tmp_wa into itab index line. " Means Next row.
Now here as you just want first 2 columns only clear tmp_wa-col3, col4 etc "before the Insert statment
" This is not a syntax checked one so need to fine tuen and just an Idea only
endcase.
IF you want to copy earlier 2 columns and insert next row inbetween 2 existing rows
then your Current row is as mentioned in the earlier post
" NO = TC-CURRENT_LINE + LINE - 1. " The line on which you Click in Internal Table
now you can insert at this position the same procedure applicable here also like READ TABLE ITAB INDEX NO " NO here.
Hope this serves your purpose.
04-13-2010 6:05 PM
Thanks for the replies. I have solved that portion. Whenever I add a row and enter some data in table row and I
am unable to save the row data into a itab as its either gives me a blank row or existing row being copies.
Please help me save the current row instead of previous row or blank row.
Regards,
Harsha
04-14-2010 9:49 AM
Between chain endchain insert a new module like below
chain.
field a1.
.
.
.
.
MODULE modify_data ON CHAIN-REQUEST.
endchain
code for modify_data
MODIFY itab
INDEX table_ctrl-current_line.
04-15-2010 6:10 PM
Hi,
In PAI write the below code :
Loop at it_tab.
module modify.
endloop.
Form Module_modify.
Modify it_tab from wa_tab line tc-current line.
Endform.
Regards
Arbind
05-13-2010 8:30 AM
Dear Ramchander,
Use the code like below reference :
in PAI.
loop at itab.
chain.
field tblctrl-field1.
field tblctrl-field2.
field tblctrl-field3.
field tblctrl-field4.
field tblctrl-field5.
module modify_itab on chain-request.
endchain.
endloop.
now use the logic of modify_itab as follows :
module modify_itab.
data : selline type sy-tabix. "Get the cursor line where you want to insert.
get cursor line selline.
modify itab from tblctrl index selline.
endmodule.
hope this will work for you.
05-27-2010 10:39 AM
IN the table control i am greying all the columns at PBO level. Whenever user uses OK_code to create a record
I want input to be enable on the next row and rest of existing records should be remain greyed.
Basically, I want to grey rows wise, as of now i am using tblctl-cols and column to grey the columns, is there any
way to grey the rows also ?
Thanks,
Harsha
05-27-2010 10:53 AM
Dear Harsha,
Use the logic like below :
IN PBO.
loop at itab with control tc.
module modify_screen.
endlooop.
module modify_screen.
if itab-column1 is not initial.
loop at screen.
if screen-name = 'ITAB-COLUMN1'.
screen-active = 0.
endif.
endloop.
endif.
endmodule.
Do this for your required columns.
Hope it will solve ur problem.
05-27-2010 11:10 AM
Thanks for the reply.
I am unable to loop at itab with control TBL200 ( within single quote also tried) is not working.
Giving me syntax error and using 4.6c.
Regards,
Harsha
05-28-2010 8:09 AM
Dear Harsha,
Try the coding like below :
If you want to disable a perticular line in a table control then first gets the cursor position of it like,
GET CURSOR LINE VLINE.
then in PROCESS BEFORE OUTPUT use the code like,
LOOP AT ITAB
INTO ITAB "Here I took ITAB with header line
WITH CONTROL TBLCTRL
CURSOR TBLCTRL-CURRENT_LINE.
MODULE ROW_SCREEN_SETTINGS.
ENDLOOP.
now in the module ROW_SCREEN_SETTING use the following code like,
module ROW_SCREEN_SETTINGS output.
data : wa2 type SCXTAB_COLUMN.
IF TBLCTRL-CURRENT_LINE EQ VLINE.
LOOP AT SCREEN.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDLOOP.
endif.
endmodule.
here also you choose your desired screen column that you want to disable, only you have to add a if statement in loop at screen , like if screen-name = 'COL1'
screen-input = 0.
modify screen.
endif.
This will solve your problem.
Edited by: CONTACTSANKU on May 28, 2010 12:42 PM
06-14-2010 10:16 AM
It didnt solve my problem. The moment I use ok_code to increment the row, the rest of rows screen-input = 1 along
with new row. I want only the last row to be input enabled.
Hope you got my point.
Regards,
Harsha
06-15-2010 5:43 AM
I am calling a screen using CALL SCREEN 200 STARTING AT 2 5 ENDING AT 120 20.
This is could be reason for not able grey the data cells in a table control, please help.
Regards,
Harsha
07-23-2010 10:37 AM