Tutorialspoint

How to split at NEWLINEs in Python?

How do I split a multiline string """some                                           .....
Rajendra Dharmkar
Answered on 12th Dec, 2017

We can use the method splitlines() in string class to achieve this. For example:>>> """some multi line string""".splitlines() ['some', 'multi line', 'string']We can also specify the delimiter '\n' in the split() method as follows:>>> """some multi line string""".split('\n')  ['some', 'multi line', 'string'] Read More

Importing/Exporting ABAP packages to Presentation server

 In SAP system, I have created multiple small programs which I’ve put in my test package. Now if my system goes down I want my data to be restored and I don’t want to trouble S.....
Ankitha Reddy
Answered on 8th Dec, 2017

You can either go for some tools like SAPlink in this case. SAPlink will let you export custom objects. In case if you want to package them, it is possible to use SAPlink, however, I doubt that it covers all types.Another way using basis is that you can configure to ... Read More

How to check if string or a substring of string starts with substring in Python?

How do I check if the string "Harry Potter" starts with a substring 'Harr' in Python?
Rajendra Dharmkar
Answered on 12th Dec, 2017

Python has a method startswith(string) in the String class. This method accepts a prefix string that you want to search and is called on a string object. You can call this method in the following way:>>> 'hello world'.startswith('hell') True >>> "Harry Potter".startswith("Harr") True >>> 'hello world'.startswith('nope') FalseThere is another way ... Read More

Properties of SAP ABAP Development Objects

I am a JAVA developer and want to learn programming that can help me understand the properties of ABAP development objects, something like reflection. How can we check ABAP development object p.....
Nikitha N
Answered on 8th Dec, 2017

Similar to reflection in JAVA we have RTTS in SAP. RTTS stands for runtime type services. It provides you with ways to retrieve the definitions of variables and lets you create a new variable during program execution. RTTS comprises of two sub-componentsRTTI – Run Time Type IdentificationRTTC – Run Time ... Read More

Using constants in ABAP OO method

There is an ABAP program that contains only constants (Not my code). I want to use these constants in an ABAP OO method (My code). Is it possible to use these constants in an object oriented AB.....
V Jyothi
Answered on 8th Dec, 2017

Your INCLUDE should only contain definitions of constants nothing else and then the answer is straightforward.Select Goto -> Class - whichever local definition and then add an INCLUDE statement. This will expose all the constants “INCLUDE” in your implementation.

How to remove all trailing and leading whitespace in a string in Python?

How do I remove all trailing and leading whitespace in the python string  '   Hello People   '?
Rajendra Dharmkar
Answered on 12th Dec, 2017

To remove all trailing and leading whitespace in a string, we can use the method strip() in String class that gets rid of both these whitespaces. You can use it as follows:>>> '   Hello People   '.strip() 'Hello People'If you only want to remove leading or trailing whitespace use ... Read More

SAP Authorization concept and Authorization Objects, Object Class

Explain me about SAP Authorization concept, and the different terms of authorization-Authorization Objects and an Object Class. Now as per my understanding of Object Oriented concepts, an Objec.....
Abhinanda Shri
Answered on 8th Dec, 2017

To clear the air all at once, SAP Authorization Objects and Object Class has nothing much in common from Object Oriented classes and objects and differ vastly from it.Authorization object details the current user’s privileges which are used to authorize user activities and data availability. The Authorization Object is the ... Read More

I don’t want configuration information to be transferred with the database in SAP ABAP

There are parameters that I would not want to be transferred from a production environment to QA, stuff like network path and URLs. The problem is that in SAP ABAP everything is in the database.....
Abhinaya
Answered on 8th Dec, 2017

The straight answer to this is a big NO. This is one of the most common places of error in the SAP environment. When you create a clone of your production in the form of QA with most of the things as it is from production, you need to make ... Read More

Is it possible to delete the actives while you are running a loop over an internal table in SAP ABAP?

Please check below sample: , Is it OK to use above code for deleting active rows or some other logic should be used?
Srinivas Gorla
Answered on 8th Dec, 2017

DELETE command will have a result. You should make sure that once you delete the row, there should not be any reference or use of row subsequently in the loop. The best is to use CONTINUE as soon as you perform deletion. I will suggest avoiding “DELETE lt_itab INDEX sy-tabix” because ... Read More

Parsing IDoc files to extract information from SAP system

We are currently running an ERP system that doesn’t support any way of communicating with SAP. We are planning on communicating with a partner that is running SAP. There is a need to extr.....
Govinda Sai
Answered on 8th Dec, 2017

There are few third party libraries which can be used to perform this task however they involve some cost however best way here is to use an SAP Connector. SAP Connectors are available for almost all prevalent programming languages like JAVA, C#, Python. You can program against these connectors and read ... Read More

How to get min alphabetical character from the string in Python?

How do I get min alphabetical letter from string ‘TAJMAHAL’ in python?
Rajendra Dharmkar
Answered on 11th Dec, 2017

You can use the min method on a string to get the minimum alphabetical character from the string. You can use it as follows:>>> min('helloworld') 'd' >>> min(‘TAJMAHAL’) ‘A’

How to replace all occurrences of a string with another string in Python?

How to replace ‘hua’ with ‘hah’ in the string ‘chihuahua’?
Rajendra Dharmkar
Answered on 11th Dec, 2017

Pyhton has a method called replace in string class. It takes as input the string to be replaced and string to replace with. It is called on a string object. You can call this method in the following way to replace all 'no' with 'yes':>>> 'no one knows how'.replace('no', 'yes') ... Read More

How to find index of last occurrence of a substring in a string in Python?

How do I find the index of the last occurrence of a substring ‘kola’ in ‘NikolaTesla’?
Rajendra Dharmkar
Answered on 11th Dec, 2017

Python has a rfind() method which searches from the end of a string for the occurrence of a substring. It returns the index of last occurrence if found, else -1. You can use it as follows:>>> 'some of the some'.rfind('some') 12 >>> 'some of the some'.rfind('none') -1 >>> "NikolaTesla".rfind('kola') 2 ... Read More

How to search a string in backwards direction in Python?

How do I search for ‘cola’ in “CocacolaPepsi” in backward direction?
Rajendra Dharmkar
Answered on 11th Dec, 2017

Python has a rfind() method which searches from the end of a string for the occurrence of a substring. It returns the index of last occurrence if found, else -1. You can use it as follows:>>> "CocacolaPepsi".rfind('cola') 4 >>> 'CocacolaPepsi'.rfind('coke') -1

How to reverse a string in Python?

How to reverse the string ‘Halloween’?
Rajendra Dharmkar
Answered on 11th Dec, 2017

String slicing and range operators can be used to reverse a string in Python. For example:>>> 'Hello'[::-1] ‘olleH’ >>>‘Halloween’[::-1] ‘neewollaH’The [] operator can take 3 numbers separated by colon ‘:’. The first is start index, second is end index and third is the stride. Here we have specified the stride ... Read More

Advertisements
Loading...
Unanswered Questions View All