Data transfer error(application server)

Hi Gurus,
While uploading data into application server, I have an issue. I am having the data in internal table but I am unable to send all the data into application server.
(open dataset file for output )
TRANSFER l_h_tbl_file  TO fu_wk_get_file.
Data in internal table:
f1 f2 f3 f4 f5
1  2   -  4  5 
after update to application server:
f1 f2 f3 f4 f5
1  2   -  -  - 
I am getting 2 fields only. if any blank filed(f3) exist between those fields remaining fields also getting blank.
How can proceed further?
Regards,
Dhanu

Try this..instead of moving field by field into the file 1st convert all he fields to a character stream..and then move that steam to file. Ex:
loop at internal table into l_h_tbl_file.
concatenate l_h_tbl_file-f1 l_h_tbl_file-f2 l_h_tbl_file-f3
l_h_tbl_file-f4 l_h_tbl_file-f5 into g_string.
TRANSFER g_string TO fu_wk_get_file.
endloop.

Similar Messages

  • Data Transfer to Application server in Background

    Hi,
    I tried running a report in background.If I choose "print immediately" option, the required file is written to the application server.But on scheduling the date and time of the job(the print immediate option is not checked), the file is not written to the server.
    Please let me know what could be the problem and how to solve it.
    Thanks and Regards,
    Chaarulatha.

    Hi don't understand the question:
    "print immediately" just means that a print order is created for the spool list created.
    This is completelöy independent of the writing of a file. Files are written using open dataset and transfer statements.
    Is it this what you want?
    Regards,
    Clemens

  • Dump in data transfer to application server

    Hi all,
    We are using the FM AUTHORITY_CHECK_DATASET before the command OPEN Dataset to transfer a file to the application server.
    The sy-subrc for the FM comes out to be 0, but the sy-subrc  for the open dataset command = 8 (on Checking in the debug mode).
    The code snippet is as follows
      v_path1 = v_bkpf.
      CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
           EXPORTING
                program          = 'ZZRFFI058_GL_ACCOUNT_MAPPING'
                activity         = 'WRITE'
                filename         = v_path1
           EXCEPTIONS
                no_authority     = 1
                activity_unknown = 2
                OTHERS           = 3.
      IF sy-subrc <> 0.
        MESSAGE e195(zzfn) WITH
              'No authorisation to write file on application server'
               v_path1.
       WRITE:/ 'File:', v_path1, ' not created'.
        STOP.
      ENDIF.
      OPEN DATASET v_bkpf FOR OUTPUT.                           "DEL ACC012
      TRANSFER i_bkpf_w TO v_bkpf LENGTH v_len.
    So we have a dump at the TRANSFER command.
    Not sure how the FM is successful and OPEN DATASET fails   
    Pls post your ideas.
    Thanks ,
    Stock.

    hi please make sure that the strcuture which ur passing into the application server is entirely in character format
    for example:
    <b>
    data: begin of itab occurs 0,
    field1 like mara-matnr,
    field2 like mara-menge,
    end of itab.
    loop at itab.
    transfer itab to app_file.
    endloop.
    </b>
    This will for a dump as the structure isnt in character format. all the fields should be of types C, N, D, T, STRING
    <b>
    in this case declare another itab with character fields of same field length
    begin of itab1.
    field1(18),
    field2(17),
    end of itab1.
    loop at itab.
    itab1-field1 = itab-field1.
    itab1-field2 = itab-field2.
    transfer itab1 to app_file
    endloop.
    award points if found helpful</b>

  • Data transfer to application server

    Hi,
    By using TRANSFER statement we can transfer the data record to the application server.
    my question here is .. Can we  transfer set of records as a whole (at once) to application server...?
    if yes.. please let me know the procedure.
    Thanks in advance..
    Ramana

    Hi Janaki,
    I understand your question that way that you want to avoid multiple TRANSFER commands but transfer all data together.
    This is possible by first concatenating all records to a string and then transfer it. For table structured with all CHAR components  it may look like this:
    DATA:
      lv_all  TYPE STRING.
    FIELD-SYMBOLS:
      <field> TYPE ANY,
      <rec>   TYPE ANY.
    LOOP AT itab ASSIGNING <rec>.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE <rec> to <field>.
        IF SY-SUBRC <> 0.
        EXIT.u201DDO
        ENDIF.
    * insert a TAB character between compoinents
        CONCATENATE
          <field>
          cl_abap_char_utilities=>horizontal_tab
          TO lv_all.
      ENDDO.
      AT LAST.
        TRANSFER lv_all TO <your file open for output or append>.
      ENDAT.
    * insert a linefeed character after each line of internal table
      CONCATENATE
        lv_all
        cl_abap_char_utilities=>linefeed
        TO lv_all.
    ENDLOOP.
    If you do not want the tab character at the end of each record, you may remove it.
    Regards,
    Clemens

  • Data transfer from application server to sap system in binary mode

    hi friends,
    can any one help me out in
    how to read,open the dataset (syntax) while transfering the file from application server in binary mode ?
    how to move the file to differrent location in the same server?
    regards,
    mohan
    Message was edited by:
            mohan kumard

    HI,
    Syntax for reading the file
    OPEN DATASET file FOR INPUT IN BINARY MODE
    if sy-subrc = 0.
    DO.
          READ DATASET file INTO wa_record.
    ENDDO.
    CLOSE DATASET file.
    endif.
    syntax for writing file.
    OPEN DATASET  file FOR OUTPUT  IN  BINARY MODE .
    if sy-subrc = 0.
    transfer wa_record to file.
    CLOSE DATASET file.
    endif.
    You can also transfer file from application server to presentation server using transaction CG3Y by specifying source path(app ser),destination path(presentation ser) and tranfer format (BIN).
    To copy the file from one location to other location in application server
    use the FM 'ARCHIVFILE_SERVER_TO_SERVER'
    reward points if needful..

  • ABAP Code for Backup the entire table data in the application server

    Hello Friends,
    I have to create the table data Backup and Store the entire table data in the application server and also be able to restore the data back if needed.
    this should be dynamic program for any table based on the table name given on the application server.. I have developed a program for this but its having problems with the Quantity, amount. Its not writing it correctly at the application level.
    ANy Suggestions on this.
    Below is the program for this.
    Thanks,
    Ster.
    * Report  YWMM_TABLE_DUMP                                             *
    REPORT ywmm_table_dump .
    TABLES :
            dd03l.
    * Type spool declaration
    TYPE-POOLS:
            abap, slis.
    DATA: i_table_data1  TYPE REF TO data.
    DATA : it_dd03l LIKE dd03l OCCURS 0 WITH HEADER LINE.
    *DATA : gt_fieldcat TYPE lvc_s_fcat.
    DATA : i_fcat      TYPE STANDARD TABLE OF lvc_s_fcat,
           l_dr_line         TYPE   REF TO data,
           l_v_as4vers       TYPE as4vers.
    FIELD-SYMBOLS: <f_table_data1>     TYPE STANDARD TABLE,
                   <f_wa_table_data1>  TYPE ANY.
    SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    PARAMETERS: rb_copy RADIOBUTTON GROUP map DEFAULT 'X',
                rb_rest RADIOBUTTON GROUP map.
    SELECTION-SCREEN: END   OF BLOCK bl1.
    SELECTION-SCREEN: BEGIN OF BLOCK bl2 WITH FRAME TITLE text-002.
    PARAMETERS: p_table  TYPE tabname OBLIGATORY,
                p_plfld TYPE dd03l-fieldname.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: p_bkfile TYPE localfile OBLIGATORY.
    SELECTION-SCREEN: END   OF BLOCK bl2.
    PERFORM get_data.
    IF rb_copy = 'X'.
      PERFORM backup.
    ELSEIF rb_rest = 'X'.
      PERFORM database_update.
    ENDIF.
    *&      Form  get_data
    FORM get_data.
      CLEAR   i_fcat.
      REFRESH i_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = p_table  " Table Name
           CHANGING
                ct_fieldcat      = i_fcat
           EXCEPTIONS
                OTHERS           = 1.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = i_fcat
      IMPORTING
        ep_table        = i_table_data1.
      IF sy-subrc = 0.
        ASSIGN i_table_data1->* TO <f_table_data1>.
      ELSE.
        WRITE: 'Error creating internal table'.
      ENDIF.
      IF rb_copy = 'X'.
        SELECT  * FROM (p_table) INTO CORRESPONDING FIELDS OF
                  TABLE <f_table_data1> UP TO 20 ROWS.
      ELSEIF rb_rest = 'X'.
        CREATE DATA l_dr_line LIKE LINE OF <f_table_data1>.
        ASSIGN l_dr_line->* TO <f_wa_table_data1>.
    *Get Data from Application Server
    * Opening the dataset P_BKFILE given in the selection screen
        TRANSLATE p_bkfile TO LOWER CASE.
        OPEN DATASET p_bkfile FOR INPUT IN TEXT MODE." ENCODING DEFAULT.
        IF sy-subrc NE 0.
    *    MESSAGE:
        ELSE.
          DO.
    * Reading the file from application server
            READ DATASET p_bkfile INTO <f_wa_table_data1>.
            IF sy-subrc = 0.
              APPEND <f_wa_table_data1> TO <f_table_data1>.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
    * Closing the dataset
          CLOSE DATASET p_bkfile.
        ENDIF.
      ENDIF.
    ENDFORM.                    " get_data
    *&      Form  backup
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM backup.
      TRANSLATE p_bkfile TO LOWER CASE.
      OPEN DATASET p_bkfile FOR OUTPUT IN TEXT MODE.
      IF sy-subrc NE 0.
        WRITE: text-017.
        STOP.
      ELSE.
        LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
          TRANSFER <f_wa_table_data1> TO p_bkfile.
        ENDLOOP.
      ENDIF.
      CLOSE DATASET p_bkfile.
    ENDFORM.                    " backup
    *&      Form  database_update
    FORM database_update.
      DATA : i_mara_u TYPE STANDARD TABLE OF mara WITH HEADER LINE,
             i_ekpo_u TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
             i_eban_u TYPE STANDARD TABLE OF eban WITH HEADER LINE,
             i_resb_u TYPE STANDARD TABLE OF resb WITH HEADER LINE,
             i_plpo_u TYPE STANDARD TABLE OF plpo WITH HEADER LINE,
             i_stpo_u TYPE STANDARD TABLE OF stpo WITH HEADER LINE,
             i_vbap_u TYPE STANDARD TABLE OF vbap WITH HEADER LINE,
             i_vbrp_u TYPE STANDARD TABLE OF vbrp WITH HEADER LINE,
             i_lips_u TYPE STANDARD TABLE OF lips WITH HEADER LINE,
             i_afvc_u TYPE STANDARD TABLE OF afvc WITH HEADER LINE,
             i_asmd_u TYPE STANDARD TABLE OF asmd WITH HEADER LINE,
    *           i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
             i_qmel_u TYPE STANDARD TABLE OF qmel WITH HEADER LINE,
             i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
             i_esll_u TYPE STANDARD TABLE OF esll WITH HEADER LINE,
             i_t165_u  TYPE STANDARD TABLE OF t165 WITH HEADER LINE,
             i_t165e_u TYPE STANDARD TABLE OF t165e WITH HEADER LINE,
             i_twpko_u TYPE STANDARD TABLE OF twpko WITH HEADER LINE,
             i_tpext_u TYPE STANDARD TABLE OF tpext WITH HEADER LINE,
             i_ce4mxpa_u TYPE STANDARD TABLE OF ce4mxpa WITH HEADER LINE,
             i_ce4mxpa_acct_u TYPE STANDARD TABLE OF ce4mxpa_acct WITH
                                                             HEADER LINE,
             i_zaim_u  TYPE STANDARD TABLE OF zaim WITH HEADER LINE,
             i_s012_d TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
             i_s012_i TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
             i_dummy  TYPE STANDARD TABLE OF mara.
      CASE p_table.
        WHEN 'MARA'.
    *     Non-Key
          PERFORM move_to_table USING   <f_table_data1>
                                CHANGING i_mara_u[]
                                         i_mara_u.
          PERFORM update_table USING i_mara_u[].
      ENDCASE.
    ENDFORM.                    " database_update
    *&      Form  move_to_mara
    FORM move_to_table USING    p_tab_from TYPE STANDARD TABLE
                       CHANGING p_tab_to   TYPE STANDARD TABLE
                                p_w_table.
      DATA:  l_wa_fcat TYPE lvc_s_fcat.
      FIELD-SYMBOLS: <f_field_from> TYPE ANY,
                     <f_field_to>   TYPE ANY.
      LOOP AT p_tab_from ASSIGNING <f_wa_table_data1>.
        LOOP AT i_fcat INTO l_wa_fcat.
          ASSIGN COMPONENT l_wa_fcat-fieldname
         OF STRUCTURE <f_wa_table_data1> TO <f_field_from>.
          ASSIGN COMPONENT l_wa_fcat-fieldname
         OF STRUCTURE p_w_table TO <f_field_to>.
          <f_field_to> = <f_field_from>.
        ENDLOOP.
        APPEND p_w_table TO p_tab_to.
      ENDLOOP.
    ENDFORM.                    " move_to_mara
    *&      Form  update_table
    FORM update_table  USING p_table_update TYPE STANDARD TABLE.
      SELECT SINGLE *
        FROM dd03l
       WHERE fieldname = p_plfld
         AND tabname   = p_table
         AND keyflag   <> 'X'
         AND as4local = 'A'
         AND   as4vers = l_v_as4vers
         AND   ( comptype = 'E' OR comptype = space ).
      IF sy-subrc = 0.
    *   Do update
        IF NOT p_table_update IS INITIAL.
          UPDATE (p_table) FROM TABLE p_table_update.
          IF sy-subrc = 0.
            COMMIT WORK.
          ELSE.
            ROLLBACK WORK.
            WRITE: text-003.
            STOP.
          ENDIF.
        ENDIF.
      ELSE.
    *delete and insert.
        IF NOT p_table_update IS INITIAL.
    *      DELETE (p_table).
          IF sy-subrc = 0.
            INSERT (p_table) FROM TABLE p_table_update.
            IF sy-subrc = 0.
              COMMIT WORK.
            ELSE.
              ROLLBACK WORK.
              WRITE: text-018.
              STOP.
            ENDIF.
          ELSE.
            ROLLBACK WORK.
            WRITE: text-018.
            STOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " update_table
    Edited by: Julius Bussche on Jul 18, 2008 1:43 PM
    Please use a meaningfull subject title!

    ARS,
    I am struggling a bit to get this.
    there is a syntax error,
    Field "FIELDS_INT-TYPE" is unknown. It is neither in one of thespecified tables nor defined by a "DATA" statement.     
    Again you have asked to move to a diffrent table. What is that table and how to build it.
        LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
          LOOP AT i_fcat INTO l_fcat.
            IF l_fcat-inttype EQ 'P'.
              ASSIGN COMPONENT l_fcat-fieldname
                  OF STRUCTURE <f_wa_table_data1> TO <f_field>
                  TYPE     fields_int-type
                  DECIMALS fields_int-decimals.
            ELSE.
              ASSIGN COMPONENT l_fcat-fieldname
                  OF STRUCTURE <f_wa_table_data1> TO <f_field>
                  TYPE     fields_int-type.
            ENDIF.
            " Move <f_field> to a new table and use this table for download
          ENDLOOP.
          TRANSFER <f_wa_table_data1> TO p_bkfile.
        ENDLOOP.
    Ster

  • Tranfer data to the application server

    Hi all,
    I have a problem in Tranfering data into the application server  when i do that data is getting trucated.Is there any length restriction ? could anyone tell us the reason why it's happening so...
    OPEN DATASET V_FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF NOT SY-SUBRC IS INITIAL.
        MESSAGE E000 WITH TEXT-026.
        EXIT.
      ENDIF.
    TRANSFER V_LINEOUT TO V_FILENAME length 3000.
    Thanks,
    SriRatna

    what is the length of  V_LINEOUT ?
    If length of V_LINEOUT is more than 3000 data gets truncated.
    dont specify that
    just use
    TRANSFER V_LINEOUT to V_FILE.
    null

  • Not able to Parse XML data in Sun Application Server 8.2

    Iam not able to parse the xml data in sun application server,this is working fine in tomcat and oracle server.
    Please go thru the code , thanks in advance.This is used in ajax.
    function processStateChange() {
    if (req.readyState == 4) { // Complete
    if (req.status == 200) { // OK response
         var message=req.responseXML.getElementsByTagName("value")[0];
              setMessage(message.childNodes[0].nodeValue);
    //document.getElementById("theResponse").innerHTML = req.responseText;
              else
    alert("Problem: " + req.statusText);
              return true;
         }

    Use Notepad. Drag and drop in notepad.
    Aman

  • Authorization Object for data downloading from application server

    Hi friends ,
       My program downloads and uploads data from the application server .
    My requirement is  ,
    Authorization checks should be performed on the Server directories to ensure that the user has access to read and write to the directory. It should check the s_dataset authorisation object for this.. If a user does not have the s_dataset authorisation object no upload or download should be allowed.
    Can you please tell me how to deal with this ? how do we check the above condition ??
    Many thanks ,
    Hemant

    hi,
    This is not a single step process.
    First of all you have to create a field for authorization for server directories from su20 and then create authorization object from su21.then define a role from pfcg with this authorization object and assign this role to user profile from su01 with values defined.
    Then you have to call this authorization object in your program at selection screen.

  • Transaction code used to upload the data in the application server SCM syst

    Hi
    Could you please anyone tell me the transaction code which has been used to upload the data into the application server in SCM ( APO) system from presentation server. 
    For ex : R/3 system CG3Y , CG3Z has been used to upload the data into application server similarly way could you please tell me the transaction code is used in the APO system for uploading the data into application server.
    Thanks advance for your support.
    Regards,
    Kiran

    try tcode SXDA_TOOLS - copy
    (1st you must fill all obligatory fields)
    A.

  • I have problem with data transfer between Windows Server 2012RT and Windows7 (no more than 14kbps) while between Windows Sever 2012RT and Windows8.1 speed is ok.

    I have problem with data transfer between Windows Server 2012RT and Windows7 (no more than 14kbps) while between Windows Sever 2012RT and Windows8.1 speed is ok.

    Hi,
    Regarding the issue here, please take a look at the below links to see if they could help:
    Slow data transfer speed in Windows 7 or in Windows Server 2008 R2
    And a blog here:
    Windows Server 2012 slow network/SMB/CIFS problem
    Hope this may help
    Best regards
    Michael
    If you have any feedback on our support, please click
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • TWAIN data transfer error

    NEW!    When I try to scan (CANON 8400F scanner) into my desktop (WindowsXP) I now get an error message (code 2,178,0) followed by the message "TWAIN data transfer error".  Can this be fixed?   sunnycroft

    Hello sunnycroft.
    Uninstalling and reinstalling the drivers may resolve this issue.  Please perform the following:
    1.  Click Start and open the Control Panel.
    2.  Open the Add or Remove Programs option.
    3.  Uninstall the CanoScan 8400F and the Canon CanoScan Toolbox.
    4.  Close all windows that are open.
    Once this has been done, ensure that the scanner has been disconnected.  Then reinstall the unit be downloading the Drivers and CanoScan Toolbox from our website at the following link.
    http://www.usa.canon.com/cusa/support/consumer/scanners/canoscan_series/canoscan_8400f#DriversAndSof...
    If these troubleshooting steps do not work, feel free to call us at 1-800-OKCANON.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Error in data load from application server

    Well, this problem again!
    In datasource for dataload by flatfile, tab Extraction i selected Load Text-Type File From Application Server.
    In tab Proposal:
    Converter: Separated with Separator (for Example, CSV).
    No. of Data Records: 9198
    Data load sucefull.
    I add 1 record:
    Converter: Separated with Separator (for Example, CSV).
    No. of Data Records: 9199
    So appear a  message error "Cannot convert character sets for one or more characters".
    I look in line 9199 in file and not have any special character. I use AL11 and debug to see this line.
    When i load file from local workstation, this error not occur.
    What's happen?

    Hi Rodrigo,
    What type of logical file path have yopu created in the application server for loading this file.
    Is it a UNIX file path or an ASCII file path.
    Did you check how the file looks in the application server AL11?
    Prathish

  • File transfer into application server

    Hi folks.
    I need to retrieve header records from table MCHB and RESB and transfer it into file.
    Again for the corresponding header record, i need to transfer item records retrived from table MKOL and LFA1 as well.
    One file each is to be create per plant.
    But,i am not able to get item data into file.
    My coding....
    LOOP AT i_mchb INTO wa_mchb.
        l_clabs = wa_mchb-clabs.
        SHIFT l_clabs LEFT DELETING LEADING space.
    Summarize requirement quantity
        LOOP AT i_resb INTO wa_resb.
          wa_sum-charg = wa_resb-charg.
          wa_sum-bdmng = wa_resb-bdmng.
          COLLECT wa_sum INTO i_sum.
          SORT i_sum BY charg.
        ENDLOOP.
        READ TABLE i_sum INTO wa_sum WITH KEY charg = wa_mchb-charg.
        IF sy-subrc EQ 0.
          l_bdmng = wa_sum-bdmng.
          SHIFT l_bdmng LEFT DELETING LEADING space.
        ENDIF.
    Calculation on Available quantity
        l_avqty = l_bdmng - l_clabs.
        SHIFT l_avqty LEFT DELETING LEADING space.
        AT NEW werks.
    *Creation of file
          PERFORM sub_create_file.
    Open File on the application server for processing
          OPEN DATASET g_file_name FOR OUTPUT IN TEXT MODE
          ENCODING DEFAULT.
          IF sy-subrc NE 0.
    *Display error message
            MESSAGE i055 WITH g_file_name.
            " Error in opening file
            LEAVE LIST-PROCESSING.
          ENDIF.
        ENDAT.
    Transfering data to file
        CONCATENATE c_header         "Header indentification
                    wa_mchb-matnr    " Material number
                    wa_mchb-werks    " Plant
                    wa_mchb-lgort    " Storage location
                    wa_mchb-charg    " Batch number
                    l_clabs           " Valuated stock-unrestricted use
                    l_bdmng           " Requirement quantity
                    l_avqty           " Avalable quantity.
        INTO l_record.
        TRANSFER l_record TO g_file_name.
        CLEAR: l_clabs,
               l_bdmng,
               l_avqty,
               l_record.
        READ TABLE i_mkol INTO wa_mkol WITH KEY matnr = wa_mchb-matnr
                                                werks = wa_mchb-werks
                                                lgort = wa_mchb-lgort
                                                charg = wa_mchb-charg
                                                BINARY SEARCH.
        IF sy-subrc EQ 0.
          l_tabix = sy-tabix.
          LOOP AT i_mkol INTO wa_mkol FROM l_tabix.
    *Population of consignment stock-unrestricted use
            l_slabs = wa_mkol-slabs.
            SHIFT l_slabs LEFT DELETING LEADING space.
            READ TABLE i_lfa1 INTO wa_lfa1 WITH KEY lifnr = wa_mkol-lifnr.
    sy-subrc check not done
            CONCATENATE c_item           " Item identification
                        l_slabs
                        " Consignment stock-unrestricted use
                        wa_mkol-lifnr    " Vendor account number
                        wa_lfa1-name1    " Vendor name
            INTO l_record.
            TRANSFER l_record TO g_file_name.
            CLEAR: l_slabs,
                   l_record.
          ENDLOOP.
        ENDIF.
        AT END OF werks.
    Close File
          CLOSE DATASET g_file_name.
          CLEAR   g_file_name.
        ENDAT.
      ENDLOOP.

    Hi,
    Yes thats correct. When using AT NEW. The field in internal table after the WERKS field will have ASTERSIK .
    So before AT NEW. Assign the work area to another work area. Eg.
    WA_mchb1 = wa_mchb.
    Later on i.e. After ENDAT use everywhere WA_MCHB1 and not not WA_MCHB.
    This will solve the problem.
    wa_sum-charg = wa_resb-charg.
    wa_sum-bdmng = wa_resb-bdmng.
    COLLECT wa_sum INTO i_sum.
    SORT i_sum BY charg.
    ENDLOOP.
    READ TABLE i_sum INTO wa_sum WITH KEY charg = wa_mchb-charg.
    IF sy-subrc EQ 0.
    l_bdmng = wa_sum-bdmng.
    SHIFT l_bdmng LEFT DELETING LEADING space.
    ENDIF.
    Calculation on Available quantity
    l_avqty = l_bdmng - l_clabs.
    SHIFT l_avqty LEFT DELETING LEADING space.
    <b>clear wa_mchb_new.</b>
    <b>wa_mchb_new = wa_mchb.</b>
    AT NEW werks.
    *Creation of file
    PERFORM sub_create_file.
    Open File on the application server for processing
    OPEN DATASET g_file_name FOR OUTPUT IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc NE 0.
    *Display error message
    MESSAGE i055 WITH g_file_name.
    " Error in opening file
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDAT.
    Transfering data to file
    CONCATENATE c_header "Header indentification
    <b>wa_mchb_new-matnr " Material number
    wa_mchb_new-werks " Plant
    wa_mchb_new-lgort " Storage location
    wa_mchb_new-charg " Batch number</b>l_clabs " Valuated stock-unrestricted use
    l_bdmng " Requirement quantity
    l_avqty " Avalable quantity.
    INTO l_record.
    TRANSFER l_record TO g_file_name.
    CLEAR: l_clabs,
    l_bdmng,
    l_avqty,
    l_record.
    READ TABLE i_mkol INTO wa_mkol WITH KEY matnr = <b>wa_mchb_new-matnr
    werks = wa_mchb_new-werks
    lgort = wa_mchb_new-lgort
    charg = wa_mchb_new-charg</b>BINARY SEARCH.
    IF sy-subrc EQ 0.
    l_tabix = sy-tabix.
    LOOP AT i_mkol INTO wa_mkol FROM l_tabix.
    *Population of consignment stock-unrestricted use
    l_slabs = wa_mkol-slabs.
    SHIFT l_slabs LEFT DELETING LEADING space.
    READ TABLE i_lfa1 INTO wa_lfa1 WITH KEY lifnr = wa_mkol-lifnr.
    sy-subrc check not done
    CONCATENATE c_item " Item identification
    l_slabs
    " Consignment stock-unrestricted use
    wa_mkol-lifnr " Vendor account number
    wa_lfa1-name1 " Vendor name
    INTO l_record.
    TRANSFER l_record TO g_file_name.
    CLEAR: l_slabs,
    l_record.
    ENDLOOP.
    ENDIF.
    AT END OF werks.
    Close File
    CLOSE DATASET g_file_name.
    CLEAR g_file_name.
    ENDAT.
    ENDLOOP.
    Best regards,
    Prashant
    PS : Please reward all helpful answers
    Message was edited by: Prashant Patil
    Message was edited by: Prashant Patil

  • Please Help! ERROR: Application Server failed. when Refreshing

    Please help on this below issue. Thanks.
    We have a requirement that using ASP.NET (C#), we need to open saved .rpt file (saved with data and the rpt file is assigned to the web page as query string) and let the users refresh themselves with latest data by clicking at refresh icon of the CrystalReportViewer. But it throws 'The Report Application Server failed' error message. What could cause this message. below is the piece of code we are using to configure the report.
    private void ConfigureCrystalReports()
    string reportPath = Server.MapPath("Reports
    SEMS0001_UBS.rpt");
    this.CrystalReportSource2.ReportDocument.Load(reportPath);
    CrystalReportViewer1.Visible = false;
    SetDBLogonForReport(this.CrystalReportSource2.ReportDocument);
    int i = 0;
    foreach (ParameterField field in this.CrystalReportSource2.ReportDocument.ParameterFields)
    field.HasCurrentValue = true;
    //this.CrystalReportSource2.ReportDocument.Refresh();
    CrystalReportViewer1.ParameterFieldInfo = this.CrystalReportSource2.ReportDocument.ParameterFields;
    CrystalReportViewer1.Visible = true;
    public void SetDBLogonForReport(ReportDocument reportDocument)
    Tables tables = reportDocument.Database.Tables;
    connectionInfo.ServerName = "server"; //ConfigurationManager.AppSettings["DBServer"];
    connectionInfo.UserID = "user"; //ConfigurationManager.AppSettings["DBUser"];
    connectionInfo.Password = "passwd"; //XsiteWinRpt.ConnUtil.GetOnlyPasswordOfConnString(); //ConfigurationManager.AppSettings["DBPassword"];
    //foreach (CrystalDecisions.Shared.IConnectionInfo connection in reportDocument.DataSourceConnections)
    // connection.SetConnection(ConfigurationManager.AppSettings["DBServer"], "", ConfigurationManager.AppSettings["DBUser"], ConfigurationManager.AppSettings["DBPassword"]);
    // connection.SetLogon(ConfigurationManager.AppSettings["DBUser"], ConfigurationManager.AppSettings["DBPassword"]);
    foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
    TableLogOnInfo tableLogonInfo = table.LogOnInfo;
    tableLogonInfo.ConnectionInfo = connectionInfo;
    table.ApplyLogOnInfo(tableLogonInfo);
    //reportDocument.Database.Tables[0].ApplyLogOnInfo(tableLogonInfo);

    Attaching full code ... Our case is the RPT files are stored wih default parameters and saved data. We need to let users just refresh the rpt files with latest db data and overwrite with the same rpt files. But this code keep showing The application server failed mesg. when the refresh icon of viewer is clicked.
    Attaching the code as it is not properly attached in my previous reply ...
    =======================
    Begin - aspx.cs code
    =======================
    using System;
    using System.Data;
    using System.Data.OleDb;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.CrystalReports;
    using CrystalDecisions.Shared;
    using CrystalDecisions.Web;
    public partial class _Default : System.Web.UI.Page
        private ConnectionInfo connectionInfo = new ConnectionInfo();
        protected void Page_Load(object sender, EventArgs e)
            if (!IsPostBack)
                //ConfigureCrystalReports();
        protected void  CrystalReportViewer1_Init(object sender, EventArgs e)
            ConfigureCrystalReports();
        private void ConfigureCrystalReports()
            string reportPath = Server.MapPath(@"Reports\Report1.rpt");
            this.CrystalReportSource1.ReportDocument.Load(reportPath);
            CrystalReportViewer1.Visible = false;
            SetDBLogonForReport(this.CrystalReportSource1.ReportDocument);
            foreach (ParameterField field in this.CrystalReportSource1.ReportDocument.ParameterFields)
                field.HasCurrentValue = true;
            //this.CrystalReportSource1.ReportDocument.Refresh();
            CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
            CrystalReportViewer1.Visible = true;
        public void ReportDocument_RefreshReport(object sender, EventArgs e)
            try
    SetDBLogonForReport(this.CrystalReportSource1.ReportDocument);
    CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
                this.CrystalReportSource1.ReportDocument.SetDatabaseLogon("user", "passwd", "server", "");
                foreach (ParameterField field in this.CrystalReportSource1.ReportDocument.ParameterFields)
                    field.HasCurrentValue = true;
                    field.AllowCustomValues = true;
                    //field.EnableNullValue = true;               
                this.CrystalReportSource1.ReportDocument.Refresh();
                       this.CrystalReportSource1.ReportDocument.SaveAs(@"C:\Inetpub\wwwroot\XsiteRpt\Reports\Report1.RPT", true);
            catch (Exception ex)
                Msg.Text = ex.Message;
        public void SetDBLogonForReport(ReportDocument reportDocument)
            Tables tables = reportDocument.Database.Tables;
            connectionInfo.ServerName = "server"; //ConfigurationManager.AppSettings["DBServer"];
            connectionInfo.UserID = "user"; //ConfigurationManager.AppSettings["DBUser"];
            connectionInfo.Password = "passwd"; //XsiteWinRpt.ConnUtil.GetOnlyPasswordOfConnString(); //ConfigurationManager.AppSettings["DBPassword"];
            foreach (CrystalDecisions.CrystalReports.Engine.Table table in reportDocument tables)
                TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                tableLogonInfo.ConnectionInfo = connectionInfo;
                table.ApplyLogOnInfo(tableLogonInfo);
    =======================
    End - aspx.cs.code
    =======================
    =======================
    Begin - Assemblies
    =======================
    <assemblies>
                        <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                        <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
          </assemblies>
    =======================
    End - Assemblies
    =======================
    =======================
    Begin - aspx
    =======================
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Xsite.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Refresh Report</title>
        <link href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css"
            rel="stylesheet" type="text/css" />
        <link href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css"
            rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Panel ID="PanelMsg" runat="server">
            <br />
            <asp:Label ID="Msg" runat="server" Font-Bold="False" Font-Names="Verdana" ForeColor="Navy"></asp:Label>
            <br />
            </asp:Panel>
            <asp:Panel ID="PanelViewer" runat="server">
            <CR:CrystalReportViewer ID="CrystalReportViewer1" OnReportRefresh="ReportDocument_RefreshReport" runat="server" AutoDataBind="True"
                EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False" ReuseParameterValuesOnRefresh="True" HasRefreshButton="True" Height="820px" OnInit="CrystalReportViewer1_Init" ReportSourceID="CrystalReportSource1" ShowAllPageIds="True" Width="1215px" />
            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">           
            </CR:CrystalReportSource>
            </asp:Panel>
        </div>
        </form>
    </body>
    </html>
    =======================
    End - aspx
    =======================

Maybe you are looking for