Transcription

Step By Step Process to Run BEXReport in BackgroundApplies to:SAP BW 3.x.SummaryThis paper describes step by step process of implementing of a generic tooland how to run BEX query in background using that tool. It is accomplishedthrough a Custom ABAP Program, which can be used to run any BEX queryrestricted by selection variant in background. The output is stored in adelimited text File in a specified application server directory.Author: Dhiraj Kumar ThakurCompany: Accenture Service Pvt. LtdCreated on: 6th October 2011Author BioDhiraj Kumar Thakur is currently with Accenture.He is a BusinessIntelligence Solution Consultant (NetWeaver 2004) and is mainlyinvolved in Development, Support and Enhancement work.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com1

Step By Step Process to Run BEX Report in BackgroundTable of ContentsRequirement.3How BEX Query Run in Foreground .3How this tool works.5Step by step process.5Step 1: Run BEX Query.5Step 2: Give the value in Selection screen.5Step 3: Save the Variant.6Step 4: Run the wrapper program.6Step 5: Give Query Name.6Step 6: Give Variant.7Step 7: Give File Path.7Step 8: Execute the Program in Background.8Step 9: Check the Log.8Step 10: Download the File.10Limitation.10Appendix.10Related Content.23Disclaimer and Liability Notice.24SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com2

Step By Step Process to Run BEX Report in BackgroundRequirementBEX Query Analyzer is the tool used to analyze ad hoc query results in MSExcel. BEX Query Analyzer can be used to run ad hoc queries and open BEXQuery Designer to create and modify ad hoc queries. BEX Query Analyzeropens in MS Excel and provides its own toolbar and Business Explorer menuto perform query analysis.Proposed Tool can be used in below situation: Those environments, where Excel 2003 or below is installed for BEXreporting, which is having a limitation to display only 65 K rows. Run a BEX-Query in Batch-Mode (periodically and automatically) anddownload output in a directory, which can be read form another system. If the query is performed on detail level data and no further drill down isrequired on the output. Only Static information is required. As an alternate of Open Hub. If the query gives shortage of memory dump or exceeding the time limitdump due to high volume of data.How BEX Query Run in ForegroundRun Tcode RRMX and click on open button. Click on query menu and selectthe query you want to runSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com3

Step By Step Process to Run BEX Report in BackgroundGive the value for the selection field in the selection screenClick on the execute button. Output is displayed in the ExcelHow this tool worksSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com4

Step By Step Process to Run BEX Report in BackgroundThe program ZBWR BEX QUERY can be used to run any BEX query as abackground job. User will be able to run the query on predefined selectionvalues which are saved as a query variant.Step by step processStep 1: Run BEX QueryRun Tcode RRMX and click on open button. It will be found on the BusinessExplorer toolbar. Click on query and select the query you want to runStep 2: Give the value in Selection screenGive the value in the selection fields in input screenStep 3: Save the VariantClick on the save button to save the selection valueSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com5

Step By Step Process to Run BEX Report in BackgroundStep 4: Run the program ZBWR BEX QUERY (Refer Appendixfor Source Code)Step 5: Give Query NameSearch Query Name you want to ExecuteSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com6

Step By Step Process to Run BEX Report in BackgroundStep 6: Give Variant NameGive the variant you saved in the previous stepStep 7: Give File PathGive the valid application server directory where you want to save the outputfileSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com7

Step By Step Process to Run BEX Report in BackgroundStep 8: Execute the Program in BackgroundPress F9 or click on program- Execute in BackgroundClick on Immediate or specify the Date/Time to execute the reportStep 9 : Check the LogRun Tcode SM37 and check the job log and see if it is completed.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com8

Step By Step Process to Run BEX Report in BackgroundStep 10: Download the FileRun Tcode AL11 and check the file in the specified directory. You candownload the file directly from here or OS levelLimitation:The only supported file type is delimited Text file. However, program can betwisted to save the output in other format.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com9

