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

Down load customer master data.

Former Member
0 Likes
301

Hi All,

I want to do download Customer Master Data with perticular fields to flat file at Application layer.

Let me know is there any predefined program or methods for this.

If send some thing thats really helpfull to me.

Very URGENT please.

Thanks,

Subbu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
277

hi,

use OPEN DATA SET.

check this one it will help you

REPORT ZSR_BDC_OPEN.

TABLES : LFA1.

SELECT-OPTIONS : S_LIFNR FOR LFA1-LIFNR.

PARAMETERS : FILE(200) TYPE C.

DATA : BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

LAND1 LIKE LFA1-LAND1,

END OF ITAB.

SELECT LIFNR LAND1 FROM KNA1 INTO TABLE ITAB WHERE LIFNR IN S_LIFNR.

OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB FROM 1 TO 5.

TRANSFER ITAB TO FILE.

ENDLOOP.

IF SY-SUBRC = 8.

WRITE 😕 'not created'.

ENDIF.

CLOSE DATASET FILE.

LOOP AT ITAB.

WRITE 😕 ITAB-LIFNR,ITAB-LAND1.

ENDLOOP.

WRITE 😕 'hai'.

REFRESH ITAB.

1 REPLY 1
Read only

Former Member
0 Likes
278

hi,

use OPEN DATA SET.

check this one it will help you

REPORT ZSR_BDC_OPEN.

TABLES : LFA1.

SELECT-OPTIONS : S_LIFNR FOR LFA1-LIFNR.

PARAMETERS : FILE(200) TYPE C.

DATA : BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

LAND1 LIKE LFA1-LAND1,

END OF ITAB.

SELECT LIFNR LAND1 FROM KNA1 INTO TABLE ITAB WHERE LIFNR IN S_LIFNR.

OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT ITAB FROM 1 TO 5.

TRANSFER ITAB TO FILE.

ENDLOOP.

IF SY-SUBRC = 8.

WRITE 😕 'not created'.

ENDIF.

CLOSE DATASET FILE.

LOOP AT ITAB.

WRITE 😕 ITAB-LIFNR,ITAB-LAND1.

ENDLOOP.

WRITE 😕 'hai'.

REFRESH ITAB.