Use a flexible Filename in REPORT CSV OUTPUT

-> ReportAttributes -> csv-output -> filename
I tried to use &item. and :Item but it seems the FILENAME of the csv-output is fixed. But I would like to give a name depending from context. Any ideas ?

Marc,
Sure. The region is a PL/SQL function body returning a SQL query :
declare q varchar2(256);
begin
q := 'select * from ' || v('CURRASSVIEW');
if v('CURRASSSLXID') IS NOT NULL THEN
q := q || ' WHERE INSTR(' || '''' || v('CURRASSSLXID') || '''' || ', SLXID ) > 0';
end if;
return q;
end;
Where CURRASSVIEW is an app item that is the name of a VIEW object behind the scenes. Various view objects have been created to peek into a data wharehousing scheme. Unfortunately, I can't go into great detail....my company would freak if I posted actual data (pharmaceutical). However, I have tracked it down to the following scenario :
One of the columns that comes through is a VARCHAR2(2). The excel-spoolling is fine while this column is empty, and when the report in Excel reaches a row with a value in this column, it dies. The values are all of length 1, so I'm not sure where else to look.
Sorry for lack of details...any hints you could give as to where to continue research would be appreciated.
Matt

Similar Messages

  • Classic Report CSV output failed to parse SQL query

    Hi,
    I'm trying to get a CSV output from a classic report. I'm generating the report based on a PL/SQL block that will return an SQL query. But when i download the CSV excel just gives me a:
    failed to parse SQL query:
    ORA-00936: Missing expression
    and shows me the query that the application is trying to parse. I'm also using bind variables (page items) in the PL/SQL block that is returning me the SQL query. I think that the reason that it fails to parse the query is that the query that is shown in excel has no bind variable values.
    Anyone got any ideas?

    Hi Arif,
    run your page in debug mode and check out the SQL statement which is actually executed for the report. That might help to diagnose what is going wrong.
    If you wish you can also post the report SQL statement which is getting executed.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • No data found in report csv or pdf output on first page load

    No data found in report csv output on first page load. Report shows up on page, but no data found in csv or pdf output. I always need to submit the page and then it shows data in downloads. The page contains a form (read-only) with a report that references 4 page items by using something like the following:
    and b.employee_no = v('P5_EMPLOYEE_NO')
    and c.fisc_year_pk = v('P5_FISC_YEAR_PK')
    and b.job_class = v('P5_JOB_CLASS')
    and b.organization = v('P5_ORGANIZATION')
    Again, report in the page shows up except there is no data in downloads. Can anyone help me solve this problem? I'm running Oracle APEX 4.2.1 in Oracle database 11gR2.
    Thanks.

    Sounds like a classic session state issue.
    You need to populate you page items using page rendering computations to ensure they're set to session state.
    Or if the download is triggered from a button press, you need to ensure those page items are submitted to session state, perhaps via a PL/SQL action.
    Scott

  • Csv output  filename &item.

    hello,
    i have a report and enabled csv output.the filename-help say:Specify a name for the export file. If no name is specified, the region name is used followed by the extension .csv.
    ok,filename is not specified,and my region-name is
    Kundenrechnung Nr. &P35_X_RECHNR.
    P35_X_RECHNR is an hidden item and works fine in regionsname,as example regionsname looks like Kundenrechnung Nr. 719
    but when i downlaod the file,the filename is Kundenrechnung Nr. &P35_X_RECHNR..CSV
    how can i use my hidden item in csv filename ?
    [email protected]

    Hi Christian,
    in your case there is a timing problem: The substitution for the region title is part of the region rendering process as is the filename. There is no double-substitution at that point. Imagine the current state to be filename:=NVL(substitute(filename), region_title) where region_title has the value that is handed to the rendering process.
    We reference a hidden page item as filename directly, e.g. "&PX_FILENAME..csv"
    The item value is calculated by a page process that is executed "On Submit - After Computations and Validations", and that works fine. You could try to set the filename to be "Kundenrechnung Nr. &P35_X_RECHNR..CSV" since P35_X_RECHNR should contain the appropriate value at that time.
    -Udo

  • CSV Output for Classic Reports 100 columns.

    Hi,
    After hours of research and several attempts, I still haven't been able to figure out a way to export a report in CSV format. I can't use an Interactive Report as the view I am displaying on the report is larger than 100 columns. Although all the columns are displayed on the report,the CSV Output link doesn't export all the columns. Can anyone help me out? I would really appreciate it.
    Thanks a lot.
    Werot.

    Were we looking at the same page?  That page shows an ORACLE PACKAGE that you can modify if need be to get what you want.  It's NOT a plugin with wrapped code..
    (You need to look for this line in the blob: The source code for the package: as_xlsx)
    Thank you,
    Tony Miller
    LuvMuffin Software

  • CSV output (export to excel) don't use right code table

    CSV output (export to excel) don't use right code table. We use code table
    8859-2 (reports and forms are OK). Why export to excel don't use this code table.
    Thanks for answers

    You could also take the example from my blob that Denes mentioned and instrument it to output in either CSV or HTML. This way, you could have a single procedure that worked for both formats.
    All you would need to do is handle each field differently - pad a TD and /TD (with proper brackets, of course) if its HTML or just append a comma if it's CSV.
    Thanks,
    – Scott –
    http://spendolini.blogspot.com/
    http://sumnertech.com/

  • .CSV output from Oracle reports 10g (from Oracle application)

    Dear all,
    I have a requirement to give an Oracle 10g report which will be deployed in Oracle RMS application.
    When the report is run thru the application, it should give the output in .CSV format.
    But, by default when the report is run thru the application, its giving the output in PDF format.
    Can any one help me in this and guide me how to get a .csv output from the Oracle reports in the RMS application.
    Thanks,
    Suma

    pls reply

  • Edit Page;Report;Enable CSV Output;Apply Changes;Page Not Found;wwv_flow

    Hi,
    We have a really annoying error in our application, whereby we are unable to save ANY changes to report attributes if Enable CSV Output is Yes.
    I have many pages with Enable CSV Output set to Yes, and when run, the pages can indeed be exported to Excel, fine so far.
    However, if we do Edit Page, choose Report change Enable CSV Output to No, then apply changes the option is removed ok - BUT if we then set it back to Yes, when we apply changes again we get a Page Not Found error at this address ;
    http://sglas-sand.fm.rbsgrp.net:7780/pls/fdm_uat2/wwv_flow.accept
    We obviously dont need to keep changing this value, but the above demonstrates that our reports do currently support CSV output, but for some recent reason, trying to save a page where this option has been changed to Yes causes this crash.
    We also seem unable to change and save any other attribute when CSV Output is set to Yes. This leaves us in a tricky situation - unable to change our pages unless we are prepared to remove the Export option!
    We were wondering if the support of this this option requires any special processing / objects / etc to be availble / running. Any help greatly appreciated.
    John Nice
    Royal Bank of Scotland - Finance IT

    Hi Scott,
    Thanks for the reply. Our errors were like this in the log ;
    [Thu Feb 22 14:52:33 2007] [error] [client <private ip removed>] ] [ecid: 1172155953:<private ip removed>] :30306:0:1855,0] mod_plsql: /pls/fdm_uat2/wwv_flow.accept HTTP-404 ORA-06550: line 23, column 3:\nPLS-00306: wrong number or types of arguments in call to 'ACCEPT'\nORA-06550: line 23, column 3:\nPL/SQL: Statement ignored\n
    Versions are ;
    Database : 10.2.02
    HTMLDB : 2.2
    Apache : 10g release 2
    Regards,
    John
    Message was edited by:
    John @ RBoS

  • Can you use information obtained in the report to use as output?

    I am wondering if in XI R2 or 2008 you can use infomation obtained in the report generation to use in output parameters?   For example, if my results come back with email addresses, can I then use them to email to?

    There are several export options.  But how about this solution:
    Insert a text object on the detail line with the text "E-mail: ".  Then drag the data field of the company/person's name and drop it in the text at the end.
    Then, right-click the text, and select "Format Text...".  Then click the Hyperlink tab and select "An EMail Address".  Below, for the e-mail address, it says "mailto:" but you don't want a static address.  So click on the formula button on the right.  For the formula, enter "mailto:" +
    When you run the report, you'll see "E-Mail: John Doe" but when you click on it, it'll open a mail message window with the address as the recipient.  (The names of the victims in this example have been changed, to protect the innocent   )
    I'm sure there are several other ways to accomplish your goal, but without more info on your situation, I can only guess that this is the best one.

  • How to Generate CSV Output from JD Edwards BI Publisher

    Hi All,
    I have a report "Critical Date Report" - R15611 in JD Edwards 8.11. This report has to be generated as CSV output from BI Publisher which is embedded to JDE.
    The purpose we want use BI Publisher is to move some of the data displaying to different place in the page(ex: Move the company address from top left corner to Bottom right corner).
    In order to achieve this
    1.We created blank rtf template and upload to XML repository using P95600 application
    2.Create report definition using P95620 application
    3.Here I see the available output types as PDF,RTF,HTML,EXCEL,POWERPOINT and XML,ETEXT(GRAYED OUT)
    Which output type we can use for CSV ?
    4.Execute the report definition of the critical date report from P95620 to get the XML source
    5.This XML source will be loaded into the blank rtf template
    6.From this point no idea how to design the rtf template in order to get the CSV output.
    7.We did design and output type as excel - but the result data is not in good formatting and alignment*(Headers and footers are repeating).*
    If any one has worked on similar type of requirement,let us know how to do or send a sample XML source,rtf template and how the CSV output will be. Or any document link present in Oracle site will be helpful. Please let me know if you need more details.
    Thanks in Advance.
    Vijay

    Hi Vijay,
    For CSV output, you need an E-text template (not RTF) that's why its grayed out! You can use Excel as output type and have (No headers and footers) , then you can open the file in Excel and store it as CSV. Does not always display correctly though.
    Why are you compelled to use BI publisher? you can use the JDE standard csv output report, (as is used by most EDI systems) of course this may involve a bit of customization if you wants the fields arranged differently.
    -Domnic

  • Values for htmldb_item.text  field do not display in CSV output

    HTML DB experts,
    I have a report query with the following 2 items in the SELECT statement:
    wwv_flow_item.display_and_save(2, DOC_CD, 10) DOC_CD,
    htmldb_item.text(3, DOC_DESC, 50, 255) DOC_DESC
    I have enabled the CSV output for this report. The problem is, when I generate a csv file, only the DOC_CD (wwv_flow_item.display_and_save) displays. The values for the DOC_DESC (htmldb_item.text) do not display. What do I need to do to get the DOC_DESC to display?
    Thanks for your help.
    Message was edited by:
    [email protected]

    Items rendered using htmldb_item generate HTML tags on the form, not plain text. You are right, the CSV export excludes them.
    Your best best is to create another report region on some other page with the same query except replace all the htmldb_item() calls with regular columns i.e. make it a read-only report and use the "export: CSV" template and put up a link to this page at the bottom of your editable report (instead of the builtin CSV link). This way when you click on this link, it will generate your report and immediately offer to export it to CSV
    Hope this helps.

  • Regarding ALV report to output in excel

    How to do  ALV report to output in excel format?

    *& DATA DECLARATION *
    TABLES: MARA, "GENERAL MASTER DATA
    MARC, "PLANT DATA FOR MATERIAL
    MARD, "STORAGE LOCATION DATA FOR MATERIAL
    MBEW, "MATERIAL VALUATION
    MVKE, "SALES DATA FOR MATERIAL
    MAKT, "MATERIAL DESCRIPTION
    EKKO, "PURCHASING DOCUMENT HEADER
    EKPO, "PURCHASING DOCUMENT ITEM
    VBAK, "SALES DOCUMENT HEADER DATA
    VBAP. "SALES DOCUMENT ITEM DATA
    TYPE-POOLS : SLIS.
    DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    V_LAYOUT TYPE SLIS_LAYOUT_ALV,
    BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    BEGIN OF I_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR, "MATERIAL NUMBER
    MBRSH LIKE MARA-MBRSH, "INDUSTRY SECTOR
    MEINS LIKE MARA-MEINS, "BASE UNIT OF MEASURE
    MATKL LIKE MARA-MATKL, "MATERIAL GROUP
    END OF I_MARA,
    BEGIN OF I_MARC OCCURS 0,
    MATNR LIKE MARC-MATNR, "MATERIAL NUMBER
    WERKS LIKE MARC-WERKS, "PLANT
    LVORM LIKE MARC-LVORM, "FLAG MATERIAL FOR DELETION AT PLANT
    "LEVEL
    DISPO LIKE MARC-DISPO, "MRP CONTROLLER
    END OF I_MARC,
    BEGIN OF I_MAKT OCCURS 0,
    MATNR LIKE MAKT-MATNR, "MATERIAL NUMBER
    MAKTX LIKE MAKT-MAKTX, "MATERIAL DESCRIPTION
    SPRAS LIKE MAKT-SPRAS, "LANGUAGE KEY
    END OF I_MAKT,
    BEGIN OF I_MVKE OCCURS 0,
    MATNR LIKE MVKE-MATNR, "MATERIAL NUMBER
    VKORG LIKE MVKE-VKORG, "SALES ORGANIZATION
    VTWEG LIKE MVKE-VTWEG, "DISTRIBUTION CHANNEL
    END OF I_MVKE,
    BEGIN OF I_MARD OCCURS 0,
    MATNR LIKE MARD-MATNR, "MATERIAL NUMBER
    LGORT LIKE MARD-LGORT, "STORAGE LOCATION
    LABST LIKE MARD-LABST, "VALUATED STOCK WITH UNRESTRICTED USE
    END OF I_MARD,
    BEGIN OF I_EKPO OCCURS 0,
    EBELN LIKE EKPO-EBELN, "PURCHASING DOCUMENT NUMBER
    EBELP LIKE EKPO-EBELP, "ITEM NUMBER OF PURCHASING DOCUMENT
    MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
    END OF I_EKPO,
    BEGIN OF I_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF I_VBAP,
    BEGIN OF I_OUT OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    LVORM LIKE MARC-LVORM,
    DISPO LIKE MARC-DISPO,
    MBRSH LIKE MARA-MBRSH,
    MEINS LIKE MARA-MEINS,
    MATKL LIKE MARA-MATKL,
    VKORG LIKE MVKE-VKORG,
    VTWEG LIKE MVKE-VTWEG,
    SPRAS LIKE MAKT-SPRAS,
    MAKTX LIKE MAKT-MAKTX,
    LGORT LIKE MARD-LGORT,
    LABST LIKE MARD-LABST,
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    VBELN LIKE VBAP-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF I_OUT,
    BEGIN OF I_HEADING OCCURS 0,
    TEXT1(20),
    TEXT2(20),
    TEXT3(20),
    TEXT4(20),
    TEXT5(20),
    TEXT6(20),
    TEXT7(20),
    TEXT8(20),
    TEXT9(20),
    TEXT10(20),
    TEXT11(40),
    TEXT12(20),
    TEXT13(20),
    TEXT14(20),
    TEXT15(20),
    TEXT16(20),
    TEXT17(20),
    END OF I_HEADING.
    *& S E L E C T I O N - S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
    PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
    SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
    S_DISPO FOR MARC-DISPO,
    S_EBELN FOR EKPO-EBELN .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
    PARAMETERS : RB1 RADIOBUTTON GROUP G1,
    RB2 RADIOBUTTON GROUP G1,
    RB3 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    *& S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    SELECT MATNR WERKS LVORM DISPO FROM MARC
    INTO CORRESPONDING FIELDS OF TABLE I_MARC
    WHERE MATNR IN S_MATNR
    AND DISPO IN S_DISPO
    AND WERKS = P_WERKS.
    IF I_MARC[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
    EXIT.
    ENDIF.
    PERFORM PURCHASEDATA_VALIDATION.
    PERFORM SALESDATA_VALIDATION.
    SELECT MATNR LGORT LABST FROM MARD INTO TABLE I_MARD
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR
    AND WERKS EQ P_WERKS
    AND LGORT IN S_LGORT.
    IF I_MARD[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
    EXIT.
    ENDIF.
    SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR.
    IF I_MVKE[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
    EXIT.
    ENDIF.
    LOOP AT I_MARC.
    MOVE-CORRESPONDING I_MARC TO I_OUT.
    CLEAR MARC.
    SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
    INTO CORRESPONDING FIELDS OF MARA
    WHERE MATNR = I_OUT-MATNR.
    IF SY-SUBRC = 0.
    MOVE: MARA-MBRSH TO I_OUT-MBRSH,
    MARA-MEINS TO I_OUT-MEINS,
    MARA-MATKL TO I_OUT-MATKL.
    ELSE.
    CONTINUE.
    ENDIF.
    SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
    INTO CORRESPONDING FIELDS OF MAKT
    WHERE MATNR = I_OUT-MATNR.
    IF SY-SUBRC = 0.
    MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
    MAKT-SPRAS TO I_OUT-SPRAS.
    ELSE.
    CONTINUE.
    ENDIF.
    LOOP AT I_EKPO WHERE MATNR = I_MARC-MATNR.
    MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
    I_EKPO-EBELP TO I_OUT-EBELP.
    ENDLOOP.
    LOOP AT I_VBAP WHERE MATNR = I_MARC-MATNR.
    MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
    I_VBAP-POSNR TO I_OUT-POSNR.
    ENDLOOP.
    LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
    MOVE: I_MARD-LABST TO I_OUT-LABST,
    I_MARD-LGORT TO I_OUT-LGORT.
    ENDLOOP.
    LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
    MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
    I_MVKE-VTWEG TO I_OUT-VTWEG.
    APPEND I_OUT.
    ENDLOOP.
    CLEAR I_OUT.
    ENDLOOP.
    PERFORM OPTIONS.
    FORM OPTIONS *
    FORM OPTIONS.
    IF RB2 = 'X'.
    PERFORM FIELDCAT.
    PERFORM OUTPUT.
    ELSE.
    IF RB1 = 'X'.
    PERFORM HEADINGS.
    PERFORM DLOAD.
    ELSE.
    IF RB3 = 'X'.
    PERFORM HEADINGS.
    PERFORM DLOAD.
    PERFORM FIELDCAT.
    PERFORM OUTPUT.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. "OPTIONS
    FORM HEADINGS *
    FORM HEADINGS.
    I_HEADING-TEXT1 = 'MATNR'.
    I_HEADING-TEXT2 = 'WERKS'.
    I_HEADING-TEXT3 = 'LVORM'.
    I_HEADING-TEXT4 = 'DISPO'.
    I_HEADING-TEXT5 = 'MBRSH'.
    I_HEADING-TEXT6 = 'MEINS'.
    I_HEADING-TEXT7 = 'MATKL'.
    I_HEADING-TEXT8 = 'VKORG'.
    I_HEADING-TEXT9 = 'VTWEG'.
    I_HEADING-TEXT10 = 'SPRAS'.
    I_HEADING-TEXT11 = 'MAKTX'.
    I_HEADING-TEXT12 = 'LGORT'.
    I_HEADING-TEXT13 = 'LABST'.
    I_HEADING-TEXT14 = 'EBELN'.
    I_HEADING-TEXT15 = 'EBELP'.
    I_HEADING-TEXT16 = 'VBELN'.
    I_HEADING-TEXT17 = 'POSNR'.
    APPEND I_HEADING.
    ENDFORM. "HEADINGS
    FORM DLOAD *
    FORM DLOAD.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\MATSTK.XLS'
    FILETYPE = 'DAT'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = I_HEADING
    EXCEPTIONS
    FILE_WRITE_ERROR = 1.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\MATSTK.XLS'
    FILETYPE = 'DAT'
    APPEND = 'X'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = I_OUT.
    ENDFORM. "DLOAD
    FORM FIELDCAT *
    FORM FIELDCAT.
    V_FIELDCAT-COL_POS = '1'.
    V_FIELDCAT-FIELDNAME = 'MATNR'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '2'.
    V_FIELDCAT-FIELDNAME = 'WERKS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '3'.
    V_FIELDCAT-FIELDNAME = 'LVORM'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '4'.
    V_FIELDCAT-FIELDNAME = 'DISPO'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '5'.
    V_FIELDCAT-FIELDNAME = 'MBRSH'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '6'.
    V_FIELDCAT-FIELDNAME = 'MEINS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '7'.
    V_FIELDCAT-FIELDNAME = 'MATKL'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '8'.
    V_FIELDCAT-FIELDNAME = 'VKORG'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
    V_FIELDCAT-REF_TABNAME = 'MVKE'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '9'.
    V_FIELDCAT-FIELDNAME = 'VTWEG'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
    V_FIELDCAT-REF_TABNAME = 'MVKE'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '10'.
    V_FIELDCAT-FIELDNAME = 'SPRAS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
    V_FIELDCAT-REF_TABNAME = 'MAKT'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '11'.
    V_FIELDCAT-FIELDNAME = 'MAKTX'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
    V_FIELDCAT-REF_TABNAME = 'MAKT'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '12'.
    V_FIELDCAT-FIELDNAME = 'LGORT'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
    V_FIELDCAT-REF_TABNAME = 'MARD'.
    V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
    V_FIELDCAT-OUTPUTLEN = 10.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '13'.
    V_FIELDCAT-FIELDNAME = 'LABST'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-SELTEXT_M = 'STOCK'.
    V_FIELDCAT-OUTPUTLEN = 15.
    V_FIELDCAT-REF_FIELDNAME = 'LABST'.
    V_FIELDCAT-REF_TABNAME = 'MARD'.
    V_FIELDCAT-DO_SUM = 'X'.
    V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
    V_FIELDCAT-HOTSPOT = 'X'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '14'.
    V_FIELDCAT-FIELDNAME = 'EBELN'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
    V_FIELDCAT-REF_TABNAME = 'EKPO'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '15'.
    V_FIELDCAT-FIELDNAME = 'EBELP'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
    V_FIELDCAT-REF_TABNAME = 'EKPO'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '16'.
    V_FIELDCAT-FIELDNAME = 'VBELN'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
    V_FIELDCAT-REF_TABNAME = 'VBAP'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '17'.
    V_FIELDCAT-FIELDNAME = 'POSNR'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
    V_FIELDCAT-REF_TABNAME = 'VBAP'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    ENDFORM. "FIELDCAT
    FORM OUTPUT *
    FORM OUTPUT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
    I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
    I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
    IS_LAYOUT = V_LAYOUT
    IT_FIELDCAT = VT_FIELDCAT1
    TABLES
    T_OUTTAB = I_OUT.
    IF SY-SUBRC 0.
    ENDIF.
    ENDFORM. "OUTPUT
    FORM TOP-OF-PAGE *
    FORM TOP-OF-PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
    WA_HEADER TYPE SLIS_LISTHEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = 'REPORT FOR : '.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'MATERIAL DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'SALES ORDER DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    I_LOGO = 'GEAR'
    IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM. "TOP-OF-PAGE
    *& FORM PURCHASEDATA_VALIDATION *
    FORM PURCHASEDATA_VALIDATION.
    SELECT EBELN EBELP MATNR
    FROM EKPO
    INTO TABLE I_EKPO
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR
    AND EBELN IN S_EBELN
    AND WERKS EQ P_WERKS.
    IF I_EKPO[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
    EXIT.
    ENDIF.
    DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
    T_EKPO] = I_EKPO[.
    REFRESH I_EKPO.
    FREE I_EKPO.
    LOOP AT T_EKPO.
    SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
    WHERE EBELN = T_EKPO-EBELN.
    IF SY-SUBRC = 0.
    MOVE-CORRESPONDING T_EKPO TO I_EKPO.
    APPEND I_EKPO.
    CLEAR I_EKPO.
    ELSE.
    CONTINUE.
    ENDIF.
    ENDLOOP.
    SORT I_EKPO.
    ENDFORM. "PURCHASEDATA_VALIDATION
    *& FORM SALESDATA_VALIDATION *
    FORM SALESDATA_VALIDATION.
    SELECT VBELN POSNR MATNR
    FROM VBAP
    INTO CORRESPONDING FIELDS OF TABLE
    I_VBAP FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR.
    DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
    T_VBAP] = I_VBAP[.
    REFRESH I_VBAP.
    FREE I_VBAP.
    LOOP AT T_VBAP.
    SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
    WHERE VBELN = T_VBAP-VBELN.
    IF SY-SUBRC = 0.
    MOVE-CORRESPONDING T_VBAP TO I_VBAP.
    APPEND I_VBAP.
    CLEAR I_VBAP.
    ELSE.
    CONTINUE.
    ENDIF.
    ENDLOOP.
    SORT I_VBAP.
    ENDFORM. "SALESDATA_VALIDATION

  • Restricting the CSV Output

    Hi
    we want to restrict some of the columns in the csv output is there any way to do it other than using extext templates.
    Thanks in Advance,
    Have a Nice day

    Thanks for your reply .
    But i am having some idea will it can be implemented.
    as you said it will depend on the datamodel .
    Consider i am having 2 datasets in my datamodel for my report to get the pdf,html,excel.
    so i want to add one more data set in the same data model with llimited number of columns in the select query and i want to use that dataset in the datamodel in the report generation when i choose the csv ouput.
    Is it possible i am using bi publisher 11g.
    So if it is possbile i can restrict my output in csv format too.
    This is my idea i dont know whether it is possible or not.

  • Creating a CSV output of just the rows of data.

    Dear All,
    I am trying to create a CSV output from SQL*Plus using the following method... All I need is the pure data, and nothing else.
    set verify off
    set feedback off
    set termout off
    set heading off
    set echo off
    spool <filename>
    <my sql statement>
    spool <off>
    The problem is that the SQL statement is displayed in the output file.
    Does anyone know how to switch this off, before I spool the file, or can I spool the file immediately after execution. I.e. Build this into the SQL statement (somehow)???
    Thanks
    David.

    If you want to handle 100% the output file you can use the package UTL_FILE but the file is going to be store in the server.
    UTL_FILE
    With the UTL_FILE package, your PL/SQL programs can read and write operating system text files. UTL_FILE provides a restricted version of operating system stream file I/O.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_file.htm#ARPLS069
    Joel Pérez
    http://otn.oracle.com/experts

  • Csv output has database column names instead of aliases as in template

    Hi,
    I'm trying to publish a csv report to an ftp server in a specific format and layout. The column names need to be customized. I've modified the alias name both in the data model and in the rtf layout template. But the csv still contains the data base names as in column0, column 1, etc. Does anyone know how to fix this? The html or rtf format displays the correct column names but not the csv.
    output sent:
    Column 0 Jane
    Column 1 Doe
    Column2 Female
    desired output:
    Name Jane
    Last Name Doe
    MF Female
    Edited by: user556100 on Apr 30, 2013 2:25 AM
    Edited by: user556100 on Apr 30, 2013 2:25 AM

    As far as i know CSV output will not consider any template formatting. it will basically give output of all the columns used in select statement of SQL in comma separated format.
    It is the default behavior of CSV output in bi publisher
    Guru's Correct me if i am wrong

Maybe you are looking for

  • Searching for a Special Soundc

    Hello, sry for my bad english i'm german I have a pc with a cheap soundcard, which has a optical sound input. At this soundcard i use the creative T7900 7. sound system. Now i want to connect my XBox360 to the soundcard via optical sound input. But m

  • Plsql objects in timesten

    Hi, may be question is obvious,but is it possible to create plsql objects (procedure, packages/bodies) in timesten database? Message was edited by: `mo

  • Issues with evaluation of EL expressions

    Hey everyone I am having issues with EL expressions being printed instead of evaluated when they are between tags. They work fine when they are in the tag itself. I will show you my code: This is a snippet from the parent file that includes the other

  • Adobe Reader X embedded files in Power Point Presentation

    I receive power point presentations with embedded pdf files. After installing Reader X these files no longer open. I see that other people have this problem but i have yet to see anyone say they have solved the problem. I have switched off the protec

  • JMS, and IIOP

    Is it possible to send and receive messgaes using JMS, with RMI over IIOP? Also from Applets is it possible to do RMI or RMI over IIOP ? Thanks, Sashi