ABAP development for Sales
88511 - SD: document status and incompletion
Report SDVBUK00 attached to this note updates the document status, document flow and the statuses for the incompletion log to the currently valid status. Call up Transaction SE38 to start the program, enter the affected document numbers and remove the test flag to save the changes in the database.Use the pricing element for account determination SD-FI
MV60AF0B_BELEG_SICHERN/BELEG_SICHERN_INTERN- Function RV_INVOICE_DOCUMENT_ADD
- Function RV_ACCOUNTING_DOCUMENT_CREATE
- Function RV_INVOICE_ACCOUNT_DETERM is called
- Cross company: if different charts of accounts are used in the selling and in the delivering company code, internal prizes use the chart of accounts of the delivering company code
- if Statistical and Relevant for Account Determination then both accounts must be set ( main + accural). 06.05.2021
- Conditions are stored in the internal table TKOMV[] filled by the standard
- For each condition record from TKOMV
- A routine RELEVANT_FOR_ACCOUNT_DETERM/ LV60AB30 is called to check the condition record
- MOVE-CORRESPONDING tkomv TO kompcv.// TKOMV will contain new fields already filled in EXIT_SAPLV60B_001
- CALL FUNCTION 'ACCOUNT_ALLOCATION' ( returning value ACCOUNT-SAKN1)
- Extend the structure kompcv with the new fields SD_COND_TYPE, CO_SD_GROUP..
- Extend the structrue KOMV with the new field CO_SD_GROUP
- Implement the exit EXIT_SAPLV60B_001 to fill XKOMV table with the new CO_SD_GROUP
- Create new cond. tables for G/L accounts determination with the new field CO_SD_GROUP
- Create a new table and the maintenance view ( Z table )
2845160 - BAPI BAPI_SALESORDER_SIMULATE doesn't show error for all the items in return table
132723 - Update of data in billing document
In the billing document, via user exist you cannot change data of the billing header (XVBRK) or the billing item (XVBRP) when you save.Implement the attached modification proposal in the include RV60AFZZ in the subroutine USEREXIT_NUMBER_RANGE.
379269 - Preference in SD document: User exit: Setting preference indicators PREFE
78317 - SD text determination: User exits in VOTX or VOTXN
- The following work areas are available. However, in the standard system, theyare not filled in their entirety, so they
might need to be filled explicitly by the customer.
- FTVCOM - communication block
- FXTHEAD - text headers
- FXVBPA - partner
- REFERENZ - work area for text module to be reference
2399773 - How to enhance the SD Document Flow
By means of the user exits and enhancement points described here, it is possible to add additional documents (additional to those included automatically by the standard code) into the representation of the document flow. This document also describes how to add or modify the attributes displayed for each custom document in the flow (attributes such as the creation date and status, as can be seen above).
Terminology and Basic Behavior- Document Tree
- The visual depiction of the document flow where rows represent individual documents (or document items) and indentation is used to represent the connections between those documents (or document items).
- Document Detail ALV
- The grid displayed at the bottom of the document flow screen (below the document tree) is used to display some details of the document or document item selected in the document tree. The details are displayed when an entry in the document tree is double-clicked or the “Details (F2)” ( ) button is pressed.
- Header Level View
- A document tree representing a composite view of the document flow of all items in the root document.
- It is important to understand this aspect of document flow: There is no separate record of document flow at the header level. It is simply a composite view of the individual item level flows. This composite view is determined at runtime.
- Item Level View
- A document tree representing the document flow of either one or all items in the root document.
- Root Document
- The sales and distribution document used as the starting point for determination of the document flow. This document is identified in the document tree by an arrow ( ) and color highlighting (as can be seen in the document tree screen shot, above).
- Root Document Item
- The item within a sales and distribution document used as the starting point for determination of the document flow. This item is identified in the document tree by an arrow ( ) and color highlighting.
- 1. Add documents that come before the root document item(s).
- 2. Add documents that follow on from the root document item(s).
- 3. Add custom fields to the document tree display.
- 4. Populate custom fields with data and supply or modify the data for standard fields.
- 5. Also explained is the method for displaying a document when one is selected from the document tree and either Environment -> Display document (F8) is selected from the menu or the Display document button ( ) is pressed.
118573 - User exits for foreign trade data in SD and MM documents
2908499 - VA02 - Restricting certain users from deleting line items
Two possible solutions exist. However, both of them are modifications to the standard system.Enhancement in program MV45AFZZ, form USEREXIT_SAVE_DOCUMENT_PREPARE.
This form is called on save event, after item is deleted. You can force an error message, but user will be forced to exit from the document, and any other change made will be gone.
2. Enhancement in program MV45AFZB, form USEREXIT_CHECK_XVBAP_FOR_DELET.
This form is called when user tries to delete an item from the sales document or by clicking Delete button and confirming the popup or tries to delete the order from the header by selecting Sales document -> Delete. This way, user will be informed immediately that item cannot be deleted.
301077 - User exits for the Accounting Interface
- EXIT_SAPLV60B_001: Change of header data in structure ACCHD
- In this exit, you can influence the header information of the accounting document. For example, here you can influence the business transaction, the time of entry, the 'Created by' entry, or the transaction used to create the document.
- EXIT_SAPLV60B_002: Changes the ACCIT customer line.
- In this exit, you can influence the customer line of the accounting document. This exit is processed from the document header VBRK after the structure ACCIT is filled.
- EXIT_SAPLV60B_003: Change of customer line for POS update
- For POS accounting, the customer line is filled differently. For this, you can influence the structure ACCIT in user exit 003.
- EXIT_SAPLV60B_004: Change of the ACCIT G/L account line.
- Additions for the G/L account line, for example, using quantity specifications are possible in user exit 004.
- EXIT_SAPLV60B_005: User exit for accruals
- After all relevant data for accruals is stored in the G/L account line, you can add to this information in user exit 005.
- EXIT_SAPLV60B_006: Change for the ACCIT tax line
- Additions for the tax account line are possible in user exit 006.
- EXIT_SAPLV60B_007: Change of the installment plan parameters
- Additions to the installment plan parameters in the G/L account line are possible in user exit 007.
- EXIT_SAPLV60B_008: Change transfer structures ACCCR and ACCIT.
- After all data is filled in the accounting document, you can finally influence it in user exit 008.
- EXIT_SAPLV60B_010: Item table for customer lines
- In user exit 010 you can influence the contents of the customer line before it is created.
- EXIT_SAPLV60B_011: Change of the parameters for cash account determination or reconciliation account determination
User exit partner determ. for invoice lists & User exit partner determination for billing documents
For this function, copy the program components from Notes 43296 and 43091.Problem in sales order creation using BAPI_SALESORDER_CREATEFROMDAT2 for BOM (Bill of Material)
Pass the parameter INT_NUMBER_ASSIGNMENT with value ‘X’ into the BAPI. It will internally generates and assign the next suitable item number and avoid the overwriting of items.
MRP areas and storage location determination in user exit
However, a plant must be known for this. You may also have to ensure that the plant is determined in the user exit. FV45PF0V_VBAP-WERKS_ERMITTELN may be useful.
Storage location determination for SD order item.
Also, storage location determination in sales documents is not possible in the standard ERP system. If you want storage location to be determined for a sales document then you have to implement your own system logic in a user exit. SAP recommends to use USEREXIT_SOURCE_DETERMINATION in include MV45AFZB. From a technical point of view, it is possible to use USEREXIT_MOVE_FIELD_TO_VBAP (include MV45AFZZ), but this user exit is not recommended to carry out a storage location determination. Using this user exit for a storage location determination can lead to problems / inconsistencies. Please consider SAP Note 387482.Pricing
A new database table called PRCD_ELEMENTS is introduced to replace the KONV table to store all SD document conditions. It is of type Transparent table.
The data is no longer stored in the KONV table. You need to use new table PRCD_ELEMENTS in custom code to SELECT pricing conditions.
2. CDS view V_KONV
Further to the table and a new ABAP CDS view V_KONV is also available to get the price conditions. CDS view V_KONV can be used in custom CDS views.
In addition to the CDS view, an API is also available to Get, Update and Delete the pricing conditions.3. New API
The factory class CL_PRC_RESULT_FACTORY is used to retrieve the pricing data.
Following methods are provided within the API to read, write and delete the data.
GET_PRICE_ELEMENT_DB | Get price elements from DB |
GET_PRICE_ELEMENT_DB_BY_KEY | Get price elements from DB by semantic key |
SAVE_PRICE_ELEMENT_DB | Save price elements on DB |
DELETE_PRICE_ELEMENT_DB_BY_KEY | Delete price element from DB by semantic key (one document) |
DELETE_PRICE_ELEMENT_DB | Delete price elements from DB (multiple documents) |
DELETE_PRICE_ELEMENTS_DB | Delete list of dedicated price elements (multiple documents) |
cl_prc_result_factory=>get_instance( )->get_prc_result( )->get_price_element_db(
EXPORTING
it_selection_attribute = VALUE #(
( fieldname = 'KNUMV' value = vbak_knumv ) )
IMPORTING
et_prc_element_classic_format = data(lk) ).
CATCH cx_prc_result.
sy-subrc = 4.
ENDTRY.
At some times we need to enhance KONV table with custom fields catering to the customer requirements. This is usually achieved using append structure to the database table KONV
In S/4 HANA system, you should NOT append directly to PRCD_ELEMENTS table.
Instead add append structure to the new structure PRCS_ELEMENTS_DATA which is included in database table PRCD_ELEMENTS.
Subsequently to PRCD_ELEM_DRAFT which is included in database table PRCD_ELEM_DRAFT(used to temporarily store pricing results as a draft prior to save)
Similarly ABAP CDS view V_KONV can also be used to get pricing data, therefore it is necessary to enhance the CDS view.
Custom Fields and Logic
You, as a business expert or implementation consultant, can use this app to create your own fields and enhancement implementations to customize applications and their UIs, reports, email templates, and form templates.https://help.sap.com/viewer/7b24a64d9d0941bda1afa753263d9e39/2020.000/en-US/66a2f4107e754be68a458408eb332d91.html
BAdIs for Business Data Field Modifications in Sales Documents
With this feature, you can now change certain business data, such as the pricing date, during sales order processing by using the new Business Add-Ins (BAdIs) Sales Header Business Data Modification (SD_SLS_MODIFY_HEAD_BUSINESS) and Sales Item Business Data Modification (SD_SLS_MODIFY_ITEM_BUSINESS). As a key user, you can set values for business data fields at the sales document header and item level by creating new custom logic in the Custom Fields and Logic app.
BAdIs for Tax Field Modifications in Sales Documents
With this feature, you can set up custom logic to determine the correct tax settings in a sales document by using the new Business Add-Ins (BAdIs), Sales Header Tax Fields Modification (SD_SLS_MODIFY_HEAD_TAX) and Sales Item Tax Fields Modification (SD_SLS_MODIFY_ITEM_TAX). As a key user, you can set values for tax relevant fields at the sales document header and item level by creating new custom logic in the Custom Fields and Logic app.
BADI-s
Flexible Billing Document Numbering
You can use the filter-enabled Business Add-In (BAdI) SD_BIL_FLEX_NUMBERING to allocate newly created billing documents of a given billing document type to custom number range intervals (and, optionally, number range prefixes). This enables a flexible allocation of billing documents to number range intervals and prefixes that is dependent on one or more attributes (header fields) of the billing document that is to be created.
Change SD document ( sales ) during processing
Us the BAdI Interface IF_EX_BADI_SD_SALES
- DELETE_DOCUMENT Replacement for User Exit DELETE_DOCUMENT
- DOCUMENT_INIT Replacement for User Exit REFRESH_DOCUMENT (after saving)
- READ_DOCUMENT Replacement for User Exit READ_DOCUMENT
- SAVE_DOCUMENT_PREPARE_PART2 Call after Processing BELEG_ENDE
- TRANSACTION_INIT Unlike Document_Init at Start of New Transaction
- SAVE_DOCUMENT_PREPARE Replacement for User Exit SAVE_DOCUMENT_PREPARE
- SAVE_DOCUMENT Replacement for User Exit SAVE_DOCUMENT
Comments
Post a Comment