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: 

FM uploads scot data

Former Member
0 Kudos

Hi All,

I have the data of tables SXNODES, SXROUTE and SXSERV in internal table. Can anyone tell me dat is there any FM in which by passing this internal table, data get uploaded in these Database table?

Also, we cant make BDC.

please help me out

2 REPLIES 2

g_srivastava
Active Contributor
0 Kudos

Hi Jatin,

You can use Funtion Module.The name of the function module is 'GUI_UPLOAD'.

DATA: <TABLE> LIKE STANDARD TABLE OF <DB_TABLE>.
  DATA: <FS_STRING> LIKE SPFLI.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = 'FILEADD/NAME.TXT'
     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                      = <TABLE>
*   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.
  LOOP AT <TABLE> INTO <FS_STRING>.
  INSERT INTO <DBTABLE> VALUES <FS_STRING>.
  ENDLOOP.

You may face the error in the format of the data.For that please check the documentation of the function module.

Hope you will resolve the query.

Have a best day ahead.

Former Member
0 Kudos

Hi,

Create the same structure of internal table,

and using the GUI_UPLOAD upload the data into an internal table and

using INSERT command

INSERT TABLE dbtable from itab.

upload it in db table