cancel
Showing results for 
Search instead for 
Did you mean: 

Using AbstractList when calling a BAPI

Former Member
0 Kudos

Anyone familiar with the AbstractList data type?

I am calling a bapi (BAPI_CTRACPSOBJECT_GETLIST) and the input parameter I need to pass is BAPIDPSOB_BP_ACC_PARTNER which has the following structure:

SIGN

OPTION

LOW

HIGH

When I run SE37 I just need to fill out the structure like this:

SIGN = 'I'

OPTION = 'EQ'

LOW = '200000263' (Business Partner created by me)

HIGH = '200000263'

The problem is that I do not know how to populate this input structure. Below my code which it does not work due a null pointer just where I do Abstract_list.add ...

public boolean call_BAPI_CTRACPSOBJECT_GETLIST( java.lang.String businessPartner )

{

//@@begin call_BAPI_CTRACPSOBJECT_GETLIST()

if (businessPartner != null) {

//Create new element Registration Number

Abstract_list.add(1, "I");

Abstract_list.add(2, "EQ");

Abstract_list.add(3, businessPartner);

Abstract_list.add(4, businessPartner);

//

registrationNumberInput.setPartnerselection(Abstract_list);

}

// Call BAPI

try {

wdContext.nodeBapi_Ctracpsobject_Getlist()

.currentBapi_Ctracpsobject_GetlistElement()

.modelObject()

.execute();

} catch (Exception ex) {

msgMgr.reportException("Exception occurred in Ctracpsobject_Getlist", false);

msgMgr.reportException(ex.getLocalizedMessage(), false);

}

// Resynchronise the data in the context with the data in the model

wdContext.nodePsobjectlist().invalidate(); //nodeCentral_Output().invalidate();

Thanks in advance,

Diego.

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Hello Diego,

in which SAP Product is the BAPI BAPI_CTRACPSOBJECT_GETLIST avaliable? I think the Import Parameter is a Table. So you have to add it as a row.

Regards

Gregor

diego_gaudenzi
Participant
0 Kudos

Hello Gregor,

sorry I took so long to reply back. I had fixed my problem. I was binding the wrong object.

Thanks for posting your message regarding to my question.

B.R.

Diego.