Issue related to Excel to Text tab delimited conversion

Hi,
I am facing a strange issue in converting an excel file to a text tab delimited file. I have an excel sheet which contains two columns:
vendor         new_zip
153357      99645-6340
162642         99669-7631
$209930-1   91320-1201
$209989-1   91710-5766
When i save this file as a text tab delimited file  this is how it turns into:
    vendor  new_zip
    153357  99645-6340
    162642  99669-7631
    $209930-1     91320-1201
    $209989-1     91710-5766
i am using WS_UPLOAD since i am not using the enterprise version of SAP. In the above mentioned u can see that the zip values(first character) of the first two records and the vendor numbers(last character) of the last two records get in line with each other. so when i load this file it gives a "File open error" exception. if i move the zip codes of the first two records by one space so that they are not in line with the vendor numbers of the last two records the file uploading happens fine. but this is something which cant be done from the user point of view. so can anyone tell as to what can be done without changing the concept of using text tab delimited file and aviod this problem?
thanks & regards,
Bala.

The following program uses alsm_convert_excel_to_internal_table.but i want to use split at tab delimiter.pls help.
REPORT ZSAINAL_BDC_TRAN .
*INCLUDE BDCRECX1.
*definition of selection screen
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME .
SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-t01.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(20) text-c01.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(10) text-c02.
SELECTION-SCREEN POSITION 22.
PARAMETERS: p_txt RADIOBUTTON GROUP grp1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 30(12) text-c03.
SELECTION-SCREEN POSITION 46.
PARAMETERS: p_xls RADIOBUTTON GROUP grp1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK bl2.
*PARAMETERS
PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'A'.
PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'S'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK bl1.
*DATA
DATA : bdc_data LIKE STANDARD TABLE OF bdcdata INITIAL SIZE 10
       WITH HEADER LINE.
*DATA: bdc_tab LIKE TABLE OF bdcdata INITIAL SIZE 0 WITH HEADER LINE.
*Internal table to get legacy data records structured in
*target format
DATA: BEGIN OF inrec OCCURS 0,
          lifnr LIKE lfa1-lifnr,
          name1 LIKE lfa1-name1,
          stras LIKE lfa1-stras,
          ort01 LIKE lfa1-ort01,
      END OF inrec.
*Internal table of structure ALSMEX_TABLINE suitable for
*uploading records from an Excel worksheet
DATA: it_excel TYPE STANDARD TABLE OF alsmex_tabline
              INITIAL SIZE 0 WITH HEADER LINE,
      it_excel_dummy TYPE  alsmex_tabline.
data: messtab like bdcmsgcoll occurs 0 with header line.
DATA: L_MSTRING(480).
DATA: L_SUBRC LIKE SY-SUBRC.
*START-OF-SELECTION
START-OF-SELECTION.
  PERFORM read_data.
  PERFORM populate_bdcdata.
*START NEW SCREEN
FORM bdc_dynpro USING program dynpro.
  CLEAR bdc_data.
  bdc_data-program  = program.
  bdc_data-dynpro   = dynpro.
  bdc_data-dynbegin = 'X'.
  APPEND bdc_data.
ENDFORM.
*INSERT FIELD
FORM bdc_field USING fnam fval.
IF FVAL <> NODATA.
  CLEAR bdc_data.
  bdc_data-fnam = fnam.
  bdc_data-fval = fval.
  APPEND bdc_data.
ENDIF.
ENDFORM.
*&      Form  read_data
      text
-->  p1        text
<--  p2        text
FORM read_data.
  IF p_txt = 'X'.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = 'C:\URMILA.TXT'
         filetype                      = 'ASC'
         has_field_separator           = 'X'
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
IMPORTING
  FILELENGTH                    =
  HEADER                        =
        TABLES
          data_tab                      = inrec
   EXCEPTIONS
     file_open_error               = 1
     file_read_error               = 2
     no_batch                      = 3
     gui_refuse_filetransfer       = 4
     invalid_type                  = 5
     no_authority                  = 6
     unknown_error                 = 7
     bad_data_format               = 8
     header_not_allowed            = 9
     separator_not_allowed         = 10
     header_too_long               = 11
     unknown_dp_error              = 12
     access_denied                 = 13
     dp_out_of_memory              = 14
     disk_full                     = 15
     dp_timeout                    = 16
     OTHERS                        = 17
    IF sy-subrc <> 0.
      WRITE: /'ERROR UPLOADING TXT FILE FROM PRESENTATION SERVER!',
             / 'RETURN CODE : ',sy-subrc.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ELSE.  "filetype is excel
-read excel file into an int. table in row/col format--
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
         EXPORTING
              filename                = 'C:\URMILA.XLS'
              i_begin_col             = 1
              i_begin_row             = 1
              i_end_col               = 4
              i_end_row               = 3
         TABLES
              intern                  = it_excel
         EXCEPTIONS
              inconsistent_parameters = 1
              upload_ole              = 2
              OTHERS                  = 3.
    IF sy-subrc <> 0.
      WRITE: /'ERROR UPLOADING XLS FILE FROM PRESENTATION SERVER!',
             / 'RETURN CODE : ',sy-subrc.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
--now fill data from it_excel into final legacy data itabinrec----
      IF NOT it_excel[] IS INITIAL.
        CLEAR inrec.
        REFRESH inrec[].
        LOOP AT it_excel.
          it_excel_dummy = it_excel.
          AT NEW col.
            CASE it_excel_dummy-col.
              WHEN 1.
                inrec-lifnr = it_excel_dummy-value(10).
              WHEN 2.
                inrec-name1 = it_excel_dummy-value(35).
              WHEN 3.
                inrec-stras = it_excel_dummy-value(35).
              WHEN 4.
                inrec-ort01 = it_excel_dummy-value(35).
                APPEND inrec.
                CLEAR inrec.
            ENDCASE.
          ENDAT.
         AT END OF row.
         ENDAT.
        ENDLOOP.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.
*&      Form  populate_bdcdata
  to populate BDCDATA table from legacy file data contained in
  internal table inrec.
-->  p1        text
<--  p2        text
FORM populate_bdcdata.
  IF  not inrec[] IS INITIAL.
    LOOP AT inrec.
      CLEAR bdc_data.
      REFRESH bdc_data.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0106'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'RF02K-LIFNR'
                                    inrec-lifnr.
      PERFORM bdc_field       USING 'RF02K-BUKRS'
                                    '1000'.
      PERFORM bdc_field       USING 'RF02K-D0110'
                                    'X'.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=PF03'.
      PERFORM bdc_field       USING 'LFA1-NAME1'
                                   inrec-name1.
      PERFORM bdc_field       USING 'LFA1-SORTL'
                                    'ALLGEMEIN'.
      PERFORM bdc_field       USING 'LFA1-STRAS'
                                    inrec-stras.
      PERFORM bdc_field       USING 'LFA1-PFACH'
                                    '645793'.
      PERFORM bdc_field       USING 'LFA1-ORT01'
                                    inrec-ort01.
      PERFORM bdc_field       USING 'LFA1-PSTLZ'
                                    '12001'.
      PERFORM bdc_field       USING 'LFA1-ORT02'
                                    'COOK'.
      PERFORM bdc_field       USING 'LFA1-PSTL2'
                                    '76905'.
      PERFORM bdc_field       USING 'LFA1-LAND1'
                                    'DE'.
      PERFORM bdc_field       USING 'LFA1-REGIO'
                                    '11'.
      PERFORM bdc_field       USING 'LFA1-SPRAS'
                                    'DE'.
      PERFORM bdc_field       USING 'LFA1-TELF1'
                                    '06894/55501-0'.
      PERFORM bdc_field       USING 'LFA1-TELFX'
                                    '06894/55501-100'.
      PERFORM bdc_dynpro      USING 'SAPLSPO1' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=YES'.
      CALL TRANSACTION 'FK02'
                       USING bdc_data
                       MODE ctumode
                       UPDATE cupdate
                       MESSAGES INTO MESSTAB.
    ENDLOOP.
    perform mess_handling.
  ENDIF.
ENDFORM.                    " populate_bdcdata
*&      Form  mess_handling
      ERROR MESSAGE HANDLING IN CALL TRANACTION
-->  p1        text
<--  p2        text
form mess_handling.
tables:T100.
LOOP AT MESSTAB.
        SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                  AND   ARBGB = MESSTAB-MSGID
                                  AND   MSGNR = MESSTAB-MSGNR.
        IF SY-SUBRC = 0.
          L_MSTRING = T100-TEXT.
          IF L_MSTRING CS '&1'.
            REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
          ELSE.
            REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
          ENDIF.
          CONDENSE L_MSTRING.
          WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
        ELSE.
          WRITE: / MESSTAB.
        ENDIF.
      ENDLOOP.
endform.                    " mess_handling

Similar Messages

  • Option to read fixed-length format, EXCEL or ASCII TAB delimited

    Hi Experts,
                      I have a requirement for giving an option to read fixed-length format, EXCEL or ASCII TAB delimited in the selection screen.Kindly help me how can i read the fixed length format?
    Thanks,
    Ankita

    As far as I could have understood your problem
    You have to read the file with
    Open dataset  'file path+name'  FOR INPUT in text mode encoding default.
    and move its contents to string type variable
    Transfer to 'file path+name' to v_string.
    Now as per your requirements you need to use Offsets to transfer the data into a work area.
    For example
    wa_task-year=  v_string(4).
    wa_task-month=  v_string+4(2).
    Please confirm if this is your requirement.

  • Discover Plus - Export to Text Tab delimited is not exporting all the rows

    Hi gurus,
    I am trying to export a large data report which has 1 million plus rows to text tab delimited. The export takes 9 plus hours to export and the data is not more than 100000.
    My question is
    1. How can I make the discoverer to export it quicker or rather faster to tab delimited.
    2. Where can I change the number of rows to be exported.
    Any help, suggestions is appreciated.
    Thanks,
    SAI

    Hi Rod,
    Yes. The text tab delimited export is taking lot of time. The total rows for this report are nearly 1 million. If I break down the report with condition and export it I was able to export it ( three files exported with 212000, 103000 and 687000 rows respectively).
    But I m still having problems exporting it in one shot. Is there any way I could resolve this? Please let me know.
    Thanks,
    SAI

  • Text Tab delimited - using Numbers

    I have some Numbers files that I need to upload to a contact manager as Text Tab - Delimited. I cannot seem to find the correct way of doing it, since I am not able to get them done.

    If you need to export data from specific tables, you can try is selecting the cells, command-c to copy, and in a text editor, command-v to paste, and then save to file, which you should then be able to upload to the contact manager.
    Selecting cells and copying them places their values on the clipboard tab-delimited.
    SG

  • Text Tab delimited file-Strcuture-validation

    Hi Folks,
    1.Is there a way to check whether the file is text tab delimited or not,programatically ?
    2.can we check whether the data in the text tab delimited file is in line with the structure of the internal table into which it is going to be uploaded ?
    Thanks,
    K.Kiran.

    hi try this
    DO.
    READ DATASET p_ufile INTO in_file.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    APPEND in_file.
    CLEAR in_file.
    ENDDO.
    CLOSE DATASET p_ufile.
    LOOP AT in_file.
    SPLIT in_file AT c_tab INTO
    wa_citm_b-type
    wa_citm_b-vbeln
    wa_citm_b-posnr
    wa_citm_b-uepos.
    wa_citm_b-matnr
    lv_menge
    wa_citm_b-arktx
    wa_citm_b-vbegdat
    wa_citm_b-venddat
    wa_citm_b-prctr
    wa_citm_b-zterm
    wa_citm_b-faksp
    wa_citm_b-taxm1
    wa_citm_b-vlaufz
    wa_citm_b-vlauez
    wa_citm_b-vlaufk
    wa_citm_b-vkuegru
    wa_citm_b-bstkd
    wa_citm_b-bstdk
    wa_citm_b-posex
    wa_citm_b-bstkd_e
    wa_citm_b-bstdk_e
    wa_citm_b-period.
    IF NOT wa_citm_b-posnr CA sy-abcde.
    APPEND wa_citm_b TO lt_citm_b.
    ENDIF.
    ENDLOOP.

  • Excel to Tab delimited .text

    At work i have to deal with a lot of excels in which i have to save the file as .txt and then .xls, I will then upload the .txt file to SAP
    In the txt files, the numbers are being saved with "." (dot) and not with a ","(Comma) in the decimals, even though then numbers in excel are formated in number with 2 decimals and with comma separator.
    So I'm having problems with this, I've tried the different formats (number, text, general) but nothing seems to work. If I save manually in Tab delimited .txt the files is always saved with a comma in the decimals, but if i run the excel macro the .txt always save with a dot. I've also tried changing the file format in my VBA (TextWindows, TextMSDOS, Currentplatformtext) without sucess.
    Can anyone give me some help with this? I've been looking the internet for a solution but found none. The number of files i have to upload is huge, so i'd like to program my macro to do all this saving automatically.
    Thank you..
    PS:The VBA code I am using now is this:
    Sub Save()
        Dim NomeFicheiro As String
        Dim PathGrav As String
        NomeFicheiro = InputBox("Nome do Ficheiro?")
        PathGrav = "H:\Starflows\" & NomeFicheiro
        If NomeFicheiro = "" Then Exit Sub
        ActiveWorkbook.SaveAs Filename:=PathGrav, FileFormat:=xlTextWindows, CreateBackup:=False
        ActiveWorkbook.SaveAs Filename:=PathGrav, FileFormat:=xlNormal, CreateBackup:=False
        ActiveWorkbook.Close SaveChanges:=False
    End Sub

    I thought it might me the regional settings, mine are in Portuguese and by default we have the comma as decimal separator, so this should be ok.
    I tried changing to the English (US) format using both the comma and the dot as separator, but the problem remains, the macro is always saved with dot instead of comma, even so if I save the file manually as tab delimited text.
    What I also did was, I configured dot as decimal separator in the regional settings and putted commas in the numbers in my excel, I think it recognizes the numbers as text, in this case, when i run the macro the numbers in the text are saved with quotes like this but with commas, for example  "12,56". But in this case SAP does not accept the file because of the quotes.
    I remembered something that might be the reason for this happening. when I manually save as tab delimited .txt, excel asks me 2 questions, which i answer yes and which could be important.
    1. Excel tells me that the selected file type does not support workbooks that contain multiple sheets and to save only the active sheet click ok. This does not look like the problem but i changed the code to:
    ActiveSheet.SaveAs Filename:=PathGrav, FileFormat:=xlTextWindows, CreateBackup:=False
    I executed it but the dot and not comma remains.
    2. 123.txt may contain features that are not compatible with Text (Tab delimited). Do you want to keep the workbook in this format?
    *To keep this format, which leaves out any incompatible features, click Yes.
    *To preserve the features, click No. then save a copy in the latest Excel format
    I press yes and the file is saved as comma delimited.
    Could it be that i need to add something to my VBA code, as when the macro runs I am not prompted any of these questions.
    Thanks

  • EXcel to tab delimited text file

    I am saving an excel file into a tab delimited text file so that i can use it for uploading data.
    The excel file contains a text field in which there is a comma ',' .
    for all the fields which has a comma in the excel file
    the text  file is adding double qoutes " in the beginning and end of the filed.
    for example
    contents of filed in excel file is :  GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE
    and in the text file it is coming as "GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE"
    i dont want the " in the beginning and end
    can anybody help.
    points will be rewarded.
    I am just saving the excel file as tab delimited text file and i am getting the quotes added in the begining and end.
    Thanks.

    Thats to preserer the comma in between otherwise when you upload the same the data will split at comma.
    Regards,
    Amit
    Reward all helpful replies.

  • Application Server Download - Tab Delimited Text File

    Hi,
    I am trying to create a tab delimited text file in application server. Is there any option should i use with the Open Dataset / Transfer statements? My requirement is to download the file (Text - Tab Delimited) into Excel for further analysis. Can you please suggest me a suitable solution for this?
    Thanks,
    Kannan.

    Hi,
    You can use transactions CG3Y and CG3Z. Its very simple.
    Refer sample code:
    constants: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
    c_path TYPE VALUE char100 '/local/data/interface/A28/DM/OUT'.
    *& Form f1001_browse_appl_file
    Pick up the file path for the file in the application server
    FORM f1001_browse_appl_file .
    DATA: lcl_directory TYPE char128.
    lcl_directory = p_direct.
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = lcl_directory
    filemask = c_mask
    IMPORTING
    serverfile = p_f2
    EXCEPTIONS
    canceled_by_user = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE s000 WITH text-039.
    EXIT.
    ENDIF.
    ENDFORM. " f1001_browse_appl_file
    *& Form f1004_app_file
    upload the file from the application server
    FORM f1004_app_file .
    REFRESH: i_input.
    OPEN DATASET p_f2 IN TEXT MODE ENCODING DEFAULT FOR INPUT.
    IF sy-subrc EQ 0.
    DO.
    READ DATASET p_f2 INTO wa_input_rec.
    IF sy-subrc 0.
    MESSAGE s000 WITH text-030.
    EXIT.
    ENDIF.
    o
    + Split The CSV record into Work Area
    PERFORM f0025_record_split.
    o
    + Populate internal table.
    APPEND wa_input TO i_input.
    CLEAR wa_input.
    ENDDO.
    ENDIF.
    ENDFORM. " f1004_app_file
    *& Form f0025_record_split
    Move the assembly layer file into the work area
    FORM f0025_record_split .
    CLEAR wa_input.
    SPLIT wa_input_rec AT c_split INTO
    wa_input-legacykey
    wa_input-profile_role
    wa_input-read_date.
    ENDFORM. " f0025_record_split
    DO your manipulation with the data records here.
    Popualte data into final internal table and write it back to application server at the desired path.
    *& Form f0020_write_application
    Write error log to application Server
    FORM f0020_write_application .
    IF p_f1 IS NOT INITIAL.
    CONCATENATE p_direct p_obj sy-datum text-037 INTO p_f2.
    ELSEIF p_f2 IS NOT INITIAL.
    REPLACE text-036 IN p_f2 WITH text-037.
    ENDIF.
    OPEN DATASET p_f2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT i_error INTO wa_error.
    TRANSFER wa_error TO p_f2.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    CLEAR wa_error.
    ENDLOOP.
    CLOSE DATASET p_f2.
    ENDFORM. " f0020_write_application
    HTH,
    Regards,
    Dhruv Shah

  • LSMW Convert Excel to Tab Delimited

    Hello,
    I need to upload data, presnt in excel sheet via LSMW. The input for the LSMW needs to be in tab delimited file. Is it possible in the LSMW process to be able to convert the file format from excel to a tab delimited file or should the file format be manually changed to excel ?
    Thanks,
    Anand

    Thanks for the answer..But I wanted to know if the same operation can be automated or is it possible via LSMW ? Can we achieve this in any of the steps in LSMW ?
    Regards,
    Anand

  • Issues with external table from text file ( tab delimiter )

    Hello Guru,
    --Data in my file, file name : TEST1 ( tab delimiter )
    "C1" "C2"
    "test column1" "01/27/2012"
    "test column1" "01/27/2012"
    "test column1" "01/09/2012"
    -- Table
    CREATE TABLE EXT_TEST
    C1 VARCHAR2(50 BYTE),
    C2 VARCHAR2(12 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "TEST"
    ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE
    SKIP 1 FIELDS
    TERMINATED BY X'9' missing field VALUES are NULL REJECT ROWS
    WITH ALL NULL FIELDS ) LOCATION ( 'TEST1' )
    REJECT LIMIT UNLIMITED;
    -- my current output
    select * from EXT_TEST ;
    C1 C2
    "test column1" "01/27/2012"
    "test column1" "01/27/2012"
    "test column1" "01/09/2012"
    -- I need output in this way
    C1 C2
    "test column1" "01/27/2012"
    "test column1" "01/27/2012"
    "test column1" "01/09/2012"
    my version :
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    "CORE     10.2.0.5.0     Production"
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    Please help me resolve this and learn further steps.
    Thank You!

    Try this:
    -- Etc ---
    FIELDS TERMINATED BY X'9'
    OPTIONALLY ENCLOSED BY '"'
    missing field VALUES are NULL REJECT ROWS
    -- Etc ---
    {code}
    :p                                                                                                                                                                                                                                                                                                               

  • Import text into a form from a tab delimited file using an action

    Good evening.
    I am using Adobe Acrobat XI Pro
    I have been working all weekend so far on this, and have tried many options.
    What I am wanting is to import a line of data from an excel file into a form, save the file with a name drived from the form fields, close the new file, then go back to the original file, import a line of data, and so on and so on.
    I had all of this working in livecyle with a tool, but now that we are going to Windows 8 and Microsoft Office 2013, the driver that I need to load the excel file into the form is not available--so now I have to redo the forms in Adobe and import using a tab delimited file.
    I would like to do this with an action.
    Thus far, I have the following.
    **Credit goes to George Johnson who helped me with the script to save the file using field names a few months ago**
    To start, I have a folder level script
    mySaveAs = app.trustPropagatorFunction(function(doc,path)
    app.beginPriv();
    var myDoc = event.target;
    myDoc.saveAs(path);
    app.endPriv();
    myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
    //privileged and/or non-privileged code above
    app.beginPriv();
    mySaveAs(doc, path);
    app.endPriv
    //Privileged and/or non-privileged code below
    For the Action, I start with the Form file loaded
    Then I execute a javascript to import the text into the file.
    this.importTextData("/c/data/clerical.txt");
    The next step is to save the file using field names as part of the file name
    --credit goes to George Johnson who assisted me with this on a similar project a few months ago.
    //Get the Field Value
    var fn=getField("Last").valueAsString + "-" + getField("First").valueAsString;
    //Specify the folder
    var fldr = "/c/data/";
    //Determine the full path
    var fp=fldr + fn + ".pdf";
    //save the file
    myTrustedSpecialTaskFunc(this, fp);
    That is as far as I have gotten. 
    What I want to do now is load the original form file, import the next line into the form, save the file, repeat.
    If anyone could assist me, I would greatly appreciate it.
    **note  I had to type this from my I-pad because I kept getting kicked off the internet from my computer.  I hope my code is typed correctly.

    George
    Thank you so much for your response.
    Yes--there are multiple lines in the data file--it will vary from month to month.  It looks like from what you are saying is that I need to do the global variable since it will constantly change, and then increment it as it goes through the text file.  When it reaches the end, then it will stop.
    I looked at the following links--but this is from Adobe 9 API--I don't know if things have changed with XI--especially since 9 used batch processing and XI has actions.
    Count PDF Files
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    Global counter
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    I am not exactly sure how to include this in my code.
    If you could point me in the right direction, I would appreciate it.

  • Download into tab delimited  text file

    Hi all
    I am uploading  data from a text file with tab delimited.
    For some reason if the record doesnot satisfy the criteria i cannot upload the record .
    In the program i am moving those records into another internal table and deleting from the actual that i ausing to update the ztable.
    I need to download those fault records into another text file with tab delimited space with the same format so that they can correct those records and upload again.
    Thanks
    Preeti

    Preeti,
    Look at the code below. It should do everything that U want to do. However it uploads data from excel and downloads data into a text file.
    Hope this helps,
    Shreekant.
    Program Name  : ZRSD0177_XREF_EXCEL_UPLOAD                           *
    REPORT  zrsd0177_xref_excel_upload NO STANDARD PAGE HEADING    .
    TABLES : zzsd0010,
             knvv.
    DATA : g_repid LIKE sy-repid,
           $v_start_col         TYPE i VALUE '1',
           $v_start_row         TYPE i VALUE '2',
           $v_end_col           TYPE i VALUE '256',
           $v_end_row           TYPE i VALUE '65536',
           gd_currentrow TYPE i.
    *Data Declaration for the table ZZSD0010
    DATA : BEGIN OF it_zzsd0010 OCCURS 0.
            INCLUDE STRUCTURE zzsd0010.
    DATA : END OF it_zzsd0010.
    *DATA : it1_zzsd0010 LIKE it_zzsd0010 OCCURS 0 WITH HEADER
          LINE.
    *Data Declaration for EXCEL TABLES
    DATA :BEGIN OF it_tab_driver OCCURS 0,
               mandt                LIKE zzsd0010-mandt,
               sorg                 LIKE zzsd0010-vkorg,
               sdis                 LIKE zzsd0010-vtweg,
               sdiv                 LIKE zzsd0010-spart,
               gelco_princ_customer LIKE zzsd0010-princ_customer,
               sell_div             LIKE zzsd0010-kdgrp,
               payer                LIKE zzsd0010-payer,
               qad_cust(10)         TYPE c,
               name(30)             TYPE c,
               broker(3)            TYPE c,
          END OF it_tab_driver.
    DATA : it_tab_driver1 LIKE it_tab_driver OCCURS 0 WITH HEADER LINE.
    DATA :BEGIN OF it_tab_lookup OCCURS 0,
               rpc_ship_to(10) TYPE c,
               rpc_sold_to(10) TYPE c,
               rpc_bill_to(10) TYPE c,
               type(10)        TYPE c,
               qad_ship_to(10) TYPE c,
               qad_sold_to(10) TYPE c,
               qad_bill_to(10) TYPE c,
               sell_div1       LIKE zzsd0010-kdgrp,
               broker(3)       TYPE c,
          END OF it_tab_lookup.
    DATA : BEGIN OF it_knvv OCCURS 0,
            kunnr LIKE knvv-kunnr,
            vkorg LIKE knvv-vkorg,                              "V004
            vtweg LIKE knvv-vtweg,                              "V004
            spart LIKE knvv-spart,                              "V004
            kdgrp LIKE knvv-kdgrp,
           END OF it_knvv.
    DATA: it_outfile(200)   OCCURS 0 WITH HEADER LINE.
    DATA: it_outfile1(200)  OCCURS 0 WITH HEADER LINE.          "V004
    DATA: it_outfile2(200)  OCCURS 0 WITH HEADER LINE.          "V004
    DATA: it_outfile3(200)  OCCURS 0 WITH HEADER LINE.          "V004
    DATA: it_outfile4(200)  OCCURS 0 WITH HEADER LINE.          "V004
    DATA: it_driver LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA: it_lookup LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    *--- Selection Screen
    SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text.
    PARAMETERS : p_file  LIKE rlgrap-filename DEFAULT
    'C:\zzsd0010\driver.xls'.
    PARAMETERS : p1_file LIKE rlgrap-filename DEFAULT
    'C:\zzsd0010\lookup.xls'.
    PARAMETERS : p2_file LIKE rlgrap-filename DEFAULT
    'C:\zzsd0010\error.txt'.
    PARAMETERS : p3_file LIKE rlgrap-filename DEFAULT
    'C:\zzsd0010\warning_Sales_Div.txt'.
    PARAMETERS : p4_file LIKE rlgrap-filename DEFAULT           "V004
    'C:\zzsd0010\warning_Sales_Org.txt'.                        "V004
    PARAMETERS : p5_file LIKE rlgrap-filename DEFAULT           "V004
    'C:\zzsd0010\warning_Dist_channel.txt'.                     "V004
    PARAMETERS : p6_file LIKE rlgrap-filename DEFAULT           "V004
    'C:\zzsd0010\warning_Division.txt'.                         "V004
    PARAMETERS : p7_file LIKE rlgrap-filename DEFAULT           "V004
    'C:\zzsd0010\cust_not_found.txt'.
    SELECTION-SCREEN : END OF BLOCK blk.
    INITIALIZATION.
      g_repid = sy-repid.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name = g_repid
        IMPORTING
          file_name    = p_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p1_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name = g_repid
        IMPORTING
          file_name    = p1_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p2_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name = g_repid
        IMPORTING
          file_name    = p2_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p3_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name = g_repid
        IMPORTING
          file_name    = p3_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p4_file.           "V004
      CALL FUNCTION 'F4_FILENAME'                               "V004
        EXPORTING                                               "V004
          program_name = g_repid                                "V004
        IMPORTING                                               "V004
          file_name    = p4_file.                               "V004
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p5_file.           "V004
      CALL FUNCTION 'F4_FILENAME'                               "V004
        EXPORTING                                               "V004
          program_name = g_repid                                "V004
        IMPORTING                                               "V004
          file_name    = p5_file.                               "V004
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p6_file.           "V004
      CALL FUNCTION 'F4_FILENAME'                               "V004
        EXPORTING                                               "V004
          program_name = g_repid                                "V004
        IMPORTING                                               "V004
          file_name    = p6_file.                               "V004
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p7_file.           "V004
      CALL FUNCTION 'F4_FILENAME'                               "V004
        EXPORTING                                               "V004
          program_name = g_repid                                "V004
        IMPORTING                                               "V004
          file_name    = p7_file.                               "V004
    START-OF-SELECTION.
    Get the data from XLS to Internal Table
      PERFORM f1000_upload_driver_data.
      PERFORM f2000_upload_lookup_data.
    *UPDATE DATA BASE
      SORT it_tab_driver BY gelco_princ_customer qad_cust.
      SORT it_tab_lookup BY qad_sold_to.
      CLEAR : it_tab_lookup,
              it_tab_driver.
      LOOP AT it_tab_driver.
        CLEAR : it_tab_lookup.
        IF
           it_tab_driver-gelco_princ_customer = it_tab_driver-qad_cust.
    Hit the sold-to column first, and if does not find a hit then try
    the bill-to column.
          READ TABLE it_tab_lookup
          WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
          IF sy-subrc = 0.
            it_zzsd0010-mandt          = it_tab_driver-mandt.
            it_zzsd0010-vkorg          = it_tab_driver-sorg.
            it_zzsd0010-vtweg          = it_tab_driver-sdis.
            it_zzsd0010-spart          = it_tab_driver-sdiv.
            it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
            it_zzsd0010-kunnr          = it_tab_lookup-rpc_sold_to.
            it_zzsd0010-payer          = ' '.
            it_zzsd0010-kdgrp          = it_tab_driver-sell_div.
            it_zzsd0010-ernam          = sy-uname.
            it_zzsd0010-erdat          = sy-datum.
            it_zzsd0010-erzet          = sy-uzeit.
            it_zzsd0010-aenam          = sy-uname.
            it_zzsd0010-aedat          = sy-datum.
            it_zzsd0010-aezat          = sy-uzeit.
            PERFORM f6000_add_zeros_to_cust.                    "V004
            APPEND it_zzsd0010.
            INSERT INTO zzsd0010 VALUES it_zzsd0010.
            PERFORM f5000_warning_file.                         "V004
            CLEAR  it_zzsd0010.
          ELSEIF sy-subrc <> 0.
            READ TABLE it_tab_lookup
            WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
            IF sy-subrc = 0.
              it_zzsd0010-mandt          = it_tab_driver-mandt.
              it_zzsd0010-vkorg          = it_tab_driver-sorg.
              it_zzsd0010-vtweg          = it_tab_driver-sdis.
              it_zzsd0010-spart          = it_tab_driver-sdiv.
              it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
              it_zzsd0010-kunnr          = it_tab_lookup-rpc_bill_to.
              it_zzsd0010-payer          = 'X'.
              it_zzsd0010-kdgrp          = it_tab_driver-sell_div.
              it_zzsd0010-ernam          = sy-uname.
              it_zzsd0010-erdat          = sy-datum.
              it_zzsd0010-erzet          = sy-uzeit.
              it_zzsd0010-aenam          = sy-uname.
              it_zzsd0010-aedat          = sy-datum.
              it_zzsd0010-aezat          = sy-uzeit.
              PERFORM f6000_add_zeros_to_cust.                  "V004
              APPEND it_zzsd0010.
              INSERT INTO zzsd0010 VALUES it_zzsd0010.
              PERFORM f5000_warning_file.                       "V004
              CLEAR  it_zzsd0010.
            ELSE.
              it_tab_driver1 = it_tab_driver.
              APPEND it_tab_driver1.
            ENDIF.
          ENDIF.
        ELSEIF it_tab_driver-gelco_princ_customer <> it_tab_driver-qad_cust.
    Hit the sold-to column first, and if does not find a hit then try
    the bill-to column.
          READ TABLE it_tab_lookup
          WITH KEY qad_sold_to = it_tab_driver-qad_cust.
          IF sy-subrc = 0.
            it_zzsd0010-mandt          = it_tab_driver-mandt.
            it_zzsd0010-vkorg          = it_tab_driver-sorg.
            it_zzsd0010-vtweg          = it_tab_driver-sdis.
            it_zzsd0010-spart          = it_tab_driver-sdiv.
            it_zzsd0010-kunnr          = it_tab_lookup-rpc_sold_to.
            it_zzsd0010-payer          = ' '.
            it_zzsd0010-kdgrp          = it_tab_driver-sell_div.
            it_zzsd0010-ernam          = sy-uname.
            it_zzsd0010-erdat          = sy-datum.
            it_zzsd0010-erzet          = sy-uzeit.
            it_zzsd0010-aenam          = sy-uname.
            it_zzsd0010-aedat          = sy-datum.
            it_zzsd0010-aezat          = sy-uzeit.
            READ TABLE it_tab_lookup
            WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
            IF sy-subrc = 0.
              it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
              PERFORM f6000_add_zeros_to_cust.                  "V004
              APPEND it_zzsd0010.
              INSERT INTO zzsd0010 VALUES it_zzsd0010.
              PERFORM f5000_warning_file.                       "V004
              CLEAR  it_zzsd0010.
            ELSEIF sy-subrc <> 0.
              READ TABLE it_tab_lookup
              WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
              IF sy-subrc = 0.
                it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
                PERFORM f6000_add_zeros_to_cust.                 "V004
                APPEND it_zzsd0010.
                INSERT INTO zzsd0010 VALUES it_zzsd0010.
                PERFORM f5000_warning_file.                      "V004
                CLEAR  it_zzsd0010.
              ELSE.
                it_tab_driver1 = it_tab_driver.
                APPEND it_tab_driver1.
              ENDIF.
            ENDIF.
          ELSEIF sy-subrc <> 0.
            READ TABLE it_tab_lookup
            WITH KEY qad_bill_to = it_tab_driver-qad_cust.
            IF sy-subrc = 0.
              it_zzsd0010-mandt          = it_tab_driver-mandt.
              it_zzsd0010-vkorg          = it_tab_driver-sorg.
              it_zzsd0010-vtweg          = it_tab_driver-sdis.
              it_zzsd0010-spart          = it_tab_driver-sdiv.
              it_zzsd0010-kunnr          = it_tab_lookup-rpc_bill_to.
              it_zzsd0010-payer          = 'X'.
              it_zzsd0010-kdgrp          = it_tab_driver-sell_div.
              it_zzsd0010-ernam          = sy-uname.
              it_zzsd0010-erdat          = sy-datum.
              it_zzsd0010-erzet          = sy-uzeit.
              it_zzsd0010-aenam          = sy-uname.
              it_zzsd0010-aedat          = sy-datum.
              it_zzsd0010-aezat          = sy-uzeit.
              READ TABLE it_tab_lookup
              WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
              IF sy-subrc = 0.
                it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
                PERFORM f6000_add_zeros_to_cust.                "V004
                APPEND it_zzsd0010.
                INSERT INTO zzsd0010 VALUES it_zzsd0010.
                PERFORM f5000_warning_file.                     "V004
                CLEAR  it_zzsd0010.
              ELSEIF sy-subrc <> 0.
                READ TABLE it_tab_lookup
                WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
                IF sy-subrc = 0.
                  it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
                  PERFORM f6000_add_zeros_to_cust.              "V004
                  APPEND it_zzsd0010.
                  INSERT INTO zzsd0010 VALUES it_zzsd0010.
                  PERFORM f5000_warning_file.                   "V004
                  CLEAR  it_zzsd0010.
                ELSE.
                  it_tab_driver1 = it_tab_driver.
                  APPEND it_tab_driver1.
                ENDIF.
              ENDIF.
            ELSE.
              it_tab_driver1 = it_tab_driver.
              APPEND it_tab_driver1.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      LOOP AT it_tab_driver.
        IF
         it_tab_driver-gelco_princ_customer <> it_tab_driver-qad_cust.
          READ TABLE it_tab_lookup
          WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
          IF sy-subrc = 0.
            it_zzsd0010-mandt          = it_tab_driver-mandt.
            it_zzsd0010-vkorg          = it_tab_driver-sorg.
            it_zzsd0010-vtweg          = it_tab_driver-sdis.
            it_zzsd0010-spart          = it_tab_driver-sdiv.
            it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
            it_zzsd0010-kunnr          = it_tab_lookup-rpc_sold_to.
            it_zzsd0010-payer          = ' '.
            it_zzsd0010-kdgrp          = it_tab_driver-sell_div.
            it_zzsd0010-ernam          = sy-uname.
            it_zzsd0010-erdat          = sy-datum.
            it_zzsd0010-erzet          = sy-uzeit.
            it_zzsd0010-aenam          = sy-uname.
            it_zzsd0010-aedat          = sy-datum.
            it_zzsd0010-aezat          = sy-uzeit.
            PERFORM f6000_add_zeros_to_cust.                    "V004
            APPEND it_zzsd0010.
            INSERT INTO zzsd0010 VALUES it_zzsd0010.
            PERFORM f5000_warning_file.                         "V004
            CLEAR  it_zzsd0010.
          ELSE.
            it_tab_driver1 = it_tab_driver.
            APPEND it_tab_driver1.
          ENDIF.
        ENDIF.
      ENDLOOP.
      PERFORM f3000_data_base_not_updated.
      PERFORM f4000_check_sales_division.
    *&      Form  f1000_upload_driver_data
    FORM f1000_upload_driver_data.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = $v_start_col
          i_begin_row             = $v_start_row
          i_end_col               = $v_end_col
          i_end_row               = $v_end_row
        TABLES
          intern                  = it_driver
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/10 'File '.
      ENDIF.
      IF sy-subrc EQ 0.
        READ TABLE it_driver INDEX 1.
        gd_currentrow = it_driver-row.
        LOOP AT it_driver.
          IF it_driver-row NE gd_currentrow.
            APPEND it_tab_driver.
            CLEAR it_tab_driver.
            gd_currentrow = it_driver-row.
          ENDIF.
          CASE it_driver-col.
            WHEN '0001'.
              it_tab_driver-mandt = it_driver-value.
            WHEN '0002'.
              it_tab_driver-sorg = it_driver-value.
            WHEN '0003'.
              it_tab_driver-sdis = it_driver-value.
            WHEN '0004'.
              it_tab_driver-sdiv = it_driver-value.
            WHEN '0005'.
              it_tab_driver-gelco_princ_customer = it_driver-value.
            WHEN '0006'.
              it_tab_driver-sell_div = it_driver-value.
            WHEN '0007'.
              it_tab_driver-payer = it_driver-value.
            WHEN '0008'.
              it_tab_driver-qad_cust = it_driver-value.
            WHEN '0009'.
              it_tab_driver-name = it_driver-value.
            WHEN '0010'.
              it_tab_driver-broker = it_driver-value.
          ENDCASE.
        ENDLOOP.
      ENDIF.
      APPEND it_tab_driver.
    ENDFORM.                    " f1000_upload_driver_data
    *&      Form  f2000_upload_lookup_data
    FORM f2000_upload_lookup_data.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p1_file
          i_begin_col             = $v_start_col
          i_begin_row             = $v_start_row
          i_end_col               = $v_end_col
          i_end_row               = $v_end_row
        TABLES
          intern                  = it_lookup
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/10 'File '.
      ENDIF.
      IF sy-subrc EQ 0.
        READ TABLE it_lookup INDEX 1.
        gd_currentrow = it_lookup-row.
        LOOP AT it_lookup.
          IF it_lookup-row NE gd_currentrow.
            APPEND it_tab_lookup.
            CLEAR it_tab_lookup.
            gd_currentrow = it_lookup-row.
          ENDIF.
          CASE it_lookup-col.
            WHEN '0001'.
              it_tab_lookup-rpc_ship_to = it_lookup-value.
            WHEN '0002'.
              it_tab_lookup-rpc_sold_to = it_lookup-value.
            WHEN '0003'.
              it_tab_lookup-rpc_bill_to = it_lookup-value.
            WHEN '0004'.
              it_tab_lookup-type        = it_lookup-value.
            WHEN '0005'.
              it_tab_lookup-qad_ship_to = it_lookup-value.
            WHEN '0006'.
              it_tab_lookup-qad_sold_to = it_lookup-value.
            WHEN '0007'.
              it_tab_lookup-qad_bill_to = it_lookup-value.
            WHEN '0008'.
              it_tab_lookup-sell_div1    = it_lookup-value.
            WHEN '0009'.
              it_tab_lookup-broker      = it_lookup-value.
          ENDCASE.
        ENDLOOP.
      ENDIF.
      APPEND it_tab_lookup.
    ENDFORM.                    " f2000_upload_lookup_data
    *&      Form  f3000_data_base_not_updated
          text
    FORM f3000_data_base_not_updated .
      CALL FUNCTION 'DOWNLOAD'
       EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
         filename                      = p2_file
         filetype                      = 'ASC'
        TABLES
          data_tab                      = it_tab_driver1
      FIELDNAMES                    =
       EXCEPTIONS
         invalid_filesize              = 1
         invalid_table_width           = 2
         invalid_type                  = 3
         no_batch                      = 4
         unknown_error                 = 5
         gui_refuse_filetransfer       = 6
         customer_error                = 7
         OTHERS                        = 8
      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.                    " data_base_not_updated
    *&      Form  f4000_Check_Sales_Division
          text
    FORM f4000_check_sales_division .
      SORT it_outfile.
      SORT it_outfile1.
      SORT it_outfile2.
      SORT it_outfile3.
      CALL FUNCTION 'DOWNLOAD'
        EXPORTING
          filename                = p3_file
          filetype                = 'ASC'
        TABLES
          data_tab                = it_outfile
        EXCEPTIONS
          invalid_filesize        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          customer_error          = 7
          OTHERS                  = 8.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'DOWNLOAD'                                  "V004
        EXPORTING                                               "V004
          filename                = p4_file                     "V004
          filetype                = 'ASC'                       "V004
        TABLES                                                  "V004
          data_tab                = it_outfile1                 "V004
        EXCEPTIONS                                              "V004
          invalid_filesize        = 1                           "V004
          invalid_table_width     = 2                           "V004
          invalid_type            = 3                           "V004
          no_batch                = 4                           "V004
          unknown_error           = 5                           "V004
          gui_refuse_filetransfer = 6                           "V004
          customer_error          = 7                           "V004
          OTHERS                  = 8.                          "V004
      IF sy-subrc <> 0.                                         "V004
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO           "V004
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.           "V004
      ENDIF.                                                    "V004
      CALL FUNCTION 'DOWNLOAD'                                  "V004
        EXPORTING                                               "V004
          filename                = p5_file                     "V004
          filetype                = 'ASC'                       "V004
        TABLES                                                  "V004
          data_tab                = it_outfile2                 "V004
        EXCEPTIONS                                              "V004
          invalid_filesize        = 1                           "V004
          invalid_table_width     = 2                           "V004
          invalid_type            = 3                           "V004
          no_batch                = 4                           "V004
          unknown_error           = 5                           "V004
          gui_refuse_filetransfer = 6                           "V004
          customer_error          = 7                           "V004
          OTHERS                  = 8.                          "V004
      IF sy-subrc <> 0.                                         "V004
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO           "V004
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.           "V004
      ENDIF.                                                    "V004
      CALL FUNCTION 'DOWNLOAD'                                  "V004
        EXPORTING                                               "V004
          filename                = p6_file                     "V004
          filetype                = 'ASC'                       "V004
        TABLES                                                  "V004
          data_tab                = it_outfile3                 "V004
        EXCEPTIONS                                              "V004
          invalid_filesize        = 1                           "V004
          invalid_table_width     = 2                           "V004
          invalid_type            = 3                           "V004
          no_batch                = 4                           "V004
          unknown_error           = 5                           "V004
          gui_refuse_filetransfer = 6                           "V004
          customer_error          = 7                           "V004
          OTHERS                  = 8.                          "V004
      IF sy-subrc <> 0.                                         "V004
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO           "V004
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.           "V004
      ENDIF.                                                    "V004
      CALL FUNCTION 'DOWNLOAD'                                  "V004
        EXPORTING                                               "V004
          filename                = p7_file                     "V004
          filetype                = 'ASC'                       "V004
        TABLES                                                  "V004
          data_tab                = it_outfile4                 "V004
        EXCEPTIONS                                              "V004
          invalid_filesize        = 1                           "V004
          invalid_table_width     = 2                           "V004
          invalid_type            = 3                           "V004
          no_batch                = 4                           "V004
          unknown_error           = 5                           "V004
          gui_refuse_filetransfer = 6                           "V004
          customer_error          = 7                           "V004
          OTHERS                  = 8.                          "V004
      IF sy-subrc <> 0.                                         "V004
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO           "V004
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.           "V004
      ENDIF.                                                    "V004
    ENDFORM.                    " f4000_Check_Sales_Division
    *&      Form  f5000_warning_file
          Sales area in KNVV table is compared with the sales area in
          ZZSD0010 table and a warning file is created if any mismatch   *
          occurs                                                         *
    FORM f5000_warning_file .                                   "V004
      IF it_zzsd0010-payer <> 'X'.                              "V003
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'             "V002
          EXPORTING                                             "V002
            input  = it_zzsd0010-kunnr                          "V002
          IMPORTING                                             "V002
            output = it_zzsd0010-kunnr.                         "V002
        SELECT kunnr                                            "V002
               vkorg                                            "V004
               vtweg                                            "V004
               spart                                            "V004
               kdgrp                                            "V002
          INTO TABLE it_knvv                                    "V002
          FROM knvv                                             "V002
         WHERE kunnr = it_zzsd0010-kunnr.                       "V002
        IF sy-subrc = 0.                                        "V002
          READ TABLE it_knvv WITH KEY kunnr = it_zzsd0010-kunnr.
          IF it_zzsd0010-kdgrp <> it_knvv-kdgrp.                "V002
            CONCATENATE it_zzsd0010-princ_customer              "V002
                        it_zzsd0010-kunnr                       "V002
                        it_zzsd0010-kdgrp                       "V002
                        it_knvv-kdgrp                           "V002
            INTO it_outfile SEPARATED BY space.                 "V002
            APPEND it_outfile.                                  "V002
          ENDIF.                                                "V002
          IF it_zzsd0010-vkorg <> it_knvv-vkorg.                "V004
            CONCATENATE it_zzsd0010-princ_customer              "V004
                        it_zzsd0010-kunnr                       "V004
                        it_zzsd0010-vkorg                       "V004
                        it_knvv-vkorg                           "V004
            INTO it_outfile1 SEPARATED BY space.                "V004
            APPEND it_outfile1.                                 "V005
          ENDIF.                                                "V004
          IF it_zzsd0010-vtweg <> it_knvv-vtweg.                "V004
            CONCATENATE it_zzsd0010-princ_customer              "V004
                        it_zzsd0010-kunnr                       "V004
                        it_zzsd0010-vtweg                       "V004
                        it_knvv-vtweg                           "V004
            INTO it_outfile2 SEPARATED BY space.                "V004
            APPEND it_outfile2.                                 "V005
          ENDIF.                                                "V004
          IF it_zzsd0010-spart <> it_knvv-spart.                "V004
            CONCATENATE it_zzsd0010-princ_customer              "V004
                        it_zzsd0010-kunnr                       "V004
                        it_zzsd0010-spart                       "V004
                        it_knvv-spart                           "V004
            INTO it_outfile3 SEPARATED BY space.                "V004
            APPEND it_outfile3.                                 "V005
          ENDIF.                                                "V004
          CLEAR it_outfile.                                     "V002
          CLEAR it_outfile1.                                    "V004
          CLEAR it_outfile2.                                    "V004
          CLEAR it_outfile3.                                    "V004
          CLEAR it_knvv.                                        "V002
          REFRESH it_knvv.                                      "V002
        ELSE.                                                   "V002
          CONCATENATE 'CUSTOMER'                                "V002
                       it_zzsd0010-kunnr                        "V002
                      'NOT FOUND IN KNVV TABLE'                 "V002
          INTO it_outfile4 SEPARATED BY space.                   "V002
          APPEND it_outfile4.                                    "V002
        ENDIF.                                                  "V002
      ENDIF.                                                    "V003
    ENDFORM.                    " f5000_warning_file            "V004
    *&      Form  f6000_add_zeros_to_cust
          text
    -->  p1        text
    <--  p2        text
    form f6000_add_zeros_to_cust .
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'             "V002
          EXPORTING                                             "V002
            input  = it_zzsd0010-kunnr                          "V002
          IMPORTING                                             "V002
            output = it_zzsd0010-kunnr.                         "V002
    endform.                    " f6000_add_zeros_to_cust

  • Output file as a text file with tab delimited and fixed length fields

    Hi all,
    I have developed a custom report which outputs an excel file on the user desktop who executes that report.Now i need to create an additional (second) excel file with almost the same data as the first file.
    Im using the FM GUI_DOWNLOAD to create the file.i need have the 2nd file as txt file(seperated by space/tab delimited) and also i want the fields to have fixed length.For this format of the file,what parameters do I need to pass to the FM ?
    BR,
    SRM Tech.

    Thanks for the prompt reply.
    Also in the sel screen,Im entering the path where  the o/p file needs to be downloadede.g. C:/Output_folder/Output.xls...Now if I need a text file,do I need to give the fielname as C:/Output_folder/Output.txt.?

  • FM to upload TAB DELIMITED TEXT file into Internal table.

    Hello Friends,
    The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' is used to upload EXCEL file into a Internal table.
    Is there any FM which performs the simillar operation on TAB DELIMITED TEXT FILE.
    Thanks in advance!
    Ashish

    Hi,
    To upload text file with tab delimated you can use FM
    GUI_OPLOAD.
    In this function you have put X in the field HAS_FIELD_SEPARATOR.
    Regards,
    Sujit

  • Uploading text file (TAB delimited) to Oracle database table

    Hi, im creating a form that will upload a text file(TAB delimited) that will insert a data in a database table. How would i do this? And what trigger will i use in the upload button? Please help..
    Thanks,
    Majic

    hi majic,
    Check any of this site related to oracle sql and plsql
    and do reply me if not found.
    1) http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/03_types.htm#LNPLS003
    Oracle composite data type help
    2) http://www.cs.umb.edu/cs634/ora9idocs/appdev.920/a96624/07_errs.htm#784
    Oracle plsql help good one check out
    3) http://www.orafaq.com/faqsql.htm#WHAT
    Oracle frequently asked questions
    4) http://www.bijoos.com/ora9/index.htm
    Oracle diff version comparasion help in above no 4 web site
    5) http://www.unix.org.ua/orelly/oracle/prog2/index.htm
    Oracle oreilly hand book good book for oracle pl/sql
    6) http://www.orafaq.com/glossary/faqgloss.htm#SQL_Loader
    check out for oracle faq good one
    7) http://www.rittman.net/archives/cat_oracle_9ias.html
    check out for Froms10g Installation and much more
    8) http://www.devarticles.com/c/a/Oracle/Creating-a-Database-in-Oracle-9i/2/
    check this for creating a oracle database in 9i***
    9) http://tahiti.oracle.com/
    suggested my many user for oracle help..check out this also
    10) http://www.jlcomp.demon.co.uk/faq/ind_faq.html
    For Full oracle related questions and answer****
    Regards,
    Asif A K.

