Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

upload data into table control from excel

Former Member
0 Kudos

Hello all ,

Is there a way to upload data from excel file into table control? plz advise.

Thanks in advance

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

sorry about that , I meant multiple selection.

0 Kudos

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

Former Member
0 Kudos

any inputs..please?