Read Data from SAP

Shweta

Active Member
Hi

How can we read the following text (HOP, Site code and Site name) in BP?

******************************************
Some data written in 3-4 lines
Hop Site Code Site name
871 ABC XYZ
 

Sanjiv

New Member
@Shweta , if it is web based application spy the whole data in html mode and use Get table in read action then use string manipulation to extract data according to your requirement.
Please mention the nature of UI if my answer is not feasible your question.
 

Sachin_Kharmale

Active Member
if you are using sap then spy element using sap mode in blue prism.
and if the above mentioned structure is a table then in blue prism sap mode there one action called get data in collection / Read Table.
So you will be get data in collection as output.
 

Shweta

Active Member
This is SAP application.. And the data is read in form of text as:
***************************************************************
Some text here with 4-5 lines
****************************************************************

**GOODS MUST DELIVER IN THE PROFILED MONTH AS PER ***
HOP Site Name Network
ABC DEF GHI JKL

Now, I want to to Read the data so that I can get:
HOP = ABC
Site = DEF .. like this.
So, how can I get this?

There can be few more lines after this also.
 

Sanjiv

New Member
@Sachin_Kharmale ,if it is web based application , follow the steps accordingly
1. If whole data coming as one table , spy the whole data in one from html spy mode.
2. Use the Read action and selection Get Table.(Output will be in collection)
3. And use action Utility String or Select Text in Calculation Stage to format data according to your requirement.

I hope you got it :)
 

Sachin_Kharmale

Active Member
This is SAP application.. And the data is read in form of text as:
***************************************************************
Some text here with 4-5 lines
****************************************************************

**GOODS MUST DELIVER IN THE PROFILED MONTH AS PER ***
HOP Site Name Network
ABC DEF GHI JKL

Now, I want to to Read the data so that I can get:
HOP = ABC
Site = DEF .. like this.
So, how can I get this?

There can be few more lines after this also.
Hi Shweta ,

If you are getting output in text like
HOP Site Name Network
ABC DEF GHI JKL


Then you can split text first line by Line. using utility string object.
after getting Lines collection


HOP Site Name Network -- Line 1
ABC DEF GHI JKL -- Line 2

you can split lines as word by word using split text from utlity string using parameter as " " input to split text
Split first Line using split text
you will get
HOP

Site
Name
Network
apply above logic for all lines it may be 3 or 4 lines in your text data item.
and then you can push data in collection.


I hope it will help you.
 

Shweta

Active Member
@Sachin_Kharmale ,if it is web based application , follow the steps accordingly
1. If whole data coming as one table , spy the whole data in one from html spy mode.
2. Use the Read action and selection Get Table.(Output will be in collection)
3. And use action Utility String or Select Text in Calculation Stage to format data according to your requirement.

I hope you got it :)
As I said, this is SAP application
 

Shweta

Active Member
Hi Shweta ,

If you are getting output in text like
HOP Site Name Network
ABC DEF GHI JKL


Then you can split text first line by Line. using utility string object.
after getting Lines collection


HOP Site Name Network -- Line 1
ABC DEF GHI JKL -- Line 2

you can split lines as word by word using split text from utlity string using parameter as " " input to split text
Split first Line using split text
you will get
HOP

Site
Name
Network
apply above logic for all lines it may be 3 or 4 lines in your text data item.
and then you can push data in collection.


I hope it will help you.

Thanks but there is a space in columns also like:
HOP Site Name Site Code Network

Here Site name and Site code are two columns..
 

Sanjiv

New Member
@Shweta if I understood your question better spy the whole data as table i.e while spying you will get element type as SAP Table and store the data in collection.

Now to get the data
HOP = ABC
Site = DEF .. like this.
Use action Split text in Utility sting and in input for split character pass " (space)" to so that every text from one line will come in different row.

Output
HOP
Site
Name
Network
Do the same for different field.

and put both the collection in loop and using calculation stage keep Collection. field1 = Collection.field2.


I hope I understand your question and answer :)
 

Shweta

Active Member
@Shweta if I understood your question better spy the whole data as table i.e while spying you will get element type as SAP Table and store the data in collection.

Now to get the data
HOP = ABC
Site = DEF .. like this.
Use action Split text in Utility sting and in input for split character pass " (space)" to so that every text from one line will come in different row.

Output
HOP
Site
Name
Network
Do the same for different field.

and put both the collection in loop and using calculation stage keep Collection. field1 = Collection.field2.


I hope I understand your question and answer :)
This is only getting spied in Win32 mode and not accepting SAP spy mode that's why I am taking it as a text. And in Win32 mode, we can't get it in table.
 
Top