Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error when calling bapi (order_maintain)

Former Member
0 Kudos

Hi,

I have a problem with updating an order with BAPI_ALM_ORDER_MAINTAIN.

I have a simple example where I want to update the short_text to a new value for an existing order.

I send this:


<n:BAPI_ALM_ORDER_MAINTAIN xmlns:n="urn:sap-com:document:sap:rfc:functions">
	<IT_HEADER>
		<item>
			<ORDERID>000000815966</ORDERID>
			<SHORT_TEXT>test</SHORT_TEXT>
		</item>
	</IT_HEADER>
	<IT_HEADER_UP>
		<item>
			<ORDERID>000000815966</ORDERID>
			<SHORT_TEXT>X</SHORT_TEXT>
		</item>
	</IT_HEADER_UP>
	<IT_METHODS>
		<item>
			<REFNUMBER>1</REFNUMBER>
			<OBJECTTYPE>HEADER</OBJECTTYPE>
			<METHOD>CHANGE</METHOD>
			<OBJECTKEY>000000815966</OBJECTKEY>
		</item>
		<item>
			<OBJECTTYPE> </OBJECTTYPE>
			<METHOD>SAVE</METHOD>
		</item>
	</IT_METHODS>
</n:BAPI_ALM_ORDER_MAINTAIN>

And receive this:


<rfc:BAPI_ALM_ORDER_MAINTAIN.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
	<ET_NUMBERS/>
	<EXTENSION_IN/>
	<IT_COMPONENT/>
	<IT_COMPONENT_UP/>
	<IT_HEADER/>
	<IT_HEADER_SRV/>
	<IT_HEADER_SRV_UP/>
	<IT_HEADER_UP/>
	<IT_METHODS/>
	<IT_OBJECTLIST/>
	<IT_OBJECTLIST_UP/>
	<IT_OLIST_RELATION/>
	<IT_OPERATION/>
	<IT_OPERATION_UP/>
	<IT_PARTNER/>
	<IT_PARTNER_UP/>
	<IT_RELATION/>
	<IT_RELATION_UP/>
	<IT_SRULE/>
	<IT_SRULE_UP/>
	<IT_TASKLISTS/>
	<IT_TEXT/>
	<IT_TEXT_LINES/>
	<IT_USERSTATUS/>
	<RETURN>
		<item>
			<TYPE>E</TYPE>
			<ID>IWO_BAPI2</ID>
			<NUMBER>119</NUMBER>
			<MESSAGE>BAPI call must have a SAVE or DIALOG method</MESSAGE>
			<LOG_NO/>
			<LOG_MSG_NO>000000</LOG_MSG_NO>
			<MESSAGE_V1/>
			<MESSAGE_V2/>
			<MESSAGE_V3/>
			<MESSAGE_V4/>
			<PARAMETER/>
			<ROW>0</ROW>
			<FIELD/>
			<SYSTEM>CF5CLNT800</SYSTEM>
		</item>
	</RETURN>
</rfc:BAPI_ALM_ORDER_MAINTAIN.Response>

What am I doing wrong? I have a SAVE method in the message...?

I have also checked the checkbox in XI to automatically do a closing BAPI_TRANSACTION_COMMIT..

Good reward will be given for a good answer.

Thanks

Anders

4 REPLIES 4

Former Member
0 Kudos

Hello Anders,

try to skip the ' <OBJECTTYPE> </OBJECTTYPE>' in the SAVE-method line. Guess that in this line

there has to be only the SAVE in method field, nothing else.

Regards Wolfgang

0 Kudos

Thanks for the tip but unfortunately it didn't help, still same error back.

Former Member
0 Kudos

Can't have comments in the xml!

Former Member
0 Kudos

Hi Anders.

You need to have field IT_METHODS-REFNUMBER filled with 1 also for the SAVE method.

Regards

/Elisabet