Upload/Download from unix - give easy exammple for tab delimited .TXT file

Hello experts,
I have 2 requirements.
1. I want to upload a tab delimited .txt file from local PC to UNIX server.
2. I want to Read same file, then some process and get result to the same location. (output file name should be diffrent)
How i can fulfill these two requirements?
Regards,
RH

Hi,
upload a tab delimited .txt file from local PC to UNIX server
Please go through the below logic this will help you,
*& Report  Z10_SHAD_V_UPLD_PR_APP_SERV
report  z10_shad_v_upld_pr_app_serv message-id zmessage.
*&--INCLUDE FOR DECLARATION
include z10_upld_top.
*&--INCLUDE FOR ALL FORMS
include z10_upld_forms.
start-of-selection.
*&--PERFORM FOR UPLOADING LOGIC.
perform z10_upld.
end-of-selection.
*&  Include           Z10_UPLD_TOP
*&--STRUCTURE FOR INTERNAL TABLE.
*&--THAT IS GOING TO HOLD PRESENTATION SERVER FILE DATA.
data:begin of wa,
name(40) ,
end of wa.
*&--INTERNAL TABLE THAT IS GOING TO HOLD PRESENTATION SERVER DATA.
data: it_tab like wa occurs 0 with header line.
*&--SELECTION-SCREEN FOR GETTING THE PATH OF PRESENTATION LAYER
selection-screen begin of block abc with frame title text-001.
parameters: p_string(128) type c,
                  p_st(128) type c,
selection-screen end of block abc.
data: file_path type rlgrap-filename.
data: p_path type rlgrap-filename,
      filename1 type string,
      file_name like ibipparms-path,
      v_path like dxfields-longpath,
      l_path type string.
*&--PROVIDING F4 KEY FOR THE SCREEN FIELD THAT IS GOING TO
*&--HAVE THE PRESENTATION SERVER FILE PATH
at selection-screen on value-request for p_string.
  call function 'F4_FILENAME'
   exporting
     program_name        = syst-cprog
     dynpro_number       = syst-dynnr
  FIELD_NAME          = ' '
   importing
     file_name           = file_name
  p_string = file_name.
file_path = p_string.
p_path = file_path.
  filename1 = file_name.
*&--PROVIDING F4 KEY FOR THE SCREEN FIELD THAT IS GOING TO
*&--HAVE THE APPLICATION SERVER FILE PATH
at selection-screen on value-request for p_st.
call function 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
  I_LOCATION_FLAG       = ' '
  I_SERVER              = '?'
  I_PATH                =
  FILEMASK              = '.'
  FILEOPERATION         = 'R'
importing
  O_LOCATION_FLAG       =
  O_SERVER              =
   o_path                = v_path
  ABEND_FLAG            =
exceptions
   rfc_error             = 1
   error_with_gui        = 2
   others                = 3
p_st = v_path.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*&      Form  Z10_UPLD
      text
-->  p1        text
<--  p2        text
form z10_upld .
if not p_string is initial.
*&--FUNCTION MODULE THAT IS GOING TO UPLOAD THE PRESENTATION SERVER FILE TO
*&--APPLICATION SERVER.
call function 'GUI_UPLOAD'
  exporting
   filename                      = filename1
   filetype                      = 'ASC'
  HAS_FIELD_SEPARATOR           = ' '
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
  CODEPAGE                      = ' '
  IGNORE_CERR                   = ABAP_TRUE
  REPLACEMENT                   = '#'
  CHECK_BOM                     = ' '
  VIRUS_SCAN_PROFILE            =
  NO_AUTH_CHECK                 = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  tables
    data_tab                      = it_tab[]
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.
message id sy-msgid type sy-msgty number sy-msgno
         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*path = filename1.
open dataset p_st in text mode for output encoding default.
  if sy-subrc ne 0.
    close dataset p_st.
    exit.
  endif.
  if sy-subrc eq 0.
  loop at it_tab.
    transfer it_tab to p_st.
  endloop.
  close dataset p_st.
  message i000.
  endif.
endif.
endform.                    " Z10_UPLD
Hope this helps.