Step By Step Process to Run BEX Report in BackgroundAPPENDIX:REPORT ZBWR BEX QUERYline-size 1023 message-id ZBW ***************************Types **********************************TYPE-POOLS: rsr, rzi0, rrx1, rrms, rsbbs, rrkh, rro01, rsdd,rrx2, rsdm4, vrm.TYPES: BEGIN OF g s col width,column TYPE rrx1 s grid-x,width TYPE i,END OF g s col width,g t col widths TYPE g s col width OCCURS 0.tables : *****************************Constants **********************************Constants: c x type c value 'X',c m type c value 'M',c w type c value 'W',c t type c value 'T',c n type c value 'R',c r type c value 'R',c s type c value ***************************Variable **********************************data: v string(65000) type c.DATA: g th dat nTYPE rrx1 th dat n,g th txt nTYPE rrx1 th txt n,g gentimeTYPE rsr s rkb1d-gentime,g s grid layout TYPE rrx1 s grid layout,g t gridTYPE rrx1 t grid,g t rangesTYPE rrx1 t ranges,g t hry types TYPE rrx1 t hry types,g t ranges out TYPE rrx1 t ranges,g s rangesTYPE rrx1 s ranges,g dflt req lines TYPE i,g t mesgTYPE rrx1 t mesg,g t menuTYPE rrx1 t menu,g fieldname(20) TYPE c,g t repdirLIKE rsrrepdir OCCURS 10,g s repkeyLIKE rszcompkey,g handleLIKE rrx misc-handle,g handle2LIKE rrx misc-handle,g handle int LIKE rrx grid-x,g t varLIKE rrx var OCCURS 0,g t var2LIKE rrx var OCCURS 0,g t msgLIKE rrx mesg OCCURS 0,g t msg2LIKE rrx mesg OCCURS 0,g xLIKE rrx grid-x,g yLIKE rrx grid-y,g subrcLIKE sy-subrc,g ucommLIKE sy-ucomm,g cmdidTYPE rrx menu-cmdidvalue 'STRT', "ID of Excel context menug t dimTYPE rrx1 t dim,SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com10

Step By Step Process to Run BEX Report in Backgroundg t atrTYPE rrx1 t atr,g t memTYPE rrx1 t mem,g t conTYPE rrx1 t con,g t facTYPE rrx1 t fac,g t celTYPE rrx1 t cel,g s prptysTYPE rrx1 s prptys,g t prptysTYPE rrx1 t prptys,g s debugflags TYPE rsr s debugflags,g t col widths TYPE g t col widths,g bbs receiver TYPE rsbbsreceiver,g t genuniid TYPE w3html OCCURS 0,g iobjnmTYPE rs char30,g rowTYPE rsint4,g row hideTYPE rsint4,g start rowTYPE rsint4,g colTYPE rsint4,g cancelTYPE rs bool,g ok(20)TYPE c,g chavlTYPE rsd chavl,g r eTYPE REF TO cx root,g cmd countTYPE i.DATA: g txt1(50) TYPE c,g txt2(50) TYPE c,g txt3(50) TYPE c,g txt4(50) TYPE c,g txt5(50) TYPE c,g txt6(50) TYPE c,g txt7(50) TYPE c,g txt8(50) TYPE c,g txt9(50) TYPE c,g txt10(50) TYPE c,g txt11(50) TYPE c,g txt12(50) TYPE c,g txt13(50) TYPE c,g txt14(50) TYPE c,g txt15(50) TYPE c,g txt16(50) TYPE c,g txt17(50) TYPE c,g txt18(50) TYPE c,g txt19(50) TYPE c,g txt20(50) TYPE c,g txt21(50) TYPE c,g txt22(50) TYPE c,g txt23(50) TYPE c,g txt24(50) TYPE c,g txt25(50) TYPE c,g txt26(50) TYPE c,g txt27(50) TYPE c,g txt28(50) TYPE c,g txt29(50) TYPE c,g txt30(50) TYPE c,g txt31(50) TYPE c,g txt32(50) TYPE c,g txt33(50) TYPE c,g txt34(50) TYPE c,g txt35(50) TYPE c,g txt36(50) TYPE c,SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com11