Maybe you are looking for

  • Can't see Documents folder in Finder, but can see it in Terminal

    I have a MacBook Pro, OS 10.6.5. My Documents folder does NOT appear in a Finder window, but I can see it using the ls command in Terminal. Documents is not an invisible file in the UNIX sense; its name is NOT ".Documents" Below is a copy of the line

  • Can't access Cruzer Extreme 16GB USB 3.0

    Strange thing happened to my Cruzer. When I attach it to USB port I hear that characteristic sound that something is plugged. In Device Manager it appears almost instant. But when I open My Computer most of the time I see nothing. When my Cruzer deci

  • Tracking Change Management in P6

    caveat: We don't use Contract Manager / Expedition<br /> We do use Timesheets for time entry and status of activities Ok, in P6 we are trying to track change management. Maybe not the full workflow that passes from individual to individual. We are lo

  • Dyndns providers on WRP400

    Cisco routers have two Dyndns providers. Since Dyndns.com is no longer free, TZO too. Do Cisco make an Upgrade with new free dyndns providers (like no-ip.com)?. I have WRP400 router and BEFW11S4. Must We Pay for DynDns with Cisco/Linksys

  • Background Image in SharePoint 2013

    Hi, Whenever I add a background image in SharePoint 2013, approx. 99% of the background image has an automatic overlay applied; some form of automatic transparency, so that the image is more like a watermark. Oddly, at the bottom of the page, there i