cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Employee Info

Former Member
0 Kudos

Hi All,

I am trying to get the employye info, using the BAPI BAPI_ADDRESSEMP_GETDETAIL. But, I dont know why I always get the error:

There is not data for 0006 (in the selected period).

0006 in the infotype.

I am triying to sen all the parametres for the BAPI, but always get the same result, with or without parameters.

Somebody can help me?

Thanks in advance.

/* -


*/

function = this.createFunction("BAPI_ADDRESSEMP_GETDETAIL");

if (function == null) {

System.out.println("BAPI " +

" not found in SAP.");

System.exit(1);

}

System.out.println("BAPI=OK.....\n");

// Here we go...

function.getImportParameterList().setValue("00034797", "EMPLOYEENUMBER");

function.getImportParameterList().setValue("19000101","VALIDITYBEGIN");

function.getImportParameterList().setValue("99991231","VALIDITYEND");

function.getImportParameterList().setValue("1", "SUBTYPE");

function.getImportParameterList().setValue("","OBJECTID");

function.getImportParameterList().setValue("","LOCKINDICATOR");

// function.getImportParameterList().setValue("", "RECORDNUMBER");

// function.getExportParameterList().setActive(false, "COMPANYCODE_ADDRESS");

mConnection.execute(function);

JCO.Structure returnStructure =

function.getExportParameterList().getStructure("RETURN");

if (! (returnStructure.getString("TYPE").equals("") ||

returnStructure.getString("TYPE").equals("S")) ) {

System.out.println("DADOS= "+returnStructure.getString("MESSAGE"));

System.exit(1);

}

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Luis,

The BAPI_ADDRESSEMP_GETDETAIL requires exact date for validitybegin date. I would call <b>BAPI_ADDRESSEMP_GETLIST</b>

first to get the information to be passed to BAPI_ADDRESSEMP_GETDETAIL.

Former Member
0 Kudos

Sorry, I am still haveing problems.

I have tried using GETLIST instead of GETDETAIL,

also I use the TutorialBAPI1.java fro mthe JCO examples as reference,

but the error happends before sending parameters.

Look:

// After JCO conection

function = this.createFunction("BAPI_ADDRESSEMP_GETLIST");

if (function == null) {

System.out.println("BAPI_ADDRESSEMP_GETLIST" +

" not found in SAP.");

System.exit(1);

}

mConnection.execute(function);

JCO.Structure returnStructure =

function.getExportParameterList().getStructure("RETURN");

if (! (returnStructure.getString("TYPE").equals("") ||

returnStructure.getString("TYPE").equals("S")) ) {

System.out.println("Test BAPI1 Message: "+returnStructure.getString("MESSAGE")); // <---ERROR OCCURS HERE

System.exit(1);

}

Former Member
0 Kudos

Hi Luis,

I couldn't get it to work either. Maybe a bug. Try this one <b>BAPI_ADDRESSEMPGETDETAILEDLIST</b>. This will get you all the info. You should also look for BAPI that is specific to your country.

Prakash

Former Member
0 Kudos

Well, I am stranger in the SAP land.

I will try this and another functions, but the matters now is, how to know what function are availables to be invoked via JCO.

I found this function browsing in the ABAP workbench.

I will find another an try again. Thanks !!!

Former Member
0 Kudos

Use transaction <b>BAPI</b> to browse available BAPIs.