Step By Step Process to Run BEX Report in Backgroundg txt37(50)g txt38(50)g txt39(50)g txt40(50)g txt41(50)g txt42(50)g txt43(50)g txt44(50)g txt45(50)g txt46(50)g txt47(50)g txt48(50)g txt49(50)g txt50(50)g txt51(50)g txt52(50)g txt53(50)g txt54(50)g txt55(50)g txt56(50)g txt57(50)g txt58(50)g txt59(50)g txt60(50)g txt61(50)g txt62(50)g txt63(50)g txt64(50)TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c,TYPE c.data : G compid like RSZCOMPKEY-compid.DATA: v genuniid TYPE rscrmrepuid,v reportuid TYPE rscrmrepuid,v num type i,v EVENT like RSMPE-FUNC,v CUBENAME like BAPI6110CUB-CUBE NAM ,v CATALOG like BAPI6110CAT-CAT NAM ,v REPNAME like RSCRMREPDEF-REPNAME ,v REPTXT like RSCRMREPDEF-REPTXT ,v varient type RSVAR-VARIANT,v report TYPE RSVAR-REPORT,v RSR S RKB1D like RSR S *****************************Declaration of work ***************************DATA: BEGIN OF w session,reportuid TYPE rscrmrepuid,sessionid TYPE rscrmsession,END OF w session.data : wa infocube like tion of Selection ****************************SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-000.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com12

Step By Step Process to Run BEX Report in BackgroundSELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.PARAMETERS: p genuid LIKE rsrrepdir-genuniid.select-options: s varnt for VARID-VARIANT no intervals.PARAMETERS: P OFILE(80) DEFAULT '/tmp/zbex.txt'LOWER CASE."Down load fileSELECTION-SCREEN END OF BLOCK B1.SELECTION-SCREEN END OF BLOCK ***************************Initializaion *************At selection screen **************************AT SELECTION-SCREEN ON VALUE-REQUEST FOR p genuid.*get Bex query list*by using this FM, we get the infocube and Internal display of the*report identifier, UUID in compressed form and the bex report name*the table RSRREPDIR contains all bex report detailsCALL FUNCTION 'RSZ COMPONENT TREE GET'EXPORTINGi title sy-titleIMPORTINGE INFOCUBE wa infocubeE COMPID g compide genuniid p genuide infocube txt v REPTXTEXCEPTIONSOTHERS 1.*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s varnt-low.*** variant of the selected query can be picked up from this FM.* CALL FUNCTION 'RRS VARIANT F4'* EXPORTING*I GENUNIID p genuid*I INFOCUBE wa infocube*I COMPID g compid* IMPORTING*E VARIANT p varnt* EXCEPTIONS*REPORT NOT FOUND 1*NO VARIANTS POSSIBLE 2*VARIANT NOT FOUND 3*CANCELED 4*OTHERS 5.AT SELECTION-SCREEN.*validating the file name and file pathOPEN DATASET P OFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.IF SY-SUBRC 0.MESSAGE E000 WITH 'File Could not be Open'(002).else.close dataset p ofile.endif.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com13

