Can file operations, like creation of a file, be done in ABAP?
Yes it can be done.
You can code in ABAP by using 'open dataset' / 'transfer' / 'close dataset' statements to create files on the Application Server.
You can also create your file directly to a certain application for e.g. MS Excel like so.
Also there are several function modules and classes that can simplify certain tasks like gathering your report output, putting your file on the AS (such as 'GUI_UPLOAD' / 'GUI_DOWNLOAD' / 'WS_DOWNLOAD' / 'SAP_CONVERT_TO_CSV_FORMAT' / etc.) ...
Bear in mind that certain functions modules were built for foreground tasks so they won't work in background job scheduling ...
Yes, it's possible, as nict said before. You should start reading here - that's the official documentation, it covers pretty much everything, including working with files on both the application and the presentation server. It also explains how to use platform-independent filenames - always remember, someday you might encounter an application server running on OS/400 that will not let you write stuff to C:\Temp\MyExport.csv. One more hint: Be careful about the function modules nict mentioned, some of them are not safe to use when unicode content is involved. Always use the methods of class CL_GUI_FRONTEND_SERVICES to be on the safe side.
You can use CL_GUI_FRONTEND_SERVICES class or GUI_DOWNLOAD function. Here is a link
You may use CL_GUI_FRONTEND_SERVICES class. But this services only work on front end. Or you can use some function modules like GUI_DOWNLOAD, GUI_UPLOAD etc.
we can create a flat file with data entered into it, with tabs-separated.
Now, that dota corresponds to the sap tables-fields, where the tables are related to an application, like say, material master.
Now we can use the standard FMs to upload the data to the internal tables of the program and followed by updating the database.
So, uploading flat-file data can be done.
Related
I want to do some bulk search/edit operation on the scripts embedded in our UrbanCode components and applications, and possibly on the flowcharts and blueprints. Unfortunately a lot of this is stored in UrbanCode's own repository, where it can only be access through the browser GUI and I can't do things like grep for common patterns across the whole set.
Is there any documented way to check out/check in, or at least download, a copy of an entire UCD environment as text files that I could analyze?
Thanks.
I think the closest documented way to get some of the things you are looking for is to export the application and to search through the json file. Component processes with all their steps are included in the application export.
I'm looking to break my access applications out into their component pieces so that I can use some version of source control with it. I currently have separated the front end and back end database. However I would like to go one step further and separate out the front end logic in the forms into their component files. If someone could point me in the right direction it would be much appreciated.
Access for about 20 years has supported the standard source code control interface.
The fact that the project is stored in one file is MOOT since Access can “logically” view each individual item (forms, reports, query, code etc.) as a separate object. So don’t confuse a logical view of the application vs that of physical.
There are quite a few posts on SO that outline this, and this post here gives some more information:
Version control for VBA file
When you use SCC with Access, then you see this:
if using Visual Source safe, you see this:
If using Team foundation server, you see this:
And the UI inside of Access shows the status of such objects. eg this:
There also add ins for git hub etc.
Keep in mind that Access 2010 was/is the last version to support SCC. If using 2013, then you have to use the noted "save-as-text" to send out each part and code as a standard text file which then of course can be used by any standard source code provider/control system.
I need to create a lot of SAP roles and profiles with a little difference between them.
Is there any way to do this using ABAP, or any the tamplate for the file to be uploaded using the PFCG transaction?
I'm pretty new in SAP, so if you have any document about that, please send me.
Thanks in advance.
quite often you can use the Legacy Systems Migration Workbench (transaction 'lsmw'). The workbench works like a sort of macro recorder. In it you can record the steps in a transaction and replay that record any number of times, replacing the values you used in your recorded transaction with new ones, for instance read from a text file. There are a few limitations though:
handling table controls is quite tricky
the steps for all iterations have to be the same. You can't just omit some part of your recording because you only need it for some of the records.
A lot more complex would be creating your own batch input (that is the technology used to replay recorded transactions) using some ABAP coding you need to create yourself. There you would be more flexible, for instance adding different numbers of privileges to different roles. That batch input would then be executed by using the "call transaction using " statement (see here).
If you can manage to restrict the differences to organizational hierarchy fields, you can use the built-in function to derive roles. This way, you can create a master role and a number of derived roles that only differ in specific values. You should be able to use the LSMW mentioned by Dirk Trilsbeek to create the derived roles, if necessary.
If this is not possible, you could try to create the role once, download it and check the contents of the file - it's basically a line-based fixed-width format with the first field of each line describing the line type, IIRC - just compare the contents of each line to the structures named. If you are familiar with any programming environment that is able to handle text output, it's not too hard to generate files containing the new roles with any toolkit you're comfortable with. I've successfully used XText / XPand for this, but it doesn't really matter. You can then upload the roles from the generated text files.
What is the process to access data from a SQL data source and have it fill in a list box control so that the user may select one of the values?
I have been given the name of the database and server, the login ID and password.
Code samples would really be appreciated as I have never done any SQL coding.
The latest Extension Library on OpenNTF ( extlib.openntf.org ) has a whole bunch of Relational Database extensions.
You'll need to get the JDBC drivers for whatever SQL server your going to be accessing and then take a look at the ExtLib demo application on how to create the JDBC connector from your application. Once the connector is in place you can then just the new controls in ExtLib to easily create a view pane etc.
You will also need more then the SQL server, username and password, you'll need to find out the different tables that you'll be accessing so that you can reference them from your Xpages application.
I've created a video showing JDBC access from XPages: http://www.youtube.com/watch?v=p6oRCsTsVqc
Wait for the book that will e released soon about the extlib. I know Jeremy hodge wrote the chapter so you might be able to get some info from him.
From an answer I gave earlier: you might want to check out the blog post announcing the JDBC support . It has an excellent video explanation and a link to a slide deck.
Also, take a look at Xpages101 lesson 61. It's paid-for content, but well worth it if you're serious about Xpages development.
If you want to combine Upgrade Pack 1 (UP1) with the Extension Library JDBC parts, then make sure to use the Extension Library that matches exactly the UP1 version. This is version 853-20111215 of the Extension Library. Then you can use the update site method to only deploy the experimental parts of the Extension Library (com.ibm.xsp.extlibx.feature_8.5.3.20111215-0914.jar).
For newer releases of Extension Library things might (will) have changed so that UP1 and Extension Library can not work together.
When UP2 is released, you need to remove the Extension Library package and deploy UP2. At that point in time UP2 might contain the JDBC support.
Roy,
As the previous posters put the ext library stuff will make it a little more "Drag and Drop", but you can use regular JDBC connection to get the data you want, Its pretty simple, but a lot more code than using Domino as a backend. You might want to look at this John Mackey blog post about doing a very similar thing...http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7G9GT4
Keep in mind that you need the actual ext. library for this. The upgrade pack does not contain the JDBC stuff.
Edit:
Keep in mind that if you don't need "LIVE" data access, and the information you want is fairly static you could always just use a lotusscript agent to pull the data down into Notes Documents. Run that once a day or whatever. No fancy XPages stuff needed. That's fairly common coding and practices with examples available.
Then just have the list box pull from the documents you brought down.
I am interested in creating a routine that would query the currently running cache processes and then write this information to a file. How could this be done in Cache 2008.2?
PERFMON might be what you're looking for. That's app with it's own UI, but you can call it's functions directly too, as an API.
Check the Cache docs for "Cache Monitoring Guide". That will give you links to PERFMON docs, as well as docs for other system monitoring tools.
You might find something useful in the Class Reference, under packages %SYSTEM, %SYS, and %Monitor.
For some process info you might need to shell out to the OS. In that case check into the $ZF function. That will let you invoke os-level commands from within Cache.
Oh, and you might want to consider saving the process data within the Cache DB, rather than dumping it out to a file. That is, create a Persistent Class with Properties corresponding to each process attribute that you want to capture, then write code to create, populate, and save instances of that class, taking the data from PERFMON or whatever other source you choose.
If you do that you can use Cache SQL to generate whatever kind of report you need. (Cache will automatically generate a SQL Table corresponding to your Persistent Class.) Cache supports ODBC, so you can use an external tool like Crystal Reports or Access for that part.
Obviously that will be more work than just echoing data to a file, but some kind of structure will be needed if you're going to do anything interesting with the information.