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

OPEN DATASET PROBLEM

Former Member
0 Likes
1,404

HI

i m having one file on application server the file has records which has 900 characters in one line .

there can be more than one line.

when i use



OPEN DATASET TO_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC <> 0.
  WRITE: SY-SUBRC, ' LIKE ', TO_FILE.
ELSE.
  WHILE SY-SUBRC = 0.
    READ DATASET TO_FILE INTO WA_UPD.

    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    APPEND WA_UPD TO IT_UPD.
    CLEAR WA_UPD.
  ENDWHILE.

it read up to 255 characters only so i m getting the data in my internal table wrong.

pls help me on this...

Thanxs & Regards

Rajan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,357

HI,

Check this code...

OPEN DATASET dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC EQ 0.

CLEAR : it_upd_dt.

DO.

READ DATASET dsn INTO rec.

IF sy-subrc = 0.

wa_upd_dt-msg = rec.

APPEND wa_upd_dt TO it_upd_dt.

CLEAR wa_upd_dt.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET dsn.}

ELSE.

error message..

ENDIF.

Edited by: avinash kodarapu on Dec 2, 2008 3:11 PM

13 REPLIES 13
Read only

Former Member
0 Likes
1,357

Hi.... rajan

wat abt that KKE1 Issue, Solved or wat.....

Thanks

Saurabh

Read only

0 Likes
1,357

no KKE1 is not solved i have given the dump which i m getting

Read only

Former Member
0 Likes
1,357

Hi Rajan,

How have you declared WA_UPD ?

Regards

Read only

0 Likes
1,357

wa_upd is of 1000 charcters


data : wa_upd(1000) type c.

Read only

Former Member
0 Likes
1,358

HI,

Check this code...

OPEN DATASET dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC EQ 0.

CLEAR : it_upd_dt.

DO.

READ DATASET dsn INTO rec.

IF sy-subrc = 0.

wa_upd_dt-msg = rec.

APPEND wa_upd_dt TO it_upd_dt.

CLEAR wa_upd_dt.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET dsn.}

ELSE.

error message..

ENDIF.

Edited by: avinash kodarapu on Dec 2, 2008 3:11 PM

Read only

0 Likes
1,357

i hv write the same code buddy...almost same but it read 255 char only

Read only

Former Member
0 Likes
1,357

declare like this

data: wa_upd(1500) type c.

Regards,

Ajay

Read only

0 Likes
1,357

wa_upd is of 1000 charcters

data : wa_upd(1000) type c.

Read only

Former Member
0 Likes
1,357

Hi There,

Can I see the declaration Part? May be you restricted to 255 characters.

Hope this helps.

Read only

0 Likes
1,357

wa_upd is of 1000 charcters

data : wa_upd(1000) type c.

Read only

Former Member
0 Likes
1,357

Hi..

In the application server .. only 255 chars can be displayed.. the rest gets truncated....

Use CG3Y transaction..to download the exact data available in the application server.....

Cheers

Read only

0 Likes
1,357

thanxs

but i hv to run my program in background job

so in background job do u think this cg3y works ?

Regards

rajan

Read only

Former Member
0 Likes
1,357

its been solved

if u want to pass more than 255 charc

u have to make a workarea as per yopu required

that is the same i did

and it works

thnxs to u all

rajan