Step By Step Process to Run BEX Report in Background* validate if the user enters the range instead single valuesif not s varnt[] is initial.read table s varnt with key option 'BT'. "option BT for range valsif sy-subrc 0.message e000 with 'Enter single values for variant instead ART-OF-SELECTION ***************************START-OF-SELECTION.* Call to function module to open the sessionperform sub ******************************* END-OF-SELECTION ---------------**&Form sub ---------*FORM sub getdata .* open the output file for data download, if not raise errorOPEN DATASET P OFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.IF SY-SUBRC 0.MESSAGE E000(zz) WITH 'File Could not be Open'.endif.* generate the report for multiple variant values.loop at s varnt.refresh: g t ranges,g t dim, g t mem, g t cel,g t prptys,g t atr,g t grid,g t con,g t fac,g t var.clear v RSR S RKB1D.*getting the handleCALL FUNCTION 'RRX REPORT OPEN'EXPORTINGi genuniid p genuidIMPORTINGe handle g handleEXCEPTIONSopen failed 1invalid genuniid 2msg init failed 3inherited error 4x message 5OTHERS 6.*To hide the popup of selection screen of the selected queryCALL FUNCTION 'RRC VARIABLES START'EXPORTINGI HANDLE g handleI SELSCRN RSR C SELSCRN-INACT* I VARIANT p varntSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com14

Step By Step Process to Run BEX Report in BackgroundI VARIANT s varnt-low " low value of variantI PMODE ''I NEW VARIANT RS C FALSEIMPORTINGE S RKB1D v RSR S RKB1D.IF SY-SUBRC 0.MESSAGE E000 WITH 'Problem in getting value of variant'(003).ENDIF.*getting the BEX query resultsCALL FUNCTION 'RRX GRID CMD PROCESS'EXPORTINGi handle g handlei cmdid g cmdidi iobjnm g iobjnmIMPORTINGe max x g xe max y g yTABLESi t ranges g t rangese t dim g t dime t mem g t meme t cel g t celc t prptys g t prptyse t atr g t atre t grid g t gride t ranges g t rangese t con g t cone t fac g t face t var g t varEXCEPTIONSinherited error 1no record found 2terminated by user 3no processing 4no change 5dbcl nosupport 6no authorization 7x message 8screen canceled 9launch url 10OTHERS 11.IF SY-SUBRC 0.MESSAGE E000 WITH 'Problem in getting BEx query results'(004).ENDIF.perform sub report genarate. " generate reportCALL FUNCTION 'RRX REPORT CLOSE'EXPORTINGI HANDLE g handle.IF SY-SUBRC 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.endloop.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com15

Step By Step Process to Run BEX Report in Background* close the output fileclose dataset p ofile. " close the output fileENDFORM." sub ----------------------------**&Form sub report ------** -- p1text* -- ---------------------------*FORM sub report genarate .*determined the column windth of the reportPERFORM sub determine col widths CHANGING g t gridg t col widths.*write the output in the file/listPERFORM sub write grid CHANGING g t grid.ENDFORM." sub report ----------------------------**&Form sub determine col --**-- C T GRID text*-- C T COL ---------------------------*FORM sub determine col widthsCHANGING c t gridTYPE rrx1 t gridc t col widths TYPE g t col widths.DATA: l s gridTYPE rrx1 s grid,l s grid last TYPE rrx1 s grid,l s col width TYPE g s col width,l lenTYPE i,l maxwidth TYPE i VALUE 25."MSTSORT c t grid BY x.LOOP AT c t grid INTO l s grid.AT NEW x.CLEAR: l s grid last, l s col width.l s col width-column l s grid-x.ENDAT.l len strlen( l s grid-data ).* Länge wird abhängig vom mwkz erweitertMSTCASE l s grid-mwkz.WHEN c m.IF l s grid-y NE 1."Keine Zahlen in Zeile 1l len l len 5.ENDIF.WHEN C w.IF l s grid-y NE 1."Keine Zahlen in Zeile 1l len l len 4.ENDIF.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com16

