Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

inserting email id for vendors using xk02...but error with internal table in pulling data

surendra_battula
Participant
0 Kudos

hi i am trying to update the vendors with email ids. so i have used fm gui_upload and just executed to see how it is pulling data to internal table

but i got error as below with a # and lifnr is taking some part of the emailid as lifnr = 3190#wji@...can u help me please.

types : begin of itab,

        lifnr type rf02k-lifnr,

        REMARK type adrt-remark,

        end of itab.

data : t_itab type table of itab with header line.

data: wa_itab type itab.

*Target table

data : t_bdcdata type standard table of bdcdata,

       wa_bdcdata like line of t_bdcdata.

  data: MSG LIKE BDCMSGCOLL,

   T_MSG LIKE TABLE OF MSG,

   MESSAGE(72) TYPE C.

CALL FUNCTION 'GUI_UPLOAD'

   EXPORTING

     FILENAME                      = 'C:\Users\suri\Documents\suri1.txt'

    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                      = t_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.

* Implement suitable error handling here

ENDIF.

**_

loop at t_itab into wa_itab.

   write : / wa_itab-lifnr,

          wa_itab-remark.

   endloop.

regards

suri

4 REPLIES 4

basarozgur_kahraman
Contributor
0 Kudos

Hi Surendra,

it is about suri1.txt file. Don't use space in file and reserve first 10 characters for lifnr.

ravi_lanjewar
Contributor
0 Kudos

Hi,

It is issue with you file data format, Please check space in fields lifnr. Please correct is and then try again.

Kind Regards

Ravishankar

Former Member
0 Kudos

Hi Surendra,

The text file looks like tab delimited file.

Just try giving HAS_FIELD_SEPARATOR           = 'X' and check how the internal table is getting filled.

   CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename            = 'C:\Book1.txt'
    has_field_separator = 'X'
    read_by_line        = 'X'
  TABLES
    data_tab            = t_itab.

Thanks,

Shambu

Former Member
0 Kudos

Hello Surendra,

Please provide your file.  Must be file format is wrong due to that its overlapping the LIFNR  field.

Regards,

Deepti