Csv file format problem

prodorder;batchno   ;text1    ; text2; text3;text4;text5;
"100001012;0008339492;487-07-G1;22;6,86;000081022G;  "
"100001013;0008339493;487-07-G1;22;6,86;000081022E;1 "
This is my sample csv file.
i want to upload using bdc.
im splitting the internal table and uploading like this.
call function 'GUI_UPLOAD'
    exporting
      FILENAME                      = FILE
     FILETYPE                      = 'ASC'
    has_field_separator           = ','
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
  CODEPAGE                      = ' '
  IGNORE_CERR                   = ABAP_TRUE
  REPLACEMENT                   = '#'
  CHECK_BOM                     = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
    tables
      DATA_TAB                      = ITAB
loop at ITAB.
    split ITAB at ';' into ITAB1-AUFNR
    ITAB1-CHARG
    ITAB1-TEXT1
    ITAB1-TEXT2
    ITAB1-TEXT3
    ITAB1-TEXT4
    ITAB1-TEXT5.
    append ITAB1.
  endloop.
But finally im getting output as
"100001012 in ordernumber of co01 transaction.
it should display 100001012 in ordernumber field.
please suggest how we can rectify this problem.

Hi Vijay,
   I can sugest you one thing. Before splitting ITAB at " , " .
use REPLACE command to remove inverted code value ( " ) .
Eg Loop at Itab.
REPLCE ALL OCCURANCES OF  "  WITH SPACE ( Check syntax).
Hope this will solve your problem.
Regards
Sourabh

Similar Messages

  • File upload - issue with European .csv file format

    All,
    when uploading the .csv file for "Due List for Planned Receipts" in the File Transfer Upload center I receive an error.  It appears that it is due to the european .csv file format that is delimited by semicolon rather than comma. The only way I could solve this issue is to change Regional and Language options to English. However, I don't think this is a great solution as I can't ask all our suppliers to change their settings.  Has anyone come across this issue and another way of solving it?
    Thank you!
    Have a good day,
    Johanna

    Igor thank you for your suggestion. 
    I found this SAP note:
    +If you download a file, and the formatting of the CSV file is faulty, it is possible that your column separator does not match the standard settings of the SAP system. In the standard SAP system, the separator is ,.
    To ensure that the formatting is correct, set your global default for column separation in your system, so that it matches that of the SAP system you are using.+
    To do that Microsoft suggests to change the "List separator" in the Regional and Language Options Customize view. Though like you suggest that does not seem to do the trick. Am I missing something?
    However, if I change the whole setting from say German to English (UK) the .csv files are comma delimited and can be easily uploaded.  Was hoping there would be another way of solving this without need for custom development.

  • Extract data from Oracle Database and store it into a CSV file format

    Hello.
    I'm trying to export a table from an Oracle Database into CSV file format with any Oracle adaptor and store it into a HDFS system.
    How could I do it?
    Thanks in advance!

    Xavi wrote:
    HI Charles. Could I use.. Oracle Data Integrator Application Adapter for Hadoop? For this purpose?
    Thanks in advancePerhaps. I have to confess that I am not familiar enough with ODI to know if that is within its capabilities.
    You might see if there is a forum for ODI and post your question to that.
    Charles Lamb

  • BO 4.0 save as csv file format issue

    Hi All,
    We are using BO 4.0 Webi for reporting on SAP BW 7.3 system. Some of our reports have to be scheduled to bring the output in CSV file format. When I schedule the report in CSV format, the final output has data in two sets. The first set has the list of columns which I have selected in my report. Starting on the next row I get to see the second set of data with all the objects selected in the query panel including the detail objects.
    We only need the data for the columns which is selected in the report, but it is bringing the dump from all the objects in the dataprovider.
    Can anyone tell me how to get rid of the second set of data in the same csv file ?
    Thanks,
    Prasad

    Hi,
    CSV format is reserved for 'data only' dataprovider dumps. it exports the entire webi microcube (query results)
    You don't get that option when going 'save as' - which preserves the report formatting - in which case you should consider .xls
    regards,
    H

  • To download data into csv file format

    Hi All
    I have to download data into csv file format. I use the FM
    GUI_DOWNLOAD and gave the filename text.csv. But data is stored in excel
    file in place of csv file.
    Can anyone tell me what should i do to load the data into csv file or any other function module should used?
    Regards

    see this sample code
    REPORT  YSG_MATSTK_REPT    LINE-SIZE 220
                               LINE-COUNT 50(5).
    *&                       DATA DECLARATION                              *
    TABLES: MARA,                      "GENERAL MASTER DATA
            MARC,                      "PLANT DATA FOR MATERIAL
            MARD,                      "STORAGE LOCATION DATA FOR MATERIAL
            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.
    *&                  I N I T I A L I Z A T I O N                      *
    *INITIALIZATION.
    *&             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.
        ENDLOOP.
        APPEND I_OUT.
        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.csv'
          FILETYPE              = 'DAT'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_HEADING
        EXCEPTIONS
          FILE_WRITE_ERROR      = 1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.csv'
          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  DISPLAYDETAILS                          *
    FORM DISPLAYDETAILS USING UCOMM LIKE SY-UCOMM
          SELFIELD TYPE SLIS_SELFIELD.
      IF SELFIELD-FIELDNAME = 'EBELN'.
        IF UCOMM = '&IC1'.
          READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
          PERFORM PORECDNG.
          CLEAR BDCDATA[].
        ENDIF.
      ELSE.
        IF SELFIELD-FIELDNAME = 'MATNR'.
          IF UCOMM = '&IC1'.
            READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
            PERFORM MMRECDNG.
            CLEAR BDCDATA[].
          ENDIF.
        ELSE.
          IF SELFIELD-FIELDNAME = 'VBELN'.
            IF UCOMM = '&IC1'.
              READ TABLE I_OUT INDEX SELFIELD-TABINDEX.
              PERFORM SALESRECDNG.
              CLEAR BDCDATA[].
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "DISPLAYDETAILS
                        FORM PORECDNG                                   *
    FORM PORECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0105'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RM06E-BSTNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RM06E-BSTNR'
                                    I_OUT-EBELN.
      PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0120'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RM06E-BSTPO(01)'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=AH'.
      PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                    I_OUT-EBELP.
      PERFORM BDC_FIELD       USING 'RM06E-TCSELFLAG(01)'
                                    'X'.
      PERFORM BDC_TRANSACTION USING 'ME23'.
    ENDFORM.                    "PORECDNG
                        FORM MMRECDNG                                   *
    FORM MMRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'RMMG1-MATNR'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                    I_OUT-MATNR.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'MSICHTAUSW-DYTXT(01)'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '=ENTR'.
      PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(01)'
                                    'X'.
      PERFORM BDC_TRANSACTION USING 'MM03'.
    ENDFORM.                    "MMRECDNG
                        FORM SALESRECDNG                                *
    FORM SALESRECDNG.
      PERFORM BDC_DYNPRO      USING 'SAPMV45A' '0102'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'VBAK-VBELN'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'VBAK-VBELN'
                                    I_OUT-VBELN.
      PERFORM BDC_TRANSACTION USING 'VA03'.
    ENDFORM.                    "SALESRECDNG
                     FORM BDC_TRANSACTION                               *
    FORM BDC_TRANSACTION USING TCODE.
      CALL TRANSACTION TCODE USING BDCDATA MODE 'E'.
    ENDFORM.                    "BDC_TRANSACTION
                           FORM BDC_DYNPRO                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM = PROGRAM.
      BDCDATA-DYNPRO = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
                           INSERT FIELD                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDCDATA.
      BDCDATA-FNAM = FNAM.
      BDCDATA-FVAL = FVAL.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_FIELD
    *&                  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 AVAILABLE 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.
    IF I_VBAP[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM TABLE VBAP'.
        EXIT.
      ENDIF.
      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
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • .CSV files format needs to be changes

    Hi ,
    I have procdure which converts all my data to .csv format, The problem here is i have used the SQL which has the alias name's Jan-12...upto Dec-12.
    The resulting .csv file dispalying this format as 12-Jan ---------up to 12-Dec
    I want the .CSV format should contain Jan-12...upto Dec-12.
    Pleae advice.
    Thanks

    876639 wrote:
    Hi ,
    I have procdure which converts all my data to .csv format, The problem here is i have used the SQL which has the alias name's Jan-12...upto Dec-12.
    The resulting .csv file dispalying this format as 12-Jan ---------up to 12-DecNo, the resulting .csv file contains whatever data you put into it. It's just a text file with characters in it.
    If data is getting changed then that's either being changed by your own code before it's put in the .csv file, or by the application you are using to view the .csv file.
    Let me guess, you're loading the .csv file into Microsoft Excel to view it...?
    Excel can recognise certain data and change the display formats accordingly e.g. it can recognise numbers and dates and display them in it's default formats. That's not a fault with Oracle or your code in that case, but with how the data is being viewed through Excel.
    Is the data still wrong if you open it up in WordPad or Notepad?

  • Excel File Format Problem while downloading in ALV Grid

    Hi All,
    My program gives an ALV Grid Output which contains the file download button , when I choose spread sheet as the file format , the actual data starts only from 4th line and the lines above it contain date, heading etc and the rest are blank. Is it possible that I can download only the records in the grid output with the column names and not the unnecessary log?
    Also the format is not proper excel format, this same file will be used for upload into another program using the Function Module 'TEXT_CONVERT_XLS_TO_SAP'. When I load the file saved in the above format, this Function Module always fails.
    Please let me know any solution for this problem
    Thanks in Advance.

    Hi
    try this code----
    *&      Form  DOWNLOAD_EXCEL_TEMPLATE
          text
    -->  p1        text
    <--  p2        text
    FORM download_excel_template .
      TYPES: BEGIN OF lt_data,
                field1(20),
                field2(30),
                field3(20),
                field4(20),
                field5(20),
                field6(30),
                field7(15),
                field8(10),
                field9(10),
                field10(20),
                field11(20),
                field12(10),
                field13(20),
                field14(20),
              END OF lt_data.
      DATA: lv_file TYPE rlgrap-filename,
            li_data TYPE STANDARD TABLE OF lt_data,
            wa_data TYPE lt_data,
            lv_pathcheck type c,
            lv_file1 type string.
      wa_data-field1 = ''.
      APPEND wa_data TO li_data.
      REFRESH gi_header.
      wa_header-name = 'Company Code'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Main Asset Number'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Asset Sub Number'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Document Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Posting Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Asset Value Date'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Item Text'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Reference'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Allocation'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Amount Posted'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Percentage Rate'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Quantity'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Prior-Yr Quantity'.
      APPEND wa_header TO gi_header.
      wa_header-name = 'Curr-Yr Quantity'.
      APPEND wa_header TO gi_header.
      lv_file = gv_file.
      lv_file1 = gv_file.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = lv_file1
        RECEIVING
          result               = lv_pathcheck
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
       FIND '.xls' IN lv_file IGNORING CASE.
      IF sy-subrc = 0.
        REPLACE '.XLS' IN lv_file WITH ' ' IGNORING CASE.
      ENDIF.
      FIND '.TXT' IN lv_file IGNORING CASE.
      IF sy-subrc = 0.
        REPLACE '.TXT' IN lv_file WITH ' ' IGNORING CASE.
      ENDIF.
      CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          file_name                 = lv_file
          data_sheet_name           = 'DATA'
        TABLES
          data_tab                  = li_data
          fieldnames                = gi_header
        EXCEPTIONS
          file_not_exist            = 1
          filename_expected         = 2
          communication_error       = 3
          ole_object_method_error   = 4
          ole_object_property_error = 5
          invalid_pivot_fields      = 6
          download_problem          = 7
          OTHERS                    = 8.
      IF sy-subrc <> 0.
        MESSAGE ID gv_msgid TYPE 'E' NUMBER 002.
      ENDIF.
    ENDFORM.                    " DOWNLOAD_EXCEL_TEMPLATE
    regards,
    Prashant

  • COA in csv file format

    Hello Experts,
    We have a requirement to create quality certificate as flat file in CSV format. I am afraid this cant be achieved through any of the exit and option is to copy and create Z print program. Please advice if there is an option without creating custom program.
    Thanks
    Prathib

    You are correct in that there is some programming involved but NOT a Z print program.  If you do ned to do the Z program, ONLY change the final forms module NASTEDFO.  Do not change any of the other submodules.
    SAP already provides an example program that is supported in the form of the print program RSNASTED which is delivered out of the box for EDI processing.
    An EDI file is nothing more than a text file formatted in a particular way with particular syntax.  If you look at how this is set up for the LQCA and LQCB output types, you should be able to duplicate this setup to produce a text file that matches your CSV requirement.  You can assign the changed programs maybe to "8 - Special function" or "4 - Telex" or "5 - external send".
    In config:
    QM-->Quality Certificates-->Process Output-->Assign print Program to Output/Type/Medium
    QM-->Quality Certificates-->Process Output-->Define Output Types with Certificate
    Make sure you read the help files for each field and all configuration documentation.
    Craig

  • LCM in csv File Format 11.1.2

    Is it possible to export dimension metadata into a .csv file using LCM in 11.1.2?
    I can only see it as .xml format and no options to change to .csv.

    xml is the default and only format when it comes to LCM.
    You can refresh the outline from Planning to Essbase and can use outline extractor to get the metadata in to CSV file
    http://www.appliedolap.com/free-tools/outline-extractor
    You can use ODI for the same as well.
    Its a good practice to mark the answers as helpful or correct if you think they are.
    Cheers...!!!

  • Using Excel 14.3.7 to create a text file, for saving as a .csv file. Problems with commas.

    I have created a text file in Excel, to be saved as a .csv file and uploaded to an online database. The file is rejected. When I open it in textedit I can see that the empty cells ( of which there are several in each row, all in the same columns) contain commas. It looked to me as though this could be the result of tabbing across empty cells. So I created a dummy file with a couple of lines where I tabbed across the whole row including the empty cells, and a couple of lines where I clicked in each individual cell in which I wanted to enter text. Opened in textedit there is no difference between the two type of entry. What can I do to stop Excel or .csv format entering commas in blank cells? Suggestions in simple English appreciated.

    http://answers.microsoft.com/en-us/mac/forum/macexcel?tab=QnA

  • Error in upload CSV file format ?

    Hi everyone !
    What to do in this case when I've to upload my CSV file
    (Report 2.14MB & Form 430KB), getting error.Can anybody help me in this regard when the values stored (Numeric+character), my data is considerably long,What I can do that in this respect?
    "Error ORA-20001:Unable to create collection
    Error ORA-06502:numeric or value error"
    Helps in helping you !
    Thanks in advance
    Oracle is not just a Database, it's the lifestyle

    hi muhammad--
    though your initial post seemed to suggest that you were trying to upload a very large spreadsheet into a table via our DataWorkshop (for which i'd still run with holger's suggestion above), your follow up seems to ask about enabling spreadsheet upload/download from within your app. you probably know by now that it's a pretty simple matter to turn on the ability for your report regions in htmldb to output to csv format. there's a "CSV Output" region on the report attributes page to let you control that stuff. regarding the ability to upload spreadsheet data into a table within HTML DB, there's no functionality built into htmldb for facilitate this for you. i'm still not sure if this is what you're looking for, but i explained a little about what it would take to implement one method of excel data upload functionality into one's app at the bottom of...
    Bulk Insert, SQL*Loader style
    ...hope this helps,
    raj

  • How to save from a JTable to .CSV file format?

    i am building a client sever model in which the client will send the details to the server...
    the server will take all the details and display it in a jtable..
    now, after sorting it using autorowsorter(..), how can i save the data from table to a .CSV file???
    Thanks in advance..

    Here is one code from my own my application. It should compile straight away, but if there are any compile time bugs, you can easily fix them. Pls do read the comments at the top.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.table.*;
    * This class is now JDK 1.6 Dependent, with the addition of the use of the Desktop
    * class instead of the default application launch procedure, and the use of the new
    * FileNameExtensionFilter class introduced under javax.swing.filechooser.
    * This class can be used in one line of code by passing the appropriate JTable to the
    * desired constructor.
    public class ExcelExporter extends Object {
        public JTable source;
        public JFileChooser chooser;
        public File csvFile;
        private boolean cancelOp = false, isDefault = true;
        private String topText = "";
        public ExcelExporter(JTable source) {
            this(source, "");
        public ExcelExporter(JTable source, String topText) {
            this(source, topText, true);
        public ExcelExporter(JTable source, String topText, boolean isDefault, File target, JProgressBar bar) {
            super();
            this.source = source;
            this.topText = topText;
            this.isDefault = isDefault;
            new ProgressDialog(source, target, bar);
        public ExcelExporter(JTable source, String topText, boolean isDefault) {
            super();
            this.source = source;
            this.topText = topText;
            this.isDefault = isDefault;
            obtainFileName();
        public void obtainFileName() {
            cancelOp = false;
            FileNameExtensionFilter filter = new FileNameExtensionFilter("Excel Format (CSV)", "csv");
            if(chooser == null) {
                chooser = new JFileChooser();
                chooser.setDialogTitle("Saving Database");
                chooser.setFileFilter(filter);
                chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                chooser.setSelectedFile( new File("database.csv") );
                chooser.setAcceptAllFileFilterUsed(false);                     
            int val = chooser.showSaveDialog((Component)null);
            if(val == JFileChooser.APPROVE_OPTION) {
                csvFile = chooser.getSelectedFile();
                boolean fixed = fixExtension(csvFile, "csv");
                if(!fixed && !cancelOp) {
                    JOptionPane.showMessageDialog(null,"File Name Specified Not Supported",
                    "File Name Error", JOptionPane.ERROR_MESSAGE);
                    obtainFileName();
                    return;
                if(!cancelOp) {
                    //storeTableAsCSV(csvFile, source);
                    new ProgressDialog(source, csvFile).setVisible(true);
        public boolean fixExtension(File file, String prefExt) {
            String fileName = file.getName();
            String dir = file.getParentFile().getAbsolutePath();
            String ext = null;
            try {
                ext = fileName.substring( fileName.lastIndexOf("."), fileName.length() );
                System.out.println("Original File Extension: " + ext);
            } catch(StringIndexOutOfBoundsException e) {
                ext = null;
            if(ext != null && !ext.equalsIgnoreCase("."+prefExt)) {
                return false;
            String csvName = null;
            if(ext == null || ext.length() == 0) {
                csvName = fileName + "." + prefExt;
            } else {
                csvName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + prefExt;
            System.out.println("Corrected File Name: " + csvName);
            File csvCert = new File(dir, csvName);
            if(csvCert.exists()) {
                int val = JOptionPane.showConfirmDialog(null, "Replace Existing File?", "File Exists",
                            JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
                if(val == JOptionPane.NO_OPTION) {
                    obtainFileName();
                    cancelOp = true;
                    return false;
                } else if(val == JOptionPane.CANCEL_OPTION) {
                    cancelOp = true;
                    return false;              
            if(!file.renameTo(csvCert)) {
                file = new File(dir, csvName);
                try {
                    file.createNewFile();
                } catch(IOException ioe) {}
            System.out.println("Exporting as: " + file.getAbsolutePath() );
            return true;
        public void storeTableAsCSV(File target, JTable src) {
            String csvData = topText + "\n\n";
            for(int i = 0; i < src.getModel().getRowCount(); i++) {
                for(int x = 0; x < src.getModel().getColumnCount(); x++) {
                    int col = src.convertColumnIndexToView(x);
                    String curVal = (String)src.getModel().getValueAt(i,col);
                    if(curVal == null) {
                        curVal = "";
                    csvData = csvData + removeAnyCommas(curVal) + ",";
                    if(isDefault) {
                        if(x == src.getModel().getColumnCount() - 3) {
                            csvData = csvData + "\n";
                            continue;
                    } else {
                        if(x == src.getModel().getColumnCount() - 1) {
                            csvData = csvData + "\n";                      
            try {
                FileWriter writer = new FileWriter(target);
                    writer.write(csvData);
                    writer.flush();
                    writer.close();
                writer = null;
                csvData = null;
            } catch(IOException ioe) {
                JOptionPane.showMessageDialog(source, "Error Writing File.\nFile may be in use by another application."
                + "\nCheck and try re-exporting", "Export Error", JOptionPane.ERROR_MESSAGE);
        public String removeAnyCommas(String src) {
            if(src == null) {
                return "";
            for(int i = 0; i < src.length(); i++) {
                if(src.charAt(i) == ',') {
                    src = src.substring(0,i) + src.substring(i+1, src.length());
            return src;
        class ProgressDialog extends JDialog {
            JProgressBar progress;
            JLabel progressLabel;
            javax.swing.Timer timer;
            int rowPoint = -1;
            StringBuffer data;
            JTable srcTable;       
            DefaultTableModel srcModel;
            File targetFile;
            public ProgressDialog(JTable src, File target) {
                super( new JDialog(), "Exporting", true);
                createUI();
                setLocationRelativeTo(null);
                srcTable = src;
                srcModel = (DefaultTableModel)src.getModel();
                targetFile = target;
                exportDataProgressively();
            public ProgressDialog(JTable src, File target, JProgressBar progress) {
                super();
                srcTable = src;
                srcModel = (DefaultTableModel)src.getModel();
                targetFile = target;
                setProgressBar(progress);
                exportDataProgressively();
            public void createUI() {
                progress = new JProgressBar(0, 100);
                progress.setIndeterminate(true);
                progress.setValue(0);
                progress.setBorder( BorderFactory.createCompoundBorder(
                                        BorderFactory.createEmptyBorder(10,10,10,10),
                                    UIManager.getBorder("ProgressBar.border") ) );
                progress.setPreferredSize( new Dimension(300, 38) );
                progressLabel = new JLabel("Writing Excel Format. Please Wait...");
                progressLabel.setFont( new Font("Verdana", Font.PLAIN, 11) );
                progressLabel.setBorder( BorderFactory.createEmptyBorder(10,10,10,10) );
                JPanel progressPanel = new JPanel( new BorderLayout() );
                    progressPanel.add(progressLabel, BorderLayout.NORTH );
                    progressPanel.add(progress, BorderLayout.CENTER);
                    progressPanel.setBorder( BorderFactory.createEmptyBorder(10,10,10,10) );
                setContentPane(progressPanel);         
                pack();
            public void exportDataProgressively() {
                //progress.setString("");
                progress.setMaximum(srcModel.getRowCount());
                progress.setIndeterminate(false);
                data = new StringBuffer("Autogenerated Excel Format"
                     + topText + "\n\n");          
                timer = new javax.swing.Timer(15, new ActionListener() {
                    public void actionPerformed(ActionEvent e) {                   
                        if(rowPoint > -1 && srcModel.getValueAt(rowPoint,0) == null) {
                            timer.stop();
                        progress.setValue(rowPoint);
                        appendData();
                timer.setRepeats(false);
                timer.start();
            public void appendData() {
                timer.stop();
                for(int j = 0; j < srcModel.getColumnCount(); j++) {
                    int col = srcTable.convertColumnIndexToView(j);
                    if(rowPoint == -1) {
                        data.append(removeAnyCommas((String)srcModel.getColumnName(col)).toUpperCase());
                    } else if(col != -1){
                        String text = (String)srcModel.getValueAt(rowPoint,col);
                        if(srcModel.getColumnName(col).equalsIgnoreCase("Phone Number(s)") && !isPrintableText(text) ) {
                            text = "\'" + getPrintableText(text);
                        } else if( srcModel.getColumnName(col).equalsIgnoreCase("Phone Number(s)") && isPrintableText(text)  ) {
                            text = "\'" + removeAnyCommas(text);
                        } else {
                            text = removeAnyCommas(text);
                        data.append(text);
                    if(isDefault) {
                        if(j != srcModel.getColumnCount() - 3 ){
                            data.append(",");
                        } else {
                            data.append("\n");
                            break;
                    } else {
                        if(j != srcModel.getColumnCount() - 1 ){
                            data.append(",");
                        } else {
                            data.append("\n");
                rowPoint++;
                if(rowPoint < srcModel.getRowCount()) {
                    timer.start();
                } else {
                    try {
                        if(!targetFile.exists())
                            targetFile.createNewFile();
                        FileWriter writer = new FileWriter(targetFile);
                            writer.write(data.toString());
                            writer.close();
                            progress.setValue(progress.getMaximum());
                            progress.setStringPainted(true);
                            progress.setString("Done");
                            openFile(targetFile);                      
                            setVisible(false);
                            data = null;
                    } catch(IOException ioe) {
                        JOptionPane.showMessageDialog(source, "Error Writing File. Try Resaving",
                        "Save Error", JOptionPane.ERROR_MESSAGE);
                    } catch(Exception exc) {
                        System.out.println(exc);
            public void setProgressBar(JProgressBar bar) {
                progress = bar;
            public boolean isPrintableText(String text) {
                return !text.contains("::");
            public String getPrintableText(String text) {          
                try {
                    text = text.substring(2);
                } catch(StringIndexOutOfBoundsException sie) {
                    System.out.println(sie);
                String generated = "";
                StringTokenizer st = new StringTokenizer(text, ",");
                try {
                    for(int i = 0; st.hasMoreTokens(); i++ ) {
                        if(i > 0) {
                            generated = generated + " / ";
                        String token = st.nextToken();
                        generated = generated + token.substring( token.indexOf("-") + 2 );
                } catch(NoSuchElementException nse) {}
                return generated;
            public void openFile(File file) {
                int val = JOptionPane.showConfirmDialog(null, "Would You Like To View The File Right Now?",
                "View File", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
                try {
                    if(val == JOptionPane.YES_OPTION) {
                        if(Desktop.isDesktopSupported()) {
                            Desktop.getDesktop().open(file);
                        } else {
                            new ExcelExecutor(file.getAbsolutePath());
                } catch(IOException ioe) {
                    JOptionPane.showMessageDialog(null, "Failed to Open File", "Error",
                     JOptionPane.ERROR_MESSAGE);
    }ICE

  • Nokia Asha 200 image file format problem

    hello. I just bought a Nokia Asha 200 recently, and I am happy with it. The only problem that I am currently having is with my phone's captured image's file format. It used to be .jpg and then it suddenly became .nrw and I can't open it when I tranfer the images to my computer. Whenever I convert it it just becomes black. I restored the factory settings of my phone but the format is still .nrw.
    I want to know what caused it and how can I revert back the image file format to .jpg.
    Thank you so much in advance.
    Good day.
    Solved!
    Go to Solution.

    Because Nokia s40 Phones automatically Enhancing the Image Captured and reduces it's size. The reason why you're Photos is in .nrw format because you didn't wait to process it. Follow these steps so it won't occuring again On the Camera Choose Options > Settings > Image Preview > Choose End Manually. Then wait for pictures to be processed you captured (sometimes you will notice that the image enhanced). It also can be done in the background. Hope it Helps.
    I love T9 Bar Phones | I used to be a Sony Ericson fan before but they leave the low end Phones so I have to switch to Nokia | LG Optimus L5 II and Nokia 206 3

  • ABAP to XML file - Formatting problem and UTF-8 requirement

    Hi Everyone,
    Could you please guide us on the ABAP coding required to get the proper XML file format. We have prepared the code for downloading SAP transaction data into an XML file format. However, we are stuck with an improper format as per Example 1.
    The file format we get is this:
    Example 1:
    <?xml version="1.0"?><FDXLMDOrd><FXNHdrLp><CrtDtTm>20070613094517</CrtDtTm><MsgID>319304155</MsgID><MsgTyp>850</MsgTyp><MsgSubTyp>SALES_A</MsgSubTyp><Pr
    <RcvTP>FSCS</RcvTP><SndSrc>FXN</SndSrc><RcvSrc>EIB</RcvSrc><UsrID>VAR</UsrID></FXNHdrLp><OrdHdrLp><OrdNbr>319304155</OrdNbr><OrdActnCD>9</OrdActnCD><Ord
    teCarrReq>FDE</RteCarrReq><RteTptSvcReq>FEIP</RteTptSvcReq></DprtRteLp><SpecInstrLp><SpecInstrTyp>SHIP</SpecInstrTyp><SpecInstr>Example Packing Instruct
    les Order</RefDesc></RefLp><RefLp><RefIDQual>CPO</RefIDQual><RefID>test 1 line 1 pc - s</RefID><RefDesc>Customers Customer Purchase Order</RefDesc></Ref
    Typ><EntIDQual>91</EntIDQual><EntID>H00092</EntID><EntNm>VLAD BOBES</EntNm><Cty>MONTREAL</Cty><PstlCD>H3X 2N5</PstlCD><RgnalCD>QC</RgnalCD><CtryISOCD>CA
    ></AdrLnLp><ConLp><ConTypCD>IC</ConTypCD><ConNm>VLAD BOBES</ConNm><CommLp><CommNbrQual>TE</CommNbrQual><CommNbr>514-731-8361</CommNbr></CommLp></ConLp><
    <Cty>MONTREAL</Cty><PstlCD>H3X 2N5</PstlCD><RgnalCD>QC</RgnalCD><CtryISOCD>CA</CtryISOCD><AddlNmLp><AddlNm1>VLAD BOBES</AddlNm1></AddlNmLp><AdrLnLp><Str
    However, the format need to look like this as in Example 2 below.
    We also need help in how to get  " encoding="UTF-8"?> " as part of the file format.
    Example 2:
    <?xml version="1.0" encoding="UTF-8"?>                
    <FDXLMDProdRcpt>                                      
        <FXNHdrLp>                                        
            <CrtDtTm>20070612151817</CrtDtTm>             
            <SessID>26796</SessID>                        
            <MsgTyp>861</MsgTyp>                          
            <MsgSubTyp>WRE_A</MsgSubTyp>                  
            <PrcsingPrty>5</PrcsingPrty>                  
            <SndTPQualCD>ZZ</SndTPQualCD>                 
            <SndTP>FSCS</SndTP>                           
            <RcvTPQualCD>ZZ</RcvTPQualCD>                 
            <RcvTP>EIB</RcvTP>                            
            <SndSrc>YANTRA</SndSrc>                       
            <RcvSrc>EIB</RcvSrc>                          
            <UsrID>VAR</UsrID>                            
        </FXNHdrLp>                                       
        <ProdRcptHdrLp>                                   
            <ShpID>VAR20070612NCHIC1</ShpID>              
            <ShpTyp> </ShpTyp>                            
            <ShpActnCD>00</ShpActnCD>                     
            <InTransMrgTyp> </InTransMrgTyp>              
            <ShpVolUOM>CI</ShpVolUOM>                     
            <ShpWgtUOM>LB</ShpWgtUOM>                     
            <ShpTotVol>310022.00</ShpTotVol>              
            <ShpTotWgt>861.00</ShpTotWgt>                 
            <DtTmLp>                                      
                <DtTyp>050</DtTyp>                        
                <DtTmQual>501</DtTmQual>                  
                <DtTm>2007-06-12T15:07:41-04:00</DtTm>    
            </DtTmLp>                                     
            <AdrLp>                                       
                <EntTyp>RC</EntTyp>                       
                <EntIDQual>93</EntIDQual>                 
                <EntID>NCHIC</EntID>                      
                <EntNm>NCHIC</EntNm>                      
                <AutoCrtTrdPar>0</AutoCrtTrdPar>          
                <AutoCrtTrdParRole>0</AutoCrtTrdParRole>  
                <AutoUpdtTrdPar>0</AutoUpdtTrdPar>        
            </AdrLp>                                      
            <ProdRcptTptLp>                               
                <TptIDQual>BOL</TptIDQual>                
                <TptSCAC> </TptSCAC>                      
                <TptID> </TptID>   
    Thanks and Best Regards
    Sitaraman

    You could try to use the following coding:
    *& Report  ZUS_SDN_UC_XML_TO_UTF8_TRANSF
    REPORT  zus_sdn_uc_xml_to_utf8_transf.
    define local data
    CONSTANTS:
      gc_encoding           TYPE string VALUE 'UTF-8'.
    DATA:
      gd_result             type string,
      go_ixml               TYPE REF TO if_ixml,
      go_stream_factory     TYPE REF TO if_ixml_stream_factory,
      go_encoding           TYPE REF TO if_ixml_encoding,
      go_resstream          TYPE REF TO if_ixml_ostream.
    DATA:
      gt_knb1    TYPE STANDARD TABLE OF knb1,
    gd_xml     TYPE string,
      gt_xml     TYPE TABLE OF string.
    START-OF-SELECTION.
      SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 10 ROWS
          WHERE bukrs = '1000'.
      go_ixml = cl_ixml=>create( ).
      go_stream_factory = go_ixml->create_stream_factory( ).
      go_encoding = go_ixml->create_encoding( character_set = gc_encoding
                                            byte_order = 0 ).
      go_resstream =
                  go_stream_factory->create_ostream_cstring( gd_result ).
      CALL METHOD go_resstream->set_encoding
        EXPORTING
          encoding = go_encoding.
    XML Transformieren
      CALL TRANSFORMATION id_indent
        SOURCE     itab = gt_knb1
        RESULT XML go_resstream.
      APPEND gd_result TO gt_xml.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
         BIN_FILESIZE              =
          filename                  = 'C:\temp\xml_to_utf8.txt'
         FILETYPE                  = 'ASC'
         APPEND                    = SPACE
         WRITE_FIELD_SEPARATOR     = SPACE
         HEADER                    = '00'
         TRUNC_TRAILING_BLANKS     = SPACE
         WRITE_LF                  = 'X'
         COL_SELECT                = SPACE
         COL_SELECT_MASK           = SPACE
         DAT_MODE                  = SPACE
         CONFIRM_OVERWRITE         = SPACE
         NO_AUTH_CHECK             = SPACE
         CODEPAGE                  = SPACE
         IGNORE_CERR               = ABAP_TRUE
         REPLACEMENT               = '#'
         WRITE_BOM                 = SPACE
         TRUNC_TRAILING_BLANKS_EOL = 'X'
       IMPORTING
         FILELENGTH                =
        CHANGING
          data_tab                  = gt_xml
        EXCEPTIONS
          file_write_error          = 1
          no_batch                  = 2
          gui_refuse_filetransfer   = 3
          invalid_type              = 4
          no_authority              = 5
          unknown_error             = 6
          header_not_allowed        = 7
          separator_not_allowed     = 8
          filesize_not_allowed      = 9
          header_too_long           = 10
          dp_error_create           = 11
          dp_error_send             = 12
          dp_error_write            = 13
          unknown_dp_error          = 14
          access_denied             = 15
          dp_out_of_memory          = 16
          disk_full                 = 17
          dp_timeout                = 18
          file_not_found            = 19
          dataprovider_exception    = 20
          control_flush_error       = 21
          not_supported_by_gui      = 22
          error_no_gui              = 23
          OTHERS                    = 24.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    However, I like to mention that the file created from out ECC 5.0 (6.40, non-Unicode) contains a special character between the XML header and the data part (when displayed using NotePad Editor):
    ...xml version="1.0" encoding="utf-8"?>[special character]<asx:abap xmlns:asx="http://www.sap.com/a...
    Using a HexEditor the special character (0x0A) is displayed as a dot.
    Also Check with FM - TREX_TEXT_TO_UTF8
    Reward Points if it is helpful
    Thanks
    Seshu

  • Rendering file formats problem (non-issue in premier)

    hello all,
    so i'm new to final cut and baffled at the unusual render issues i've encountered from the get go.
    i recorded some video using the canon fs-10 / fs-20, a lowend digital camcorder.
    the camera outputs the format to .mod which i then converted to .mpeg4.
    without any editing in FC, a single clip needs to render just to view it in the canvas but plays ok in the viewer. does this make any sense?
    i've even tried to convert to .mov and .avi.
    when i used a different camera that automatically records in .mov, final cut plays back in the canvas just fine without rendering.
    so,
    1. what exactly determines when FC renders if not the file format?
    2. why does it need to render at all if i'm just playing back? it plays back in the viewer but not the canvas. baffling.
    would be a real shame if FC couldn't handle simple editing with these basic files.
    thanks!

    Just grabbing software, and throwing video files at it, without taking the time to read or learn HOW this said application works, isn't wise. FCP isn't Premiere...FCP doesn't just take in any old QT file and then work with it. No. It needs to be converted to a format that FCP works with. What you see in the EASY SETUP list is what FCP works with.
    If you don't bother to learn the basics of the application, then things won't go smoothly. If you just want to grab QT files and throw them into an application to start editing, then use Premiere.
    1. what exactly determines when FC renders if not the file format?
    If it isn't in the Easy Setup list...FCP will want to render it. If you mix two or more codecs in a sequence, then FCP will render the footage that differs from the main footage you are editing with.
    2. why does it need to render at all if i'm just playing back?
    Because It is viewable in the Viewer...that's just a window to the QT file. But the canvas is where things are put together. And that is where settings are determined.
    would be a real shame if FC couldn't handle simple editing with these basic files.
    Basic files that aren't in editable codecs. At least ones that FCP (and Avid) work with. If you want an app that just works with stuff you throw at it, Premiere and Vegas are for you.
    Shane

Maybe you are looking for

  • Can't Set Default Value for LOV Presentation DB Column

    I have a simple form. One of the fields is populated using a named, dynamic LOV with the following source query: SELECT USER_NAME DISPLAY_VALUE, USER_ID RETURN_VALUE FROM USER_ACCT ORDER BY 1 I want the default user to be public, which is one of the

  • 4GB iPod Nano Corrupt

    I updated recently to itunes 7.1 and it worked fine on my ipod (60gb video) and I figured I would connect my Mum's 4gb nano to update that too. Connected the nano and it updated the actual ipod and told me to leave it to restart, so I did. It finishe

  • Pre-owner's contacts in i-pad still there.

    My ipad was owned by another relative before I got it. It has been set up for me---mostly. I still have a problem with the contacts. They are his even though many are also my relatives. How do I change from him in the CONTACTS window where it says "M

  • ITunes 11 "get info" grayed out

    Some of my songs' info under "get in" are grayed out, so I cannot change genre, etc.  I have read thru a lot of old posts and I've checked the permissions on the iTunes folder and they are correct.  Weird thing is that only some songs are grayed out,

  • New Themes and Extra Large Book format not working

    I can't access the new themes or the new large format book in iPhoto. I have installed the 8.1 upgrade. (I also have installed Snow Leopard). 8.1 seems to have installed successfully, but I still can't get the new stuff, so I tried re-installing it,