Step By Step Process to Run BEX Report in BackgroundWHEN OTHERS.l len l len 0.ENDCASE.* Ende einfügenIF l len GT l s col width-width.IF l len GE l maxwidth.l s col width-width l maxwidth.ELSE.l s col width-width l len.ENDIF.ENDIF.AT END OF x.APPEND l s col width TO c t col widths.ENDAT.l s grid last l s grid.ENDLOOP.ENDFORM." sub DETERMINE COL ---------------------------**&Form WRITE -------------------------*FORM sub write grid CHANGING c t grid TYPE rrx1 t grid.DATA: l s gridTYPE rrx1 s grid,l s grid2 TYPE rrx1 s grid,l s grid last TYPE rrx1 s grid,l tabixTYPE i.DATA: l s col width TYPE g s col width,l widthTYPE i,l position TYPE i,l xTYPE i,l yTYPE i,l max xTYPE i,l max yTYPE i,l help position TYPE i,l cell type TYPE c,l cell text(50) TYPE c," MST Länge unschönl cell add(4) TYPE c." MSTg start row sy-linno.CLEAR: g t ranges[].SORT c t grid BY y x.LOOP AT c t grid INTO l s grid.IF l s grid-y l max y.l max y l s grid-y.ENDIF.IF l s grid-x l max x.l max x l s grid-x.ENDIF.ENDLOOP.l tabix 1.READ TABLE c t grid INTO l s grid2 INDEX 1.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com17

Step By Step Process to Run BEX Report in BackgroundDO l max y TIMES.l y sy-index.DO l max x TIMES.l x sy-index.WHILE l y l s grid2-yOR ( l y l s grid2-yAND l x l s grid2-x ).ADD 1 TO l tabix.READ TABLE c t grid INTO l s grid2 INDEX l tabix.IF sy-subrc NE 0.EXIT.ENDIF.ENDWHILE.IF l s grid2-y l y AND l s grid2-x l x.l s grid l s grid2.ELSE.CLEAR: l s grid.l s grid-x l x.l s grid-y l y.l s grid-content 'NN'.ENDIF.IF l s grid last-y l s grid-y.g row hide l s grid last-y.HIDE g row hide.CLEAR l position.NEW-LINE.ENDIF.READ TABLE g t col widths INTO l s col width INDEX l s grid-x.l width l s col width-width.l position l position l width.* format* Ausgabeattribute in Abhängigkeit vom Cell-style setzen.l help position l position 20.*CHECK l help position LT sy-linsz.IF l s grid-content NE l s grid last-content.PERFORM sub set format attributes USING l s grid-content.ENDIF.l cell type l s grid-content 1(1).* Eingefügt zur Anzeige von Währung/Menge.CLEAR l cell add.CASE l s grid-mwkz.WHEN c m.IF l s grid-y NE 1."keine Zahlen in Zeile 1l cell add l s grid-unit.ENDIF.WHEN c w.IF l s grid-y NE 1."keine Zahlen in Zeile 1l cell add l s grid-currency.ENDIF.WHEN OTHERS.CLEAR l cell add.ENDCASE.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com18

Step By Step Process to Run BEX Report in BackgroundCONCATENATE l s grid-data l cell add INTO l cell textSEPARATED BY ' '.* Ende EingefügtIF l s grid-x EQ 1.WRITE l s grid-drillstate.ENDIF.*PERFORM sub write cell col USING l widthl s grid-xl cell text.WRITE AT (l width) l cell text."MSTdata : l temp(1000) type c,l len type i.if l cell text space.l temp ' '.else.CONCATENATE l cell text ' ' into l temp.endif.CONCATENATE v string l temp into v string.l s grid last l s grid.ENDDO.l len strlen( v string ).transfer v string to p ofile length l len.clear v string.ENDDO.ENDFORM." sub WRITE ------------------------**&Form set format ------**-- I CONTENT ------------------------*FORM sub set format attributesUSING i contentTYPE rrx1 s grid-content.DATA: l colorl intensifiedl inversel linetypel itemtypeTYPE c,TYPE rs bool,TYPE rs bool,TYPE c,TYPE c.l linetype i content 1(1).l itemtype i content 0(1).CASE l itemtype.WHEN c n.CASE l linetype.WHEN c t. l color 3.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com19

Step By Step Process to Run BEX Report in BackgroundWHEN c n. l color 2.WHEN c r. l color 2.WHEN c s. l color 2.ENDCASE.WHEN c t.CASE l linetype.WHEN c t. l color 3.WHEN c n. l color 4.WHEN c r. l color 4.WHEN c s. l color 4.ENDCASE.ENDCASE.CASE l inverse.WHEN rs c true.WHEN rs c false.ENDCASE.CASE l intensified.WHEN rs c true.WHEN rs c false.ENDCASE.CASE i content 2(2).WHEN '01'. l color 5.WHEN '02'. l color 5.WHEN '03'. l color 5.WHEN '04'. l color 7.WHEN '05'. l color 7.WHEN '06'. l color 7.WHEN '07'. l color 6.WHEN '08'. l color 6.WHEN '09'. l color 6.ENDCASE.CASE l color.WHEN 0. FORMAT COLOR COL BACKGROUND.WHEN 1. FORMAT COLOR COL HEADING.WHEN 2. FORMAT COLOR COL NORMAL.WHEN 3. FORMAT COLOR COL TOTAL.WHEN 4. FORMAT COLOR COL KEY.WHEN 5. FORMAT COLOR COL POSITIVE.WHEN 6. FORMAT COLOR COL NEGATIVE.WHEN 7. FORMAT COLOR COL GROUP.ENDCASE.ENDFORM." sub GET FORMAT ------------------------------**FORM sub write cell -----------------------------------------------** -- I WIDTH** -- I COL** -- L -------------------------*SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com20

Step By Step Process to Run BEX Report in BackgroundFORM sub write cell col USING i width TYPE ii col TYPE il text TYPE c.FORMAT INTENSIFIED OFF.CASE i col.WHEN 1. g txt1 l text. WRITE AT (i width) g txt1.WHEN 2. g txt2 l text. WRITE AT (i width) g txt2.WHEN 3. g txt3 l text. WRITE AT (i width) g txt3.WHEN 4. g txt4 l text. WRITE AT (i width) g txt4.WHEN 5. g txt5 l text. WRITE AT (i width) g txt5.WHEN 6. g txt6 l text. WRITE AT (i width) g txt6.WHEN 7. g txt7 l text. WRITE AT (i width) g txt7.WHEN 8. g txt8 l text. WRITE AT (i width) g txt8.WHEN 9. g txt9 l text. WRITE AT (i width) g txt9.WHEN 10. g txt10 l text. WRITE AT (i width) g txt10.WHEN 11. g txt11 l text. WRITE AT (i width) g txt11.WHEN 12. g txt12 l text. WRITE AT (i width) g txt12.WHEN 13. g txt13 l text. WRITE AT (i width) g txt13.WHEN 14. g txt14 l text. WRITE AT (i width) g txt14.WHEN 15. g txt15 l text. WRITE AT (i width) g txt15.WHEN 16. g txt16 l text. WRITE AT (i width) g txt16.WHEN 17. g txt17 l text. WRITE AT (i width) g txt17.WHEN 18. g txt18 l text. WRITE AT (i width) g txt18.WHEN 19. g txt19 l text. WRITE AT (i width) g txt19.WHEN 20. g txt20 l text. WRITE AT (i width) g txt20.WHEN 21. g txt21 l text. WRITE AT (i width) g txt21.WHEN 22. g txt22 l text. WRITE AT (i width) g txt22.WHEN 23. g txt23 l text. WRITE AT (i width) g txt23.WHEN 24. g txt24 l text. WRITE AT (i width) g txt24.WHEN 25. g txt25 l text. WRITE AT (i width) g txt25.WHEN 26. g txt26 l text. WRITE AT (i width) g txt26.WHEN 27. g txt27 l text. WRITE AT (i width) g txt27.WHEN 28. g txt28 l text. WRITE AT (i width) g txt28.WHEN 29. g txt29 l text. WRITE AT (i width) g txt29.WHEN 30. g txt30 l text. WRITE AT (i width) g txt30.WHEN 31. g txt31 l text. WRITE AT (i width) g txt31.WHEN 32. g txt32 l text. WRITE AT (i width) g txt32.WHEN 33. g txt33 l text. WRITE AT (i width) g txt33.WHEN 34. g txt34 l text. WRITE AT (i width) g txt34.WHEN 35. g txt35 l text. WRITE AT (i width) g txt35.WHEN 36. g txt36 l text. WRITE AT (i width) g txt36.WHEN 37. g txt37 l text. WRITE AT (i width) g txt37.WHEN 38. g txt38 l text. WRITE AT (i width) g txt38.WHEN 39. g txt39 l text. WRITE AT (i width) g txt39.WHEN 40. g txt30 l text. WRITE AT (i width) g txt40.WHEN 41. g txt41 l text. WRITE AT (i width) g txt41.WHEN 42. g txt42 l text. WRITE AT (i width) g txt42.WHEN 43. g txt43 l text. WRITE AT (i width) g txt43.WHEN 44. g txt44 l text. WRITE AT (i width) g txt44.WHEN 45. g txt45 l text. WRITE AT (i width) g txt45.WHEN 46. g txt46 l text. WRITE AT (i width) g txt46.WHEN 47. g txt47 l text. WRITE AT (i width) g txt47.WHEN 48. g txt48 l text. WRITE AT (i width) g txt48.WHEN 49. g txt49 l text. WRITE AT (i width) g txt49.WHEN 50. g txt50 l text. WRITE AT (i width) g txt50.WHEN 51. g txt51 l text. WRITE AT (i width) g txt51.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com21

