Today one of the member of our telegram group aked how to open a document in it’s related transaction by doubleclicking the documentnumber in a tablecontrol. So I created a small demo report to open a material by doubleclicking on materialnumber.
Create a report in SE38 or SE80 and copy the following code into it.
Create a screen 100 and copy the following code into flow logic of the screen.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PROCESS BEFORE OUTPUT.MODULEtc_init.LOOP AT gt_maraINTOgs_maraWITHCONTROLtc_maraCURSORtc_mara-current_line.MODULEtest_move.ENDLOOP.MODULEstatus_0100.PROCESS AFTER INPUT.LOOP AT gt_mara.ENDLOOP.MODULEuser_command_0100.
Create PF-Status 0100 as shown below.
Important for the doubleclick is funktioncode 4.
Create title 0100 as shown below.
Now place the tablecontrol on screen 100 as described below.
1. Use normal tablecontrol and not tablecontrol wizard. 2. Fill the screen with the tablecontrol object1. Open the Dictionary/Program Fields Window 2. Enter the tablename “MARA” 3. click Get From Dictionary 4. Choose the fields 5. Confirm with OKPlace the selected fields in the grey area at top of the tablecontrol.1. Doubleclick on every field directly under the header 2. Uncheck Input Field for all fields1. Check Responds to double-click for the first column in tablecontrol.
Now activate all created objects and execute the report.
Doubleclick one Material in Column Material.See that the material will be open
Get the source code from GitHub
Download
You can download the soure code from GitHub. Available Versions are: