Retrieving ABAP BAdi from SAP BW

SAP Developer
Published on 07-Dec-2017 19:59:30
There are different Function Module that you can use depending on BAdi type- classic or fast kernelYou can try using Function module SXO_IMPL_FOR_BADI_READ. To read the coding of class, try using “CL_ENH_BADI_RUNTIME_FUNCTIONS”You can use “GET_BADI_SHORTTEXT” method to know different BAdi’s types.There is a Function modules SEO* - which can be ... Read More

How to run Python functions in Eclipse command line?

Rajendra Dharmkar
Published on 07-Dec-2017 18:10:35
We can use PyDev, which is a plugin for running Python programs from Eclipse. Once installed, we will have the option of running the applications themselves directly or from the PyDev console/command line.

How we can store Python functions in a Sqlite table?

Rajendra Dharmkar
Published on 07-Dec-2017 18:04:06
In the following code, we import sqlite3 module and establish a database connection. We create a table and then insert data and retrieve information from the sqlite3 database and close the connection finally.#sqlitedemo.py import sqlite3 from employee import employee conn = sqlite3.connect('employee.db') c=conn.cursor() c.execute(‘’’CREATE TABLE employee(first text, last text, pay ... Read More

How to pass a json object as a parameter to a python function?

Rajendra Dharmkar
Published on 07-Dec-2017 18:01:44
We have this code below which will the given json object as a parameter to a python function.import json json_string = '{"name":"Rupert", "age": 25, "desig":"developer"}' print type (json_string) def func(strng):     a =json.loads(strng)     print type(a)     for k, v in a.iteritems():           ... Read More

How to return a json object from a Python function?

Rajendra Dharmkar
Published on 07-Dec-2017 17:52:25
We return a json object from a python function as follows using given python dictionary.import json a = {'name':'Sarah', 'age': 24, 'isEmployed': True } # a python dictionary def retjson(): python2json = json.dumps(a) print python2json retjson()OUTPUT{"age": 24, "isEmployed": true, "name": "Sarah"}Read More

How to pass a dictionary as argument in Python function?

Rajendra Dharmkar
Published on 07-Dec-2017 17:49:44
In the code given below we pass given dictionary as an argument to a python function and then call the function which works on the keys/value pairs and gives the result accordinglyd = {'a' : 1, 'b' : 2, 'c' : 3} def f(dict):     for k, v in ... Read More

How can you execute functions with multiple arguments at a terminal?

Rajendra Dharmkar
Published on 07-Dec-2017 17:41:52
We first import the sys module. We have to use the argv function of the sys module to fetch the arguments of the function entered at the terminal and execute the function.#fubar.py import sys def print_funcargs(arg1, arg2, arg3):       print arg1 + ' '+ arg2 + ' ' ... Read More

Why and how are Python functions hashable?

Rajendra Dharmkar
Published on 07-Dec-2017 17:40:09
An object is said to be hashable if it has a hash value that remains the same during its lifetime. It has a __hash__() method and it can be compared to other objects. For this, it needs the __eq__() or __cmp__()method. If hashable objects are equal when compared, then they ... Read More

Why does Python code run faster in a function?

Manogna
Published on 07-Dec-2017 17:33:59
It is found that if python code is run normally and then if it is run in a python function, it runs faster in the latter case. I want to know why python code runs faster in a function.It is generally found that it is faster to store local variables ... Read More

How exactly do Python functions return/yield objects?

Manogna
Published on 07-Dec-2017 17:33:02
The return statement causes a python function to exit and give back a value to its caller. The purpose of functions in general is to take in inputs and return something. A return statement, once executed, immediately terminates execution of a function, even if it is not the last statement ... Read More
Advertisements