Related to Open Dataset

Hi all,
The abstract of my problem is as follows.
I have to use both the AT POSITION and FILTER Optinns in Open dataset statement.
e.g Open dataset <dsn> in <Mode>
                       AT POSITION <pos>
                       FILTER <command>
But when i execute this, i get a syntax error at this line stating that i can only use filter and at poition at one place even though i put then one after the other.
Is there any way i can use both the additions?
If yes,How? and If no.. are there any alternatives?
Thanks in advance..
Sravan

Hi sravan,
1. As mentioned, use two statement.
   One shot statement cannot work.
2. try this code(just copy paste)
   it will do what u want.
   Try with commenting / uncommenting the line
   of SET DATASET
  and u will know the difference.
  [mention proper filename in the code]
3. REPORT abc.
DATA : fname(100) TYPE c.
DATA : lin(100) TYPE c.
fname = '/tmp/arv'.
OPEN DATASET fname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
comment/uncomment
*SET DATASET fname POSITION 10.
READ DATASET fname INTO lin.
WRITE lin.
regards,
amit m.
Message was edited by: Amit Mittal

Similar Messages

  • OPEN DATASET...  in a Unicode system

    I'm discussing with a developer @ SAP about the correct use of OPEN DATASET in a Unicode system. I'm not sure I'm correct with my opinion so maybe someone could shed a light on it.
    The source of discussion is the (SAP standard) program RSQUEU01. This program is used to download data from the TemSE; in our case we use it to produce a file that is to be sent to auditors (component FI-AIS).
    Our system is a little endian Unicode system (codpage 4103). If we download the created data using that program we get a dump with "CONVT_CODEPAGE" because a character could not be converted from 4103 to 1100.
    The proposed correction by the developer is changing
    OPEN DATASET EXP_FILENAME FOR OUTPUT IN legacy BINARY MODE.
    to
    OPEN DATASET exp_filename                              
    FOR OUTPUT IN LEGACY BINARY MODE                     
    IGNORING CONVERSION ERRORS.
    I think, that correction is wrong. Since we have 12 languages in the system including some Asian the output might get corrupted.
    When I asked him about that I was told use an application server with a "correct codepage" then - I'm not sure what that means since I can't connect an ASCII application server to a Unicode system.
    I guess the statement should be
    OPEN DATASET EXP_FILENAME FOR OUTPUT IN BINARY MODE ENCODING DEFAULT.
    This makes sure that no data is cut (like doublebyte) and makes sure, the appropriate codepage (LE/BE) is used.
    Are my assumptions right?
    Markus
    (OSS 323320/2010)

    Hi Markus,
    Let's first clarify the difference ways for writing files:
    <ul style="list-style:circle!important;">
    <li>BINARY MODE: Means that we essentially dump a sequence of bytes, which isn't necessarily related to any code page (and characters). I.e. if I'd want to save for example an executable program, the individual bytes have no meaning when interpreted as characters (unless we look at strings stored in the program). Note that legacy binary mode actually allows you to specify a code page though, but in general the recommendation is not to use the legacy option.</li>
    <li>TEXT MODE: Here we have text information that has to be interpreted using a specific code page; thus usually the additional parameter ENCODING should be given, which specifies which code page is used.</li>
    </ul>
    Now, let's clear up a small typo in Ajay's response:
    Yes you are right if you want to have all double byte characters too then you need to use ENCODING DEFAULT which would use 4103 in Unicode system.
    That is incorrect. In a Unicode system [encoding default|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_ENCODING.htm] corresponds to UTF-8, not UTF-16.
    Back to your problem. Your suggestion doesn't work, because you cannot specify encoding default for a binary output (the legacy binary mode allows you to specify a code page, but that's misleading and I wouldn't use any legacy mode). So when you try to use the syntax you proposed, you'd get a syntax error.
    Generally the recommendation is for Unicode enabled applications to use UTF-8 files with byte order mark, i.e. something like
    open dataset EXP_FILE in text mode encoding utf-8 with byte-order mark.
    However, the real question is what your external audit application expects and it sounds as if it's not Unicode enabled...
    Enough blabber, here's what I'd do: Since you're having issues with a audit-related standard SAP program I'd post the question in forum - other people must have run into that problem. Also, I checked OSS, but couldn't make much sense out of the few notes I've found (and nothing seemed relevant). Check what the expected input format is in the external audit system; possibly post a message to OSS.
    Cheers, harald

  • Fetch excel file from app. server using open dataset...

    Hello Experts,
    Our functional consultant is asking me if it possible to get an excel file from the
    application server file using OPEN dataset and in background mode? If yes, Please tell me on how to do this.
    Thank you guys and take care!

    Hi Viraylab,
    to download this the procedure:
    you can use the FM 'EXCEL_OLE_STANDARD_DAT ' for this purpose.
    this FM 'EXCEL_OLE_STANDARD_DAT' can be used to start Excel with a new sheet and transfer data from an internal table to the sheet.
    Here are some of the parameters:
    file_name: Name and path of the Excel worksheet file e.g. ?C:TEMPZTEST?
    data_tab: Name of the internal table that should be uploaded to Exvcel
    fieldnames: Internal tabel with column headers
    How to build the field names table:
    data: begin of i_fieldnames occurs 20,
    field(60), end of i_fieldnames.
    i_fieldnames-field = ?This is column 1?. append i_fieldnames-field.
    i_fieldnames-field = ?This is column 2?. append i_fieldnames-field.
    to upload follow this:
    OPEN DATASET dsn FOR INPUT IN BINARY MODE.
    DO.
    READ DATASET dsn INTO itab-field.
    IF sy-subrc = 0.
    APPEND itab.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    [/code]Rob
    or Try this function module.
    FILE_READ_AND_CONVERT_SAP_DATA
    pass 'XLS' to I_FILEFORMAT..
    Dont forgot to Reward me points .....All the very best....
    Regards,
    Sreenivasa sarma K.

  • Open dataset and close dataset

    Hi
    I need to write log file in fileshare.
    I am using the following FM to create the file.
    Z_FILE_OPEN_OUT_UNICODE'
    I have following qns
    1. do i need to use open dataset and close dataset stmts, even I create the files with the FM?

    Hi,
    you can fill in the name of the FM in transaction SE37, then click 'Display' and look at the source code and the 'Tables' tab.
    It's a custom build FM, so you might have to look at the import parameters it needs... ( Tab 'Import' and 'Tables' ).
    To answer your question, as the name of the FM suggests it will write the file for you, so no open/close dataset. Please doublecheck tab 'Source code' and you might find these statements there...
    hope that helps,
    Rolf

  • OPEN Dataset - Peculiar problem

    Hello experts!
    I am facing a peculiar problem with ABAP keyword OPEN DATASET.
    I have a directory to which I am adding new files using OPEN DATASET FOR OUTPUT.. this works perfectly fine in the Consolidation system. But the same thing does'nt work in the Production system! It return SY-SUBRC = 8
    After reading several other posts on SDN and other forums, the following causes were touted.
    1) Path incorrect 
    2) No Authorization
    But upon checking, neither of the wo are possible because the path is maintained properly and the authorizations at OS level are given (R/W) to this folder. Moreover, the user has S_DATASET auth object!!
    Then I read somewhere else that having multiple Application Servers could be a possible cause and that running the code as a background job would be afix.. Is it so?
    Even if it is, the application is in ABAP Web Dynpro and is launched from the portal.. hence launching it as a background job is not an option... Any solutions?????
    Any help on this would be appreciated...
    Thanks in advance, Amith

    Hi,
    Yes this is true that if we are having the multiple application server then this kind of error occures if your specified directory is not mapped on the alll the avaiable sAP application servers.
    I guess when ever you are running your application then system will pick the appkication server based on the present load. Hence if your directory is not mapped in that application server then you wil get this kind of issues,
    so i guess check with you basis team that spctified path is avaiable in all the application server.

  • OPEN DATASET FOR INPUT IN TEXT MODE - linesize issue

    Hi,
    I faced a problem when opened ANSI file with CYRILLIC in ECC 6.0 Unicode system - the system cuts the line to 250 characters. Below is snip of code:
    REPORT  Z_TEST_01 LINE-SIZE 1023.
    DATA:
      file TYPE char40 VALUE 'ansi_file.txt',
      line TYPE char1024, len TYPE i.
    OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    WHILE sy-subrc = 0.
          READ DATASET file INTO line ACTUAL LENGTH len.
            WRITE: / len, line.
    ENDWHILE.
    CLOSE DATASET file.
    In this case, variable LEN always get value 250. File-content is correctly converted from ANSI and all CYRILLIC is displayed to the screen. I changed type for LINE - initialy the type was STRING, actially.
    Further, tried to open it in BINARY - like this:
    DATA:
      file TYPE char40 VALUE 'ansi_file.txt',
      line TYPE char1024, len TYPE i.
    FIELD-SYMBOLS <hex_container> TYPE x.
    OPEN DATASET file FOR INPUT IN BINARY MODE.
    ASSIGN line TO <hex_container> CASTING.
    DO.
      READ DATASET file INTO <hex_container>.
      IF sy-subrc = 0.
        WRITE: / line.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    CLOSE DATASET file.
    WRITE: / line.
    In this case I got bigger linesize (obviously 1024), but faced conversion issues - the file contains some CYRILLIC and it is messed. Played for few hours with conversions - using additions: IN LEGACY BINARY MODE... BIG/LITTLE ENDIAN, CODE PAGE... without success. So decided to ask...
    Well, I searched SDN for a similar issue, but didn't found, except this one:
    Re: OPEN DATASET STRING Problem
    Could someone points me what am I doing wrong? How can I read my ANSI file with line-size more than 250 chars? Actually, in my case line size may vary up to 1800 chars. Further, afrer conversion and some validation, I should save it back to the AS.
    Many thans in advance.
    Regards,
    Ivaylo Mutafchiev

    Sorry for the noise - it is not an issue anymore.

  • Open dataset......

    Hi Folks,
    I am trying to get some data using Open dataset.The program is not showing any errors and executing fine,but I was not able to find the data that I am going to get using OPEN DATASET.Where will I be able to see the data.In the given path there is no file downloaded.Kindly let me know.
    run the program
    enter some data in the blank fields of the alv
    save it
    now double click on the qty1 field in the alv.
    Thanks,
    K.Kiran.
    REPORT  zlabel.
    TYPE-POOLS:slis,icon.
    TABLES:makt.
    *Declarations for ALV
    DATA:itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA:itfieldcat1 TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA:itprintparams TYPE slis_print_alv.
    DATA:itrepid TYPE sy-repid.
    itrepid = sy-repid.
    DATA:itevent TYPE slis_t_event.
    DATA:itlistheader TYPE slis_t_listheader.
    DATA:walistheader LIKE LINE OF itlistheader.
    DATA:itlayout TYPE slis_layout_alv.
    DATA:top TYPE slis_formname.
    DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA : grid  TYPE REF TO cl_gui_alv_grid.
    *Declaration for DSN
    <b>DATA : file(50) VALUE 'E:\userdata\labelfiles'.</b>
    DATA : dsn(150).
    DATA : dsn1(100).
    DATA : n1(4) TYPE n.
    *Declarations for Internal tables.
    DATA:BEGIN OF imakt OCCURS 0,
         matnr LIKE makt-matnr,
         spras LIKE makt-spras,
         maktx LIKE makt-maktx,
         label1(03) TYPE c,
         qty1(03) TYPE c,
         label2(03) TYPE c,
         qty2(03) TYPE c,
         END OF imakt.
    DATA:ITFINAL LIKE imakt OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:matnr FOR makt-matnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    PERFORM getdata.
    IF sy-subrc = 0.
    PERFORM alv.
    ELSE.
    STOP.
    ENDIF.
    *&      Form  getdata
          text
    FORM getdata.
      SELECT matnr
             spras
             maktx
             FROM makt
             INTO CORRESPONDING FIELDS OF TABLE imakt
             WHERE spras = sy-langu.
    ENDFORM.                    "getdata
    *&      Form  ALV
          text
    FORM alv.
      DEFINE m_fieldcat.
        itfieldcat-fieldname = &1.
        itfieldcat-col_pos = &2.
        itfieldcat-seltext_l = &3.
        itfieldcat-do_sum = &4.
        itfieldcat-outputlen = &5.
        itfieldcat-edit = &6.
        append itfieldcat to itfieldcat.
        clear itfieldcat.
      END-OF-DEFINITION.
      m_fieldcat 'MATNR' '' 'MATERIAL No' '' 18 ''.
      m_fieldcat 'SPRAS' '' 'Language' '' 02 ''.
      m_fieldcat 'MAKTX' '' 'Description' '' 40 ''.
      m_fieldcat 'LABEL1' '' 'LABEL1' '' 12 'X'.
      m_fieldcat 'QTY1' '' 'QTY1' '' 12 'X'.
      m_fieldcat 'LABEL2' '' 'LABEL2' '' 12 'X'.
      m_fieldcat 'QTY2' '' 'QTY2' '' 12 'X'.
      itlayout-zebra = 'X'.
      itlayout-colwidth_optimize = 'X'.
      itlayout-no_subtotals = ' '.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              i_callback_program      = sy-repid
              is_layout               = itlayout
           i_callback_pf_status_set = 'PF_STATUS'
              i_callback_user_command =  'LIST1'
              i_callback_top_of_page  = 'TOP'
              it_fieldcat             = itfieldcat[]
              i_save                  = 'X'
         is_variant              = ITVARIANT
              it_events               = itevent[]
            is_print                = itprintparams
              it_sort                 = itsort[]
            TABLES
              t_outtab                = imakt
              EXCEPTIONS
              program_error           = 1
              OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR itfieldcat.
    ENDFORM.                    "ALV
    *&      Form  list1
          text
         -->R_UCOMM    text
         -->RS_SELFIELDtext
    FORM list1 USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
      WHEN 'EXIT'.
      STOP.
      ENDCASE.
      CLEAR itfieldcat1.
      REFRESH itfieldcat1.
      DEFINE k_fieldcat.
        itfieldcat1-fieldname = &1.
        itfieldcat1-col_pos = &2.
        itfieldcat1-seltext_l = &3.
        itfieldcat1-outputlen = &4.
        append itfieldcat1 to itfieldcat1.
        clear itfieldcat1.
      END-OF-DEFINITION.
      k_fieldcat 'MATNR' '' 'MATERIAL No' 18 .
      k_fieldcat 'SPRAS' '' 'Language'    02 .
      k_fieldcat 'MAKTX' '' 'Description' 40 .
      k_fieldcat 'LABEL1' '' 'LABEL1'     12 .
      k_fieldcat 'QTY1' '' 'QTY1' 12 .
      k_fieldcat 'LABEL2' '' 'LABEL2' 12 .
      k_fieldcat 'QTY2' '' 'QTY2' 12 .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              i_callback_program      = sy-repid
              is_layout               = itlayout
           i_callback_pf_status_set = 'PF_STATUS'
              i_callback_user_command =  'LIST2'
              i_callback_top_of_page  = 'TOP'
              it_fieldcat             = itfieldcat1[]
              i_save                  = 'X'
         is_variant              = ITVARIANT
              it_events               = itevent[]
            is_print                = itprintparams
              it_sort                 = itsort[]
            TABLES
              t_outtab                = imakt
              EXCEPTIONS
              program_error           = 1
              OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR:itfieldcat1,itfieldcat.
    ENDFORM.                                                    "list1
    *&      Form  list2
          text
         -->R_UCOMM    text
         -->RS_SELFIELDtext
    FORM list2 USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
        IF rs_selfield-fieldname = 'QTY1'.
        LOOP AT IMAKT.
        <b>CONCATENATE file n1 '.PJ' INTO dsn.</b>
       <b> PERFORM DSN.</b>  
       CLEAR DSN.
        N1 = N1 + 1.
        ENDLOOP.
        ENDIF.
    ENDCASE.
    ENDFORM.                                                    "list2
    *&      Form  top
          text
    FORM top.
      DATA:title(70) TYPE c.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
              i_list_type           = 0
           IMPORTING
              et_events             = itevent
    EXCEPTIONS
      LIST_TYPE_WRONG       = 1
      OTHERS                = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      title = 'LABEL'.
      walistheader-typ = 'H'.
      walistheader-info = title.
      APPEND walistheader TO itlistheader.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary      = itlistheader
        I_LOGO                   = ''.
        I_END_OF_LIST_GRID       =
      CLEAR itlistheader.
    ENDFORM.                    "TOP
    *&      Form  DSN
          text
    -->  p1        text
    <--  p2        text
    <b>form DSN .</b>
    OPEN DATASET dsn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc <> 0.
    <b>LEAVE TO LIST-PROCESSING</b>
    <b>WRITE:/ 'FILE COULD NOT BE OPENED'.</b>
    EXIT.
    ENDIF.
    MOVE-CORRESPONDING IMAKT TO ITFINAL.
    APPEND ITFINAL.
    TRANSFER 'MDA.LBL' TO dsn.
    TRANSFER '1' TO dsn.
    TRANSFER: ITFINAL-MATNR TO DSN,
              ITFINAL-SPRAS TO DSN,
              ITFINAL-MAKTX TO DSN,
              ITFINAL-LABEL1 TO DSN,
              ITFINAL-QTY1 TO DSN,
              ITFINAL-LABEL2 TO DSN,
              ITFINAL-QTY2 TO DSN.
    <b>if sy-subrc <> 0.</b>
    write:/ 'Check your code'.
    endif.
    CLOSE DATASET DSN.
    ENDFORM.

    Hi Kiran,
    To my understanding your file is not being created cause you have not passed a location for your file to be put. Refer to my below code you see how its done.
    If you need more info let me know.
    TYPES DECLARATIONS                                                   *
    *Data type for Accounting Document Header Table
    TYPES: BEGIN OF gt_bkpf,
             bukrs TYPE bkpf-bukrs,      "Company Code
             belnr TYPE bkpf-belnr,      "Accounting Document Number
             gjahr TYPE bkpf-gjahr,      "Fiscal Year
             budat TYPE bkpf-budat,      "Posting Date
           END OF gt_bkpf.
    *Data type for Accounting Document Segment Table
    TYPES: BEGIN OF gt_bseg,
             bukrs TYPE bkpf-bukrs,        "Company Code
             belnr TYPE bkpf-belnr,        "Accounting Document Number
             gjahr TYPE bkpf-gjahr,        "Fiscal Year
             buzei TYPE bseg-buzei  ,      "Line Item
             shkzg TYPE bseg-shkzg  ,      "Debit/Credit Indicator
             wrbtr TYPE bseg-wrbtr  ,      "Amount in document currency
             kostl TYPE bseg-kostl  ,      "Cost Center
             aufnr TYPE bseg-aufnr  ,      "Project / Order Number
             hkont TYPE bseg-hkont  ,      "General Ledger Account Key
             prctr TYPE bseg-prctr  ,      "Profit Center
             segment  TYPE bseg-segment,      "Segment
             END OF gt_bseg.
    *Data type for Posting Summary Table of given file format
    TYPES: BEGIN OF gt_posting_summary,
             effective_date(10)  TYPE c,       "Date of last tuesday
             company_code(4)     TYPE c,       "Company Code
             gl_key(6)           TYPE c,       "General Ledger Account Key
             cost_centre(10)     TYPE c,       "Cost Center
             profit_centre(10)   TYPE c,       "Profit Center
             project(12)         TYPE c,       "Order Number
             segment(10)         TYPE c,       "Segment for Segmental Reporting
             amount(16)          TYPE c,       "Amount with minor denomination & debit/credit indicator
           END OF gt_posting_summary.
    INTERNAL TABLE DECLARATIONS                                          *
    DATA:
    *Internal table for Accounting Document Header Table
    gi_bkpf              TYPE STANDARD TABLE OF gt_bkpf,
    *Internal table for Accounting Document Segment Table
    gi_bseg              TYPE STANDARD TABLE OF gt_bseg,
    *Internal table for Posting Summary Table of given file format
    gi_posting_summary   TYPE STANDARD TABLE OF gt_posting_summary.
    RANGES DECLARATIONS                                                  *
    DATA:
    *Building ranges table for last saturday to current date
    gr_date  TYPE RANGE OF sy-datum.
    WORK AREA DECLARATIONS                                               *
    DATA:
    *Work area for Accounting Document Segment Table
    gwa_bseg              TYPE gt_bseg,
    *Work area for Accounting Document Segment Table
    gwa_bkpf              TYPE gt_bkpf,
    *Work area for Posting Summary Table of given file format
    gwa_posting_summary   TYPE gt_posting_summary,
    *Work area for ranges table for last saturday to current date
    gwa_date              LIKE LINE  OF gr_date.
    GLOBAL VARIABLE DECLARATIONS                                         *
    DATA: gv_to_date            TYPE sy-datum,
          gv_from_date          TYPE sy-datum,
          gv_effective_date(10) TYPE c,
          gv_posting_amount(16) TYPE c,
          gv_file_name          TYPE string,
          gv_server_file_name   TYPE fileextern,
          gv_suspense_accnt     TYPE hkont,
          gv_amount             TYPE wrbtr.
    GLOBAL CONSTANT DECLARATIONS                                         *
    DATA: gc_x                    TYPE c                     VALUE 'X',
          gc_s                    TYPE bseg-shkzg            VALUE 'S',
          gc_h                    TYPE bseg-shkzg            VALUE 'H',
          gc_i                    TYPE tvarv-sign            VALUE 'I',
          gc_bt                   TYPE tvarv-opti            VALUE 'BT',
          gc_ys                   TYPE bkpf-blart            VALUE 'YS',
          gc_zfii0431             TYPE filepath-pathintern   VALUE 'ZFII0431',
          gc_debit                TYPE c                     VALUE '+',
          gc_credit               TYPE c                     VALUE '-',
          gc_dot                  TYPE c                     VALUE '.',
          gc_suspense_key         TYPE zglkey                VALUE 'SUSPENSE_GL_ACCOUNT'.
       Selection Screen                                                 *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECTION-SCREEN SKIP 1.
    *Accounting Document type for eSFA postings
    PARAMETERS       :  p_ys             TYPE bkpf-blart DEFAULT gc_ys.
    SELECTION-SCREEN SKIP 1.
    *Logical Path of file to be downloaded on Application Server
    PARAMETERS       :  p_l_path         TYPE filepath-pathintern DEFAULT gc_zfii0431.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    SELECT-OPTIONS  :  s_date FOR sy-datum .
    SELECTION-SCREEN END OF BLOCK b2.
    ON LOAD EVENT         - Occurs only once, when the program is loaded *
    LOAD-OF-PROGRAM.
    ************************MAIN PROGRAM************************
    START-OF-SELECTION            - start of database access             *
    START-OF-SELECTION.
    Clear all global variables
      PERFORM clear_memory.
    Routine for calulating date of Last Saturday and Current Tuesday
      PERFORM calculate_posting_dates.
    Routine to select posted G/L records from database
      PERFORM posting_record_selection.
    Routine to compile posting summary table
      PERFORM build_posting_summary.
    Routine to make filename as eSFA_GL_CandC_YYYYMMDD.txt
      PERFORM build_file_name.
    Routine for compile physical path of file on Appln. Server
    from logical path and desired filename.
      PERFORM get_physical_path USING  p_l_path
                                       gv_file_name
                                       gc_x
                             CHANGING  gv_server_file_name.
    Routine to download file on application server
      PERFORM download_on_application_server.
    **************************INCLUDES***************************
      INCLUDE zfi_get_physical_path.
      INCLUDE zfi_file_status_change.
    *************************SUBROUTINES*************************
    *&     Form  calculate_posting_dates
         Routine for calulating date of Last Saturday and Current Tuesday
    FORM calculate_posting_dates .
      DATA: lv_monday    TYPE sy-datum.
    *Get the first day of the week.
      CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
        EXPORTING
          date_in  = sy-datum
        IMPORTING
          date_out = lv_monday.
    *Calculate the  to date (saturday)
      gv_to_date   =  lv_monday - 2.
    *Calculate the from date (sunday)
      gv_from_date =  lv_monday - 8.
      IF s_date-low IS NOT INITIAL.
        gv_from_date = s_date-low.
      ENDIF.
      IF s_date-high IS NOT INITIAL.
        gv_to_date = s_date-high.
      ENDIF.
    ENDFORM.                    " calculate_posting_dates
    *&      Form  build_posting_summary
          Routine for processing posting summary data table & compile
          in given output file table
    FORM build_posting_summary .
      DATA : lv_kostl      TYPE kostl,
             lv_amount     TYPE wrbtr,
             lv_amount_str TYPE wrbtr.
      DATA : li_posting_summary  TYPE TABLE OF gt_posting_summary.
      DATA : lwa_posting_summary TYPE gt_posting_summary.
      LOOP AT gi_bseg INTO gwa_bseg.
        READ TABLE gi_bkpf INTO gwa_bkpf
             WITH KEY bukrs = gwa_bseg-bukrs
                      belnr = gwa_bseg-belnr
                      gjahr = gwa_bseg-gjahr.
      Routine to calcualte effective date in format YYYY-MM-DD
        PERFORM calculate_effective_date.
        gwa_posting_summary-effective_date =  gv_effective_date.
        gwa_posting_summary-company_code   =  gwa_bseg-bukrs.
        gwa_posting_summary-gl_key         =  gwa_bseg-hkont+4(6).
        gwa_posting_summary-cost_centre    =  gwa_bseg-kostl.
        gwa_posting_summary-profit_centre  =  gwa_bseg-prctr.
        gwa_posting_summary-project        =  gwa_bseg-aufnr.
        gwa_posting_summary-segment        =  gwa_bseg-segment.
      Remove the derived fields created in SAP while posting
        IF gwa_bseg-kostl IS NOT INITIAL OR
           gwa_bseg-aufnr IS NOT INITIAL.
          CLEAR: gwa_posting_summary-profit_centre,
                 gwa_posting_summary-segment.
        ENDIF.
        IF gwa_bseg-aufnr IS NOT INITIAL.
      Substitution for internal order to costcenter for document type 'YS'
          SELECT SINGLE cost_centre
                   INTO lv_kostl
                   FROM ztfi_sub_costctr
                  WHERE internal_order = gwa_bseg-aufnr.
          IF sy-subrc = 0.
            gwa_posting_summary-cost_centre = lv_kostl.
            CLEAR gwa_posting_summary-project.
          ENDIF.
        ENDIF.
        IF gwa_bseg-shkzg = gc_h.
          gwa_bseg-wrbtr = gwa_bseg-wrbtr * -1.
          gwa_posting_summary-amount = gwa_bseg-wrbtr.
        ELSE.
          gwa_posting_summary-amount = gwa_bseg-wrbtr.
        ENDIF.
        APPEND gwa_posting_summary TO gi_posting_summary.
        CLEAR gwa_posting_summary.
        CLEAR gwa_bseg.
      ENDLOOP.        "LOOP AT gi_bseg INTO gwa_bseg
    Sort to find the summary
      SORT gi_posting_summary BY company_code
                                 gl_key
                                 cost_centre
                                 profit_centre
                                 project
                                 segment.
    *Summarise amount for unique entries
      LOOP AT gi_posting_summary INTO gwa_posting_summary.
        lv_amount_str = gwa_posting_summary-amount.
        lv_amount = lv_amount + lv_amount_str.
        AT END OF segment.
          gv_amount = lv_amount.
          PERFORM calculate_amount.
          gwa_posting_summary-amount = gv_posting_amount.
          APPEND gwa_posting_summary TO li_posting_summary.
          CLEAR lv_amount.
        ENDAT.
      ENDLOOP.
    *Copy the summarised table back to summary table
      gi_posting_summary = li_posting_summary.
    ENDFORM.                    " build_posting_summary
    *&      Form  calculate_effective_date
          Routine to calcualte effective date in format YYYY-MM-DD
    FORM calculate_effective_date .
      DATA: lv_date(8)            TYPE c,
            lv_yyyy(4)            TYPE c,
            lv_mm(2)              TYPE c,
            lv_dd(2)              TYPE c,
            lv_effective_date(10) TYPE c.
      DATA: lc_dash               TYPE c VALUE '-'.
      lv_date = gv_to_date.
      lv_yyyy = lv_date+0(4).
      lv_mm   = lv_date+4(2).
      lv_dd   = lv_date+6(2).
      CONCATENATE lv_yyyy
                  lc_dash
                  lv_mm
                  lc_dash
                  lv_dd
             INTO lv_effective_date.
      gv_effective_date = lv_effective_date.
    ENDFORM.                    " calculate_effective_date
    *&      Form  posting_record_selection
          Routine to select posted G/L records from database
    FORM posting_record_selection .
      gwa_date-sign   = gc_i.
      gwa_date-option = gc_bt.
      gwa_date-low    = gv_from_date.
      gwa_date-high   = gv_to_date.
      APPEND gwa_date TO gr_date.
    *Get the suspese GL accout number from ZTFI_SIXPARTKEY table.
      SELECT SINGLE gl_account
              FROM ztfi_sixpartkey
              INTO gv_suspense_accnt
            WHERE sixpartkey = gc_suspense_key .
      IF sy-subrc IS INITIAL.
    Selection of records (other than suspended acc. no. 999999) posted
    between last saturday and current tuesday where document type is 'YS'
        SELECT bukrs       "Company Code
               belnr       "Accounting Document Number
               gjahr       "Fiscal Year
               budat       "Posting Date
          FROM bkpf
          INTO TABLE gi_bkpf
          WHERE blart EQ p_ys
            AND budat IN gr_date.           "Change - MV - 16.04.2007 - FCDK902208
           AND cpudt IN gr_date.
        IF sy-subrc IS NOT INITIAL.
          WRITE / 'No records for current posting period, file not created.'(m03).
        ELSEIF sy-subrc IS INITIAL.
          READ TABLE gi_bkpf INTO gwa_bkpf INDEX 1.
          IF sy-subrc = 0.
            PERFORM calculate_effective_date.
          ENDIF.
      Selection of details of all records selected in above table
          SELECT bukrs          "Company Code
                 belnr          "Document Number
                 gjahr          "fiscal year
                 buzei          "Line Item
                 shkzg          "Debit/Credit Indicator
                 wrbtr          "Amount in document currency
                 kostl          "Cost Center
                 aufnr          "Project / Order Number
                 hkont          "General Ledger Account Key
                 prctr          "Profit Center
                 segment        "Segment
            FROM bseg
            INTO TABLE gi_bseg
            FOR ALL ENTRIES IN gi_bkpf
            WHERE bukrs = gi_bkpf-bukrs
              AND belnr = gi_bkpf-belnr
              AND gjahr = gi_bkpf-gjahr
              AND hkont <> gv_suspense_accnt.
          IF sy-subrc IS NOT INITIAL.
            WRITE / 'No records Found, file not created.'(002).
          ENDIF.
        ENDIF.
      ELSE.
        WRITE / 'Suspense GL account is not maintained in sixpart key look up table'(001).
      ENDIF.
    ENDFORM.                    " posting_record_selection
    *&      Form  calculate_amount
          Routine to concancate amouunt and debit/credit indicator
    FORM calculate_amount .
      DATA: lv_amount(15)   TYPE c,
            lv_amount_1(12)  TYPE c,
            lv_amount_2(2)  TYPE c,
            lv_debit_credit TYPE c.
      IF gv_amount <= 0.
        lv_debit_credit = gc_credit.
        gv_amount = gv_amount * -1.
      ELSE.
        lv_debit_credit = gc_debit.
      ENDIF.
      lv_amount  = gv_amount.
      SPLIT lv_amount AT gc_dot
                    INTO lv_amount_1
                         lv_amount_2.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = lv_amount_1
        IMPORTING
          output = lv_amount_1.
      CONCATENATE lv_amount_1
                  lv_amount_2
             INTO lv_amount
      SEPARATED BY gc_dot.
      CONCATENATE  lv_debit_credit lv_amount INTO gv_posting_amount.
    ENDFORM.                    " calculate_amount
    *&      Form  build_file_name
          Routine to make filename as eSFA_GL_CandC_YYYYMMDD.txt
    FORM build_file_name .
      DATA: lv_date(8)       TYPE c,
            lv_file_name     TYPE string.
      DATA: lc_file_prefix(14) TYPE c VALUE 'eSFA_GL_CandC_',
            lc_file_suffix(4)  TYPE c VALUE '.txt'.
      lv_date = gv_to_date.
      CONCATENATE lc_file_prefix lv_date lc_file_suffix INTO lv_file_name.
      gv_file_name = lv_file_name.
    ENDFORM.                    " build_file_name
    *&      Form  download_on_application_server
          Routine to download file on application server
    FORM download_on_application_server.
      DATA : lv_command   TYPE string,
             lv_lines     TYPE i.
      lv_command   = 'ZFII0431'.
    File should be downloaded only if it is not empty
      IF gi_bseg IS NOT INITIAL.
    Open file for output in text mode
        OPEN DATASET gv_server_file_name FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc IS NOT INITIAL.
          WRITE / 'File could not be open.'(m01).
          EXIT.
        ENDIF.        "IF sy-subrc IS NOT INITIAL
        DESCRIBE TABLE gi_posting_summary LINES lv_lines.
        LOOP AT gi_posting_summary INTO gwa_posting_summary.
          IF sy-tabix <> lv_lines.
          Transfer data to application server
            TRANSFER gwa_posting_summary TO gv_server_file_name.
          ELSE.
          Transfer data to application server with out end of line
            TRANSFER gwa_posting_summary TO gv_server_file_name NO END OF LINE.
          ENDIF.
        ENDLOOP. " LOOP AT gi_posting_summary INTO gwa_posting_summary
    Close file for output in text mode
        CLOSE DATASET gv_server_file_name.
        IF sy-subrc IS NOT INITIAL.
          WRITE / 'File could not be close.'(m02).
          EXIT.
        ELSEIF sy-subrc IS INITIAL.
          WRITE : / 'File Name:', gv_file_name .
          WRITE : / 'File Downloaded to Application Server successfully.'(m04).
        Call the OS command to run Shell script.
          PERFORM change_file_status USING lv_command.
        ENDIF.
      ENDIF.
    ENDFORM.                    " download_on_application_server
    *&      Form  clear_memory
          Clear all global variables
    FORM clear_memory .
      REFRESH: gi_bkpf           ,
               gi_bseg           ,
               gi_posting_summary.
      REFRESH: gr_date.
      CLEAR: gwa_bseg           ,
             gwa_posting_summary,
             gwa_date           .
      CLEAR: gv_from_date       ,
             gv_to_date         ,
             gv_effective_date  ,
             gv_posting_amount  ,
             gv_file_name       ,
             gv_server_file_name.
    ENDFORM.                    " clear_memory
    ***INCLUDE ZFI_GET_PHYSICAL_PATH .
    *&      Form  get_physical_path
          Routine for compile physical path of file on Appln. Server
          from logical path and desired filename.
         -->P_P_L_PATH  text
         -->P_GV_FILE_NAME  text
         -->P_GC_OK  text
         <--P_GV_SERVER_FILE_NAME  text
    FORM get_physical_path  USING    p_p_l_path      TYPE any
                                     p_gv_file_name  TYPE any
                                     p_gc_ok         TYPE any
                            CHANGING p_gv_server_file_name    TYPE any.
      CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
        EXPORTING
          client                     = sy-mandt
          logical_path               = p_p_l_path
          operating_system           = sy-opsys
          file_name                  = p_gv_file_name
          eleminate_blanks           = p_gc_ok
        IMPORTING
          file_name_with_path        = p_gv_server_file_name
        EXCEPTIONS
          path_not_found             = 1
          missing_parameter          = 2
          operating_system_not_found = 3
          file_system_not_found      = 4
          OTHERS                     = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " get_physical_path

  • Open dataset is not working in background in PRD

    Dear All,
    Open dataset is not working in background in PRD .
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Whike running in foregroundits working dev as well as prd.
    but when i am running in background  its giving error like file not found .
    but al11 is working (i mean my file path is working ).
    Thanks N Regards,
    Srinivasa Reddy

    your authority team shall check the batch user of that abap!
    Could you please tell us the detailed error message?
    grx
    Andreas

  • OPEN DATASET FOR OUTPUT IN LEGACY TEXT MODE not working!

    Hi All,
    I need your expertise to help me with my problem.
    The program passed through the code OPEN DATASET ... FOR OUTPUT IN LEGACY TEXT MODE. Then it gave an error message "Error Accessing File /home/sap/sample.txt".
    I would like to know what are the causes of this error. Please explain to me further why the program gives an error message specified above because I'm not familiar in OPEN DATASET.
    Please reply asap since the issue need to be resolved immediately.
    Thanks in advance,
    Carina

    Hi Carmey,
    The Problem will u need toi get Open Dataset Authorisation from ur Basis Team from the Specified Path.
    Regards,
    Morris Bond.
    Reward Points if Helpful.

  • Open dataset input error

    Hi guys
    i am trying to open more than 100 files  using open dataset input but i am getting below error
      program is abending reading after 50files..
    Program failing in  open data set error  can u help me please?
    143
    144 * Each file is getting into an internal table
    >>>   OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    146   IF sy-subrc <> 0.
    147     CONTINUE.
    148   ELSE.
    149     DO.
    150       READ DATASET w_file INTO s700_delta.
    What command I should give here
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_TOO_MANY_FILES', was not
         caught and
        therefore caused a runtime error.
        The reason for the exception is:
        The maximum number of open files (100) has been exceeded.
    please let me know what should makes changes to avoid this abend?

    Standard programming problem, should be rather trivial to find with a quick search. Basically there's always a limit of how many open file handles you can have at a time.
    Please try to consult the ABAP help next time before posting (or search on SCN). A quick check for [open dataset|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET.htm] would've told you the following:
    You can open up to 100 files per internal session. The actual maximum number of simultaneously open files may be less, depending on the platform.
    Most likely you actually don't want to have all those files open at the same time and you simply forgot to use a [close dataset|http://help.sap.com/abapdocu_70/en/ABAPCLOSE_DATASET.htm] after reading each file.

  • File not found in shared folder when transferred through Open Dataset

    Dear Experts,
    I am transferring a file to a shared folder using open dataset .
    The sy-subrc value returns as 0 . But i am not able to find the file in the destined path.
    But when i try to retrieve the file from the same path through CG3Y to my local PC ,  i am able to retrieve the file.
    Could you please throw some light into this as to why this is happening.
    With Regards,
    Syed Ibrahim G

    Hi venkat,
    Sorry for the delayed response . The Authority check FM also returns the sy-subrc value 0 .
    But still not able to find the File . I am Trying to paste the data through FTP_R3_To_SERVER . But it is not supporting Non-English Characters. Is there any way to paste the file through FTP ( with Non English Characters ).
    {code}
    call function 'FTP_CONNECT'
       exporting
         user            = user
         password        = pwd
         host            = host
         rfc_destination = dest
       importing
         handle          = hdl.
    if sy-subrc = 0.
       CALL FUNCTION 'FTP_R3_TO_SERVER'
         EXPORTING
           handle               = hdl
           fname                = FNAME
    *      BLOB_LENGTH          =
          character_mode       = 'X'
    TABLES
    *  BLOB                 =
          text                 = it_data1
        EXCEPTIONS
          tcpip_error          = 1
          command_error        = 2
          data_error           = 3
          OTHERS               = 4.
    endif.
    {code}
    With Regards,
    Syed Ibrahim G

  • I don't know if this is the right section but I experience the following issue with Adobe Acrobat Pro XI installed on Windows 8.1. When I start Acrobat the related window opens normally but, after some scroll up and down along the document, it blocks, Acr

    I don't know if this is the right section but I experience the following issue with Adobe Acrobat Pro XI installed on Windows 8.1. When I start Acrobat the related window opens normally but, after some scroll up and down along the document, it blocks, Acrobat doesn't respond to any command I can give and, in place of the pointer arrow, a vertical bar, as the one of the text editor appears. The only way I can stop Acrobat is by means of the task manager. I tried to de-install and the re- install Acrobat but the behaviour is always the same. What can I do??

    Have you opened Acrobat and gone to Help>Updates to get an updated install?

  • Unable to create a file in Application Server using OPEN DATASET stattement.

    I am unable to create a file in Application Server using the following statement.
    OPEN DATASET filename FOR OUTPUT
    IN TEXT MODE ENCODING DEFAULT
    MESSAGE msg.
    The message I'm getting is "Permission Denied". I have checked authorisation using SU53 which says "The last authorization check was successful". Please help.

    You can use following code to capture the error.
    TRY.
          OPEN DATASET filename FOR OUTPUT IN BINARY MODE MESSAGE V_MSG.
          CATCH CX_ROOT
          INTO EXCEPTION.
          CALL METHOD O_EXCEPTION ->IF_MESSAGE~GET_TEXT
            RECEIVING
            RESULT = V_MSG.
          MESSAGE v_msg
          TYPE 'E'.
    ENDTRY.
    You can capture error in v_msg.
    Following are the exceptions for the same:
    Exceptions
    Catchable Exceptions
    CX_SY_FILE_OPEN
    Cause: The file is already open.
    Runtime Error: DATASET_REOPEN
      CX_SY_CODEPAGE_CONVERTER_INIT   
    Cause: The desired conversion is not supported. (Due to specification of invalid code page or of language not supported in the conversion, with SET LOCALE LANGUAGE.)
    Runtime Error: CONVT_CODEPAGE_INIT
    CX_SY_CONVERSION_CODEPAGE
    Cause: Internal error in the conversion.
    Runtime Error: CONVT_CODEPAGE
    CX_SY_FILE_AUTHORITY
    Cause: No authorization for access to file
    Runtime Error: OPEN_DATASET_NO_AUTHORITY
    Cause: Authorization for access to this file is missing in OPEN DATASET with addition FILTER.
    Runtime Error: OPEN_PIPE_NO_AUTHORITY
      CX_SY_PIPES_NOT_SUPPORTED   
    Cause: The operating system does not support pipes.
    Runtime Error: DATASET_NO_PIPE
    CX_SY_TOO_MANY_FILES
    Cause: Maximum number of open files exceeded.
    Runtime Error: DATASET_TOO_MANY_FILES   Non-Catchable Exceptions   
    Cause: An attempt was made to open a pipe that is already open.
    Runtime Error: DATASET_PIPE_POSITION
    Hope that will help you.
    Please reward if useful.

  • Runtime Error in OPEN DATASET

    Dear All,
    I am trying to upload a text file in application server. But I am getting the run time error which says-
    " For the statement
        "TRANSFER f TO ..."
    only character-type data objects are supported at the argument position
    "f".
    In this case. the operand "f" has the non-character-type "u". The
    current program is a Unicode program. In the Unicode context, the type
    'X' or structures containing not only character-type components are
    regarded as non-character-type."
    If I remove the quantity fields then the error does not happen. But I have to take quantity fields also. Plz tell me what to do. My code is,
    DATA FILENAME like rlgrap-filename VALUE 'MIGO_VALUE.txt'.
    TABLES VBAK.
    DATA D_MSG_TEXT(50).
    DATA : BEGIN OF it_mseg OCCURS 0,
           mblnr TYPE mseg-mblnr,
           mjahr TYPE mseg-mjahr,
           matnr TYPE mseg-matnr,
    *       erfmg TYPE mseg-erfmg,
           werks TYPE mseg-werks,
           lgort TYPE mseg-lgort,
           END OF it_mseg.
    DATA wa LIKE it_mseg.
    SELECT mblnr mjahr matnr werks lgort FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_mseg WHERE bwart = '101'.
    SORT it_mseg BY mblnr.
    OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
                          MESSAGE D_MSG_TEXT.
    if sy-subrc eq 0.
    message 'File created succesfully in SAP System'(002) type 'S'.
    endif.
    IF SY-SUBRC NE 0.
      WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
      EXIT.
    ENDIF.
    * Transferring Data
    LOOP AT it_mseg INTO wa.
    TRANSFER wa to filename.
    ENDLOOP.
    * Closing the File
    CLOSE DATASET FILENAME.
    Thanks,
    Tripod.

    Thanks Sri for your help. I tried to apply the logic, but the  error i am getting here is -
    "IT_MSEG-ERFMG" must be a character-like data object (data type C, N,D, T, or STRING) STRING).
    Same case here, if I remove ERFMG field, i do not get such error.
    data ld_string type string.
    LOOP AT it_mseg INTO wa.
      CONCATENATE it_mseg-mblnr it_mseg-mjahr it_mseg-matnr it_mseg-erfmg it_mseg-werks it_mseg-lgort INTO ld_string.
         endloop.
    With regards,
    Tripod.

  • Open Dataset for XML not reading the XML file, Returning Code 8.

    Dear all,
    Im trying to open an XML file using Open Dataset, since i have to execute this report in background and GUI_upload doesnt work in background.
    The XML file is available in my C:\, say, C:\xmlfile.xml.
    But  the open dataset is not reading any value into the g_xml_line . it is returning sy-subrc = 8.
    Below is my code for that, can anybody help me out to resolve.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_input.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc ne 0.
        WRITE:/ 'invalid file'.
      else.
      DO.
        READ DATASET lv_filename INTO  g_xml_line.
        IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_filename.
       ENDIF.
    TYPES: BEGIN OF t_xml_line,
            data(256) TYPE x,
          END OF t_xml_line.
    DATA: g_xml_table       TYPE TABLE OF t_xml_line,
          g_xml_line        TYPE t_xml_line,
          g_xml_table_size  TYPE i.
    GET REFERENCE OF gt_person INTO gs_result_xml-value.
      gs_result_xml-name = 'IPIX'.
      APPEND gs_result_xml TO gt_result_xml.
    Perform the XSLT stylesheet
      TRY.
          CALL TRANSFORMATION zaum_manh_sync_rpt
          SOURCE XML g_xml_table
          RESULT (gt_result_xml).
        CATCH cx_root INTO gs_rif_ex.
          gs_var_text = gs_rif_ex->get_text( ).
          MESSAGE gs_var_text TYPE 'E'.
      ENDTRY.
    Kindly suggest me a solution. Points assured
    regs,
    raja

    After saving the file , below is the code i wrote, but it gives a runtime error with message
    No roll storage space of length 3788808 available for internal storage.
    ***Coding****
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/DEV/SYS/global/XMLABAP2.XML'.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_file.
      DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_file
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    */usr/sap/DEV/SYS/global/substanc
      lv_filename = l_fname.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        WRITE:/ 'invalid file'.
      ELSE.
        DO.
          READ DATASET lv_filename INTO  g_xml_line.
       IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
       ELSE.
         EXIT.
       ENDIF.
        ENDDO.
        CLOSE DATASET lv_filename.
      ENDIF.

