2006 Nov 17 8:23 PM
Hi,
My another requirement is need to add 3 bottons(Material, Asset, Equipment) in the menu and user will select a row in the alv and click a button to enter text. A pop up screen should appear to user input. User should allow to enter test for each row. If text already exists to a row should show up the text in the popup screen text area.
I am not sure how to do this but I saw this on some SAP Plant maintanance screens.
Thanks in Advance,
Venkat.
2006 Nov 18 3:11 AM
Venkat,
When you say text for each row, I am assuming that you want to maintain some long text for each row and this long text is different for Material, Asset and Equipment.
Now, here is my design for this.
1. You will have a table with some data that you are showing in the ALV, right?
2. This ALV will also have a Key field.
3. Now, create another internal table with the following structure to store the texts. This will be a nested internal table.
Key field of the ALV
Text table for Material
Text table for Asset
Text table for Equipment
This text table, will be usually of type T_LINE.
4. Now, that this is done, when the buttons are clicked, you would know which row has been selected ( I am assuming that you are handling the User Command event). So, that means you know the key field of the row selected.
5. Use the key field value to read the TEXT table to see if the column (based on which button has been clicked) has the data or not.
6. Design a popup screen, with a TEXT EDIT control.
7. Use the text retrieved and populate the text edit control, while calling the screen.
8. If the user changes the data, you can capture that and update the text table with the new text.
9. Finally when the user presses save, all the changed data should be saved to the database.
If you are not dealing with long text, it will be just a additional column in the ALV, and I dont think a popup will be required to enter the text.
Hope this will resolve the issue.
Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 20 4:02 PM
Hi,
use the class CL_GUI_TEXTEDIT and using container in module pool you can have a running text into it. there are GET_SELECTED_TEXT_AS_R3TABLE and SET_SELECTED_TEXT_AS_R3TABLE methods, by which you can send the contents of internal table to Text area and read the contents from text area and place it in internal table.
Regards,
Manohar.