cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE

Former Member
0 Kudos

Hi,

guys i am developing an application to change poitem data from the webdynpro. Everythign is done, the problem inam facing is

AbstractList lsx = null;

AbstractList ls = null;

Bapi_Po_Change_Input inputc = new Bapi_Po_Change_Input();

inputc.setPoitem(ls);

inputc.setPoitemx(lsx);

in the setPoitem function i need to the items as a AbstractList, i have created the items as collections of object Bapimepoitem and Bapimepoitemx.

Now how to set them in the abstract list so that i can pass it.

points will be rewarded.

Regards,

Khusro Habib

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Khusro,

Instead of inputc.setPoitem(ls); use

inputc.addPoitem(new <ModelClass>());

Poitem is an internal table used in RFC. So you can add multiple records in Poitem.

When writing above code, click Ctrl+Space you will automatically come to know for which RFC Model Class you have to create the object.

Regards,

Gopal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Khusro Habib .

I am also developing application to change Sales Order from WebDynpro.

But getting problem while setting update flag for BAPI.

Can it is possible for you to post code snip of change PO.Here I am using like this.....

	wdContext.currentBapi_Salesorder_Change_InputElement().setSalesdocument("90");
	wdContext.currentOrder_Item_InxElement().setUpdateflag("U");
         wdContext.currentOrder_Header_InxElement().UPDATEFLAG.valueOf(true);
	  wdContext.currentOrder_Item_InxElement().setUpdateflag("U");  	
	 wdContext.currentOrder_Item_InxElement().setMaterial(true);
wdContext.currentOrder_Item_InElement().setMaterial(wdContext.currentOrder_Item_InElement().getMaterial() );	
	 wdContext.currentOrder_Item_InElement().setMaterial("GOLDSPOT");	
	 wdThis.wdGetChangesalesorderCustController().ChangeOrderMethod();
	 wdThis.wdGetChangesalesorderCustController().ChangeOrderCommitMethod();

Any help is appreciated and points will be rewarded

Regards

Sunil Pawar

Former Member
0 Kudos

Check this code

My dynrpo was first getting the data from BAPI_PO_GETDETAIL then passing it to BAPI_PO_CHANGE

but for simplicity i have changed those variables to fixed values.


//@@begin updateData()
Bapi_Transaction_Commit_Input commit =	new Bapi_Transaction_Commit_Input();
Bapi_Po_Change_Input inputc = new Bapi_Po_Change_Input();

		String result = "";
		boolean cont = true;
		try {

					Bapimepoitem itemmod = new Bapimepoitem();
					Bapimepoitemx itemmodx = new Bapimepoitemx();
					itemmod.setPo_Item("00010");
					itemmodx.setPo_Item("00010");
					itemmodx.setPo_Itemx(true);
					itemmod.setShort_Text("THIS IS THE TEXT");
					itemmodx.setShort_Text(true);
					inputc.addPoitem(itemmod);
					inputc.addPoitemx(itemmodx);
wdContext.currentPOCHANGEElement().setPurchaseorder("4500000000");

			wdContext.currentPOCHANGEElement().modelObject().execute();
			wdContext.nodeOutputCH().invalidate();
			commit.execute();

		} catch (Exception e) {
			// TODO: handle exception
			result = e.toString();
		}

		return result;
    //@@end

Former Member
0 Kudos

Thanks This will defiantly help me.

Former Member
0 Kudos

Hi Khusro,

I am trying to implement the BAPI_PO_CHANGE and I want to pass the values to it from BAPI_PO_GETDETAILS. Could you please post your code for this application. I would appreciate your help.

Regards,

Gopal.