SAP ALV Excel Inplace with Macro recordingSAP ALV Excel Inplace with Macro recordingAuthor:    Aromal RaveendranEmail:arom...
SAP ALV Excel Inplace with Macro recordingPre-requisites:SAP NetWeaver ABAP 7.0 and above with SAP GUI 7.20and MSExcel 200...
SAP ALV Excel Inplace with Macro recordingTable of ContentsIntroduction......................................................
SAP ALV Excel Inplace with Macro recordingIntroductionIt is quite often that we have downloaded the standard/custom SAP AL...
SAP ALV Excel Inplace with Macro recordingStep3: Go to Macro Settings and select details as per following screen shot.Addi...
SAP ALV Excel Inplace with Macro recordingStep 2: After seeing the data in Excel go to RawData tabStep 3: Now go toview ta...
SAP ALV Excel Inplace with Macro recordingStep 5: Write the formula in the cell as shown. Also leave one cell for heading....
SAP ALV Excel Inplace with Macro recordingStep 8: Apply borders for the column if needed and do necessary formattingStep 9...
SAP ALV Excel Inplace with Macro recordingStep 11: Save the Excel in the front end computer
SAP ALV Excel Inplace with Macro recordingStep 12: Now select change layout to upload the excel macro (alv_macro_eample.xl...
SAP ALV Excel Inplace with Macro recordingStep 14: Select the excel file we saved in the desktop and upload
SAP ALV Excel Inplace with Macro recordingStep 15: Save this layout by selecting the template we have just uploaded.
SAP ALV Excel Inplace with Macro recordingStep 16. Now go out of the report and run the report and select the layout we ha...
SAP ALV Excel Inplace with Macro recordingStep 17: You can run the macro by pressing the shortcut Ctrl+Shift+L(we assigned...
SAP ALV Excel Inplace with Macro recordingStep 18: We can see the output now as belowWe can automatically run the macro wh...
SAP ALV Excel Inplace with Macro recordingSummaryAll the above tasks we can easily do within couple of minutes. If we cons...
SAP ALV Excel Inplace with Macro recordingRelated Contenthttp://office.microsoft.com/en-us/excel-help/change-macro-securit...
Upcoming SlideShare
Loading in …5
×

Sap alv excel inplace with macro recording sapignite

6,210 views

Published on

This article explains how we can make use of MS Excel Inplace functionality in the SAP ALV toolbar with macro recording to avoid repetitive tasks such as adding custom calculation field in the standard /Custom/ Query reports (e.g. Order Qty- Delivery Qty, Pivot Table chart etc)

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,210
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
100
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Sap alv excel inplace with macro recording sapignite

  1. 1. SAP ALV Excel Inplace with Macro recordingSAP ALV Excel Inplace with Macro recordingAuthor: Aromal RaveendranEmail:aromalr@gmail.com
  2. 2. SAP ALV Excel Inplace with Macro recordingPre-requisites:SAP NetWeaver ABAP 7.0 and above with SAP GUI 7.20and MSExcel 2007/2010 installed in frontend computerPurposeThis article explains how we can make use of MS Excel Inplace functionality in the SAP ALV toolbarwith macro recording to avoid repetitive tasks such as adding custom calculation field in the standard/Custom/ Query reports (e.g. Order Qty- Delivery Qty, Pivot Table chart etc)Intended AudienceSAP Consultants/Users
  3. 3. SAP ALV Excel Inplace with Macro recordingTable of ContentsIntroduction......................................................................................................................................................... 4General Settings to enable macro in Excel 2007 ............................................................................................... 4Addition of a custom field in ALV report using Excel Inplace and Macro .......................................................... 5Summary .......................................................................................................................................................... 16Related Content ............................................................................................................................................... 17Copyright ............................................................................................................ Error! Bookmark not defined.
  4. 4. SAP ALV Excel Inplace with Macro recordingIntroductionIt is quite often that we have downloaded the standard/custom SAP ALV report as Excel document tothe front-end computer and added some calculation fields, converting to pivot table etc. Theserepetitive tasks in Excel can be recorded as an Excel macro and we can upload this excel layoutcontaining macro to SAP as a new ALV layout, so that, when you run the report/selecting the layout,immediately the output will be displayed as Excel with the repetitive task automatically executed. Withthis we can avoid building of Custom fields (derived fields) in standard / Custom / Query report andsave lot of time.General Settings to enable macro in Excel 2007When we run the Excel in place functionality in the SAP ALV, by default, the data will not getautomatically transferred to Excel. For that we have to do some macro security settings. Followingscreen shots explains how to enable a macro in excel 2007. After activating this we have to closeExcel and run Excel in place functionality once again. Then the data can be seen in Excel. Excel Inplace will also work in MSExcel 2010 and MSExcel 2003 with Latest GUI (7.20 advisable) + patchesinstalled at frond end computerStep 1: Select Excel optionsStep 2: Go to Trust center settings
  5. 5. SAP ALV Excel Inplace with Macro recordingStep3: Go to Macro Settings and select details as per following screen shot.Addition of a custom field in ALV report using Excel Inplace and MacroE.g. Adding Rejection%column in standard report (E.g. t-code COID)In the standard report transaction COID we want to add a Rejection % column. Either we can do it byABAP code or download the report to excel and do a formula calculation. But there is an easiermethod than writing code in Enhancement spot/Exits/download to achieve this. Following screenshots explain step by step methods to run a macro along Excel in place functionality.Step 1: Select Excel in place functionality in the ALV.Normally in standard /custom report we can also see Excel Inplace functionality like this.
  6. 6. SAP ALV Excel Inplace with Macro recordingStep 2: After seeing the data in Excel go to RawData tabStep 3: Now go toview tab and select Record Macro.Step 4: Give the name for the macro and assign a shortcut key (Ctrl + Shift + L)
  7. 7. SAP ALV Excel Inplace with Macro recordingStep 5: Write the formula in the cell as shown. Also leave one cell for heading. (It is better to put theHeading after the formula calculation otherwise we have to re-adjust the macro code). Eg (ROUND(h2/e2*100,2) which will give you rejection percentage rounded upto 2 decimal placeStep 6: Double click/drag outside cell selection, so that this makes the formula applicable for theentire column.Step 7: After formula, enter the heading for the column (eg. Rejection %)
  8. 8. SAP ALV Excel Inplace with Macro recordingStep 8: Apply borders for the column if needed and do necessary formattingStep 9: Stop recording the macro as shown below. Now the tasks that we have done from step 5 tostep 8 has been recorded as macro named RejectionPer(see Step 4).Step 10: Now you can see the recorded macro in View Macros.
  9. 9. SAP ALV Excel Inplace with Macro recordingStep 11: Save the Excel in the front end computer
  10. 10. SAP ALV Excel Inplace with Macro recordingStep 12: Now select change layout to upload the excel macro (alv_macro_eample.xls) in front endmachine to SAP .Step 13: Now go to the view tab and select Microsoft Excel and use Upload to BDS option
  11. 11. SAP ALV Excel Inplace with Macro recordingStep 14: Select the excel file we saved in the desktop and upload
  12. 12. SAP ALV Excel Inplace with Macro recordingStep 15: Save this layout by selecting the template we have just uploaded.
  13. 13. SAP ALV Excel Inplace with Macro recordingStep 16. Now go out of the report and run the report and select the layout we have saved.
  14. 14. SAP ALV Excel Inplace with Macro recordingStep 17: You can run the macro by pressing the shortcut Ctrl+Shift+L(we assigned it in Step 4) or goto view tab and run the macro manually.
  15. 15. SAP ALV Excel Inplace with Macro recordingStep 18: We can see the output now as belowWe can automatically run the macro when we select the Raw Data tab in the Excel .For this, Edit themacro and put below piece of code in ThisWorkbook ->Workbook->SheetActivate method (asshown below). If Sh.Name = "RawData" Then Module1.RejectionPer End If
  16. 16. SAP ALV Excel Inplace with Macro recordingSummaryAll the above tasks we can easily do within couple of minutes. If we consider enhancing the standardreport and transporting it through the landscapes to PRD or downloading it to excel and do theactivities,this functionality saves a lot of time for the consultants/Users.Try to record some Pivot table with charts and start exploring.
  17. 17. SAP ALV Excel Inplace with Macro recordingRelated Contenthttp://office.microsoft.com/en-us/excel-help/change-macro-security-settings-in-excel-HP010096919.aspxhttp://help.sap.com/saphelp_470/helpdata/en/e3/41a138c4397a42e10000009b38f842/content.htm

×