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

Regarding material number conversion

Former Member
0 Likes
770

Hi All,

I have a issue with material number conversion.

Issue: I am uploading flatfile data into my program using GUI_UPLOAD F.M.

I will get data into I_MAT internal table.

Now in this from every record first 18 characters are Material numbers.

So then i will push all records first 18 characters to I_MATNR internal table

Now i will have I_MATNR with all material fields.

But now if i see these material for some materials it is displaying # symbol at the end of material, this is happening for most of the fields.

I have used F.M CONVERSION_EXIT_MATN1_INPUT to convert material no to actual but still it is not working.

Can anybody suggest solution for this issue!

Thanks,

Deep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
737

Hello,

Deep this is because the file has the delimiter with hex value 09.

While using the GUI_UPLOAD make this change.


  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = l_va_file
*      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = 'X'   " Check here
*      HEADER_LENGTH                 = 0
*      READ_BY_LINE                  = 'X'
*    IMPORTING
*      FILELENGTH                    =
*      HEADER                        =
    TABLES
      data_tab                      = it_import
    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.

If useful reward.

Vasanth

Hi All,

I have a issue with material number conversion.

Issue: I am uploading flatfile data into my program using GUI_UPLOAD F.M.

I will get data into I_MAT internal table.

Now in this from every record first 18 characters are Material numbers.

So then i will push all records first 18 characters to I_MATNR internal table

Now i will have I_MATNR with all material fields.

But now if i see these material for some materials it is displaying # symbol at the end of material, this is happening for most of the fields.

I have used F.M CONVERSION_EXIT_MATN1_INPUT to convert material no to actual but still it is not working.

Can anybody suggest solution for this issue!

Thanks,

Deep.

5 REPLIES 5
Read only

Former Member
0 Likes
738

Hello,

Deep this is because the file has the delimiter with hex value 09.

While using the GUI_UPLOAD make this change.


  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = l_va_file
*      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = 'X'   " Check here
*      HEADER_LENGTH                 = 0
*      READ_BY_LINE                  = 'X'
*    IMPORTING
*      FILELENGTH                    =
*      HEADER                        =
    TABLES
      data_tab                      = it_import
    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.

If useful reward.

Vasanth

Read only

Former Member
0 Likes
737

Hi,

Try using FM conversion_exit_alpha_input.

Thanks,

Deepti

Read only

Former Member
0 Likes
737

Hi,

The Blank spaces are filling with # symbol, so delete these symbosl frist from the Material number then use the Converstion exit function module

Regards

Sudheer

Read only

Former Member
0 Likes
737

whether while uploading form the flat file to ur I_MAT internal table u get that problem, then check the FILETYPE.

please paste ur code.

regards

prabhu

Read only

Former Member
0 Likes
737

Hi Deep,

In the FM 'GUI_UPLOAD', there is one option...

HAS_FIELD_SEPARATOR = 'X'

If ur text file is having seperators..u will get '#' s.

so with the above stmt. in that FM, passing 'X' will tell that file is havin separators.

.

Your file is tab dilimited. If you still have problem go through the code below:

CONSTANTS: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = l_file

filetype = 'ASC'

has_field_separator = c_tab

TABLES

data_tab = itab_upload

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.

Do reward points if this helps.

Regard:

Sapna