Skip to Content
avatar image
Former Member

doubt in open data set

HI.

i have flat file (TAB limited) in application server. i need to update all records from application server to SAP.but i am having problem while fecthing field .

eg:first field length is 10 in iternal table but actual length in flat file is 5

now it fecthinh 5 char from 1st filed remaning taking from next fields.

how can i avoid?

help me.

To be Reward all helpfull answers.

Ragards.

Jay

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 22, 2007 at 03:26 PM

    Open dataset..

    do

    read dataset into itab-line.

    if sy-subrc eq 0.

    split itab-line at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB into jtab-field1 jtab-field2..

    append jtab.

    else.

    exit.

    endif.

    enddo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 03:27 PM

    hi

    u have created a internal table based on the file structure...

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2007 at 03:35 PM

    Hi Jay,

    this is a typical problem.

    i think you are moving staraigt from work area (that you are getting from file) to that work area (which you are using to update).

    so, do one thing ...move field by field like wa_file0(5) to wa_table0(10)

    hope it will solve ur problem.

    Regards

    Krish

    Add comment
    10|10000 characters needed characters exceeded