Step By Step Process to Run BEX Report in BackgroundWHEN 52. g txt52 l text. WRITE AT (i width) g txt52.WHEN 53. g txt53 l text. WRITE AT (i width) g txt53.WHEN 54. g txt54 l text. WRITE AT (i width) g txt54.WHEN 55. g txt55 l text. WRITE AT (i width) g txt55.WHEN 56. g txt56 l text. WRITE AT (i width) g txt56.WHEN 57. g txt57 l text. WRITE AT (i width) g txt57.WHEN 58. g txt58 l text. WRITE AT (i width) g txt58.WHEN 59. g txt59 l text. WRITE AT (i width) g txt59.WHEN 60. g txt60 l text. WRITE AT (i width) g txt60.WHEN 61. g txt61 l text. WRITE AT (i width) g txt61.WHEN 62. g txt62 l text. WRITE AT (i width) g txt62.WHEN 63. g txt63 l text. WRITE AT (i width) g txt63.WHEN 64. g txt64 l text. WRITE AT (i width) g txt64.WHEN OTHERS. WRITE AT (i width) l text.ENDCASE.ENDFORM."sub write cell colSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com22

Step By Step Process to Run BEX Report in BackgroundRelated ContentRUN BEX QUERYBEX In BackgroundRun BEX queries in background or batchSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com23

Step By Step Process to Run BEX Report in BackgroundDisclaimer and Liability NoticeThis document may discuss sample coding or other information that does notinclude SAP official interfaces and therefore is not supported by SAP.Changes made based on this information are not supported and can beoverwritten during an upgrade.SAP will not be held liable for any damages caused by using or misusing theinformation, code or methods suggested in this document, and anyone usingthese methods does so at his/her own risk.SAP offers no guarantees and assumes no responsibility or liability of anytype with respect to the content of this technical article or code sample,including any liability resulting from incompatibility between the content withinthis document and the materials and services offered by SAP. You agree thatyou will not hold, or seek to hold, SAP responsible or liable with respect to thecontent of this document.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com24

BEX Query Analyzer is the tool used to analyze ad hoc query results in MS Excel. BEX Query Analyzer can be used to run ad hoc queries and open BEX Query Designer to create and modify ad hoc queries. BEX Query Analyzer opens in MS Excel and provides its own toolbar and B