Maybe you are looking for

  • 'if condition' in EL Expression in JHeadStart

    Hi, I am developing an application using Oracle JHeadstart 10.1.3 Preview Version 10.1.3.0.83 How I can put an 'if condition' in the EL Expression? I can put an expression which will return true or false. But how I can put an 'if condition' that will

  • Error while creating logical port in SOAMANAGER and testing it

    Hi, When I enter WSDL Access user and password in cnfiguration tab( SOAMANAGER),Im getting error as, Error: Error in WSDL access: Exception occurred in communication framework:Error in HTTP Framework:401Unauthorizedhttp://cryo-cell.net/Inventory/Inve

  • CS5 Unable to print to PDF ... export to PDF works fine??

    I can't print to PDF without going to PS first. Printing to the PDF is necessary for print booklet and printing separations, among other things. It will not print directlly to the PDF without first producing a PS file. I then have to convert the PS f

  • Trouble with with CS4 "open with" and FOLDER OPTIONS FILE TYPES

    I just installed CS4 MC and when I right click to use "OPEN WITH" CS4 is not listed. I use BROWSE and point to photoshop.exe in which is in the adobe/adobe photoshop cs4 folder as it should be. I click the .exe file then click OK and it takes me back

  • Clean the acrhivelog that i don't need

    i wil make a script to clean the archive log like; SELECT r.CONSUMER_NAME, r.NAME, r.FIRST_SCN, r.NEXT_SCN, r.PURGEABLE FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c WHERE r.CONSUMER_NAME = c.CAPTURE_NAME and r.purgeable='YES'; is there maby anot