How To UPLOAD a DATA (.DAT) fiel from PC to internal table and then split it into the data different columns

Hi all,
I am new to ABAP Development. I need to upload a .DAT file (the file doesn#t have any proper structure-- Please find the .DAT file in the attachment). After uploading the DATA (.DAT) fiel I need to split in into different columns. Refering the attached .DAT fiel the fields in bracets like:
[Arbeitstag],  [Pecunia], [Mita], [Kunde], [Auftrag] and  [Position] are different fields that need to be arranged in columns in an internal table. this .DAT fiel which I want to upload and then SPLIT it into various fields will will treated as MASTER DATA table for further programming. The program that I had written is as below. Also please refer the attached .DAT table.
Please if any one could help me. i searched a lot in different forums but couldn't find me  a solution. Also note that the attached fiel is in text (.txt) format here but in real situation the same fiel is in DATA (.DAT) format.
*& Report  ZDEMO_ZEITERFASSUNG9
REPORT  ZDEMO_ZEITERFASSUNG9.
Types: Begin of ttab,
        Rec(1000) type c,
       End of ttab.
DATA: itab  type table of ttab.
DATA: wa_tab type ttab.
DATA: file_str type string.
Parameters: p_file type localfile.
At selection-screen on value-request for p_file.
                                       CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
                                        EXPORTING
*                                          PROGRAM_NAME        = SYST-REPID
*                                          DYNPRO_NUMBER       = SYST-DYNNR
*                                          FIELD_NAME          = ' '
                                           STATIC              = 'X'
*                                          MASK                = ' '
                                         CHANGING
                                           file_name           = p_file.
*                                        EXCEPTIONS
*                                          MASK_TOO_LONG       = 1
*                                          OTHERS              = 2
Start-of-Selection.
  file_str = P_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\BUP_ZEIT.DAT'   " This the file  source address
      FILETYPE                      = 'DAT'
      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                      = 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 into wa_tab.
        WRITE: / wa_tab.
  ENDLOOP.
I will be grateful to all you experts for ur inputs
regards
Chandan Singh

For every Auftrag, there are multiple Position entries.
Rest of the blocks don't seems to have any relation.
So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
Try out this snippet.
DATA lt_data TYPE TABLE OF string.
DATA lv_data TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
  EXPORTING
    filename = 'C:\temp\test.txt'
  CHANGING
    data_tab = lt_data
  EXCEPTIONS
    OTHERS   = 19.
CHECK sy-subrc EQ 0.
TYPES:
BEGIN OF ty_str,
  a1 TYPE string,
  a2 TYPE string,
  a3 TYPE string,
  p1 TYPE string,
  p2 TYPE string,
  p3 TYPE string,
END OF ty_str.
DATA: lt_str TYPE TABLE OF ty_str,
      ls_str TYPE ty_str,
      lv_block TYPE string,
      lv_flag TYPE boolean.
LOOP AT lt_data INTO lv_data.
  CASE lv_data.
    WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
         OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
      lv_block = lv_data.
      lv_flag = abap_false.
    WHEN OTHERS.
      lv_flag = abap_true.
  ENDCASE.
  CHECK lv_flag EQ abap_true.
  CASE lv_block.
    WHEN '[Auftrag]'.
      SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
    WHEN '[Position]'.
      SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
      APPEND ls_str TO lt_str.
  ENDCASE.
ENDLOOP.

Similar Messages

  • How can I move all my bookmarks from different Firefox profiles into one area to organize them and then place them into the different Firefox profiles?

    How can I move all my bookmarks from different Firefox profiles (would like to move whole bookmark folders at once if possible) into one area to organize them and then place them into the different Firefox profiles? This is all under one window user account, I am using windows 8.1. Even if you have information on how to do it on a different windows, it may still be helpful. Thanks for any input you have.

    Just a note about the difference between these two things:
    * "export" and "import" use an ancient HTML document format that all browsers can understand. When you import bookmarks, Firefox may place them into an Imported Bookmarks folder, or into Unsorted Bookmarks. This does not displace existing bookmarks, and Firefox does not automatically remove duplicates.
    * "backup" and "restore" use a more comprehensive JSON data file, which contains extra information about your bookmarks (such as tags) not contained in the traditional export file. HOWEVER, a restore completely replaces all existing bookmarks, so the restore feature cannot be used to merge in a set of additional bookmarks.
    Related support articles:
    * [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]]
    * [[Import Bookmarks from a HTML file]]
    * [[Restore bookmarks from backup or move them to another computer]]
    Some users find the disk-based Windows Favorites folder a convenient way to organize bookmarks. If you do, too, and you do not need to preserve tags on your bookmarks, you could export each profile's bookmarks to HTML and import them all into IE11. Organize them in the Windows Favorites folder, then export from IE11 to HTML and import that file into each Firefox profile. See: [http://windows.microsoft.com/en-us/internet-explorer/add-view-organize-favorites].

  • Since updating to OS X Yosemite, I am unable to save files into another computer or server. I have to save it on my desktop and then drag it into the server. How do i correct this?

    Since updating to OS X Yosemite, I am unable to save files into another computer or server. I have to save it on my desktop and then drag it into the server. How do i correct this?

    Ok this worked to solve the error.
    Use cmd prompt in windows 7 or 8 and run as admin:
    sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
    sc config mrxsmb20 start= disabled
    No need for all that power shell nonsense as shown elsewhere for windows 8.
    That's it. Also force smb2 disabling on the apple side for good measure.
    With the above I was able to network mavericks and windows 8.1 pro flawlessly. He issues I had before where I could not read video, ISO and audio files (but could open documents and pictures from the windows machine connected to an apple network share folder went away.

  • How do i change  ringtone volume to ring with low volume first and then gradually increase to the max volume ?

    how do i change  ringtone volume to ring with low volume first and then gradually increase to the max volume ? this feature was available before but is  still available now ? this is for IOS8 running on Iphone 5c.

    I've never been aware of a function like this in the past. You could create a personal ringtone that would last 30 seconds or less and set the volume on that ringtone to do that with an audio editor, such as Audacity.

  • What happened to the recently purchased icon on the left side of the playlist?  I used to could purchase songs from one of my computers and then put them on the second authorized computer by selecting recently purchased.  Is there another way?

    What happened to the recently purchased icon on the left side of the playlist?  I used to could purchase songs from one of my computers and then put them on the second authorized computer by selecting recently purchased.  Is there another way?

    Well in order to keep all the ratings, playcounts ect ect of songs in iTUnes, place the songs back into there original folders/places on the "Old harddrive" by cutting (Not copying) them from the new Harddrive. Now iTunes should report the songs has being there and have ! marks beside the imported folder from your external Harddrive.
    Now you will delet the dead/broken links (Or missing music from the new drive)in iTUnes. Goto Ottos site for a script that will remove dead links and other things here
    Just download, unzip, and run the program.
    http://ottodestruct.com/iTunes/QuickScripts.zip
    Now with everything in place and the dead links removed you will either consolidate the library or set it to copy to another Folder. If you consolidate it moves ALL your music listed in iTunes to the "iTunes Music" folder and can not be reversed. If you set it to copy, it will just copy music from its current folder to the iTunes music folder. You will have to pick the best option for you but consolidating will work best if your trying to free up space. To consolidate goto "Advanced" and select "Consolidate Library". To copy goto Edit>preferenses>Advanced tab>general sub tab and check "Copy FIles to iTunes music Folder when added to library". THis location is also where you will change the location of iTunes Music folder from your old harddrive to the new one by hitting the "Change" button above the reset button

  • HT1414 I have had to restore my ipad to factory settings and then tried to restore the data from the backup on itunes, but none of my apps have restored - please can anyone help as my daughter is going to go mad if I can't get her games back to where they

    I have had to restore my ipad to factory settings, having made a backup on my pc first. When Ihave tried to restore from my pc I have no apps!! Please can anyone help me get them back with all their data. I don't have wifi at home and I have never been able to sync my pc with my ipad, although it works with my iphone! I copied all of the apps before I restored using itunes, but no idea where they are copied to. Any help would be hugely appreciated to get my daughters games back. Thank you in advance )

    Hi Skydiver119
    Thank you so much for taking the time to reply to my problem.
    Yes the purchases were made though my apple id.
    I have looked at a few other questions on this topic and I have read that the app data is stored in the backup file but the apps themselves need to be synced back onto the ipad. Someome has mentioned right clicking on sync my ipad but I don't know where to find that to right click on!! Lol.
    Again, I really appreciate your time and if by any chance you know where I can 'right click' I would really appreciate you letting me know as I can't get my ipad to sync with my pc at all, although it is being picked up in itunes and it has backed up to itunes okay. GGrrr. Maybe I have something wrong in the settings which is not making them compatible?

  • How to upload a file in application server to an internal table

    Hi,
          I am asked to upload a file from application server to internal table. Can you please suggest me the ways to do it or the function module which helps to browse the application server file names.
      I have done a program. But its giving problem in searching the files from application server. I am pasting my code for ur review. Please tell me which part i have to correct or suggest me some other ways to do it.
    *& Report  ZUPLOAD1
    REPORT  ZUPLOAD1.
    type-pools: truxs.
    parameters: p_upl_ps radiobutton group g1 default 'X', "upload from pres. server
                 p_path type rlgrap-filename, 
                 p_upl_as radiobutton group g1,   "upload from appln server
                 <b>p_dir LIKE filepath-pathintern DEFAULT 'Y_ABAP', 
                 p_file LIKE filepath-pathintern lower case,</b>      
                 p_test as checkbox.
    constants: c_x value 'X',
               c_tab type c value cl_abap_char_utilities=>horizontal_tab.
    types: ty_data(1000) type c.    "structure to hold legacy data
    data: i_data type standard table of ty_data. "internal table of ty_data
    types: begin of stritab,
          land1 type v_t604-land1,  "structure of legacy file.
          stawn type v_t604-stawn,
          bemeh type v_t604-bemeh,
          impma type v_t604-impma,
          minol type v_t604-minol,
          end of stritab.
    data: gi_itab type standard table of stritab, "internal table of legacy file
          gw_itab type stritab.  "work area
    data: i_raw type truxs_t_text_data,
          v_fullpath type string.
    at selection-screen on value-request for p_path.
    if p_upl_ps = c_x. "if presentation server is selected
    perform get_file.
    else.            "if application server is selected
    perform set_file_path.      
    perform upload_from_server.
    perform split_data.
    endif.
    form get_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_path.     "getting the file name of pres server
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
        I_LINE_HEADER              = 'X'              "converting excel to sap and filling in
        I_TAB_RAW_DATA             = i_raw      "internal table
        I_FILENAME                 = p_path
      TABLES
        I_TAB_CONVERTED_DATA       = gi_itab
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.
    form set_file_path.                 "Getting the file path of application server
    data: lv_file type p_file.
          lv_file = p_file.
          CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
            EXPORTING
            CLIENT                           = SY-MANDT
              LOGICAL_PATH                     = p_dir
            OPERATING_SYSTEM                 = SY-OPSYS
            PARAMETER_1                      = ' '
            PARAMETER_2                      = ' '
            PARAMETER_3                      = ' '
            USE_BUFFER                       = ' '
              FILE_NAME                        = lv_file
            USE_PRESENTATION_SERVER          = ' '
            ELEMINATE_BLANKS                 = 'X'
           IMPORTING
             FILE_NAME_WITH_PATH              = v_fullpath
           EXCEPTIONS
             PATH_NOT_FOUND                   = 1
             MISSING_PARAMETER                = 2
             OPERATING_SYSTEM_NOT_FOUND       = 3
             FILE_SYSTEM_NOT_FOUND            = 4
             OTHERS                           = 5
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    endform.
    form upload_from_server.
    data: lv_msg type string,
          lw_data type ty_data.
    open dataset v_fullpath for input message lv_msg in text mode encoding default.
    if sy-subrc <> 0.
    message lv_msg type 'i'.
    stop.
    endif.
    do.
    read dataset v_fullpath into lw_data.
    if sy-subrc <> 0.
    write:/5 'Error in processign data set'.
    exit.
    endif.
    append lw_data to i_data.
    enddo.
    close dataset v_fullpath.
    if sy-subrc <> 0.
    write: /5 'Error closing dataset'.
    endif.
    endform.
    form split_data.
    data: lw_data type ty_data.
    data: lw_itab type stritab.
    data: begin of ty_itab,
          land1 type v_t604-land1,
          stawn type v_t604-stawn,
          bemeh type v_t604-bemeh,
          impma type v_t604-impma,
          minol type v_t604-minol,
          end of ty_itab.
    loop at i_data into lw_data.
    split lw_data at c_tab into
          ty_itab-land1
          ty_itab-stawn
          ty_itab-bemeh
          ty_itab-impma
          ty_itab-minol.
    lw_itab-land1 = ty_itab-land1.
    lw_itab-stawn = ty_itab-stawn.
    lw_itab-bemeh = ty_itab-bemeh.
    lw_itab-impma = ty_itab-impma.
    lw_itab-minol = ty_itab-minol.
    append lw_itab to gi_itab.
    endloop.
    endform.
    start-of-selection.
    loop at gi_itab into gw_itab.
    write: /5 'COUNTRY', 'IMPORT CODE', 'SUP UNIT', 'FIRST UOM', 'SECOND UOM',
           /5 gw_itab-land1, gw_itab-stawn,gw_itab-bemeh,gw_itab-impma,gw_itab-minol.
    endloop.
    end-of-selection.
    I hope problem must be in p_dir and p_file which are in bold.. Kindly help me out. Thanks in advance.

    see the following ex:
    *&      Form  SUB_GET_FILEPATH
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_GET_FILEPATH .
        GFILE = 'D:\SAP_INT\INBOUND\INBOX'.  "Path
    ENDFORM.                    " SUB_GET_FILEPATH
    *&      Form  SUB_GET_FILE
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_GET_FILE .
      DATA: P_FDIR(200) TYPE C.
      DATA: IT_FILEDIR1 TYPE STANDARD TABLE OF TY_FILEDIR WITH HEADER LINE.
      P_FDIR = GFILE.
      CALL FUNCTION 'RZL_READ_DIR_LOCAL'
        EXPORTING
          NAME     = P_FDIR
        TABLES
          FILE_TBL = IT_FILEDIR.
      REFRESH : IT_FILEDIR1.
      LOOP AT IT_FILEDIR.
        IF IT_FILEDIR-NAME(4) = 'ZINC' OR IT_FILEDIR-NAME(4) = 'zinc'.
          MOVE IT_FILEDIR-NAME TO IT_FILEDIR1-NAME.
          APPEND IT_FILEDIR1.
        ENDIF.
      ENDLOOP.
      IF IT_FILEDIR1[] IS INITIAL.
        STOP.
      ENDIF.
      LOOP AT IT_FILEDIR1.
        REFRESH: I_TAB.
        CLEAR: I_TAB.
        NAME = IT_FILEDIR1-NAME.
        CONCATENATE: GFILE '\' NAME INTO G_FILE.
        OPEN DATASET G_FILE FOR INPUT IN TEXT MODE
                                         ENCODING DEFAULT
                                         IGNORING CONVERSION ERRORS.
        IF SY-SUBRC EQ 0.
          CONCATENATE 'FILENAME  : ' G_FILE INTO I_MSG1.
          APPEND I_MSG1.
          DO.
            READ DATASET G_FILE INTO RECORD.
            IF SY-SUBRC = 0.
              SPLIT RECORD AT ',' INTO I_TAB-BUKRS  I_TAB-EBELN
                  I_TAB-BLDAT  I_TAB-XBLNR I_TAB-LIFNR I_TAB-AMOUNT
                  I_TAB-CURR  I_TAB-BUSAREA
                  I_TAB-BKTXT I_TAB-DMBTR I_TAB-MENGE I_TAB-SRNO.
              MOVE-CORRESPONDING I_TAB TO I_TAB1.
            ELSE.
              EXIT.
            ENDIF.
            APPEND I_TAB1.
            CLEAR: I_TAB, I_TAB1.
          ENDDO.
        ENDIF.
        CLOSE DATASET G_FILE.

  • Is there a way to create a still image from video in either imovie or iphoto?  I want to add an arrow to an imovie and so far have not had any luck but I'm thinking I might be able to add an arrow to a photo and then incorporate it into the movie.

    I'm still trying to point out a location in an imovie with an arrow.  I thought I might be able to insert an arrow in a still photo from the imovie and then reinsert the photo in the movie but my attempts at capturing a still frame from a video in imovie or iphoto haven't worked so far.  Any ideas any one???

    First, get an app called MPEG Streamclip, which is free. You can find it by googling MPEG Streamclip Squared 5.
    Open MPEG Streamclip.
    In iMovie, select the clip you need. Then, right-click/Reveal in Finder.
    Drag this clip into MPEG Streamclip
    In MPEG Streamclip, move the playhead to the frame you want.
    In MPEG Streamclip, click FILE/EXPORT FRAME.
    Choose JPEG, TIFF, or PNG and give it a name.
    Also, for how to add a pointer, try Karsten Schluter's website for a good post on how to do this.

  • Upload data from Excel to Internal table

    Hi,
    I am facing a peculiar problem in uploading the data in excel sheet to internal table.
    The excel file contains material number and product hierarchy number. The product hierarchy number for some material is downloaded as 5.73101E17 for the value 573100910115782000. Though I expand the sheet the display is the same 5.73101E17. When i upload the sheet using the f'n module "ALSM_EXCEL_TO_INTERNAL_TABLE" the value is taken as it is (5.73101E+17) into the internal table which is wrong. I tried to change the data type to type n. Then the value is uploaded as 5731011700000000.
    Please propose a solution to this without having to change the format of the column from general to "number without decimals"
    Regards,
    Sam

    HI
    see this example code which EXCEL TO INTERNAL TABLE AND THEN TO APPLICATION
    *& Report  ZSD_EXCEL_INT_APP
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 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.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • Data upload from xls to internal table

    Suppose I have data in the form of a matrix and I need to upload the data into the database after validation. The excel sheet is of the format:
    Emp Empdept E1     E2     E3     E4     E5     E6     E7     E8     E9     
    E1     MEC     0     2     3     4     5     6     6     5     7
    E2     ELE     4     0     5     5     6     2     2     1     3
    E3     ELE     4     4     0     6     1     4     7     8     9
    E4     ECE     2     2     4     0     6     7     5     9     4
    E5     CHE     7     8     9     5     0     5     6     1     3
    E6     ELE     8     9     10     12     11     0     5     6     4     
    E7     MEC     4     5     4     6     7     6     0     5     7
    E8     MEC     9     4     7     5     2     2     8     0     1
    E9      ELE     1     5     2     4     2     6     4     6     0
    The first column is the employee number
    The second column is the employee department and
    The matrix indicates the time taken by emplyee1 to be trained to handle position of employee E2 is 2 months (map using row of E1 and column of E2).
    Similarly E9 to E8 is 6 months.
    I have to get the above data into an internal table of the format
    Emp_from     Emp_to     Duration
    E1          E1          0     
    E1          E2          2
    E1          E3          3     
    E1          E4          4          
    E1          E5          5     
    E1          E6          6
    E1          E7          6
    E1          E8          5     
    E1          E9          7
    E2             E1          4
    E2          E2          0     
    E2          E3          5
    can someone help me in building the logic for this
    regards,
    seenu

    HI refer this program
    in this
    excel to internal table and then application server
    *& Report  ZSD_EXCEL_INT_APP
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 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.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • How do I remove my credit card from both my Itunes account and I Cloud

    How do I remove my credit card from both my Itunes account and I Cloud

    I go into my account remove the card but it wont let me save since the card number is a required field

  • In SRM How to upload data from Excel to Internal Table

    Hello Experts,
    As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
    Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
    Please advice..
    Thanks..

    did u try this
    TEXT_CONVERT_XLS_TO_SAP
    in this manner
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header              = 'X'
          i_tab_raw_data             = lt_raw
          i_filename                 = p_path
        TABLES
          i_tab_converted_data       = gt_output
        EXCEPTIONS
          conversion_failed          = 1
          OTHERS                     = 2.
    this FM works on DOI
    so
    SAP document about DOI:
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
    SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
    the fm you mentioned works on OLE
    so you could refer,
    SAP document about OLE:
    http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
    Also you can refer this post
    Download of SRM Contracts in Excel - Unit of Measurement Missing
    Let me know if this works ..
    Regards
    Manthan.
    Edited by: Manthan_R on Feb 23, 2010 12:18 PM

  • Upload data from Excel to Internal table in ECC

    Hello SDN,
    Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
    Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
    Waitingfor your valuable response.
    Thanks & Regards,
    Kumar.

    Hi,
    you can use OLE to acces (not only) excel, but this will only work in dialog processing.
    regards,
    Hans

  • To upload data from excel to internal table

    hi
    in excel sheet it contains 4 tabs.to upload data from excel to internal table i have used this fm
    text_convert_xls_to_sap .but error wil comeing.that error in tables parameter.iternal table does not contain data.ple help me.(v 6.0) ple give me one example with coding

    Hello,
    Take a look on this: [ABAP - Upload data from Excel to Sap using OO|https://wiki.sdn.sap.com/wiki/x/xOw].
    Regards.

  • I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date is created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date  created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    The Finder reports File information. The date and time of the photo are in the Photo's Exif metadata. The Finder has no awareness of this. All photos apps on any system do.
    Regards
    TD

Maybe you are looking for

  • BLOB Files

    Hi, Is it possible to view BLOB files in OBIEE. I have these binary files stored in tables but would like to reference them in a report and allow the user to open a file. These are text/pdf/jpeg files Can anyone help? Thanks

  • Saving email attachments in os2.1

    It seems that saving email attachments such as pdf's is slightly different in 0s2.1....I now have to touch and hold a downloaded attachment for a second or so, then the save/open option appears.  In, previous versions, you just had to tap the attachm

  • Where is sort by release date in itunes store?

    Taking this feature away makes it VERY difficult to find what you're looking for in the store now.  For example, if you search for GLEE, and filter media by type 'music' there are hundreds of songs.  I can't figure out how they are sorted (if at all.

  • Apple Student Program for Colombia?

    Hi there, I've being searching the whole site, trying to find a number or an email to send this inquiry to but I couldn't so Had no other choise but to post this on the Discussions hoping for someone in the high roll to see this post. I've being a wa

  • Urgent!!!!Interactive Form Error :Invalid Node Type dataGroup

    Hi All, I have created an interactive form with webdynpro java and when i run the application the form is running perfectly but i am getting the inforamtion error as Invalid Node Type:dataGroup The fault Occured on line 28. I think it is an adobe rea