2008 Aug 19 10:36 AM
Hi,
Function module VELO14_READ_PORDERS_WITH_VGUID allows you to specify a range of action document types in table parameter VLCACTDOCTYPE_IT. This is then used in the select on table VLCPORDER (VELO: MM Purchase Order).
As this is not a key field but the GUID and timestamp are key fields, I was wondering what the point was in it checking the action document type. We're trying to enhance this as we've copied a standard action and made some other enhancements. Could I safely take the check for action document types out in an enhancement, or is there a scenario where this would cause a problem? Would you ever want it to fail if for some reason the VLCPORDER line had a different action doc type?
Best regards,
Paul.
2008 Aug 19 12:56 PM
Hi Paul,
this seems to be related to the thread opened by David Lees.
The purpose of the action document type (ABA) being part of e. g. VLCPORDER (and other VMS document link tables) is to have the possibility to use the table for documents which are both (technically) purchase orders but have completely different business meanings. An example in standard VMS is ORD1 (purchase order to order a vehicle from the manufacturer) vs. UORD (subcontract purchase order to have the vehicle reworked by a third party).
When reading a vehicle's purchase orders via VELO14_READ_PORDERS_WITH_VGUID, the timestamp (despite being part of the key of the database table) is often not known. It's used e. g. to read if for a vehicle a normal purachse order has been created (for which e. g. no goods recipt exists yet). For this purpose, the timestamp doesn't matter but there's a need to distinguish the business meaning of the record in the table. This is possible using the ABA only.
In your case (as far as I understand it) you can ...
1.) stick to one ABA (QORD for action ZORD) if the business meaning of the purchase order is the same as the one intended by SAP for QORD (purchase order used by dealer to purchase new or used vehicle). In this case, despite the fact that there're different purchase order actions, the document created (purchase order) has pretty much the same business meaning. Therefore you're also able to reuse the SAP standard follow-up actions which expect ABA QORD to be used.
2.) decide to use different ABAs. This is typically not recommended but might be required if you need to create a purchse order document for a vehicle which is different from the one defined for QORD. In this case you would have to differentiate the two business meanings. In such a case the follow up actions, e. g. the incoming invoice would also have to know for which purchase order you want to create an incoming invoice. This is done via the ABA. in case you introduce a new ABA, you most likely won't be able to reuse the subsequent actions as the ABA is hardcoded there.
It might be helpful to have a look at the where-used list of function module VELO14_READ_PORDERS_WITH_VGUID. This might give you some insight how VMS uses VLCPORDER for different business meanings and therefore uses different ABAs when reding purchase order documents from VLCPORDER.
Please refer to the thread "VMS QORD/Z action issues" for mor information. Please read the documents attached to notes 903913 as well as 903914 on how to write actions.
Kind regards,
Steffen
2008 Aug 19 2:29 PM
Thanks Steffen. I understand what you're saying about the overall approach of copying actions and it makes sense.
Given that we have decided to create custom action document types (ABA) and specifically regarding this function module and select statement I'm still thinking that removing the check for action document types would be sound. The reason being that we're starting with a vehicle GUID and we want to get the purchase order. It should always be one to one if a PO exists. We wouldn't have one entry in VLCPORDER for the standard action and another entry with a custom action. Rather than add our custom actions to the list of valid actions that might be selected it would seem to be more reliable to remove the check. I can't think how you'd ever get more than one purchase order for a unique vehicle. Can you think of any risks in doing this?
If we go ahead and test this, and find any issues, I'll also post them back here for info.
Best regards,
Paul
2008 Aug 19 4:52 PM
Hi Paul,
if you have two ABAs to create a purchase order, ZORD and QORD, you need to be sure that for any vehicle, there's just an entry for one of the two. I think otherwise you cannot get rid of the ABA when e. g. calling VELO14_READ_PORDERS_WITH_VGUID.
Example: When creating a goods receipt, you can't differentiate any more if you create the goods receipt for the ZORD-PO or the QORD-PO. If you know for sure that for a vehicle only one of the two can exist, then this should be now problem (?). If for a vehicle both can exist (with no goods receipt posted for both of them), then I don't see how you can control for which of the two you create a goods receipt. Incoming invoice creation, purchase order change: same issue.
You could have more then one purchase order for one vehicle in case you repurchase a vehicle you sold later as a used one (trade-in).
Kind regards,
Steffen