Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
SriniBlog / getRFCLookupUDF.java
Last active February 9, 2018 01:09
RFC Lookup is simple UDF that can be used to execute RFC from UDF and fetch the output. This UDF uses RFC channel to make the calls to the SAP system.
public String getRFCLookupUDF(Container container) throws StreamTransformationException{
GlobalContainer globalContainer;
MappingTrace trace;
java.util.Map map;
trace = container.getTrace();
globalContainer = container.getGlobalContainer();
map = globalContainer.getTransformationParameters();
SystemAccessor rfcAccessor = null;
@SriniBlog
SriniBlog / DBLookupUDF.java
Last active October 19, 2019 18:44
DB Lookup from Standard SAP PI UDF to execute select query and get the records. This UDF can be used to call JDBC channel and execute the select query to fetch the records from database.
public String getDBLookupUDF(Container container) throws StreamTransformationException{
GlobalContainer globalContainer;
MappingTrace trace;
java.util.Map map;
trace = container.getTrace();
globalContainer = container.getGlobalContainer();
map = globalContainer.getTransformationParameters();
//Variables Used
@SriniBlog
SriniBlog / IonIconFonts.php
Created December 27, 2015 03:36
This code snippet is used to include the IonIcon fonts in the wordpress using genesis framework
// Include the below code in functions.php
//* Enqueue ionicons
add_action( 'wp_enqueue_scripts', 'genesis_ionicons_css' );
function genesis_ionicons_css() {
wp_enqueue_style( 'bg-ionicons-css', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css?ver=1.0.1', array(), CHILD_THEME_VERSION );
}
@SriniBlog
SriniBlog / FormValidation.js
Created December 25, 2015 15:32
This is a code snippet to show how to validate form using JQuery
/*
HTML Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.2.min.js"></script>
<!-- CUSTOM JS -->
<script src="js/tester.js" type="text/javascript"></script>
@SriniBlog
SriniBlog / AjaxCallUsingJquery.js
Created December 25, 2015 15:11
This is a code snippet of AJAX to call servlet and get the response from the server. Example is shown with JQuery.
$(document).ready(function () {
//Stops the submit request
$("#frmSomeForm").submit(function(e){
e.preventDefault();
});
//checks for the button click event for New
$("#btnSubmit").click(function(e){
dataString = "somefield=" + $("#frmSomeForm #someField").val();
@SriniBlog
SriniBlog / removefooter
Created December 25, 2015 12:36
This code snippets is used to remove the footer from the wordpress site with genesis framework.
//Remove the genesis footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
@SriniBlog
SriniBlog / customauthorbox.php
Last active December 25, 2015 12:26
This code snippet is used to create the custom author box in wordpress using genesis framework.
//Add the below code in functions.php
/*************** AUTHOR BOX **********************/
/**
* STEP 1: Create Custom Author Widget
*
*/
genesis_register_sidebar( array(
'id' => 'authorbox',
'name' => __( 'Author Box', 'sb' ),
@SriniBlog
SriniBlog / addGoogleFontWordpressGenesis.php
Created December 25, 2015 07:20
This code snippet is used in functions.php file to add the google font in the head section. This works for wordpress with genesis framework
//Add the below code to functions.php file
/*
* OUTPUT in HTML file
* <link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Raleway%3A300%2C700%7CLato%3A700%2C400italic%2C400&amp;ver=1.0.0" type="text/css" media="all">
*/
// Enqueue Google Fonts
add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
function genesis_sample_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Raleway:300,700|Lato:700,400italic,400', array(), CHILD_THEME_VERSION );
}
@SriniBlog
SriniBlog / getSeeburgerCounter.java
Last active February 9, 2018 01:09
This is used to read the seeburger Counter value and auto increment the counter
//import com.seeburger.functions.permstore.*;
public String getSeeburgerCounter(String counterName, Container container) throws StreamTransformationException{
String counterValue = "";
try {
CounterBean be = CounterFactory.getCounterInstance();
counterValue = be.nextCounter( counterName );
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
return counterValue;
@SriniBlog
SriniBlog / setSeeburgerVariable.java
Created December 24, 2015 07:11
This UDF can be used to write the Seerburger Variable
public String setSeeburgerVariable(String variableName, String variableValue, Container container) throws StreamTransformationException{
try
{
VariableBean be=VariableFactory.getVariableInstance("");
be.setStringVariable(variableName, variableValue);
}catch (Exception e){
throw new RuntimeException(e);
}
return "";
}