Ansicht
Dokumentation

/DSD/BAPI_VP_CREATEFROMDATA - Create or Copy Visit Plan

/DSD/BAPI_VP_CREATEFROMDATA - Create or Copy Visit Plan

Fill RESBD Structure from EBP Component Structure   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

You can use this method to create a visit plan.

With the VPID_FOR_COPY import parameter, you can use an existing visit plan as a copy template for the new visit plan. If you enter a visit plan ID in this import parameter, the system copies all the header data and item data of that visit plan to the new visit plan. You can update the new visit plan with the import parameter VPH_IN. You must define a new validity period for the new visit plan at this point. If you enter a template in parameter VPID_FOR_HRULE with a Date Rule - Header that is not the same as the copy template, this is also updated in the new visit plan. Customer data, however, is copied from the copy template and not updated by additional entries in other import parameters.

If you create a new visit plan without a template, you must at least enter the header data (VPH_IN) as an import parameter. The sequence in which you add the customers to the visit plan determines the sequence in which the customers are visited.

You can use the VPID_FOR_HRULE and VPID_FOR_CRULE import parameters to copy date rules at header and item level from an existing visit plan to a new visit plan.

You can use the VPTEXT_IN import structure to assign texts at header and item level to the new visit plan.

You can use the SIMULATION parameter to specify that you only want the new visit plan to be created in simulation mode, that is, that the data should not initially be written to the database.

The document number of the new visit plan is returned by the system as a key field of the document.

Customer Enhancements

To add customer fields to the tables for the visit plan, you can use the following BAPI Table Extensions:

  • Structure /DSD/BAPI_VC_TE_VPH for additional fields at header level
  • Structure /DSD/BAPI_VC_TE_VPP for additional fields at item level
    If customer fields are added to the item data table, these fields must also be added to the structure /DSD/VC_VP_TREE.

You can assign the relevant values to customer fields with the EXTENSIONIN table.

All data transferred to the BAPI is checked for consistency before further processing. By implementing the BAdI method VP_CHECK_CONSISTENCY, you can add your own checks or check the consistency of customer fields in the visit plan tables.

Return Messages

Messages are returned in the Return parameter. See the parameter documentation for the return values and their meanings.

Example

Notes

The following authorization object is checked with the activity 01 (Create): /DSD/VC_VP.

Further information

For more information, see the parameter documentation.





Parameters

EXTENSIONIN
RETURN
SIMULATION
VISITPLAN_ID
VPH_IN
VPH_OUT
VPID_EXTERN
VPID_FOR_COPY
VPID_FOR_CRULE
VPID_FOR_HRULE
VPP_IN
VPTEXT_IN

Exceptions

Function Group

/SAPLVC_BAPI_VP

BAL Application Log Documentation   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 4314 Date: 20240328 Time: 171929     sap01-206 ( 67 ms )