Skip to Content
0
Former Member
Jul 05, 2012 at 06:01 AM

Issue with Android Native Apps (Unable to Connect to a SAP BAPI from Native APP)

28 Views

Hi ,

Using SYBASE ESD 3 with the highest Android SDK for ICS.I have already completed SUP101 tutorial for android.I am unable to figure out working with SAP Server BAPIS.

I modeled a simple MBO to retrieve email address for a particular business partner.

MBO name GET_BP.

It only has 2 attributes one for email and one for business partner.

BAPI used :BusinessPartner.Getdetail ---> It takes up the BP id and returns many parameters including email.I have done everything similar to

SUP101 sample android project.I am unable to make the connection profile work when I do it the way it is mentioned in SUP101 sample.

Kindly help me write connection profile code so that I can call the standard BAPI to retrieve the email. In line number 55,56,57 I want to know the code to be inserted.

The code used is

package com.getbp.mbo;
import com.sybase.mobile.Application;
import com.sybase.mobile.ConnectionProperties;
import com.sybase.mobile.RegistrationStatus;
import com.sybase.persistence.LoginCredentials;
import com.sybase.persistence.SynchronizationGroup;
import AdndroidMBO.AdndroidMBODB;
import AdndroidMBO.BP_QUERYOtherOperation;
import AdndroidMBO.GET_BP;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.text.Editable;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;public class SimpleAndroidActivity extends Activity
{
private static final int REQUEST_DETAIL = 99;
private static String USERNAME = "supAdmin";
private static String PASSWORD = "s3pAdmin";
private static String HOST = "localhost";
private static int PORT = 5001;
private static int TIMEOUT = 600;
private QuerySAPADAPTER adapter;

private static volatile boolean initializationDone = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);


setButtonClickListener();

}

private void setButtonClickListener()
{
Button Button = (Button)findViewById(R.id.button1);
Button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

EditText mEdit1 = (EditText)findViewById(R.id.editText1);
Editable BP = mEdit1.getText();

/* What is the code stub I should add to set up the connection profile
* I have tried using the similar code as SUP101 Sample for android but I am * not able to connect *
*/
EditText mEdit2 = (EditText)findViewById(R.id.editText2);
mEdit2.setText();


}
});
}


}

Attachments

Program_Issue.png (231.9 kB)