2008 Nov 05 10:10 AM
Hi all,
I have a requirement like two table controls in one screen.
I had Button Let side button.
after selecting the records from tab_cont1, Press that Button (left side)
It has to move the records from Tab_cont1 to Tab_cont2.
As though i wrote the code it is not picking the records from one control to another.
Will anybody will provide me coding for to accomplish the task.
Regards,
Madhavi
Hi all,
I have a requirement like two table controls in one screen.
I had Button Let side button.
after selecting the records from tab_cont1, Press that Button (left side)
It has to move the records from Tab_cont1 to Tab_cont2.
As though i wrote the code it is not picking the records from one control to another.
Will anybody will provide me coding for to accomplish the task.
Regards,
Madhavi
2008 Nov 05 11:09 AM
there is a generic problem when you have more than one table control on one screen
what you need to do is to change the sequence of the loops, the table control that appears first on the screenshould have the loop first
and how do you determine first on the screen ? Top Left to Bottom right
2008 Nov 05 11:45 AM
2008 Nov 05 12:36 PM
Hi,
I have worked on two table controls. After populating the values from itab1 to the first table control, check the below sample code to move the selected values to the second table control.
WHEN 'TC'. " TC - button
LOOP AT itab1 INTO wa_itab1.
IF wa_itab1-mark EQ 'X'.
MOVE wa_itab1-fieldname TO wa_itab2-fieldname.
APPEND wa_itab2 TO itab2.
CLEAR wa_itab2.
ENDIF.
ENDLOOP.
Clicking on the table control screen painter attributes will be opened. We can find a field named w/SelColumn.Select that check box and give a name like wa_itab1-mark. This field only will capture the selected rows from the first table control. Then these selected records will be moved to the second table control clicking on the button.
2008 Nov 05 1:33 PM
Hi Madhavi,
You can achieve this requirement by processing the Transaction Code in the PAI Event of the Screen.
In the PAI where you are doing the processing for the function code, there you need to loop the first internal table and then insert the values in the second internal table. Then in the PBO when the automatic mapping will happen then the values will be present in the other table.
Have a look at the DEMO Code in SE38 by *DEMODYNPRO**.
Hope this will help.
Thanks,
Samantak.
2008 Nov 05 6:00 PM
2008 Nov 05 10:24 PM
Hi Varisetti,
You can also define each table control in subscreens, which you include in your main screen.
regards,
Andri
2008 Nov 06 4:42 AM
Hi,
You have to write a module in PAI of your screen.
after the loops of table controls in PAI.
I guess you must have row selector field in structure of yours internal tables which you show at output in table control.
lets the fields name be SEL .lets say the button on your screen have the Function code as BUTT.
Module Copy_row.
If sy-ucomm = 'BUTT'.
Loop at Itab1 where SEL = 'X'.
itab2 = itab1.
append itab2.
endloop.
endif.
endmodule.
But as far as possible build subscreens and put your table controls on diffrent subsreen. It will let you to handle the things better.
I hope this will help you.
2008 Nov 06 4:45 AM
hi,
1.table control shows entries from internal table. so, if you move entries from itab1 to itab2, then you will reach your requirement.
2. if you are getting problem in 2 table control in single screen, then use this logic.
1.create 3 screen
2. first screen is main screen. it has two sub-screen area.
3. second is sub-screen. it has left side table control. And place it in main screen at left side.
4. third is sub-screen. it has right side table control. And place it in main screen at right side.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |