cancel
Showing results for 
Search instead for 
Did you mean: 

Error using Adaptive RFC model.

Former Member
0 Kudos

I am trying to use Adaptive RFC model to create a PO using BAPI_PO_CREATE1.

I am setting all import parameters. Still at the end, I get this error:

"Creation of PO using Enjoy BAPI unsuccessful."

I have no ABAP experience. How do I check the problem?

Please help me in.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

dhawal_joshi
Employee
Employee
0 Kudos

Hi,

To check what error has happened you could open an error log to get the details. You could click on Windows ( Alt +W) , Show View, Others, PDE Runtime, Error log . Double click on error to see details.

In normal circumstance the error is thrown in case if you try to import RFC which has table types that do not support proper line types. Line type is like a structure defined in dictionary , but ABAP also support tables that do not have line types ( structures ), which is not supported by ARFC .

Thanks

Dhawal

Former Member
0 Kudos

Hi Dhawal

Thanks for answering.

On opening the error log, I see that there are no errors, just informative statments.

Can you elaborate on your statement."Line type is like a structure defined in dictionary , but ABAP also support tables that do not have line types ( structures ), which is not supported by ARFC."

I am trying to call this BAPI from Java WebDynpro.

Please see the code below, which I am writing out here. I have hardcoded the values for convenience sake.

public void onActionContinue(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionContinue(ServerEvent)

// Create a new element in the Bapi_PO_Create1_Input node

Bapi_Po_Create1_Input bapiPoCreate1Input = new Bapi_Po_Create1_Input();

wdContext.nodeBapi_Po_Create1_Input().bind(bapiPoCreate1Input);

Bapimepoheader bapimepoheader = new Bapimepoheader();

bapimepoheader.setDoc_Type("ZUB2");

bapimepoheader.setPurch_Org("1000");

bapimepoheader.setPur_Group("A01");

bapimepoheader.setComp_Code("1000");

/*wdContext.currentPoheaderElement().setDoc_Type("ZUB2");

wdContext.currentPoheaderElement().setPurch_Org("1000");

wdContext.currentPoheaderElement().setPur_Group("A01");

wdContext.currentPoheaderElement().setComp_Code("1000");

wdContext.currentPoheaderElement().setSuppl_Plnt("059");*/

bapiPoCreate1Input.setPoheader(bapimepoheader);

Bapimepoheaderx bapimepoheaderx = new Bapimepoheaderx();

bapimepoheaderx.setDoc_Type(true);

bapimepoheaderx.setPurch_Org(true);

bapimepoheaderx.setPur_Group(true);

bapimepoheaderx.setComp_Code(true);

bapiPoCreate1Input.setPoheaderx(bapimepoheaderx);

Bapimeposchedule bapimeposchedule= new Bapimeposchedule();

bapimeposchedule.setPo_Item("10");

bapimeposchedule.setDelivery_Date("05/09/2007");

bapiPoCreate1Input.addPoschedule(bapimeposchedule);

Bapimeposchedulx bapimeposchedulx= new Bapimeposchedulx();

bapimeposchedulx.setPo_Item("10");

bapimeposchedulx.setPo_Itemx(true);

bapimeposchedulx.setDelivery_Date(true);

bapiPoCreate1Input.addPoschedulex(bapimeposchedulx);

Bapiparex bapiparex = new Bapiparex();

bapiPoCreate1Input.addExtensionin(bapiparex);

Bapimepoitem bapimepoitem = new Bapimepoitem();

IPrivateFirstView.IPoitemElement element =

wdContext.createPoitemElement(new Bapimepoitem());

wdContext.nodePoitem().addElement(0, element);

bapimepoitem.setPo_Item("10");

bapimepoitem.setPlant("659");

bapimepoitem.setSuppl_Stloc("ALIV");

bapimepoitem.setMaterial("A000021");

bapimepoitem.setQuantity(new BigDecimal("1"));

bapiPoCreate1Input.addPoitem(bapimepoitem);

Bapimepoitemx bapimepoitemx = new Bapimepoitemx();

bapimepoitemx.setPo_Item("10");

bapimepoitemx.setPo_Itemx(true);

bapimepoitemx.setPlant(true);

bapimepoitemx.setSuppl_Stloc(true);

bapimepoitemx.setMaterial(true);

bapimepoitemx.setQuantity(true);

bapiPoCreate1Input.addPoitemx(bapimepoitemx);

try{

wdThis.wdGetFirstCompController().exec();

}

exec()

{

wdContext.currentBapi_Po_Create1_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

I get this error:

Creation of PO using Enjoy BAPI unsuccessful.

Thanks!

Former Member
0 Kudos

Hi,

To solve this problem we should be clear where the problem is.

We have two possibilities

1. We are not able to call Bapi from webdynpro application.

2. Bapi is not creating a PO.

As said try seeing the details returned in return table after execution of Bapi, if you are able to see that it means we are not facing the problem 1.

Please log in to SAP use tcode SE37 ( Function module display ).

Enter you Bapi name and press button Execute(F8) then enter the details you have in the program manually and press Execute again.

See if the execution is successful there.In this way you can solve the issue 2.

Hope this helps you.

Regards,

Nagaraju Donikena

Former Member
0 Kudos

Hi,

Could any one please tell me how to pass values to "Bapiparex" or "EXTENSIONIN" in BAPI_PO_CREATE1 from WebDynpro.

Thanks

Vijay

Former Member
0 Kudos

Hi Vijay,

For this, we have to set the structure.

BAPI_TE_MEPOHEADER structure is used for this........

Goto se11, enter

this in data type.

Here you would be able to see the structure with field lengths.

Find your customer column.

You have to enter spaces for all the columns before your column.

Like in my case before my column, there are 2 columns whose lengths add up to be 39.

So 39 spaces and then value of the column.(for i=0).

Find for the BAPI_TE_MEPOHEADERX also in the same way.

// Values for Customer data

for (int i=0;i<2;i++){

Bapiparex bapiparex = new Bapiparex();

IPrivateCreateSTOView.IEt_ExtensioninElement element1 = wdContext.createEt_ExtensioninElement(new Bapiparex());

wdContext.nodeEt_Extensionin().addElement(i, element1);

if (i==0){

bapiparex.setStructure("BAPI_TE_MEPOHEADER");

bapiparex.setValuepart1(" "+wdContext.currentContextElement().getTrailer());

}

if (i==1){

bapiparex.setStructure("BAPI_TE_MEPOHEADERX");

bapiparex.setValuepart1(" X");

}

wdContext.nodeEt_Extensionin().bind(bapiparex);

zPoCreate1Input.addEt_Extensionin(bapiparex);

}//End of for

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Nagaraju and Raja for answering my question.

I actually used se37 to execute the Bapi and saw the return code and found the field which I was missing.

Thanks a lot!

Former Member
0 Kudos

Someone please help me.

Thanks

raja_thangamani
Active Contributor
0 Kudos

BAPI will have return parameter called "RETURN" (Table), check out, it will tell you what went wrong.

<i>*Reward each useful answer</i>

Raja T