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>

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

  • 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 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.

  • 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.

  • 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

  • Data Writing to Application server

    Hi,
    I am Uploading 108 fields of data to application server file
    Below ZFI_PAYMENT is the table which contains 108 fields of data
    Please check my code
    TYPES: ty_file TYPE zfi_payment.
    DATA: wa_file TYPE ty_file.
    DATA: it_file TYPE STANDARD TABLE OF ty_file.
    FIELD-SYMBOLS: <f1> TYPE ANY,
                   <f2> TYPE ANY.
    TYPES: BEGIN OF ty_data,
             data type string,
           END OF ty_data.
    DATA: wa_data TYPE ty_data,
                it_data TYPE STANDARD TABLE OF ty_data.
    DATA:  v_pay_amount(23).
    DATA: as_file TYPE file VALUE '/usr/sap/RD2/DVEBMGS20/work/fi_test2'.
    select * from zfi_payment into table it_file.
    open dataset as_file for output in text mode encoding default.
    LOOP AT it_file INTO wa_file.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE wa_file TO <f1>.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        IF sy-index = 5.
          MOVE wa_file-pay_amount TO v_pay_amount.
          CONCATENATE wa_data-data v_pay_amount '@' INTO wa_data-data.
        ELSE.
          CONCATENATE wa_data-data  <f1> '@' INTO wa_data-data.
        ENDIF.
      ENDDO.
      move wa_data-data to wa_data1.
      TRANSFER WA_DATA-DATA TO AS_FILE.
      APPEND wa_data TO it_data.
      CLEAR: WA_DATA,V_PAY_AMOUNT,WA_FILE,wa_data1.
    ENDLOOP.
    close dataset as_file.
    Here i am getting all 108 fileds of data into IT_DATA. (in debugging i seen that)
    But the only 68 fields of data is writing to the appl server.
    there is no problem in ztable and internal tables. data is coming properly to wa_data and it_data also.
    Please Give me reply
    Regards
    sri

    Hi,
    I guess, Now you are viewing only the first 68 fields on the application server. If yes, that is because of the restriction on the size and length can be viewed on application server.
    Try downloading directly from here.
    I guess, again using the OPEN DATASET and reading the file, it will retrieve all the data completely, i.e. only for viewing purpose, you can view the complete data.
    Regards,
    Nangunoori.

  • Read Attachment from SAP inbox and Transfer to Application Server Folder

    Hi
      I have one requirement . I have to developed one background program to read the all the attachment in SAP inbox and transfer all this attachment to sap application server folder.
    Thanks and Regards
    Shyam

    Hi Rajendra ,
    please try this code snippet , here we call a selection screen that allows us to browse the file name .
    PARAMETER : p_file TYPE localfile OBLIGATORY .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file .
      data: user_action type i, filename type filetable, result type i,
            fn type file_table.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'SELECT FILE'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
      CHANGING
        FILE_TABLE              = filename
        RC                      = result
        USER_ACTION             = user_action
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
      if user_action = cl_gui_frontend_services=>action_ok.
        clear p_file.
        loop at filename into fn.
          p_file = fn-filename.
        endloop.
      endif.
    Hopefully it helps

  • Problems with file transfer to application server

    Hi Experts,
        am using sap 4.0 version. Now i want to transfer data to application sever in csv format.
    I have doubt, since 4.0 is not a unicode check then how can we handle text while transferring to application server.
    how we find the text is double bit or single bit? how can i convert this and download to al11.

    Hi
    If you want to transfer the file to App Server through a custom Program, then you need to use
    V_FILENAME = Complete path with filename.
    Open dataset V_FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    if sy-subrc EQ 0.
    loop at itab into watab.
    move watab to V_String.
    transfer V_String to V_FILENAME
    endloop.
    endif.
    If you want to transfer the file to App Server manually then use the transaction.
    CG3Z
    If you want to get the file from App Server through a custom Program, then you need to use
    Open dataset V_FILENAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    if SY-SUBRC EQ 0.
    DO.
    Read dataset V_FILENAME INTO V_STRING.
    if sy-subrc ne 0.
    exit.
    endif.
    Move this V_string to Wa
    append wa to itab
    enddo.
    endif.
    If you want to Copy the file from App Server manually then use the transaction.
    CG3Y
    If you want to append the file , then first find out if the file is present in the asked location or not.
    Call the FM to List all the Files in the directory - 'RZL_READ_DIR_LOCAL' and store the data in an internal table
    Search this internal table to see if the file already exists.
    if it is present use
    OPEN dataset V_FILENAME in text mode for appending.
    if sy-subrc EQ 0.
    loop at itab into watab.
    move watab to V_String.
    transfer V_String to V_FILENAME
    endloop.
    endif.
    Do not forget to CLOSE DATEST after opening it.
    Cheers

Maybe you are looking for

  • Open and close data input in DP.

    Hi, We have two periods in the future (actual and next) and we need open and close actual year for input with macros. We have built two macros to open and close actual year for input. The macro to close the input is working OK (COL_INPUT( 0 )). the m

  • Create, Update & Save Functions

    Hi All, This is my code for the requirement to print sales order in ALV Grid Format using OOPS concept. Please tell me how i should add select button to the ALV Grid in the first column. Also when i click on CREATE button a new blank line should be a

  • How to write a unicode text in pdf file

    Dear Friends, I am a beginner in acrobat pdf plug-in development. I was trying to write a unicode text (Tamil text) into pdf file. Using same api I am able to write english text in time-roman, areal etc fonts. But I am not able to write tamil texts.

  • Transfer songs from a ipod mini that was created from another account

    I bought a used ipod mini that came loaded with over 400 songs which I would like to add to my itunes MAC account. The ipod mini is in Windows format and I understand that at sometime in the future I will have to restore the ipod mini in order to con

  • Problem with dbcontrol

    os: windows server 2003 db: 10.2.0.4 dbcontrol configured automatically after db creation i get the following url for dbcontrol https://blah-blah-0815.saxony.germany.de:1158/em blah-blah-0815 is the maschine and saxony.germany.de is the domain but fo