Application Development and Automation 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: 
Read only

Upload .CSV file from Application server to int. table.

Former Member
0 Likes
1,056

Hi friends,

I am tring to upload the >CSV file from Application server to internal table using Open dataset. While reading the file from file path to character data type of length 1024, the entair record is not getting uploaded in to the varible but only upto the 423 characters are assigned in the varible.

Could any one please help me how to get entair record populated in to the varible.

Thanks,

Saya

Hi friends,

I am tring to upload the >CSV file from Application server to internal table using Open dataset. While reading the file from file path to character data type of length 1024, the entair record is not getting uploaded in to the varible but only upto the 423 characters are assigned in the varible.

Could any one please help me how to get entair record populated in to the varible.

Thanks,

Saya

5 REPLIES 5
Read only

Former Member
0 Likes
745

Hi,

In the debugging mode did you check if the whole of the record is getting loaded into the variable?

Vikranth

Read only

Former Member
0 Likes
745

Hi,

Please refer to this

Regards,

Aditya

Read only

0 Likes
745

Hi,

I have used same coding to upload the .CSV file and SPLIT function in my program. Please find the below coding.


Data: COL1(1000) TYPE C,
        lv_space TYPE C,
        mlen TYPE I.
  do.
    clear: COL1.
    read dataset w_legfle into COL1.
    if sy-subrc eq 0.
      if sy-index <> 1.
        SPLIT COL1 AT ','    " where comma is ur demiliter
            INTO wa_input-edate
                 lv_space
                 wa_input-refe
                 wa_input-comp
                 wa_input-seqe
                 wa_input-glacc
                 wa_input-credit
                 wa_input-amount
                 wa_input-desc
                 wa_input-glfolio
                 lv_space
                 lv_space
                 lv_space
                 wa_input-vendor
                 wa_input-desc1
                 wa_input-desc2
                 lv_space
                 wa_input-curry
                 lv_space
                 lv_space
                 lv_space
                 lv_space
                 lv_space
                 lv_space
                 wa_input-indate.

        append wa_input TO it_input.
      endif.
    else.
      exit.
    endif.
  enddo.

I have checked the value of COL1 in debug mode it has populated up the 423 character only even though the length of the records are having more that 483 char. I don't understand why it is limiting to only 423 character.

Please help me where I am missing.

Thanks,

Saya

Read only

0 Likes
745

May be in debugging mode there is a limitation for the total number of displayed characters in a instance. In the debugging mode give the variable as COL1(423) and check if the remaining value is wriiten or not

Read only

Former Member
0 Likes
745

u can use

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

  • EXPORTING

  • PROGRAM_NAME = SYST-REPID

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

  • STATIC = ' '

  • MASK = ' '

CHANGING

file_name = P_FILE

  • EXCEPTIONS

  • MASK_TOO_LONG = 1

  • OTHERS = 2

or

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_file

i_begin_col = '1'

i_begin_row = '2'

i_end_col = '256'

i_end_row = '10000'

TABLES

intern = l_intern

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc NE 0.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.

WRITE : / 'File Error'.

EXIT.

ENDIF.