2009 Aug 25 8:09 AM
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.
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.
2009 Aug 25 8:17 AM
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
2009 Aug 25 8:41 AM
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
2009 Aug 25 9:08 AM
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
2009 Aug 25 9:23 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |