Application Development 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: 

How can I update a customized table from a text document?

Former Member
0 Kudos
218

Hi,

I am one sample file. The file is an text document. From this .txt file how can I update a customized table in SAP.

How can I Update the fields in the Customized table.

Thanks & Regards,

NManohar.

4 REPLIES 4

Former Member
0 Kudos
127

Hi,

Use 'GUI UPLOAD' FM to bring the data in the text file into an internal table.

Then loop at internal table and use INSERT statement to update the custom table.

INSERT <db table> FROM <int table>

Thanks

Martina

Former Member
0 Kudos
127

use the Function module GUI_UPLOAD or WS_UPLOAD and give the path and the file name from where the data has to be uploaded. in table parameter give the iternal table

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename =

  • 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 =

  • 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.

and finally use insert command to update the database table with the data

Former Member
0 Kudos
127

Hi, as already said use the FM: GUI_UPLOAD. Process the internal table using a small ABAP program. Use the INSERT dbtable FROM wa and do not forget to COMMIT your work. Succes

Former Member
0 Kudos
127

Take Help from your ABAP Resource. They know it very well.