04-23-2007 10:59 AM
I am getting some output in my table control as per my select query.
now i am selecting a few lines from my table control and those lines that i have selected needs to be saved in my ztable.
i dont know how to read those selected lines,
Please help me.
Regards,
Roshan Lilaram.
04-23-2007 11:14 AM
Hi,
First define the SELECTION KEy in the Table control Attributes like v_CHK
along with vertical and horizontal scroll bars.
In the PAI of that LOOP..Endloop. write some module and in that module write the code like:
loop at itab where v_chk = 'X'.
move the fields from itab to your Ztable fields.
modify your Ztable .
endloop.
reward if useful
regards,
Anji
04-23-2007 11:11 AM
Hi,
Try like this ..
when the user press SAVE Button.
CASE OK_9000.
When 'SAVE'.
Loop at itab where sel = 'X'.
ztable = itab.
INSERT ztable .
Endloop.
Endcase.
04-23-2007 1:28 PM
i have defined a field called chk in the attributes as well as in the itab,
when i select a few lines and then i check in the debugger, there is no value in the chk column.
I dont know what i am missing.
in attributes the w/selcolumn = itab-chk is been defined by me, i hope this is correct and
the code is
When 'SAVE'.
Loop at itab where CHK = 'X'.
some code ***
Endloop.
here nothing is in chk.
the whole column is blank after pressing save and after selecting a few lines and i am also not getting any vertical scrol bar.
Please help.
Regards,
Roshan Lilaram.
04-23-2007 11:14 AM
Hi,
First define the SELECTION KEy in the Table control Attributes like v_CHK
along with vertical and horizontal scroll bars.
In the PAI of that LOOP..Endloop. write some module and in that module write the code like:
loop at itab where v_chk = 'X'.
move the fields from itab to your Ztable fields.
modify your Ztable .
endloop.
reward if useful
regards,
Anji
04-23-2007 11:19 AM
Hello Roshan,
First include a checkbox for ur tale control and add the same field in ur internal table also.
In the screen add a button to save the selected entry to the ZTABLE.
Then in the PAI write this code:
CASE SY-UCOMM.
WHEN 'SAVE'.
LOOP AT ITAB INTO WA_ZTABLE WHERE SEL = 'X'.
MODIFY ZTABLE FROM WA_ZTABLE.
ENDLOOP.
ENDCASE.
Hope this will solve ur problem.
IF USEFUL REWARD.
REgards,
VAsanth
04-23-2007 11:20 AM
Hi,
I guess this piece of code will help you. In PAI of the screen. Inside the LOOP
ENDLOOP, write a statement ' FIELD sel MODULE XXXX ON INPUT'.
This module gets triggered only for those values which you have selected on table control. This 'sel' field value will turn to 'X' when you select a line on table control.
You part of code can be included in the module above.
If you think this helped you in any way request you to award me points.
Regards,
Sravanthi.
04-23-2007 11:23 AM
Hi Roshan,
As it is a MODULE pool program it is difficult to send the code.But,follow these steps to.....
<b>See this standard program and follow the below steps to get your problem solved :
</b>
<b>DEMO_DYNPRO_TABCONT_LOOP_AT</b>
1. After execution, you see some data in TABLE CONTROL.
2. Press Display/Change button on the application tool bar to get into change mode.
3.Select some records.
4.Now press on delete button which is again on the application tool bar.
<b>
5. Now you have to observe one thing i.e., How come only these lines are deleted ???</b>
6. Check functionality in debugging mode if required.
7.Instead of DELETE statement in the program whereever it is there, put INSERT command .
8.This solves your problem.
<b>
Reward all helpful answers</b>
Regards,
V.Raghavender.
04-23-2007 2:04 PM
i have continued this thread into another one with the same title, please help me .