|
Many SAP ERP transactions display data in tabular form (table control). In some cases a user might wish to get these data into an Excel spreadsheet for further display, printing and processing.
We present a simple technique using an InputScript to build an Excel spreadsheet from the table. The user selects some (or all) rows in the table and then presses a button that invokes our InputScript. The script scrolls through the whole table, collects all selected lines and generates an xxl-file. It then uses the “View” command to start Excel for this file. Required components: InputAssistant and Viewer. |
Transaction MIR6. The user selects the rows that she would like to have in the spreadsheet She then clicks on the “Download” button. The system collects all selected rows and starts Excel:
For the implementation you need the following 2 scripts: SAPMM08N.E0201.txt: InvoicesToExcel.txt: // Parameter // Variables Screen sapmm08n.0201 // Column headers AppendFile “&U[filename]” C1 C2 C3 C4
// Start with 1st line label new_screen label new_row
// end of table? // end of screen? Set V[selected] “&cell[Table,0,&V[relrow]]”
// selected? Set V[C1] “&cell[Table,Doc. number,&V[relrow]]” AppendFile “&U[filename]” C1 C2 C3 C4 Set V[absrow] &V[absrow] + 1 goto new_row
|