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

Function module to upload material consumption data from flat file.

Former Member
0 Likes
670

is there any function module/BAPI to upload the flat file for material consumption?

The structure of flat file contains MATNR,WERKS,DATUM,PERKZ,GSVBR,UNVBR as input fields.

Data to be uploade for consumption Tcode : MM02 -> mrp view1 -> additional data

->check the consumption data.

I have FM mb_update_material_consumption as option but it is not solving purpose.

2 REPLIES 2
Read only

Former Member
0 Likes
498

hi sharma,

to upload a flat file(say an excel sheet) with all those fields u mentioned u can use the function module: 'GUI_UPLOAD'.

this shud work. coz i've used this Func mod to upload my excel file for a BDC report.

to call the function module,i did it the follwing way:

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = w_file1<i>(this is the flat file name)</i>

filetype = ASC (for ascii values)

has_field_separator = '#'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

data_tab = it_transfer

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.

try this. if useful,reward points.

Read only

Former Member
0 Likes
498

Hi,

Try using the BAPI BAPI_MATERIAL_SAVEDATA ..

Thanks,

Naren