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

get two internal tables data into one file

Hi everybody,

i have two internal tables that contains two kinds of records

ITAB1(detail records), ITAB2(trail records)

i want to transfer these two internal table contents into one file .

i already created a file using <b>open dataset</b> statement

plz guide me how to do this.

regards

Siri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 04:09 PM

    hi ,

    by using Transfer statement u can transfer data into file .

    syn is : TRANSFER <field> TO <file name>.

    in your case loop at itab1.

    TRANSFER itab1 TO <file name>.

    endloop.

    loop at itab2.

    TRANSFER itab2 TO <file name>.

    endloop.

    Regards

    Ashok P

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      iam unable to create a file . i am getting a run time error in Transfer statement.

      TRANSFER WA_DETAILS TO P_PATH.

      the error is 'WA_DETAILS having non chareter type .

      current progarm is flaged as a unicode program .

      In the unicode contest , type X feilds are seen as non char type , as are structers that contain non char type components' .

      plz suggest me how to do.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 04:07 PM

    no probs,

    if you want your data to passed one after the another internal table,

    LOOP AT ITAB1.

    TRANSFER ITAB1 TO FILENAME.

    ENDLOOP.

    *--TO TRANSFER 2ND TABLE.

    LOOP AT ITAB2.

    TRANSFER ITAB1 TO FILENAME.

    ENDLOOP.

    CLOSE DATASET FILENAME

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 03, 2006 at 04:09 PM

    Try this:

    OPEN DATASET TARGET FOR OUTPUT IN TEXT MODE.

    LOOP AT ITAB1.

    TRANSFER ITAB1 TO TARGET.

    ENDLOOP.

    LOOP AT ITAB2.

    TRANSFER ITAB2 TO TARGET.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      iam unable to create a file . i am getting a run time error in Transfer statement.

      TRANSFER WA_DETAILS TO P_PATH.

      the error is <b>'WA_DETAILS having non chareter type .

      current progarm is flaged as a unicode program .

      In the unicode contest , type X feilds are seen as non char type , as are structers that contain non char type components' .</b>

      plz suggest me how to do.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 05:43 PM

    Then you have to open the file in text mode and encoding default. It seems ur program is unicode acitve please do an F1 help on Open Dataset command.U can see the options there.

    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.