SAP Function /DSD/BAPI_VL_CREATEFROMDATA - Create Visit List

Parameter Reference Type Length Default Optional Text
SIMULATION BAPIFLAG-BAPIFLAG C 1 X Indicator Simulation Mode
VLH_IN /DSD/BAPI_VC_VLH u 154 X Visit List: Header Data
VLID_EXTERN /DSD/BAPI_VC_VL-VISITLIST_ID C 10 X External Visit Lists ID

Parameter Reference Type Length Text
VISITLIST_ID /DSD/BAPI_VC_VL-VISITLIST_ID C 10 Visit List ID
VLH_OUT /DSD/BAPI_VC_VLHOUT u 173 Visit List: Header Data (Export)

Parameter Reference Length Optional Text
EXTENSIONIN BAPIPAREX 990 X Customer Enhancements for Visit Lists
RETURN BAPIRET2 548 X Error Messages
VLH_R_IN /DSD/BAPI_VC_VLH_R 12 X Reference Documents at Header Level (Import)
VLP_IN /DSD/BAPI_VC_VLP 69 X Visit List: Customer Data (Import)
VLP_R_IN /DSD/BAPI_VC_VLP_R 15 X Reference Documents at Item Level (Import)
VLTEXT_IN /DSD/BAPI_VC_VL_TEXT 157 X Visit List: Texts (Import)

Functionality
You can use this method to create a visit list without reference to avisit plan.
If you create a new visit list, you must enter header data (VLH_IN) asimport parameters. The sequence in which you add the customers to thevisit list determines the sequence in which the customers are visited.
You can assign texts and reference documents at header and item level tothe new visit list.
You can use the SIMULATION parameter to specify that you only want thenew visit list to be created in simulation mode, that is, that the datashould not initially be written to the database.
The document number of the new visit list is returned by the system as akey field of the document.
Customer Enhancements
To add customer fields to the tables for the visit list, you can use thefollowing BAPI Table Extensions:

  • Structure /DSD/BAPI_VC_TE_VLH for additional fields at header level

  • Structure /DSD/BAPI_VC_TE_VLH_R for additional fields for reference
  • documents at header level
    If customer fields are added to the reference documents table, thesefields must also be added to the structure /DSD/VC_DOC.
    • Structure /DSD/BAPI_VC_TE_VLP for additional fields at item level

    • If customer fields are added to the item data table, these fields mustalso be added to the structure /DSD/VC_VL_TREE.
      • Structure /DSD/BAPI_VC_TE_VLP_R for additional fields for reference
      • documents at item level
        If customer fields are added to the reference documents table, thesefields must also be added to the structure /DSD/VC_DOC.
        You can assign the relevant values to customer fields with theEXTENSIONIN table.
        All data transferred to the BAPI is checked for consistency beforefurther processing. By implementing the BAdI methodVL_CHECK_CONSISTENCY, you can add your own checks or check theconsistency of customer fields in the visit list tables.
        Return messages
        Messages are returned in the RETURN parameter. See the parameterdocumentation for the return values and their meanings.

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

        Further information
        For more information, see the parameter documentation.

        Description
        This export parameter contains the ID of the new visit list.

        Description
        This export parameter contains the header data of the new visit list.
        INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX

        Description
        This parameter indicates whether or not a visit list should initially becreated in simulation mode. If the indicator is set, the visit list iscreated in simulation mode, that is, the data data is not written to thedatabase.

        Value range
        Blank = Document is saved.
        x = Document is not saved.

        Description
        This import parameter contains the header data for the new visit list,such as visit plan type, route, and execution date.
        INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX

        Description
        If the new visit list is not allocated a key using internal numberassignment, you can use this import parameter to assign an external(alphanumeric) key for the new visit list.

        Description
        The ExtensionIn table allows you to enhance the BAPI import parameterswithout making modifications.
        If you have added your own fields to the header or item data of thevisit list, you can assign appropriate values to these fields using theExtensionIn table.
        INCLUDE BAPI_TABLE OBJECT DOKU ID TX

        Value range
        Type,, ID,, Number,, Message
        E,, BAPI,, 100,, One or more errors occurred when the BAPI was called
        Messages relating to the consistency checks are also displayed.

        Description
        This import structure contains data for reference documents that areassiged to the visit list at header level.

        Description
        This import structure contains the customer data for the new visit listyou want to create. You enter the customer numbers here, for example,and also the unloading point, waiting time, and travel duration. Thesequence in which the customers are visited corresponds to the sequencein which you create the items in the visit list.

        Value range
        For items to which you want to assign texts or reference documents withthe import structure VLTEXT_IN or VLP_R_IN, you assign atemporary item number with the value 800 or higher in theVISITLIST_POS field. You assign the item number to the relevanttext ID or reference document number in the import structureVLTEXT_IN or VLP_R_IN. The temporary item numbers are onlyused to assign texts or reference documents to items. The item numbersare always assigned by the system when the visit list is created.
        The sequence in which you add the customers to the visit list determinesthe sequence in which the customers are visited. The system enters therelevant values (003 for a customer to be visited in third place,for example) in the VISIT_SEQUENCE field. If you enter your ownvalues in this field, the system des not take them into account forprocessing. You can make changes to the sequence using the BAPI/DSD/BAPI_VL_CHANGEFROMDATA.

        Description
        This import structure contains the data from the reference documentssthat are assigned to the visit list at item level.
        If you want to import a reference document number for an item, youassign it to the temporary item number with a value of 800 orhigher (that you have allocated in the VISITLIST_POS field of theimport structure VLP_IN).

        Description
        This import structure contains texts for the new visit list at header oritem level. If you want to import texts for single items, assign therelevant text ID to the temporary item number with a value of 800or higher, which you allocated in the VISITLIST_POS field inimport structure VLP_IN.