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: 

Uploading INT4 data using ws_upload??

Former Member
0 Kudos

Hi friends,

I am trying to upload data which is of type INT4 using ws_upload into SAP. But in debugging mode I can see that the format of the (INT4) data is being changed.

Any suggestions??

Regards,

Vinod.

7 REPLIES 7

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

WS_UPLOAD

OBSOLETE: Transfer Presentation Server File to Internal Table

Use GUI_UPLOAD.

Laxman

Former Member
0 Kudos

Hi vinod,

1. try to use GUI_UPLOAD

(ws_upload is old, and sometimes gives error)

regards,

amit m.

Former Member
0 Kudos

u have to define ur internal table fields of type char only, the fields will be uploaded properly of whatever type they are from flat file.

Former Member
0 Kudos

now use gui_upload and check the same .

vinod .

in ws_upload u r saying that int4 values are gettign changed , now take only one value for upload and change the same value to its original value of int4 in debugging mode( i think u might be knowing to change the value in debugging) and see if its going for a short dump .

if it leads to dump then u need to go for the gui_upload .

can u tell us the values getting changed with an example.

Former Member
0 Kudos

Hi

Use GUI_UPLOAD for correct results.

<b>

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                     = ' '
* 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.

</b>

former_member188685
Active Contributor
0 Kudos

Hi,

call method <b>GUI_UPLOAD</b> of <b>CL_GUI_FRONTEND_SERVICES</b>

      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
        EXPORTING
          FILENAME                = 'C:MY.TXT'
          FILETYPE                = 'ASC'
          HAS_FIELD_SEPARATOR     = 'X'
*          HEADER_LENGTH           = 0
*          DAT_MODE                = SPACE
*          CODEPAGE                = SPACE
*          IGNORE_CERR             = ABAP_TRUE
*          REPLACEMENT             = '#'
*          READ_BY_LINE            = 'X'
*        IMPORTING
*          FILELENGTH              =
*          HEADER                  =
        CHANGING
          DATA_TAB                = ITAB1
*        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
*          NOT_SUPPORTED_BY_GUI    = 17
*          ERROR_NO_GUI            = 18
*          others                  = 19
              .
      IF SY-SUBRC <> 0.
*       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

Regards

vijay

Former Member
0 Kudos

Adding to my previous post,,I am writing it in 3.1 I version so I cannot use gui_upload or can call any methods.

Regards,

Vinod.