Skip to Content
0
Former Member
Oct 16, 2006 at 01:28 AM

Open dataset concept.

22 Views

Hi,

I did a program for transfering data from database tables to a .dat or .txt file on my PC using the dataset concept.

the program runs without error but the data is not downloaded into the file. What can be the problem?

Here is the code.

&----


*& Report ZOPDSETOPV

*&

&----


*&

*&

&----


REPORT ZOPDSETOPV.

TABLES : LFA1, EKKO.

PARAMETERS : FILE(200) TYPE c.

DATA : BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

NAME1 LIKE LFA1-NAME1,

EBELN LIKE EKKO-EBELN,

BUKRS LIKE EKKO-BUKRS,

EKORG LIKE EKKO-EKORG,

EKGRP LIKE EKKO-EKGRP,

END OF ITAB.

SELECT LFA1NAME1 EKKOEBELN EKKOBUKRS EKKOEKORG EKKO~EKGRP INTO TABLE

ITAB FROM LFA1 INNER JOIN EKKO ON LFA1LIFNR = EKKOLIFNR.

OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB FROM 1 TO 3.

TRANSFER ITAB TO FILE.

ENDLOOP.

CLOSE DATASET FILE.

Thanks...