Similar Messages

  • I downloaded from iTunes a hd movie for the first time. What a disaster !                                                Keep stopping and looks like after 2 days has not been downloaded. What am I suppose to do? Can I get my money back? How?

    I downloaded from iTunes a hd movie for the first time. What a disaster ! Keep stopping and looks like after 2 days has not been downloaded. What am I suppose to do? Can I get my money back? How?

    Contact iTunes suport... http://www.apple.com/support/itunes/contact/
    It sounds like you might have a slow wifi internet connection?  How fast is it with a speed test from your iPad.

  • I have purchased adobe light room 5 and upon download from the website was asked for me code .... so

    I have purchased adobe light room 5 and upon download from the website was asked for me code so i entered it. then after installation when clicking on the desktop icon i was once again asked for my code. when i entered it a big red cross apeared next to the code and i was informed to either buy light room (AGAIN) or use the free 30 day trial. how do i use the light room i have paid for?

    Contavct Adobe support thru chat:
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please.  Thanks?

    why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please?

    why can't I download from kuler, my computer doesn't recognise the .ase files its says its an unknown format, can anyone help please?

  • Small doubt  reg upload from tab delimited text file

    Hi  all,
    i am uploading a tab delimited text file to a ztable.
    I moving the text file in to internal table
    data : begin of i_tab occurs 0,
           text(1024) type c,
           end of i_tab.
    then i have passed to FM GUI_UPLOAD.
    and then splitting
    loop at i_tab.
    split i_tab at con_tab
                              into i_xyz-matnr
                                   i_xyz-werks.
        append i_xyz.
    endloop..
    is this the right approach . iam getting the results but iam just curious to know.
    Do i need to internal like the one i created
    data : begin of i_tab occurs 0,
           text(1024) type c,
           end of i_tab.
    or do i need to create one with field that i have in text file.
    data : begin of i_tab occurs 0,
       matnr like mara-matnr,
      werks like marc-werks
    end of i_tab.
    WHICH ONE OF THE TWO IS RIGHT.
    THANKS IN ADVANCE

    There will be NO difference,i guess in the 2 methods.
    you can use which you like.
    Check the below program,i also given quantity fields F2,F3.
    its working fine
    REPORT  ZSRIM_TEMP13.
    data : begin of itab occurs 0,
             f1(20) type c,
             f2     type i,
             f3(10)     type p DECIMALS 2,
           end of itab.
           CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
               FILENAME                      = 'c:a.txt'
              FILETYPE                      = 'ASC'
              <b>HAS_FIELD_SEPARATOR           = 'X'</b>
    *          HEADER_LENGTH                 = 0
    *          READ_BY_LINE                  = 'X'
    *          DAT_MODE                      = ' '
    *          CODEPAGE                      = ' '
    *          IGNORE_CERR                   = ABAP_TRUE
    *          REPLACEMENT                   = '#'
    *          CHECK_BOM                     = ' '
    *          VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
    *          NO_AUTH_CHECK                 = ' '
    *        IMPORTING
    *          FILELENGTH                    = FILELENGTH
    *          HEADER                        = HEADER
             TABLES
               DATA_TAB                      = ITAB
            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.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.
           LOOP AT ITAB.
             WRITE :/ ITAB-F1, ITAB-F2,ITAB-F3.
           ENDLOOP.
    my input file i created with TAB seperated text file,
    here is the input file
    LINE1     1000     123.25
    LINE2     2000     234.25
    LINE3     3000     345.25
    LINE1     1000     123.25
    LINE2     2000     234.25
    LINE3     3000     345.25
    Regards
    Srikanth
    Message was edited by: Srikanth Kidambi

  • 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

  • Efficent method to sort data from tab delimited text file

    I am currently writing a program to sort through data that was acquired and display it on a graph and some other indicators.  The file is a tab delimited text file with possibly 100,000s of data points.  the current method that I have tried using was that if I wanted all of the data from Oct, I would parse out the month from the timestamp, compare that to the desired month, and add it to the array if it is the same.  Other possible options of sorting are yearly and daily, possibly even hourly.
    The method does work, however it does take some time (up to a minute on a P4 3.6 GHz with 2 gb ram), and most of the other computers are not nearly as fast or with as much memory.  Is there a more efficent method to sorting the data??
    I attached my sorting vi as well as a sample data file.
    thanks for the advice.  It is saved in LV8.0.1
    Kenny
    Kenny
    Attachments:
    data sort.zip ‏84 KB
    oven1.txt ‏21 KB

    First of all, "sorting" has usually a different meaning (Sorting and numeric array ascending or descending, a string array aphabetically, etc.). Your data already seems sorted by date and time, you just want to pick a subset having certain characteristics.
    The main problem that is slowing you down is your constant growing of large arrays. This causes constant memory reallocations.
    Since your data is already sorted by date and time, all you need is to place your data in a sutable data structure, find the start and end point of your selection, then use "array subset" for example.
    Your code also seems to have a lot of unecessary complexity. See for example your "test for sort data" (see image below).
    the four cases only differ by filename --> only the file name belongs into the case and the file operation outside the inner case. Even better, just use autoindexing.
    that shift register does not do anything, because it always contains the same data. Using "index array" with index wired to [i] is equivalent to an autoindexing tunnel.
    You have a case structure to select which files to read, skipped files give you an empty array. Do you really need to do all these operations on an empty array. Why not place all code inside the TRUE case??
    Below is an image of one possible code alternative that addresses some of these points.
    Message Edited by altenbach on 10-26-2006 09:32 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    testForSortData.png ‏33 KB

  • Pgm to upload a tab delimited text file

    Hi ,
    can anyone send me a program to upload a tab delimited text file into a ztable.
    My email id is : [email protected]
    Thanks
    Kajol

    Check the below code:
    *& Report  Z_UPLOAD_MUNCPCODE                                          *
    REPORT  z_upload_muncpcode.
    PARAMETERS : p_fname   LIKE rlgrap-filename.
    TYPES: BEGIN OF ty_munc,
            land1     TYPE tzone-land1,
            zone1     TYPE tzone-zone1,
            vtext TYPE tzont-vtext,
           END OF ty_munc.
    DATA: i_munc   TYPE STANDARD TABLE OF ty_munc,
          i_tzone  TYPE STANDARD TABLE OF tzone,
          i_tzont  TYPE STANDARD TABLE OF tzont,
          wa_munc  TYPE ty_munc,
          wa_tzone TYPE tzone,
          wa_tzont TYPE tzont.
    CONSTANTS: c_path     TYPE char20 VALUE 'C:\',
               c_mask     TYPE char9  VALUE ',*.*,*.*.',
               c_mode     TYPE char1  VALUE 'O',
               c_filetype TYPE char10 VALUE 'ASC',
               c_x        TYPE char01 VALUE 'X'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    *-- Browse Presentation Server
      PERFORM f4_presentation_file.
    START-OF-SELECTION..
    *-- Read presentation server file
      PERFORM f1003_pre_file.
      LOOP AT i_munc INTO wa_munc.
        wa_tzone-mandt = wa_tzont-mandt = sy-mandt.
        wa_tzone-land1 = wa_tzont-land1 = wa_munc-land1.
        wa_tzone-zone1 = wa_tzont-zone1 = wa_munc-zone1.
        wa_tzont-spras = sy-langu.
        wa_tzont-vtext = wa_munc-vtext.
        APPEND wa_tzont TO i_tzont.
        APPEND wa_tzone TO i_tzone.
        CLEAR: wa_munc, wa_tzont, wa_tzone.
      ENDLOOP.
    END-OF-SELECTION.
    Modify Table TZONT
      PERFORM enqueue_table USING text-001.
      MODIFY tzont FROM TABLE i_tzont.
      PERFORM dequeue_table USING text-001.
    Modify Table TZONE
      PERFORM enqueue_table USING text-002.
      MODIFY tzone FROM TABLE i_tzone.
      PERFORM dequeue_table USING text-002.
      WRITE: 'Tables TZONE & TZONT are updated'.
    *&                  Form  f4_presentation_file
    *&                F4 Help for presentation server
    FORM f4_presentation_file .
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = c_path
          mask             = c_mask
          mode             = c_mode
          title            = text-001
        IMPORTING
          filename         = p_fname
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " f4_presentation_file
    *&                      Form  f1003_pre_file
    *&                         Upload File
    FORM f1003_pre_file .
      DATA: lcl_filename TYPE string.
      lcl_filename = p_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lcl_filename
          filetype                = c_filetype
          has_field_separator     = c_x
        TABLES
          data_tab                = i_munc
        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.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    ENDFORM.                    " f1003_pre_file
    *&                         Form  enqueue_table
    *&                           Enqueue Table
    FORM enqueue_table USING p_tabname.
      CALL FUNCTION 'ENQUEUE_E_TABLE'
        EXPORTING
          tabname        = p_tabname
        EXCEPTIONS
          foreign_lock   = 1
          system_failure = 2
          OTHERS         = 3.
      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.                    " enqueue_table
    *&                        Form  dequeue_table
    *&                           Dequeue Table
    FORM dequeue_table USING p_tabname.
      CALL FUNCTION 'DEQUEUE_E_TABLE'
        EXPORTING
          tabname = p_tabname.
    ENDFORM.                    " dequeue_table
    Regards,
    Prakash.

  • How to write a code for  open new txt file in swing

    hai all,
    now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
    plz give me that code ! very urgent
    Advance Thanks !
    RSK

    Swing Tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
    If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
    note: don't use the word urgent because it implies that your problem is more important than others.

  • Broken AppleScript for tab delimited importing into AddressBook

    I have a tab delimited file that is not quite ready to import into AddressBook - it needs some massaging first (field merging, context sensitive edits etc.). A book (OS X Missing Manual) referred me to some AppleScripts used by AddressBook which are located in:
    /Library/Scripts/Address Book Scripts/Address Importers
    So I modified the "Tab Delimited Text File.scpt" file contained in there to accommodate all of the field merging etc. that I needed to do, but when I run the script it doesn't do anything. In fact, ALL of the scripts in that place just bring up a dialog box describing their capabilities, and then just quit. The book says these scripts work great... Would some kind soul please let me know how to run these scripts so I can point them to a tab delimited text file and do the import. Note that I'm able to figure out how to do my local changes in the AppleScript code, but I'm a total novice in AppleScript itself (but I can program well in other languages). I figure that because none of the scripts in that directory run, the error isn't mine (yet).
    Thanks,
    Mick

    Sorry for the late reply - I had already figured out that the scripts were subroutines, but also thought they might run solo (they didn't). Another surprise was that the parent routine (/Library/Scripts/Mail Scripts/Import Addresses.scpt) was hard coded to call the children scripts in the Mail directory instead of the Address Book directory. I'm not clear if that's a bug on Apple's side...
    Anyway, I got it all working. The import procedure was excruciating slow - it took well over an hour! The next time I get an update of the database to import I'm coding something up in awk instead of an AppleScript.
    Thanks again for your help.

  • 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

  • Tab Delimited Text File to be Emailed (External Email ID) from SAP

    Hi,
    I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
    Appreciate your help in advance.
    Thanks,
    Kannan

    Hi,
    I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
    Appreciate your help in advance.
    Thanks,
    Kannan

  • SQLLDR - spec for "fields terminated" clause for tab delimited files

    Does anyone know what the spec for tab delimited files is for the "fields terminated" clause in SQLLDR? See the below example for a comma delimited file:
    FIELDS TERMINATED BY ","
    Thanks in advance!
    Jeff

    Hi Jeff,
    You can try this,
    TERMINATED BY WHITESPACE
    The WHITESPACE option is usefull when, delimiter is any whitespace character including spaces, tabs, blanks, line feeds, form feeds, or carriage returns. (Only used with TERMINATED, not with ENCLOSED.)
    I hope this will help you.
    Thanks,
    Thazul.

  • KMANU field value download from R/3 to CRM for price Condition type

    Hi
    We done changes for KMANU field in R/3 - price condition type and that changes have to download from r/3 to CRM. I was tried below object adapters to update field value (R/3 u2013 table name: T685A - KMANU) from R/3 to CRM (Table :PRCC_COND_CT u2013 KMANU). Could you any one tell me how to resolve it. Its urgent plz
    u2022         DNL_CUST_CNDALL
    u2022         DNL_CUST_CND
    u2022         DNL_CUST_PRC
    u2022         DNL_CUST_FGD
    u2022         DNL_CUST_PRICE
    Appreciate your help...........
    Regards
    Sri

    Hello Sri,
    Ideally object DNL_CUST_CNDALL should get all changes done to customizing setting in R/3 to CRM.
    Did you check the logs in txn CND_MAP_LOG_DISPLAY in CRM?
    You can get some hints there, if any error has occured during the download.
    Best Regards,
    Shanthala Kudva.

  • 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

Maybe you are looking for

  • Monitoring with Effects

    I used Cubase a few years ago, and while recording audio tracks, it was impossible to monitor through the computer because of the latency. So, the alternative was having 2 outputs from what was being recorded - one that was being recorded (clean), an

  • Stage height

    I am new at this so hopefully this won't be too complicated. I have a home page that loads a .swf file when it opens. The buttons on the home page load a new .swf file using LoadMovieNum. My problem is that each of these files is a different height.

  • Restricting vendors -any user exits please?

    Hi, I have a requriement where while creating Vendors they have configured in such a way that it has to be approved for all the create and change vendors. since there is some sensitive information like bank accounts and names . now we have changed th

  • How do I remove "ERROR: GETPLUS0.inf " when booting up?

    I have looked at a number of solutions for trying to get rid of this thing and none of them have worked so far. The concensus is that Adobe has used GETPLUS to package the latest Adobe Reader (8.1.something). GETPLUS continues to make changes to the

  • My Thunderbird has been hacked by the Home Depot thieves. And it is now full of often sleazy ads that I can't get rid of. Thunderbird won't ban them. Right?

    Do I have to jettison my Thunderbird account. I'm a victim of the Home Depot hackers, and my mail is filled daily by often vile trash. Thunderbird won't ban this crap, as Gmail does. What do I do?