Application Development and Automation 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: 
Read only

Extract data from a table

Former Member
0 Likes
885

Hi All,

How to extract data from a table to a excel sheet.

I want matnr and desc from MARA.

Please help me.

Thanks

Veni

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
829

Display the table contents. Then in the top menu goto

Settings --> User Parameters. There select the ALV Grid Display Option. Now you can download this list as an excel file.

5 REPLIES 5
Read only

Former Member
0 Likes
829

go to MAKT table in SE11

u will get the records

goto Settings>list format>choose fields

deselect all the fields , and choose MATNR and MAKTX

click on copy

then goto systems>list>save>local file>spread sheet

and save ur file

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
829

The easiest way, without any programming, is to do it via SE16. Enter MARA as the table, hit F7, at the next screen you can filter your selection, if you don't want any, just click execute. From the output screen, choose settings, format list, choose fields, click deselect all, then click MATNR checkbox, then page the whole way to the end and choose MAKTX. click copy. Click system, list, save, local file. Choose spreadsheet, click green check, choose file path and enter file name with .xls extension. That's it.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
830

Display the table contents. Then in the top menu goto

Settings --> User Parameters. There select the ALV Grid Display Option. Now you can download this list as an excel file.

Read only

0 Likes
829

Programmatically it would like something like this.




report  zrich_0001.

data: begin of imakt occurs 0,
      matnr type makt-matnr,
      maktx type makt-maktx,
      end of imakt.

start-of-selection.

  select matnr maktx into table imakt from makt.

  call method cl_gui_frontend_services=>gui_download
    exporting
*      BIN_FILESIZE              =
      filename                  = 'C:makt.xls'
       write_field_separator     = 'X'
    changing
      data_tab                  = imakt
    exceptions
      others                    = 24
          .

Regards,

Rich Heilman

Read only

0 Likes
829

Thanks a lot all of you. It solved my problem.

Veni.