on 09-25-2007 9:50 PM
I have the results of an optimization program stored in Excel. I save the required data in a .csv file on the desktop. Currently the file is uploaded from within a "Z" transaction.
What I want to do now is further automate process by uploading file to SAP from within Excel. Currently I can logon to SAP, call a "Z" transaction via presentation server (users pc) and that's where it ends. Seems the transaction goes out to upload and never comes back as if it is in the background.
Can someone pls point in the correct direction to resolve this?
Thanks
Bob
Hi Bob,
I think you should create a RFC Enabled Function Module which can take the result as an internal table and update the values in SAP. Unfortunately I'm not a VBA / SAP specialist, but I think a Google or SDN Search should help.
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bob,
Refer the below program to upload data to internal table from excel.
report ZBDC_MM01_NEW no standard page heading line-size 255.
DATA : BEGIN OF STR,
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS,
END OF STR.
DATA : ITAB LIKE TABLE OF STR WITH HEADER LINE.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:\MAT.TXT'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
data_tab = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
.
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,
Sheron
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.