Skip to Content
author's profile photo Former Member
Former Member

OPEN DATASET

I want to store report output in application sever .For that i followed open dataset.

My problem:

when i used below statements.

1) 1st

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER WA_OUTPUT TO P_FILE.

loop at i_output into wa_output.

write:/0 wa_output-werks,

10 wa_output-matnr,

25 wa_output-lgort,

35 wa_output-labst.

endloop.

CLOSE DATASET P_FILE.

i got dump error:

Only character-type data objects are supported at the argument

position "f" for the statement

"TRANSFER f TO ...".

In this case, the operand "f" has the non-character-type "TYOUTPUT"._

The current program is flagged as a Unicode program. In the Unicode context ,

type X fields are seen as non-character-type, as are structures that

contain non-character-type components.

2) 2nd type

OPEN DATASET P_FILE FOR OUTPUT IN BINARY MODE.

TRANSFER WA_OUTPUT TO P_FILE.

loop at i_output into wa_output.

write:/0 wa_output-werks,

10 wa_output-matnr,

25 wa_output-lgort,

35 wa_output-labst.

endloop.

CLOSE DATASET P_FILE.

i donot get any error,but in t-code AL11.This file is creates without any data in it.

Kindly help me.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 12, 2008 at 09:56 PM

    hi,

    TRANSFER xx should be inside loop ?

    and try code like below:

    OPEN DATASET filename FOR OUTPUT IN BINARY MODE.

    CHECK sy-subrc EQ 0.

    DATA CLRF(2) TYPE x VALUE '0D0A'.

    LOOP AT itab.

    PERFORM xTRANSFER USING itab-VBELN filename.

    PERFORM xTRANSFER USING itab-AUART filename.

    ...

    TRANSFER CRLF TO filename.

    ENDLOOP.

    CLOSE DATASET filename.

    ENDLOOP.

    ...

    form xTRANSFER USING xfield xfilename.

    DATA f_type.

    DESCRIBE FIELD xfield TYPE f_type.

    CASE f_type.

    WHEN 'C'.

    TRANSFER xfield TO xfilename.

    WHEN 'D'.

    DATA: sData(10).

    WRITE: xfield TO sData.

    TRANSFER sData TO xfilename.

    WHEN 'P'.

    DATA: sAmount(20).

    WRITE: xfield TO sAmount.

    TRANSFER sAmount TO xfilename.

    WHEN OTHERS.

    EXIT.

    ENDCASE.

    TRANSFER ';' TO xfilename.

    endform.

    best regards,darek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.