09-09-2009 2:22 PM
Hello all ,
Is there a way to upload data from excel file into table control? plz advise.
Thanks in advance
09-09-2009 3:09 PM
Hello ,
All I need is a button which takes me to the browse window? like the one when u goto se16 and enter table name , run it when you press f4 button next to the field a popup window appears in the bottom of the screen u see small button import from text file.
I am looking for the same functionality on my table control(Just the import from text file button) any help will be appreciated.
Thanks.
09-09-2009 3:23 PM
Hi,
if you have already created the screen and set the GUI status ( using set pf-status in the PBO ) you would already have a button so then in order to upload data from excel when you click on the button it would go to user command so in PAI you ahve to have a module user command like below:
PAI
module user_command_0100.
module user_command input.
case sy-ucomm.
when 'IMPORT' . <<<<< user command set from the custom PF status
here use FM or OLE to read excel to internal table it_display.
endcase.
endmodule.
Then in PBO you need to set these values to the screen
PBO
loop at it_display with control tcontrol_ysubstitut
cursor tcontrol_ysubstitute-current_line.
module populate_tblcntrl.
endloop.
module populate_tblcntrl output.
you ahve to populate data to your screen fields here.
field1 = it_display-field1.
...
...
endmodule
Try like above youmight need to do some research forsome issue that you might face but it should work.
Regards,
Himanshu
09-09-2009 3:28 PM
The "import from text file" is available when you press the "multiple selection" for a SELECT-OPTION. I don't see it for F4.
Rob
09-09-2009 3:44 PM
09-09-2009 3:50 PM
It pays to be clear in your thinking before posting
I don't think this is possible. When uploading excel files, you have to determine programmatically the columns you are using. The "import from file" button wouldn't be able to do this without that logic behind it.
But you could do this programmatically.
Rob
09-09-2009 3:22 PM