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

data load into tables directly

Former Member
0 Likes
931

hi all,

I got tetx file data of one table , for ex : data of table MARA with all fields data .

now i want to load that data directly into table MARA without using

BDC programs or lsmw .

can anyone provide the program for that.

thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
732

Use INSERT

Read only

0 Likes
732

sorry there i made small mistake in above syntx

its not mara-mandt = sy-mandt.

it is <b>ztable-mandt = sy-mandt</b>.

Regards,

sunil kairam.

Read only

Former Member
0 Likes
732

Hi Srinivas,

Use GUI_UPLOAD function moudule to upload your text file into one internal table same structure of that mara. suppose u hv uploaded into table ITAB.

After uploading data into internal table use the belwo syntax for inseting internal table vales to ztable.

loop at itab.

move-corresponding itab to ztable.

mara-mandt = sy-mandt.

modify ztable.

endloop.

<b>reward if useful</b>.

regards,

sunil kairam.

Read only

Former Member
0 Likes
732

Try using BAPI: BAPI_STANDARDMATERIAL_CREATE.

Read only

Former Member
0 Likes
732

Hi Srinivas,

DATA:ITAB TYPE (table name) OCCURS 0 WITH HEADER LINE.

start-of-selection.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'path of the file'

  • FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = '#'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • VIRUS_SCAN_PROFILE =

  • NO_AUTH_CHECK = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = itab

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_READ_ERROR = 2

  • NO_BATCH = 3

  • GUI_REFUSE_FILETRANSFER = 4

  • INVALID_TYPE = 5

  • NO_AUTHORITY = 6

  • UNKNOWN_ERROR = 7

  • BAD_DATA_FORMAT = 8

  • HEADER_NOT_ALLOWED = 9

  • SEPARATOR_NOT_ALLOWED = 10

  • HEADER_TOO_LONG = 11

  • UNKNOWN_DP_ERROR = 12

  • ACCESS_DENIED = 13

  • DP_OUT_OF_MEMORY = 14

  • DISK_FULL = 15

  • DP_TIMEOUT = 16

  • OTHERS = 17

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

INSERT (table name) FROM TABLE ITAB ACCEPTING DUPLICATE KEYS .

(u can use insert statement without accepting duplicate keys also)

merlin