Skip to Content
0

Update Price in PM Order Operations Item Services ABAP

Apr 13 at 12:38 AM

59

avatar image

Hi gurus,

I need to update external service lines price in PM order operation.

I have a implementation using BAPI_ALM_ORDER_MAINTAIN. Basically, I just need to pass the service line details to tables it_servicelines and it_servicelines_up. The servicelines details I get using BAPI_ALM_ORDER_GET_DETAIL.

A snipet from my code:

CONCATENATE l_aufnr l_vornr INTO l_objectkey.

CLEAR: w_methods.

w_methods-refnumber = l_refnumber.

w_methods-objecttype = c_serviceline.

w_methods-method = c_change.

w_methods-objectkey = l_objectkey.

APPEND w_methods TO t_methods.

CLEAR: w_servicelines.

w_servicelines-activity = w_servicos_upd-vornr.

w_servicelines-outline = w_servicos_upd-outline.

w_servicelines-srv_line = w_servicos_upd-srv_line.

w_servicelines-gross_price = w_servicos_upd-netwr.

APPEND w_servicelines TO t_servicelines.

CLEAR: w_servicelines_up.

w_servicelines_up-activity = w_servicos_upd-vornr.

w_servicelines_up-outline = w_servicos_upd-outline.

w_servicelines_up-srv_line = w_servicos_upd-srv_line.

w_servicelines_up-gross_price = c_x.

APPEND w_servicelines_up TO t_servicelines_up.

It works fine when the operation have just ONE service line.

But when the operation HAVE more than one service line (not necessarily updating more than one service) I get the message E SRV 007 "The field PRICE_UNIT is customised as Hidden mode".

DEBUGGING:

The error is triggered in method CL_SERVICE_LINE_MMSRV=>CHECK_FIELD_SELECTION (the field is really customized as Hidden mode). OK.

But the problem is:

Im method CL_SERVICE_LINE_MMSRV=>SET_SERVICE_LINE I've found a problem. Trying to update the first row of two in operation:

The internal tables imt_service_line and imt_service_linex holds the data from tables it_servicelines and it_servicelines_up. OK.

It iterates this method for each serviceline in operation.

In the first row, it's OK. In imt_service_linex only the field GROSS_PRICE is marked with 'X'. The CL_SERVICE_LINE_MMSRV=>CHECK_FIELD_SELECTION is OK.

In second row, several fields are marked with 'X'. But I didn't filled the table it_servicelines_up for the second serviceline. When came to CL_SERVICE_LINE_MMSRV=>CHECK_FIELD_SELECTION it returns the error.

Can it be a bug or limitation in the BAPI?

My code is like this example:

http://saptuts.com/abap-function-module-example/example-program-how-to-update-price-in-pm-order-operations-item-services-abap.html

I've already came to this thread, and others.

https://archive.sap.com/discussions/thread/3241240

https://apps.support.sap.com/sap/support/knowledge/preview/en/2524622

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jürgen L
Apr 13 at 04:43 AM
0

What does " I came across https://apps.support.sap.com/sap/support/knowledge/preview/en/2524622 mean?

This is a preview and not the full KBA. It even wants you to read other OSS notes. Did you log on to the launchpad and read the solution, did you do what was said in the solution?

Have you at all tried to do what you want to do by BAPI with the normal transaction manually? Did you not get the SRV007 error in the normal transaction? Based on this info the next steps could be decided, whether you have to look at your own coding or into SAP Customizing and programs.


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi, I did read the note 2524622. Change the customizing is not an option. And like I said. for the second row, many fields came market with "X" to update.

Cause

  • The field COST_ELEMENT is set as hidden in customizing for MM services.
  • Additionally, corrective Note may not be applied.

Resolution

  1. If Note 2108786 is not applied (and is valid for your version), apply the correction.
  2. Enter transaction SPRO (or OLMSRV to skip to pt.3)
  3. Select Materials Management.
  4. Select External Services Management.
  5. Select Define Screen Layout.
  6. Double click on the field selection: Row 8 - Operation.
  7. Double Click on Entry sheet.
  8. Locate the field 'Internal entry sheet number'.
  9. Change field to Optional.

Like I said. It works fine for a single service line. But only if the operation have only one serviceline.

In normal transaction - IW32 - It works normal.
In earlier versions, in BAPI documentation tells that "Servicelines can't be updated". But not in my version.

0
João Paulo Moro Loureiro 3 days ago
0

Any help or idea for this?

Share
10 |10000 characters needed characters left characters exceeded