[CS4] save on a local file without user intervention
hey,...sorry for my english...
i work with a other application who need to have the
information written in the local file without an user intervention
so...
i would like to know if it s possible to write or rewrite on
a local file without intervention of the user...
whitout the ""save dialogue box" or with a managed save
dialogue box...
how to write in a local file without user intervention...
i need really an answer to make real my project...
thans for your conprehension
hey
thx a lot for your help ...
if i understand well ...
it is possible to write or rewrite in a specific folder
who is determinated by the application folder of
an specific AIR apllication
who during his install give the ""authorization to
write/rewrite /save in his specific installation foder"
so it s possible with combination of an AIR application.....
can you give me some information about this AIR application
that i must build...
some direction to ask help
because i dont have the knowledges to do that
what style/type of AIR application
what charachteristics of this AIR application....
so some information that can i use to ask help in the good
place...
one more time thx a lot for your help...;)
Similar Messages
-
Upload file without user intervention
I know that there's been some topics like this before but I have more trouble.
My goal is this: I file should be automaticly uploaded to my servlet and the I want the internet browser to handle the response.
Because of the restrictions that lies, I think I need to create a small client program that simulates a post request to my servlet and then somehow make IE handle the response.
I've gotten some source code for the simulation of the post request from previous posts in this forum (see below). I haven't really got it to work but that shouldn't be a big problem. The problem is, how do I get IE to handle the response?
Here's the source code for the java program that simulates the post request:
import java.util.*;
import java.io.*;
import java.net.*;
class FileUpload
// true globals
// Anything that's unique will work
static final String CONTENT_BOUNDARY =
"-----------------------------7d22a63810058e";
public FileUpload() {
public static void main (String [] args) {
// whatever file you care to upload
String uploadFileName = "/testFile.txt";
FileInputStream fis1 = null;
OutputStream os1 = null;
InputStream is1 = null;
try
File file1 = new File(uploadFileName);
fis1 = new FileInputStream(file1);
// the URL of your upload application
URL testPost = new URL("http://localhost:8080/test/ReadFile");
URLConnection huc1 = testPost.openConnection();
huc1.setAllowUserInteraction(true);
huc1.setDoOutput(true); // turns it into a post
huc1.setRequestProperty("Content-Type", "multipart/form-data;boundary="+CONTENT_BOUNDARY);
huc1.setRequestProperty("User-Agent", "Mozilla/4.7 [en] (WinNT; U)");
huc1.setRequestProperty("Accept-Language", "en-us");
huc1.setRequestProperty("Accept-Encoding", "gzip, deflate");
huc1.setRequestProperty("Accept",
"image/gif, image/x-xbitmap,image/jpeg, image/pjpeg, "+
"application/vnd.ms-excel, application/msword, "+
"application/vnd.ms-powerpoint, application/pdf, application/x-comet, */*");
huc1.setRequestProperty("CACHE-CONTROL", "no-cache");
os1 = huc1.getOutputStream();
// Field 1 a Field of data
os1.write(
(CONTENT_BOUNDARY +
"\r\n"+
"Content-Disposition: form-data; name=\"txtTitle\"\r\n\r\nTest"+
"Segment\r\n"
).getBytes());
// Field 2 - the file, name is "uploadFile"
os1.write(
(CONTENT_BOUNDARY + "\r\n" +
"Content-Disposition: form-data; name=\"source\"; filename=\"" +
uploadFileName +
"\"\r\nContent-Type: audio/x-pn-realaudio\r\n\r\n"
).getBytes());
byte [] fileStuff = new byte[512];
int howMany = -1;
int totMany = 0;
howMany = fis1.read(fileStuff, 0, 512);
while (howMany != -1)
totMany += howMany;
os1.write(fileStuff, 0, howMany);
howMany = fis1.read(fileStuff, 0, 512);
System.err.println("read " + totMany + " bytes from file, wrote to outputstream.");
fis1.close();
fis1 = null;
os1.write(("\r\n" + CONTENT_BOUNDARY + "--\r\n").getBytes());
is1 = huc1.getInputStream();
byte [] urlStuff = new byte[512];
howMany = is1.read(urlStuff, 0, 512);
while (howMany != -1)
System.out.write(urlStuff, 0, howMany);
howMany = is1.read(urlStuff, 0, 512);
System.err.println("that was your output.");
is1.close();
is1 = null;
os1.close();
os1 = null;
catch (Exception ex)
System.err.println("Exception: " + ex);
ex.printStackTrace();
finally
if (fis1 != null)
try
fis1.close();
catch(Exception ok_to_eat)
// ok to ignore this
if (is1 != null)
try
is1.close();
catch(Exception ok_to_eat)
// ok to ignore this
if (os1 != null)
try
os1.close();
catch (Exception ok_to_eat)
// ok to ignore this
}Any suggestions are highly appreciated.
Thanks / DanielThe problem is, how do I get IE to handle the response?You can't. The response has to be handled by whatever sent the request.
-
QuickView (run in backgroud) - How to auto save data to local file
I am using Quickview to extract data. I want to run the Quickview query in background and auto save the data extracted into local file (ASCII file). Currently when I specify File Store (as my Output Format) and enter a file name (e.g C:\Temp\test.asc). Upon completion of extraction there is a little window popup that need me to select data format (e.g DAT, ASC) and click <Transfer> button to proceed to save data into local file.
Is there a way that I can save data into local file without have to manually select ASC data format and click <Transfer> button. I will not be able to schedule my QuickView query to run in background if I can't resolve this problem.
Note that I don't have access to ABAP programming, therefore this option is out.
Thanks in advance to anybody who can share your expertise experience.Tyr Fm's
1. WS_UPLOAD
2. GUI_UPLOAD
But using gui_upload and ws_upload can only upload data from txt.
actualy we have software to convert pdf to text file it freely availabe in internet...
after conversion you can use thesr fms.
plzz reward points usefull
Cheers,
Chandru -
Upload file without user action.
Hi,
Here is my requirement: I need to upload file ( text / excel file ) from local PC without user interaction.
I try using file_upload element and I set visible property as none ( so user doesn't see this element ) but I don't know how to get the file data. I only can set the file_name and mime_type property.
Please help me how to get this file data. Or how to upload file from local PC without file_upload element.
Regards,Hi Jatra.
I guess there are several function modules you can use. Try this : UPLOAD_FILES.
Maybe you can solve your issue with it. Otherwise search the Abap Forum on how to upload files from PC to WAS.
Cheers,
Sascha -
Function - "Save list in local file"
Hi,
Do any one know authorization object for executing the function "Save list in local file" .
Regards,
SrinivasAssign S_GUI profile in user profile & try.
http://wiki.sdn.sap.com/wiki/display/SMAUTH/S_GUI -
Authorization to save lists in local files
Hi,
How to authorize a user to download (with the right click menu or Shift + F8) to save list in local file ?
Thank in advance
Best regardshm.
try object:
S_DATASET
with values
PROGRAM=SAPLSWT1
ACTVT=34
FILENAME=*
Edited by: Mylene Euridice Dorias on Sep 30, 2009 1:36 PM
when trying to download to Excel, an additional object occured: S_GUI with activity 04, 60 and 61 -
How do I save a password protected file without a password?
Someone sent me a password protected file and I want to save it on my computer without the password.
Thanks,
ScottHi Scott,
It is not possible to save a password protected file without a password with Adobe Reader, you would require Adobe Acrobat to remove the password protection. Even with Adobe Acrobat you can only remove the security if you are aware about the password otherwise you need to contact the Author/creator of the PDF to remove the security.
Regards,
~Pranav -
In the R/3 window we get a Menu Option System -> List -> Save -> Local File.
And the same appear for Transaction iViews (SAP GUI for Windows)
In cases of SAP GUI for HTML or for that matter any ITS URL for a transaction, where can we find an option to Save as a Local File?any help?
-
Creating a jar file without user compliation
Hi, i got a problem here and i do not know how to go about doing it, any help will be much appreciated...
I need a JAR file in my integration bin shell
this bin shell will read my JAR file
The user will create the MAIN class file with something call a template engine specifying some stuff that can be changed
after which together with some existing .java class files, one .XML file(which the user specify with template engine) my program is to compile them automatically without user intervention and produce the JAR file.
any suggestions? thannksHmm, this sounds to me like a task for build tool like ANT.
If you absolutely need to do this yourself look at java.util.jar and into the programmatic interface of javac (get the JDK source code distribution for this). -
I have an IMAC 10.6.8
Is the iweb that comes with your computer complete? I am not able to save to a local file or send to my web site. Do I need to purchase the complete one?If you have iWeb V 3 you need to go to the Site Publishing Settings page...
http://www.iwebformusicians.com/iWeb/Publish-Website.html
"I may receive some form of compensation, financial or otherwise, from my recommendation or link." -
Can You Play Multiple Playlists Without User Intervention
Can you stack and play multiple playlists? ie if you had three playlists of 50 songs each, could you pick all three, play all the songs in the first playlist, when it is finished move automatically to the second playlist play its songs then automatically move to the third without user intervention? And if so, can you play each of these in shuffle mode?
There's no "impromptu" method of doing so that I know of.
As far as un-impromptu methods (it's always fun inventing words), it will depend on whether you want to listen to this mega-playlist on an iPod or just with iTunes.
If it's just with iTunes, you can go to the File menu > New Folder command and create a new folder which we can call the Mega-Playlist folder. Drag the three playlists in question into that folder. When you select that folder and press Play, iTunes should go through all the songs.
If it's on an iPod, since Folders don't transfer over from iTunes, the only solution I know of would be to create a Smart Playlist with iTunes that will -
Match any of the following rules:
Playlist is the first playlist +
Playlist is the second playlist +
Playlist is the third playlist.
Synching this mega-playlist to your iPod will allow you to select it from the Playlist menu.
Shuffle mode would shuffle songs from all three playlists together, not shuffle songs from the first playlist before moving on to shuffling songs from the second playlist before shuffling songs from the third playlist. -
Generate a Report Dynamically without User Intervention and Output to XML
Here's the scenario for which I am trying to find a solution. Any help would be greatly appreciated.
I have a series of reports that the users generate from a UI by selecting the report, setting the values for a list of parameters, and then click a submit button. The report is generated in the UI for them to view. They can print it from here or export it to Excel.
They would like to be able to schedule a report to run daily without user intervention using a saved set of parameters. The system would run the report automatically and email it to a defined set of email addresses.
To do this, we need to have the report generated in a string or xml so a Java process can read it and email it.
I see that I can change a report's template to export:xml so I feel that it is possible. How can I export a report to XML without user intervention? Can the report template be changd dynamically at runtime? Ideally, I need some way to call this same report and have it output as a string data or xml to be used by a Java process that would store and generate the report for email.Hi Kumar,
From Program1 you are calling Program2, using submit syntax (inside Program1).
While using submit, if you have correctly filled up the selection screen of program2, then it will AUTOMATICALLY get executed, WITHOUT F8.
If there is any compulsary field in program 2, which does not get populated, then it will not run automatically, or unless some special code is written in program2.
If you do not want the output of Program2 on screen, then u can use
SUBMIT Program2 AND RETURN.
In that case, no selection screen (of program2) will appear and neither the output of program 2.
Regards,
Amit Mittal.
Edited by: Amit Mittal on Dec 23, 2009 4:10 PM -
Material creation without user intervention
i have to create a material without user intervention. i am using BAPI_MATERIAL_SAVEDATA for this. it is not showing any error. but the return is having the message 'No description found'. how to transfer the description to this bapi.
this is the code i am trying:
DATA: mnum like zmara01-mno,
mat_data like BAPIMATHEAD,
plantx_data like BAPI_MARCX,
salesx_data like BAPI_MVKEX,
sale_data like bapi_mvke,
plant_data like bapi_marc,
mate_data like bapi_makt,
E1BP_MAKT like E1BP_MAKT,
cli_data like bapi_mara.
DATA: E_RETURN LIKE BAPIRET2.
data: MATERIALDESCRIPTION like BAPI_MAKT
occurs 0 with header line.
*data: m(18) type c.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'ZMNUMBER'
QUANTITY = '1'
IMPORTING
NUMBER = mnum.
message i003(zmsg) with mnum.
mat_data-material = mnum.
mat_data-ind_sector = 'I'.
mat_data-matl_type = 'DIEN'.
mat_data-basic_view = 'X'.
cli_data-base_uom = 'EA'.
cli_data-base_uom_iso = 'X'.
sale_data-sales_org = 'EISO'.
sale_data-distr_chan = 'SR'.
salesx_data-sales_org = 'EISO'.
salesx_data-distr_chan = 'SR'.
plant_data-plant = 'EIHO'.
plantx_data-plant = 'EIHO'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = mat_data
CLIENTDATA = cli_data
CLIENTDATAX =
PLANTDATA = plant_data
PLANTDATAX = plantx_data
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA =
VALUATIONDATAX =
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = sale_data
SALESDATAX = salesx_data
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
NO_DEQUEUE = ' '
IMPORTING
RETURN = E_RETURN
TABLES
MATERIALDESCRIPTION = MATERIALDESCRIPTION
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
loop at materialdescription.
message I004(I) with materialdescription-matl_desc.
endloop .
MESSAGE I004(I) WITH E_RETURN-TYPE.
if sy-subrc = 0.
message i005(zmsg).
elseif sy-subrc <> 0.
message e006(zmsg).
endif.
i am trying to give direct entries to test it . please help in this issue immediately.Hi dear,
welcome on board!
If you want an answer immediately I think you have to post your question in a more appropriate forum...
take a look to https://www.sdn.sap.com/sdn/collaboration.sdn and choose one of the available forums !
Good luck!
Roberto -
Animate elements one by one without user intervention
Hi, Good Day,
I have series of rectangles and textblocks on page.
I need to show them moving at different places one by one according to the contents of textblock without user intervention.
If I use for loop then it show movement of only last rectangle as I have to stop the storyboard in each iteration of loop.
Is there any way to move these rectangles automatically one after another????
sunainaA storyboard has a completed event. I think that's the easiest way to handle this sort of requirement.
You could chain them.
So you get a reference to a storyboard, add a handler to it's completed event which starts the next storyboard...
And start it.
Obviously you will have storyboards which do something or other but here's how I attach anonymous completed eventhandlers to a storyboard:
Storyboard sb1 = new Storyboard();
Storyboard sb = new Storyboard();
sb.Duration = new TimeSpan(0, 0, 1);
sb.Completed += new EventHandler(delegate(object s, EventArgs a)
sb1.Begin();
sb.Begin();
Hope that helps.
Recent Technet articles:
Property List Editing;
Dynamic XAML -
ALV issue: when save list using Local File command will get run time error!
help!!!!
report list using ALV method when to save this list using Local File.
i will get GETWA_NOT_ASSIGNED run time error information.
how resolve it?
source code :
REPORT ZIFT0103.
TABLES : MARA,MARC,CDHDR,CDPOS,MAKT.
******DEVK909212****************
****利用工厂来区分不同的SERVER的FTP ADDRESS ,user ,PASSWORD
DATA: FTP_WERKS LIKE MARC-WERKS.
********定义一个RANGE用来抓取MARC的信息
RANGES:R_MATNR FOR MARA-MATNR OCCURS 0.
********定义一个INTERNAL TABLE 来抓取MARC 的信息
DATA:BEGIN OF IT_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
USERNAME TYPE CDHDR-USERNAME,
UDATE TYPE CDHDR-UDATE,
FLAG_UI TYPE C,
END OF IT_MARC.
*******定义存放北京的数据的变量
DATA : BEGIN OF FTP_BEIJING OCCURS 0 ,
MATNR(25) ,
MATNR1(25) ,
MAKTX(30) ,
END OF FTP_BEIJING .
******定义福清的数据变量
DATA : BEGIN OF FTP_FUQING OCCURS 0 ,
MATNR(25) ,
MATNR1(25) ,
MAKTX(30) ,
END OF FTP_FUQING .
*******DEVK909212*****************
DATA : BEGIN OF FTP_ITEMDOC1 OCCURS 0 ,
MATNR(25) ,
MAKTX(30) ,
END OF FTP_ITEMDOC1 .
DATA : BEGIN OF FTP_ITEMDOC OCCURS 0 ,
MATNR(25) ,
MATNR1(25) ,
MAKTX(30) ,
END OF FTP_ITEMDOC .
DATA: WA_ZMSGTA TYPE ZMSGTA ,
l_ersda like MARA-ERSDA .
***********DEVK909553********************
****用来决定执行FTP还是显示LIST**********
DATA:g_tcode_flag.
***********DEVK909553********************
Error message process ******************************
DEFINE EXPLAIN_MSG.
break soe_richard.
CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
EXPORTING
ID = &1 "SY-MSGID
NUMBER = &2 "SY-MSGNO
LANGUAGE = SY-LANGU
TEXTFORMAT = &3
LINKPATTERN =
MESSAGE_V1 = &4 "SY-MSGV1
MESSAGE_V2 = &5 "SY-MSGV2
MESSAGE_V3 = &6 "SY-MSGV3
MESSAGE_V4 = &7 "SY-MSGV4
IMPORTING
MESSAGE = &8 "WA_ZMSGTA-MSE1
RETURN =
TABLES
TEXT =
END-OF-DEFINITION.
DEFINE ERROR_MSG_UPDATA.
CALL FUNCTION 'ZINSERT_MSG' "IN UPDATE TASK
EXPORTING
XZMSGTA = &1 "WA_ZMSGTA
EXCEPTIONS
UPDATE_ERROR = 1
OTHERS = 2.
END-OF-DEFINITION.
IF SY-TCODE = 'ZIFT103' .
g_tcode_flag = 'L'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = '请耐心等候,系统正在抓数据'.
ENDIF.
l_ersda = sy-datum - 1 . "取前一天产生的物料号码。
DATA:BEGIN OF it_change OCCURS 0,
OBJECTID TYPE CDHDR-OBJECTID,
USERNAME TYPE CDHDR-USERNAME,
UDATE TYPE CDHDR-UDATE,
TABKEY TYPE CDPOS-TABKEY,
END OF it_change.
DATA:BEGIN OF it_cDhdr OCCURS 0,
OBJECTID type CDHDR-OBJECTID,
CHANGENR TYPE CDHDR-CHANGENR,
USERNAME TYPE CDHDR-USERNAME,
UDATE TYPE CDHDR-UDATE,
END OF it_cdhdr.
DATA:search_len TYPE I.
DATA:BEGIN of it_insert OCCURS 0,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
END OF it_insert.
DATA:BEGIN OF it_MAKT OCCURS 0,
MATNR TYPE MAKT-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF it_makt.
DATA IT_MARA TYPE TABLE OF MARA WITH HEADER LINE.
DATA:BEGIN OF IT_OUT OCCURS 0,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
MTART TYPE MARA-MTART,
MEINS TYPE MARA-MEINS,
MATKL TYPE MARA-MATKL,
MAKTX TYPE MAKT-MAKTX,
PSTAT TYPE MARA-PSTAT,
BRGEW TYPE MARA-BRGEW,
NTGEW TYPE MARA-NTGEW,
GEWEI TYPE MARA-GEWEI,
FERTH TYPE MARA-FERTH,
KZUMW TYPE MARA-KZUMW,
ERNAM TYPE MARA-ERNAM,
ERSDA TYPE MARA-ERSDA,
END OF IT_OUT.
*-- DECLARE DATA FOR ALV
TYPE-POOLS: slis.
DATA : g_variant LIKE disvariant,
g_save(1) TYPE c,
g_exit(1) TYPE c,
gx_variant LIKE disvariant.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE, "
gt_events TYPE slis_t_event,
gt_list_top_of_page TYPE slis_t_listheader,
gs_print TYPE slis_print_alv,
gs_layout TYPE slis_layout_alv .
******只能抓出系统有做更改的数据***************
******而第一次INSERT MARA的数据抓不出来********
START-OF-SELECTION.
SELECT AOBJECTID AUSERNAME AUDATE BTABKEY
INTO TABLE it_change
FROM ( CDPOS AS B INNER JOIN CDHDR AS A ON
AOBJECTCLAS = BOBJECTCLAS AND
AOBJECTID = BOBJECTID AND
ACHANGENR = BCHANGENR )
WHERE A~OBJECTCLAS = 'MATERIAL'
AND A~UDATE = l_ersda
AND B~TABNAME = 'MARC'
AND B~CHNGIND = 'I'.
LOOP AT it_change.
search_len = STRLEN( it_change-TABKEY ).
search_len = search_len - 4.
IF search_len > 0.
IT_MARC-WERKS = it_change-TABKEY+search_len(4).
ENDIF.
IT_MARC-MATNR = it_change-objectid+0(18).
IT_MARC-USERNAME = it_change-username.
IT_MARC-UDATE = It_change-udate.
IT_MARC-FLAG_UI = 'U'.
APPEND IT_MARC.
CLEAR IT_MARC.
CLEAR R_MATNR.
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'EQ'.
R_MATNR-LOW = IT_MARC-MATNR.
APPEND R_MATNR.
ENDLOOP.
****CDPOS is Cluster TABLE 所以没有办法用INNER JOIN******
SELECT OBJECTID CHANGENR USERNAME UDATE
INTO TABLE it_cdhdr
FROM CDHDR
WHERE OBJECTCLAS = 'MATERIAL'
AND UDATE = l_ersda.
AND TCODE = 'MM02'.
LOOP AT IT_cdhdr.
SELECT * FROM CDPOS
WHERE OBJECTCLAS = 'MATERIAL'
AND OBJECTID = IT_CDHDR-OBJECTID
AND CHANGENR = IT_CDHDR-CHANGENR
AND TABNAME = 'MARC'
AND CHNGIND = 'I'.
search_len = STRLEN( CDPOS-TABKEY ).
search_len = search_len - 4.
IF search_len > 0.
IT_MARC-WERKS = CDPOS-TABKEY+search_len(4).
ENDIF.
IT_MARC-MATNR = IT_cdhdr-objectid+0(18).
IT_MARC-USERNAME = IT_cdhdr-username.
IT_MARC-UDATE = IT_cdhdr-udate.
IT_MARC-FLAG_UI = 'U'.
APPEND IT_MARC.
CLEAR IT_MARC.
CLEAR R_MATNR.
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'EQ'.
R_MATNR-LOW = IT_MARC-MATNR.
APPEND R_MATNR.
CLEAR IT_MARC.
ENDSELECT.
ENDLOOP.
IF g_tcode_flag = 'L'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 20
TEXT = '处理好当天CHANGE的数据'.
ENDIF.
*******抓当天做了INSERT的数据*************
*******不需要***********************
SELECT BMATNR BWERKS INTO TABLE IT_INSERT
FROM MARC AS B JOIN MARA AS A
ON AMATNR = BMATNR
WHERE A~ERSDA = l_ersda.
LOOP AT IT_INSERT.
IT_MARC-MATNR = IT_INSERT-MATNR.
IT_MARC-WERKS = IT_INSERT-WERKS.
IT_MARC-FLAG_UI = 'I'.
APPEND IT_MARC.
CLEAR IT_MARC.
CLEAR R_MATNR.
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'EQ'.
R_MATNR-LOW = IT_MARC-MATNR.
APPEND R_MATNR.
ENDLOOP.
IF g_tcode_flag = 'L'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 40
TEXT = '处理好当天INSERT的数据'.
ENDIF.
IF g_tcode_flag = 'L'.
PERFORM get_MAKTX.
PERFORM get_mara.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 100
TEXT = '处理好数据,并开始显示数据'.
PERFORM do_data.
PERFORM display_alv.
ELSE.
PERFORM get_MAKTX.
PERFORM do_ftp.
ENDIF.
*& Form get_marktx
text
FORM get_maktx.
SELECT MATNR MAKTX INTO TABLE IT_MAKT FROM MAKT
WHERE MATNR IN R_MATNR AND SPRAS = '1'.
ENDFORM. "get_marktx
*& Form get_mara
text
FORM get_mara.
SELECT * INTO TABLE it_mara FROM MARA
WHERE MATNR IN R_MATNR.
ENDFORM. "get_mara
*& Form do_data
text
FORM do_data.
SORT IT_MARC BY MATNR WERKS.
DELETE ADJACENT DUPLICATES FROM IT_MARC COMPARING MATNR WERKS.
LOOP AT IT_MARC.
CLEAR IT_MAKT.
CLEAR IT_MARA.
READ TABLE IT_MAKT WITH KEY MATNR = IT_MARC-MATNR.
READ TABLE IT_MARA WITH KEY MATNR = IT_MARC-MATNR.
MOVE-CORRESPONDING IT_MARA TO IT_OUT.
IT_OUT-MAKTX = IT_MAKT-MAKTX.
IT_OUT-WERKS = IT_MARC-WERKS.
IF IT_MARC-FLAG_UI = 'U'.
IT_OUT-ERNAM = IT_MARC-USERNAME.
ENDIF.
APPEND IT_OUT.
CLEAR IT_OUT.
ENDLOOP.
ENDFORM. "do_data
*SELECT AMATNR BMAKTX INTO CORRESPONDING
*FIELDS OF FTP_ITEMDOC1 FROM MARA AS A JOIN MAKT AS B
*ON AMATNR = BMATNR WHERE A~ERSDA = l_ersda
*AND B~SPRAS = '1' . "代表为中文说明。
APPEND FTP_ITEMDOC1.
*******DEVK909212****************
*******添加RANGE*****************
CLEAR R_MATNR.
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'EQ'.
R_MATNR-LOW = FTP_ITEMDOC1-MATNR.
APPEND R_MATNR.
CLEAR FTP_ITEMDOC1.
*******DEVK909212****************
*ENDSELECT.
*******DEVK909212****************
****get WERKS information from MARC*******
*SELECT MATNR WERKS INTO TABLE IT_MARC
*FROM MARC
*WHERE MATNR IN R_MATNR.
*******DEVK909212****************
******DEVK909212****************
**MARK**************************
*LOOP AT FTP_ITEMDOC1 .
MOVE : FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR,
FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR1,
FTP_ITEMDOC1-MAKTX TO FTP_ITEMDOC-MAKTX.
APPEND FTP_ITEMDOC.
CLEAR FTP_ITEMDOC.
*ENDLOOP.
******DEVK909212****************
******DEVK909212***********************************
**根据IT_MARC中信息,往北京和福清的TABLE写数据*****
FORM do_ftp.
LOOP AT IT_MARC.
***福清的
IF IT_MARC-WERKS = '1010' OR IT_MARC-WERKS = '1020'
OR IT_MARC-WERKS = '1023' .
READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
MOVE : FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR,
FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR1,
FTP_ITEMDOC1-MAKTX TO FTP_FUQING-MAKTX.
CLEAR IT_MAKT.
READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
MOVE : IT_MARC-MATNR TO FTP_FUQING-MATNR,
IT_MARC-MATNR TO FTP_FUQING-MATNR1,
IT_MAKT-MAKTX TO FTP_FUQING-MAKTX.
APPEND FTP_FUQING.
CLEAR FTP_FUQING.
ENDIF.
***北京的
IF IT_MARC-WERKS = '1041' OR IT_MARC-WERKS = '1042'.
READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
MOVE : FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR,
FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR1,
FTP_ITEMDOC1-MAKTX TO FTP_BEIJING-MAKTX.
CLEAR IT_MAKT.
READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
MOVE : IT_MARC-MATNR TO FTP_BEIJING-MATNR,
IT_MARC-MATNR TO FTP_BEIJING-MATNR1,
IT_MAKT-MAKTX TO FTP_BEIJING-MAKTX.
APPEND FTP_BEIJING.
CLEAR FTP_BEIJING.
ENDIF.
ENDLOOP.
****清楚重复的数据**********
SORT FTP_FUQING.
DELETE ADJACENT DUPLICATES FROM FTP_FUQING.
SORT FTP_BEIJING.
DELETE ADJACENT DUPLICATES FROM FTP_BEIJING.
***传送数据********
REFRESH FTP_ITEMDOC.
FTP_ITEMDOC[] = FTP_FUQING[].
FTP_WERKS = '1010'.
PERFORM ftp_work.
REFRESH FTP_ITEMDOC.
FTP_ITEMDOC[] = FTP_BEIJING[].
FTP_WERKS = '1041'.
PERFORM ftp_work.
******DEVK909212***********************************
ENDFORM. "do_ftp
*& Form ftp_work
把以前FTP的工作做一个FORM
*******DEVK909212**************************
FORM ftp_work.
*******DEVK909212**************************
CHECK FTP_ITEMDOC[] IS NOT INITIAL.
FTP function *****************************************************
DATA : HDL TYPE I,
L_SLEN TYPE I ,
ERROR,
KEY TYPE I VALUE 26101957,
DEST TYPE RFCDES-RFCDEST VALUE 'SAPFTPA'.
DATA: FTP_RESULT TYPE TABLE OF TEXT.
DATA: P_FILE TYPE RLGRAP-FILENAME.
DATA: L_USER(16) TYPE C VALUE 'SFIS',
L_PWD(16) TYPE C VALUE 'SFIS',
L_HOST(16) TYPE C VALUE '172.16.31.17'.
*******DEVK909212**************************
*****根据不同的工厂来抓FTP的信息
CALL FUNCTION 'Z_FTP_SFIS'
EXPORTING
BLART = 'S'
WERKS = FTP_WERKS
IMPORTING
HOST = L_HOST
USER1 = L_USER
PASS1 = L_PWD.
*******DEVK909212**************************
CONCATENATE l_ersda '.KP' INTO P_FILE.
SET EXTENDED CHECK OFF.
ERROR = 0.
CHECK HDL IS INITIAL.
Connect to server
L_SLEN = STRLEN( L_PWD ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = L_PWD
SOURCELEN = L_SLEN
KEY = KEY
IMPORTING
DESTINATION = L_PWD.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Connect to FTP Server'.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
USER = L_USER
PASSWORD = L_PWD
HOST = L_HOST
RFC_DESTINATION = DEST
IMPORTING
HANDLE = HDL
EXCEPTIONS
NOT_CONNECTED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MOVE: 'B' TO WA_ZMSGTA-BLART,
l_ersda TO WA_ZMSGTA-REFNUMBER,
SY-MSGTY TO WA_ZMSGTA-MSGTY,
'MARA' TO WA_ZMSGTA-TBMA_VAL.
EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4 WA_ZMSGTA-MSE1.
ERROR_MSG_UPDATA WA_ZMSGTA.
EXIT.
ENDIF.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = HDL
COMMAND = 'ascii'
TABLES
DATA = FTP_RESULT
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
IF SY-SUBRC <> 0.
EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4 WA_ZMSGTA-MSE1.
MOVE: 'B' TO WA_ZMSGTA-BLART,
l_ersda TO WA_ZMSGTA-REFNUMBER,
SY-MSGTY TO WA_ZMSGTA-MSGTY,
'MARA' TO WA_ZMSGTA-TBMA_VAL.
ERROR_MSG_UPDATA WA_ZMSGTA.
EXIT.
ENDIF.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = P_FILE
CHARACTER_MODE = 'X'
TABLES
TEXT = FTP_ITEMDOC
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4 WA_ZMSGTA-MSE1.
MOVE: 'B' TO WA_ZMSGTA-BLART,
l_ersda TO WA_ZMSGTA-REFNUMBER,
SY-MSGTY TO WA_ZMSGTA-MSGTY,
'MARA' TO WA_ZMSGTA-TBMA_VAL.
ERROR_MSG_UPDATA WA_ZMSGTA.
EXIT.
ENDIF.
*******DEVK909212**************************
*******CLOSE FTP******************
CHECK NOT HDL IS INITIAL.
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
HANDLE = HDL.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
DESTINATION = DEST
EXCEPTIONS
OTHERS = 1.
CLEAR HDL.
ENDFORM. "ftp_work
*******DEVK909212**************************
FORM DISPLAY_ALV .
*-- PREPARE ALV DATA
PERFORM EVENTTAB_BUILD USING GT_EVENTS[].
PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
*-- LAYOUT SETTING
PERFORM PREPARE_ALV_FIELD USING GT_FIELDCAT[].
*-- ALV DISPLAY
PERFORM CALL_REUSE_ALV_GRID_DISPLAY.
ENDFORM. " display_alv
*& Form eventtab_build
text
-->P_GT_EVENTS[] text
FORM EVENTTAB_BUILD USING PT_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = PT_EVENTS.
READ TABLE PT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
LS_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY PT_EVENTS FROM LS_EVENT INDEX SY-TABIX.
ENDIF.
ENDFORM. " eventtab_build
*& Form comment_build
text
-->P_GT_LIST_TOP_OF_PAGE[] text
FORM COMMENT_BUILD USING PT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER,
L_DATE(30),
l_v_BWKEY like T001W-BWKEY, "Valuation area
l_v_BUKRS like T001K-BUKRS. "Firm/Company
Listenerschrift: Typ H
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-KEY: not used for this type
select single BWKEY
into l_v_BWKEY
from t001w
where WERKS IN s_WERKS.
select single BUKRS
into l_v_BUKRS
from t001k
where BWKEY = l_v_BWKEY.
SELECT SINGLE butxt INTO LS_LINE-INFO
FROM t001
WHERE bukrs = l_v_BUKRS.
APPEND LS_LINE TO PT_TOP_OF_PAGE.
Kopfinfo: Typ S
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = '报表名称:'.
LS_LINE-INFO = SY-TITLE.
APPEND LS_LINE TO PT_TOP_OF_PAGE.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = '打印日期:'.
WRITE SY-DATUM TO LS_LINE-INFO.
ls_line-info = sy-datum.
APPEND LS_LINE TO PT_TOP_OF_PAGE.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = '打印時間:'.
WRITE SY-UZEIT TO LS_LINE-INFO.
ls_line-info = sy-uzeit.
APPEND LS_LINE TO PT_TOP_OF_PAGE.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-KEY = '使用者:'.
LS_LINE-INFO = SY-UNAME.
APPEND LS_LINE TO PT_TOP_OF_PAGE.
ENDFORM. " comment_build
*& Form prepare_alv_field
text
-->P_GT_FIELDCAT[] text
FORM PREPARE_ALV_FIELD USING P_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_LINE TYPE SLIS_FIELDCAT_ALV.
*-- DEFINE MARCO
DEFINE APPEND_ALV_FIELD.
CLEAR LS_LINE.
LS_LINE-FIELDNAME = &1.
LS_LINE-TABNAME = &2.
LS_LINE-REPTEXT_DDIC = &3.
LS_LINE-SELTEXT_L = &3.
LS_LINE-SELTEXT_M = &3.
LS_LINE-SELTEXT_S = &3.
LS_LINE-QFIELDNAME = &4.
LS_LINE-QTABNAME = &5.
LS_LINE-NO_OUT = &6.
LS_LINE-NO_ZERO = &7.
LS_LINE-OUTPUTLEN = &8.
APPEND LS_LINE TO P_FIELDCAT.
END-OF-DEFINITION.
APPEND_ALV_FIELD: 'MATNR' 'IT_OUT' '料号'
'O' 'X' ''.
APPEND_ALV_FIELD: 'WERKS' 'IT_OUT' '工厂'
'O' 'X' ''.
APPEND_ALV_FIELD: 'MTART' 'IT_OUT' 'MTyp'
'O' 'X' ''.
APPEND_ALV_FIELD: 'MEINS' 'IT_OUT' 'BUn'
'O' 'X' ''.
APPEND_ALV_FIELD: 'MATKL' 'IT_OUT' '物料组\分群码'
'O' 'X' ''.
APPEND_ALV_FIELD: 'MATKX' 'IT_OUT' '物料描述'
'O' 'X' ''.
APPEND_ALV_FIELD: 'PSTAT' 'IT_OUT' '维护状态'
'O' 'X' ''.
APPEND_ALV_FIELD: 'BRGEW' 'IT_OUT' '毛重'
'O' 'X' ''.
APPEND_ALV_FIELD: 'NTGEW' 'IT_OUT' '净重'
'O' 'X' ''.
APPEND_ALV_FIELD: 'GEWEI' 'IT_OUT' 'WUn'
'O' 'X' ''.
APPEND_ALV_FIELD: 'FERTH' 'IT_OUT' '对外机种名'
'O' 'X' ''.
APPEND_ALV_FIELD: 'KZUMW' 'IT_OUT' '高关税标识'
'O' 'X' ''.
APPEND_ALV_FIELD: 'ERNAM' 'IT_OUT' '创建者'
'O' 'X' ''.
APPEND_ALV_FIELD: 'ERSDA' 'IT_OUT' '创建日期'
'O' 'X' ''.
ENDFORM. " prepare_alv_field
*& Form call_reuse_alv_grid_display
text
--> p1 text
<-- p2 text
FORM CALL_REUSE_ALV_GRID_DISPLAY .
gs_layout-f2code = 'DISPLAY'.
gs_print-no_print_listinfos = 'X'.
gs_layout-colwidth_optimize = 'X'. "列宽度自动根据内容优化
gs_layout-f2code = '&ETA'. "double check弹出详细信息
gs_layout-zebra = 'X'. "清单条纹显示
gs_layout-no_vline = ''. "是否显示列间隔线
gs_layout-box_fieldname = ''. "是否显示checkbox
gs_layout-confirmation_prompt = ''. "推出清单是否提示
gs_layout-detail_titlebar = '详细信息'."详细清单的标题
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'ALV_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = GT_LIST_TOP_OF_PAGE[]
IT_FIELDCAT = GT_FIELDCAT[]
IT_EVENTS = GT_EVENTS[]
I_STRUCTURE_NAME = 'IT_OUT'
I_SAVE = 'A'
IS_LAYOUT = GS_LAYOUT
IS_PRINT = GS_PRINT
TABLES
T_OUTTAB = IT_OUT
EXCEPTIONS
PROGRAM_ERROR = 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.
ENDFORM. " call_reuse_alv_grid_display
*& Form PREPARE_ALV_FIELD
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
ENDFORM. "TOP_OF_PAGEHi,
Please check your field catalog and refer field names once again.
Check spelling, or Check strucutre properly.
There are something wrong in your catalog definition
aRs.
Maybe you are looking for
-
Just curious, I am only using IE 11 right now although I used to use Chrome mostly. Chrome seems to perform very poor on this machine? Is it just the CPU that is too weak, or is it something that can be fixed? For example if I watch 4k clips in IE 11
-
Hi there, Can someone please help. My IPhoneS stopped working right after I did the latest update which was yesterday. Now, the phone does not work at all. When turned on, the screen shows a picture of USB cable pointing to the ITunes logo. I hav
-
Runtime stlport4 error: Unexpected Signal : 11
Hi Gurus, I am using CC 5.5 with stlport4 to build our project. I basically build a jni library which got called from java class. I had no compile and link problem. If do "ldd -r MyLib.so", all symbols are resolved. But at runtime, I got the followin
-
User/ Administrator Permissions and Log In.
I have a new Mac book Pro. I am trying to find a definitive answer to my dilemma. Currently I log on with full administrator privileges,but I have read that this is dangerous and that I should create a separate user account. I am fairly comfortable w
-
In all my incoming messages, links do not work. The error message reads=No associated application can be found. Any hints?