Need to write a progrm to upload flate file in my z table
Hi all ,
I need to write a progrm to upload flate file from presentation or application server in my z table.Please guide me to do so.
Regards,
Ranu
You have sent this via Abuse Report:
Please close my thread , so I can post new. I'll search before asking and wont ask small questions again.
Considering that you have agreed to stick to the Rules, I'm closing this question so that you can open one new question. Based on how you carry on from here, I'll decide what to do next. If you behave, I'll close your other questions, but if you break the Rules even once, your id will be deleted.
Similar Messages
-
How to convert the flat file data into sap tables . ?
how to upload flat file data into sap table . before upload mapping is also there in some filds . any one can give me some steps how to upload and mapping . ?
Hi
See the sample code
REPORT zmmupload.
Internal Table for Upload Data
DATA: i_mara like MARA occurs 0 with header line
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_mara
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.
Upload the Data from Internal Table
MODIFY MARA from TABLE i_MARA.
Regards
Anji. -
Hello everyone,
We have a Z custom table which contains data about Customer Class. I was wondering if it is possible to load a flat file into the Z Table. Kindly advice how to load a flat file in z-table.
Thanks,
SanjuPLS WATCH THE CODE and kindly tell me the error
REPORT z_test.
TABLES: mara.
FIELD-SYMBOLS : <fs> .
DATA : fldname(50) TYPE c.
DATA : col TYPE i.
DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
DATA: progname LIKE sy-repid,
dynnum LIKE sy-dynnr.
DATA itab TYPE TABLE OF alsmex_tabline WITH HEADER LINE.
DATA: BEGIN OF ZUPLOAD1_T OCCURS 0 ,
matnr like mara-matnr,
ersda like mara-ersda,
ernam like mara-ernam,
laeda like mara-laeda,
END OF ZUPLOAD1_T.
*DATA: ZUPLOAD1_T LIKE mara OCCURS 0 WITH HEADER LINE.
DATA: wa_data LIKE TABLE OF ZUPLOAD1_T WITH HEADER LINE.
selection-screen
SELECTION-SCREEN: BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
SELECTION-SCREEN : SKIP 1.
PARAMETERS : p_file LIKE rlgrap-filename.
SELECTION-SCREEN : SKIP 1.
SELECTION-SCREEN : END OF BLOCK blk.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
F4 Value for File
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
static = 'X'
MASK = ' '
CHANGING
file_name = p_file
EXCEPTIONS
mask_too_long = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = P_FILE
i_begin_col = 1
i_begin_row = 1
i_end_col = 5
i_end_row = 12507
tables
intern = ITAB
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = SY-REPID
fieldname = 'ZMARA'
tables
components = CMP.
LOOP AT itab.
AT NEW row.
IF sy-tabix = 1.
APPEND ZUPLOAD1_T.
ENDIF.
ENDAT.
col = itab-col.
READ TABLE cmp INDEX col.
CONCATENATE 'ZUPLOAD1_T-' cmp-compname INTO fldname.
ASSIGN (fldname) TO <fs>.
<fs> = itab-COL.
APPEND ZUPLOAD1_T.
ENDLOOP.
DELETE ZUPLOAD1_T where matnr eq space.
LOOP AT ZUPLOAD1_T INTO wa_data.
insert mara from wa_data .
WRITE: / ZUPLOAD1_T-matnr, 20 ZUPLOAD1_T-ersda , 45 ZUPLOAD1_T-ernam, 55 ZUPLOAD1_T-laeda.
*HERE IAM JUST CHECKING I NEED TO UPDATE A ZTABLE
ENDLOOP.
insert ZMARA FROM table itab ACCEPTING DUPLICATE KEYS.
Edited by: shivu kishu on Feb 7, 2011 10:29 AM -
BI IP - Upload flat file - "requested resource not found" when typing URL
Hi,
we tried to implement the "upload flat file" functionality (blog Marc Bernard). We followed the different steps and included the bug fixes as well. When we want to launch the URL in an internet explorer session we get message "requested resource not found".
Hereby the URL used:
http://sapscmbid.vpkgrp.int:50100/sap/bc/webdynpro/sap/zrsplf_file_upload?sap-language=EN&planning_sequence=FILE_SEQ&show_messages=WEXA
Do you know what we did wrong? We would like to finish this by the end of this week ...
kind regards
DHi,
when we use URL http://sapscmbid.vpkgrp.int:50100/ we see the screens of the portal so I presume this server and port is accurate (we use the same link for the planning modeler and this works fine).
The SICF service zrsplf_file_upload has been imported and has status active. Should we check other things as well?
D -
How to upload flat file in planning book
Hi,
Can anyone tell me how to upload flat file(e.g xls, csv) in planning book against key figures(e.g forecast) in some characteristics level(e.g brand, sku etc)?
Is it possible to have screen shots or path to follow?Hi
Yes you can upload the excel files or flat files in APO planning area. APO planning area is made of characteristics and key figures. All the characteristic information is mainly available in Infoobject. You can upload these excel files in infobojects which will than reflect in planning book. Please find the detail information regarding APO BW building blocks.
http://help.sap.com/bp_scmv250/BBLibrary/documentation/DPL_BB_ConfigGuide_EN_DE.doc
Please go through the section 2. Setting up APO BW which will tell you all the details steps.
Please remember to activate the infoobject once you load the data.
I hope this will help you.
Thanks
Amol -
Problem in upload flat file into bw-bps using web browser
Hi All,
I have follwed the steps as per the how to guide to upload flat file,its seems to be fine but when try to upload by running the URL its giving error "Value of variable Data Slice Global ( ZFIE0ALL ) cannot be determined " and warning "Errors occurred when executing planning function TUPLOAD(EXIT FOR UPLOAD DATA)/T0000000(WEB UPLOAD".
Since i am new to BW/BPS , also let me know, how test it , when i run file_upload URL directly its giving follwing error.
SAP Note
The following error text was processed in the system:
An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause
When i run page1 url and if i file_load url, then its prompt me to see upload function, path for flat file. But when enter path of flat file and press upload function button ts giving error "Value of variable Data Slice Global ( ZFIE0ALL ) cannot be determined " and warning "Errors occurred when executing planning function TUPLOAD(EXIT FOR UPLOAD DATA)/T0000000(WEB UPLOAD".
FYI..i am using new design HTMLB option in how-to-doc.
Please help me to resolve this. Thanks in advance.
Also pls let me know can i debug this application?How ?
Vishal
Message was edited by:
vishal kashyap
Message was edited by:
vishal kashyapHi Vishal
Can u guide me , by what condition the data is selected in XTH_data ( Hashed table ) before the data is written by flat file function module .
Reply me ASAP ,
Thanks
Anup Singh -
Upload [Flat File]
Hi I'm using oracle apps R12..
in oracle apps R12 is there any possibility to upload flat file into oracle apps? from client side?
plzz helpHi,
IINM, DataLoad can be used for free (Basic version). If you do not want to use this tool, you could use WebADI instead of ADI (as you are on R12).
Build Custom WebADI Integrators with EBS 12.1.2 Desktop Integration Framework
http://blogs.oracle.com/stevenChan/2010/02/webadi_dif_ebs.html
Useful Web ADI custom integrators docs
Useful Web ADI custom integrators docs
Oracle Web Applications Desktop Integrator Implementation and Administration Guide
http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121bneig.pdf
Thanks,
Hussein -
hi ,
can any one help me how to upload the data in flat file to an internal table .the file is of tabe table of delimiter .
Regards,
kumarUse FM GUI_UPLOAD'. The sample code is as pasted below:
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:/TESTDATAXKO1.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = it_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 -
Uploading Excel file into SAP Database table?
I built a table in the SAP Data Dictionary, and i need to write a program that uploads the Excel table, into the SAP Database table. Does anybody have a sample program that may help me? Thanks!
TYPES:
BEGIN OF ty_upload,
matnr like mara-matnr,
meins like mara-meins,
mtart like mara-mtart,
mbrsh like mara-mbrsh,
END OF ty_upload.
DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.
DATA wa_upload TYPE ty_upload.
DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 65535
TABLES
intern = itab.
if not itab[] is initial.
loop at itab .
case itab-col.
when '0001'.
it_upload-matnr = itab-value.
when '0002'.
it_upload-meins = itab-value.
when '0003'.
it_upload-mtart = itab-value.
when '0004'.
it_upload-mbrsh = itab-value.
append it_upload.
clear it_upload.
clear itab.
endcase.
endloop.
endif.
loop at it_upload into wa_upload.
ztable-matnr = wa_upload-matnr.
ztable-meins = wa_upload-meins.
ztable-mtart = wa_upload-mtart.
ztable-mbrsh = wa_upload-mbrsh.
insert ztable.
endloop. -
How to store the flat file data into custom table?
Hi,
Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
Regards,
SujanHie
u can use function
F4_FILENAME
to pick the file from front-end or location.
then use function
WS_UPLOAD
to upload into
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME' "Function to pick file
EXPORTING
field_name = 'p_file' "file
IMPORTING
file_name = p_file. "file
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file1
TABLES
data_tab = it_line
*then loop at it_line splitting it into the fields of your custom table.
loop at it_line.
split itline at ',' into
itab-name
itab-surname.
endloop.
then u can insert the values into yo table from the itab work area.
regards
Isaac Prince -
Flat file as a source table in my mapping
Hi all..
I am using owb 10gR2. when i debug with flat file and one target table,it is throwing error as it doesn't support flat file,you must access it through exteral table.
But i dont want to use the external table. i want the flat file to be my source file.
pls help me out.
Thanks in advance,
Bharath.
Edited by: user11342336 on Aug 11, 2009 4:26 AMhi sutirtha. you have already solved one my of issue. hope you will solve this too :)
yes,it doesn't support flat files,but i am getting the following error,
"DBG1047 :Mapping flat file operators are not supported as sources when running mappings in debug mode. To access flat files use external table operators"
but i want to run or debug it without using external table operators.
Thanks,
Bharath, -
Error while uploading flat file
Hello
My flat file(.csv) has 3 columns.But when i am uploading and when i check Master data, it just shows me the first column.Why is it so?
When i maintain Master data, do i have to maintan attr, text and hierarchies?In mapping and transfer rules?What should I map, Attr or text or hierarchies or all the 3?
ThanksHi,
Let me make some guesses about your situation.
You use an IS with Direct Update for text master data upload. In this case in Master Data maintenance you'll see the IO's code and its attributes. To see IO's texts you need to click on a 'Text' icon, with a pencil or glasses.
For direct update of master data you need to create an IS with direct update (the last radio button in the 'Create Infosource' screen).
Then right click on an IS - Assign Datasource, choose flat file source system, confirm all system 'Save changes' proposals.
In Infosource change screen press 'Activate'.
Number of datasources for a master data will depend on the settings for the IO. If this IO has master data, texts and hierarchies, then you'll have 3 DSs.
In the 'Datasource' field of the screen you can see what is this DS for. Click on this field and choose another DS. Press 'Activate'. Do it the 3rd time if you have 3 DSs.
Then during an infopackage creation you'll be able to choose an option (Master data attributes, texts, hierarchies) and upload the appropriate data.
Best regards,
Eugene
Message was edited by: Eugene Khusainov -
GUI_UPLOAD to upload flat file to internal table
Hi Experts,
I have to upload a flat file which has multiple records ,from a local server.The fields in records are ~ saperated.
Presently i am only looking into uploading the flat file into internal table.
I have done the following coding;
TYPES: BEGIN OF gt_frmgt ,
tablety type c length 10 ,
tablenm type c length 30,
numin type c length 2,
END OF gt_frmgt.
TYPES: begin of gt_frmgto,
rec(1000) type c,
end of gt_frmgto.
DATA: Itgt_frmgt type table of gt_frmgt with header line.
DATA: itgt_frmgto type table of gt_frmgto with header line.
DATA: lfile_path type string.
PARAMETERS: f_path type localfile.
at selection-screen on value-request for f_path.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = f_path.
start-of-selection.
lfile_path = f_path.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = lfile_path
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
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 = itgt_frmgto
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.
delete itgt_frmgto index 1.
loop at itgt_frmgto.
clear Itgt_frmgt.
split itgt_frmgto-rec at cl_abap_char_utilities=>vertical_tab
into Itgt_frmgt-tablety
Itgt_frmgt-tablenm
Itgt_frmgt-numin.
append Itgt_frmgt.
endloop.
loop at Itgt_frmgt.
write:/ Itgt_frmgt-tablety, Itgt_frmgt-tablenm, Itgt_frmgt-numin.
The input file in Local path is ;
XXXXXXX~~Export the invoice
2~19980501~19980531
// The first invoice:
0~00130698114000010004119980512059611000276233.350.1711076.66????321000789010005???????????????????130601000000000??????????18? 3352051????532611-3357211???~~~
0~????????176233.350.1711076.6676233.350~1510
// The second invoice:
0~00130698114000010007219980512059611000440482.000.175882.00????110108078901007?????????61? 68744479?????????????462088-07?????130601000000000??????????18? 3352051????532611-3357211???????????~~~
0~????????139780.000.175780.0039780.000~1510
0~????3.5"10702.000.17102.0070.20~1510
and the output is :
XXXXXXX~~
2~~1998050
// The fir
0~00~1
0~????~?
// The sec
0~00~1
0~????~?
0~????
I am unable to understand why this split is happening .According to me the first 3 fields should be displayed without field saperater.
It would be very much appreciated if any body has little idea about this.
Thankx,
Priya
Message was edited by:
Priya Parmeshwar Shiggaon
Message was edited by:
Priya Parmeshwar Shiggaonif it is one time upload then u can use transaction CG3Z n upload file on application server.
u can tno use Gui_upload in background.
Program to upload file via gui_upload in foreground -(open fiel in Excel format and then make changes and save it as text tab file and upload tht file) -
REPORT Z_AMIT_BAPI
no standard page heading line-size 255.
parameters: p_file like rlgrap-filename default 'C:\temp\emp.txt'.
data :begin of itab occurs 0,
pernr(8),
bdate(10),
edate(10),
mail(30) ,
end of itab.
Start-of-selection.
Perform read_file.
*& Form read_file
text
--> p1 text
<-- p2 text
FORM read_file .
DATA: full_file_name TYPE string.
full_file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = full_file_name
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = itab
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 e000(000) WITH 'Upload-Error; RC:' sy-subrc.
ENDIF.
ENDFORM. " read_file
reward points if helpfull
amit -
Upload Flat file to Infocube with key figures of type FLOAT
Dear Experts,
I need your help in the following issue : I want to upload a flat file(csv) to an infocube. Two of the key figures are of type FLOAT. In the flat file the amount are in the format number with 4 decimals. eg 0.0445. When I upload the data, although I have NO errors, the key figures show value 0. (BW system is 3.5).
How should I declare these numbers in the excel file?
Thanks in advance for your help
Regards
DinaProblem solved. I just uploaded the file first to a ODS and then to the infocube and everything worked ok.
The mystery of BW!!!
Dina -
Need help to replace hexadcimal character in flat file
Hi,
I am loading data from flat file.
My flat file contains some hexadecimal characters.
Hence when I load the data the load fails.
I have checked many routines on SDN but could not get exact solution.
Actually in some of my fields TAB or CARRIAGE RETURN symbols are coming.
I want to write a simple routine in start routine of transfer structure. It will be # in PSA if I load the data till PSA.
can anyone help me?
Thanks & Regards,
Rashmi.hi Rashmi,
validate the data in flat file itself else you can edit the data in PSA while loading else you can allow the data is RSKC by specifying ALL_CAPITAL and execute .
Assign Point if useful
Ramesh
Maybe you are looking for
-
How to disconnect ASA 5505 site-to-site VPN via SSL?
Hi all, sorry, bit of a newbie so this may be trivial. We have an ASA 5505 which has two IPSEC site-to-site VPN tunnels. One to another ASA works just fine but the other to a Checkpoint VPN locks up occasionally. I've given up on sorting the
-
I need this information because I bought CS 6.0 and I plan on selling this one, but I'm not sure if I'm allowed to (for instance, if it's a student-teacher license).. I don't know where to ask about this, so any pointers would be much appreciated! Th
-
InDesign to swf--can you make hyperlinks that don't open a new window?
I am exporting an InDesign document to swf with interactive hyperlinks placed on an existing webpage. My problem is if you click on a hyperlink a new webpage opens up. Can I make the hyperlink work so that clicking on the link does not open up a new
-
Do I need to buy this twice?
I have just bought contribute so that my assistant can update the site without knowing any code... the software is on my computer and I need her to update the site herself on her own computer. do i have to buy two software programs? I generated the k
-
Lr's 'edit in' reference to Ps
I have a problem with referencing an appropriate instance of Ps from Lr. I don't know too much how this works with Lr & Mac, or how it happened, but I apparently have several instances of Ps referencing different plugins, and Lr's default references