Quantcast
Viewing all articles
Browse latest Browse all 9760

Problem in changing account assignment Sales order item for a Subcontract PO


Dear experts, Good morning.

 

We have one requirement in our business process.

 

We have to provide an interface to change the account assignment (Sales order & Item) of the PO Item (in our case Subcontract PO).

 

We did not go by ME22 transaction since we have to place many validations to prevent assigning to a wrong Sales order item.

 

We also do not prefer BDC to ME22 for this requirement.


Scenario:

 

Subcontract PO Item: 10023 - 10 (Material code: HALB-001)

Sales order item assigned in Acct.assign: 110000 - 10

Note: The sub-component of "HALB-001" is "ROH-001"

 

Case 1:

We used "ME_UPDATE_DOCUMENT" function module in our custom program with the table parameter "YEKKN" holding the new Sales order item.


1) The above Sales order item qty is made '0' and PO Item: 10023 - 10 becomes 'Excess requirement'(Exception message '26')

 

2) The Sales order item is rebooked as 120000 - 20. Now, user needs to use the Excess PO for this Sales order item (120000 - 20)

 

3) Hence, we provided the custom interface to change the acct. assign. Sales order item and used the "ME_UPDATE_DOCUMENT" function module.

 

4) The function module works fine and it updates the new account assignment in PO Item.

 

5) In MD04, the Excess requirement that was generated for old Sales order item is removed and the PO Item is currently available with new Sales order item as reference.

 

6) Well, the problem now is with the sub-component "ROH-001". After account assignment changed to new Sales order item, the PR requirement of this "ROH-001" is not coming under "Excess requirement" for the old Sales order item.

 

That is, PR for this ROH is available in both old and new Sales order item in Exception key '30'.

 

We are struck up here in this case.

 

Case 2:


1) For the same scenario, we used "BAPI_PO_CHANGE" function module with the follwing parameters,

 

CALL FUNCTION 'BAPI_PO_CHANGE'
            EXPORTING
              purchaseorder = ls_ekko-ebeln      "Subcontract PO
            TABLES
              return        = lt_bapi_retn
              poaccount     = lt_po_acct_new      "Records feched from EKKN table with new Sales order item in "SD_DOC" & "ITM_NUMBER" fields
              poaccountx    = lt_po_acct_x.        "Only the fields "SD_DOC" & "ITM_NUMBER" marked 'X' for update


2) System returns the following errors in RETURN table parameter,

 

a) Instance 10023 of object type PurchaseOrder could not be changed (Message ID: BAPI-3)

b) Purchase order item 00001 still contains faulty schedule lines (Message ID: MEPO-1)

c) Requisition XXXX, item YYYY, assigned to other order account (Message ID: 06-251)


3) I think the third error is main error and because of it, first error & second error are returned by BAPI

 

We are struck up here in this case.


<removed by moderator>

 

Thank you, Have a nice day (make mine also Image may be NSFW.
Clik here to view.
).

 

Message was edited by: Jürgen L


Viewing all articles
Browse latest Browse all 9760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>