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

Small doubt in open dataset syntax

Former Member
0 Likes
478

Hi Gurus,

I have a small doubt in open dataset, i want to know the correct syntax for open dataset in verson 4.6C.

Actually i written the syntax as

OPEN DATASET ds_name FOR OUTPUT IN TEXT MODE .

but it wont write any file in that path, its saying file not available. Plz guid this.

<REMOVED BY MODERATOR>

Mohana.

Edited by: Alvaro Tejada Galindo on Feb 27, 2008 11:20 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
452

Syntax for that is

Ex :

OPEN DATASET W_FILENAME_ACRO FOR OUTPUT IN

TEXT MODE ENCODING DEFAULT

WITH WINDOWS LINEFEED MESSAGE W_MESSAGES.

IF SY-SUBRC <> 0.

Regards,

Ajay

3 REPLIES 3
Read only

Former Member
0 Likes
452

Hello,

Check this sample:


    OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC NE 0.
      MESSAGE S041(S9) WITH FILENAME.
      EXIT.
    ENDIF.
    LOOP AT LT_TAB INTO LR_TAB.
      TRANSFER LR_TAB TO FILENAME.
    ENDLOOP.
    IF SY-SUBRC = 0.
      CLOSE DATASET FILENAME.
      DESCRIBE TABLE LT_TAB LINES L_F_COUNT.
      SUBTRACT 1 FROM L_F_COUNT.
      MESSAGE I145 WITH L_F_COUNT FILENAME.
    ENDIF.

Cheers,

Vasanth

Read only

Former Member
0 Likes
452

Go to transactions CZ3Y and CZ3Z.

Check the file exists or not

Read only

Former Member
0 Likes
453

Syntax for that is

Ex :

OPEN DATASET W_FILENAME_ACRO FOR OUTPUT IN

TEXT MODE ENCODING DEFAULT

WITH WINDOWS LINEFEED MESSAGE W_MESSAGES.

IF SY-SUBRC <> 0.

Regards,

Ajay