on 06-17-2015 10:00 AM
Hello everyone,
I'm wondering if it's possible to create a custom BO and corresponding WorkCentre, where one can input a CSV file (for example), and have an ABSL script strip the values out and process them. I know the SAP built-in file upload facility only takes XML thanks to this thread --- http://scn.sap.com/thread/3551730 --- but it is possible/feasible to build your own miniature one? No problem if it's not, I just want to know what's feasible. Thanks in advance.
Lewis
Bump. No-one with knowledge of handling binary strings in ABSL?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lewis,
it is much easier as you think with the CSV.
If you call the "ToString()" on the BinaryObject.content from the File and the Content is a String the "real" string will be returned.
import ABSL;
if(this.AttachmentFolder.IsSet()){
foreach(var doc in this.AttachmentFolder.Document){
raise CSVScreenOutput.Create("I", "Processed Document", doc.Name);
var docContent = doc.FileContent.BinaryObject.content.ToString();
var line = 1;
var startLine = 0;
var endLine = -1;
while(true){
endLine = docContent.Find("\n", startLine);
if(endLine == -1){
break;
}
raise CSVScreenOutput.Create("I", "Document Line " + line.ToString() + " Content", docContent.Substring(startLine, endLine - startLine - 1));
line = line + 1;
startLine = endLine + 1;
}
}
}
Beste regards
Tobias
Hi Tobias ,
I have tried to upload csv file by following your post . But my entries are not getting saved into the csv file .
This is my bo
This is my absl code
This is my screen where i have given entries to get upload into csv .
As my entries are getting saved in bo . But i cant able to see my entries in csv file
Thanks and regards ,
lokesh
Hi Lokesh,
If i understand you correctly you do not want to import values from an CSV to ByD, you want to export ByD Data to CSV.
Is this correct?
So my code example was made to handle the import case. If you want to have your data exported you can use the export to MS Excel Functionality in the OWL and you have your data of the root node or you can use reports for your own BOs.
Best regards,
Tobias
So I have a file attachment upload facility --- or at least the button that one can place on the UI, see below screenshot --- but it doesn't seem to have done anything. When I click the button it allows me to select a file by using the explorer that pops up, but I stuck a bit in the AfterModify script that shows me whether 'this.Attachments.DocumentList.Count() > 0', but it's not showing anything so I guess I'm missing a piece or two of the puzzle. Any ideas folks?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
EDIT: the below can be ignored. I was flicking through my old training book and realised there was a bit about exactly this, so now I have a working file uploader. I can fetch the binary content of a file --- but does anyone know about parsing this as a CSV file? I need to be able to get the contents of the comma-separated values instead of just a big load of 1s and 0s.
Tobias,
I found it --- Configuration Explorer tab, right? I dragged it in to a new row in the UI designer as in figure 1; however, the screen dumped first time round when I viewed it in ByDesign (see figure 2), and second time round --- after logging off and on again --- only the file upload bit I've put in there appeared. Ideas? Do I need to bind it to something?
Figure 1: the screen with the EC as viewed in the UI designer.
Figure 2: The dump that occurred first time round.
Lewis
Hi,
This will get the file content working, but not the fileName (still cant get that to work)
Let me know if this works
Will
Bump.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lewis,
this is not an feature of the Cloud Application Studio, but CSV is an very simple format and you could build your very own "Helper BO" to enable CSV Fileupload.
You could create an BO with an attachment folder and some logic to parse the CSV and insert the content to your BO structure.
Best regards
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.