Jun 28, 2016

Adding Field / Column in the standard report RFUMSV00 (VAT Report)

The RFUMSV00 report program has a total 7 ALVs on the output screen, out of these 7 ALVs WRBTR colmn has to added on 1st and 3rd ALV.

HAN1 Output tax: Line items
HAN2 Output tax: Totals list
HAN3 Input tax: Line items
HAN4 Input tax: Totals list
HAN5 Tax difference: Line items
HAN6 Balance per company code
HAN7 Cross-company code balance


Step 1: To enhance the field Catalog use the BADI: FI_TAX_BADI_014

Go to Se19 and create an implementation as shown below.




Give a suitable name as per the naming conversions and create an implementation.




Give the country name in the filter values, remember that implementation would be called for the value given here.





Implement the method MODIFY_FIELDCAT in the interface.



The code is as below.

DATA: LS_tab_fieldcat type slis_fieldcat_alv.
Read TABLE ch_tab_fieldcat into ls_tab_fieldcat with key fieldname = 'USERFIELDNUM1'.
if sy-subrc EQ 0.
CLEAR ls_tab_fieldcat-no_out.
ls_tab_fieldcat-seltext_m = 'Document Currency'.
ls_tab_fieldcat-ref_fieldname = 'USERFIELDNUM1'.
ls_tab_fieldcat-ref_tabname = 'RFUMS_TAX_ITEM'.
ls_tab_fieldcat-do_sum = 'X'.
ls_tab_fieldcat-ddictxt  = 'M'.
Modify ch_ab_fieldcat from ls_tab_fieldcat transporting no_out seltext_m do_sum ref_fieldname ref_tabname ddictxt where fieldname = 'USERFIELDNUM1'.
clear ls_tab_fieldat.
endif.


Implement the BADI : FI_TAX_BADI_011




Give the filter value similarly.
Implement Method SET_FLAGS
write the below line.

CH_USE_BADI_11 = 'X'.

Implement menthod APPEND_TAX_ITEMS
for populating the values of structure CH_TAX_ITEM...
Code here to select data from BSEG based on BUKRS, BELNR and GJAHR and replace the value of the field USERFIELDNUM1.

Activate and check the same, the extra field will be displayed on screen.


Source http://scn.sap.com/docs/DOC-47307

Jun 20, 2016

User Exits/BAdI - SAP QM

User Exits

Most of User Exits available in SAP QM covered here. This may help the people to get the details regarding user exits for development.

Use SMOD transaction to get the Documentation & Function Modules used on the exits.

Quality Certificates
QC100001  QM certificates: User exit for list of batches used
QC100002  QM certificates: User-defined initialization option
QC100003  QM certificates: Before and after cert. profile determination
QC100004  QM Certificates: User-Exit Before Call-Up of Form Print
QC100006  QM Certificates: User-Exit After Selecting Delivery Data
QC100007  User-Exit for Changing Certificate Profile Characteristics
QC100008  QM certificates: User exit for changing the customer number
QCE10001  Enhancement Modules: Electronic Certificate Dispatch
QCE10002  QM: Enhancement to IDoc Type QALITY02
QCE10003  QM: Quality Data Exchange of Electronic Cert. in Insp.
QCPA0001  Certificates: Assign control data of certif. profile char.
QCPA0002  Certs: Criteria restriction insp.lot/ptl lot selection
QCPA0003  Certificates: Fill new fields to find certificate profile
QCPA0004  QM Cert. Profile Menu: Cert. Profile Function Code +US4
QCPA0005  QM Certificate Profile Menu: Edit Function Code +US5
QCPA0006  QM Certificate Profile Menu: Environment Function Code
QCPA0007  QM Certificates: Include Characteristics in Cert. Profile
QCPA0008  QM Certificate Profile: Header Data Subscreen
QCPR1001  QM GR certificates: Before sending the certificate request
QCWA0001  QM: Quality Certificates on the World Wide Web

Quality Notification
QQMA0001  QM/PM/SM: User Subscreen for Notification Header
QQMA0002  QM: Authorization Check for Entry into Notif. Transaction
QQMA0003  QM: "User data" Function in "Goto" Menu
QQMA0004  QM: "User data" Function in "Goto   > Item" Menu
QQMA0005  QM: Check Validity of Status Change
QQMA0006  QM: Automatic Task Determination for Quality Notification
QQMA0007  QM: Default Values when Creating a Notification
QQMA0008  QM/PM/SM: User Subscreen for Additional Data on Notif.
QQMA0009  QM: Predefine QM Order Parameters
QQMA0010  QM/PM/SM: User Subscreen for Additional Data on Cause
QQMA0011  QM/PM/SM: User Subscreen for Additional Data on Task
QQMA0012  QM/PM/SM: User Subscreen for Additional Data on Activity
QQMA0013  QM: Default Values when Creating a Task
QQMA0014  QM/PM/SM: Checks before saving a notification
QQMA0015  QM/PM/SM: User-Exit before Call-Up of F4 Help on Catalo
QQMA0016  QM/PM/SM: "User data" Function "Goto"   > "Task" Menu
QQMA0017  QM/PM/SM: "User data" Function "Goto"   > "Activity" Me
QQMA0018  QM/PM/SM: Deadline setting based on entered priority
QQMA0019  QM/PM/SM: Default Partner when Creating a Notification
QQMA0020  QM: Determining BOM Usage at BOM explosion
QQMA0021  QM/PM/SM: Function "User data" in "Goto" menu
QQMA0022  QM/PM/SM: "User data" function in "Goto -> Causes" menu
QQMA0023  QM/PM/SM: "User data" function in "Goto -> Item" menu
QQMA0024  QM/PM/SM Deactivate function codes in CUA menu
QQMA0025  PM/SM: Default values when adding a notification
QQMA0026  PM/SM: Auth. check when accessing notification transaction
QQMA0027  PM/SM: Default values when adding a task
QQMA0028  QM: Create notif. from confirmation of production order
QQMA0029  QM/PM/SM: Change Notification Type
QQMA0030  Check validity of status change

Results Recording & Usage Decision
QEEM0002  User exit add. functions after reading inspection features
QEEM0003  User exit: add. functions after valuating insp. characteristics
QEEM0004  User exit: add. functions after valuation of partial sample
QEEM0006  User exit: add. functions after closing inspection char
QEEM0007  User exit: add. functions after completing partial sample
QEEM0011  User exit: add. functions before valuating insp. characteristics
QEEM0012  User exit: add. functions before valuating partial sample
QEEM0015  User exit: add. functions after entering individual res
QEEM0020  User exit: additional functions after entering the inspector
QEEM0021  User exit: additional functions for user key +US1
QEEM0022  User exit: additional functions for user key +US2
QEEM0023  User exit: additional functions for user key +US3
QEEM0024  User exit: additional functions for user key +US4
QEEM0029  User-Exit for Characteristic Overview Subscreen
QEEM0030  User-Exit for Subscreen: Characteristic Single Screen
QEEM0031  User-Exit for Table Structure with External Numbers
QEEM0032  Presentation of the characteristic text in the logon language
QEEV0001  Enhancement AFTER creation of preset tables
QEEV0003  Determination of order type for print
QEVA0001  Enhancement: Quantity posting for usage decision
QEVA0002  Calculation of share of scrap in inspection lot
QEVA0003  Calculate "Next inspection date" for batch
QEVA0004  Exit for changing information line in usage decision header
QEVA0005  User subscreen for displaying add. data for usage decision
QEVA0006  Entry to usage decision transactions
QEVA0007  UD: Control of compulsory comment or long text presetting
QEVA0008  Usage decision: Customer function key (e.g. to cancel UD)
QEVA0009  UD: Predefinition of quantity to be posted to sample stock
QEVA0010  UD: Usage decision check

Retrieval of Data – After & Before the Process
QIRF0021  QIRF_SEND_INSP_REQUIRMENTS - before processing
QIRF0022  QIRF_SEND_INSP_REQUIRMENTS - after processing
QIRF0051  QIRF_SEND_INSP_DATA_FOR_WL - before processing
QIRF0052  QIRF_SEND_INSP_DATA_FOR_WL - after processing
QIRF0101  QIRF_GET_ORIGINAL_VALUES - before processing
QIRF0102  QIRF_GET_ORIGINAL_VALUES - after updating
QIRF0111  QIRF_GET_SAMPLE_VALUES - before processing
QIRF0112  QIRF_GET_SAMPLE_VALUES - after updating
QIRF0121  QIRF_GET_FEATURE_VALUES - before processing
QIRF0122  QIRF_GET_FEATURE_VALUES - after updating
QIRF0131  QIRF_GET_ALL_DATA_VALUES - before processing
QIRF0132  QIRF_GET_ALL_DATA_VALUES - after updating
QIRF0141  QIRF_GET_USAGE_DECISION - before processing
QIRF0142  QIRF_GET_USAGE_DECISION - after updating
QIRF0171  QIRF_GET_INSP_POINT - before processing
QIRF0172  QIRF_GET_INSP_POINT - after updating

Master Data (Inspection Plan & MIC)
 QPAA0001  Enhancements: Formula checking / editing
QPAA0002  Customer exit - info fields
QPAA0003  Additional (auth.) check in plan (inspection chars.)
QPAA0004  Enhancement for transferring mstr insp. char. to task list
QPAA0005  Deactivation of functions for insp. char. maintenance
QPAA0006  Additional consistency checks - inspection characteristics
QPAP0001  Enhancement - plan reading
QPAP0002  Enhancement for material/plan assignment, plan selection
QPAP0003  Conversion of sample unit of measure to material unit
QPGR0020  Customer Exit ExtensionParameter ALE Interface Code Group
QPL10001  QM: Inspection lot creation - editing work area on creation
QPL10003  Sample calculation for inspection lot without plan
QPL10004  User subscreen for displaying additional data in insp.
QPL10007  QM: Inspection lot creation - change QM order type
QPMK0001  Modify Master Inspection Characteristic Data at Creation
QPMK0002  Customer Exit: Change Master Insp. Characteristic Version
QPMK0003  Customer Exit: Delete Master Inspection Characteristic
QPMK0004  Customer Exit: Delete Validity Period of Master Insp. Char
QPMK0010  Cust. Exit: Receiving System-ALE Distr. of Mast. Insp. Char.
QPMK0020  Customer Exit: ALE Distribution of Master Insp. Char.
QPRS0001  Physical Sample: Definition for Customer - Function Cod
QPRS0002  Number Allocation: Physical Sample Record
QPRS0003  Include screen in phys. sample rec. to dsply/chng. add. data
QPRS0004  Presettings for Manual Creation of Samples
QPRS0005  Service of customer include fields during automatic creation
QPSD0001  Methods list for reading a characteristic version: yes/no


Business Add-In (BADI)

INSPECTIONLOT_UPDATE is a very good BADI to enhance TCODE especially QA11, QA12 and QA13. It has all the following methods that you can use in your enhancement:

CHANGE_AT_SAVE
CHANGE_BEFORE_UPDATE
CHANGE_IN_UPDATE
CHANGE_UD_AT_SAVE
CHANGE_UD_BEFORE_UPDATE
CHANGE_UD_IN_UPDATE
CREATE_AT_SAVE
CREATE_BEFORE_UPDATE
CREATE_IN_UPDATE
SET_UD_AT_SAVE
SET_UD_BEFORE_UPDATE
SET_UD_IN_UPDATE

It is a very important BADI if one needs to do assignment on updating Inspection Lots and Usage Decision. You can even use this BADI in ME23N from another use exit to auto create Inspection Lot, update Usage Decision and also Shelf Life Expiry Date.

Jun 1, 2016

User-exit/BADI for MIRO during SAVE: Read items & Update header (XBLNR).

Problem:

During MIRO after pressing save, to READ ITEM DATA and UPDATE HEADER DATA (XBLNR) after SAVE but before UPDATE.


Solution:

In BADI INVOICE_UPDATE there are 3 methods CHANGE_AT_SAVE, CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE.
Of these CHANGE_AT_SAVE is called before INSERT / UPDATE statements are executed. We can use this to update RBKP-XBLNR.
Can't use CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE methods as they are called after INSERT / UPDATE statements are executed and before COMMIT.
Update RBKP-XBLNR through INVOICE_UPDATE~CHANGE_AT_SAVE method using call stack technique like below.
Replace 'VALUE' in the below code with the value based on your calculation using other variables like s_rbkp_new, ti_rseg_new etc.

method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE.
  DATA: lv_name_xblnr(30) TYPE c VALUE '(SAPLMRMP)RBKPV'.
  FIELD-SYMBOLS: <fs_rbkpv> TYPE mrm_rbkpv.

  ASSIGN (lv_name_xblnr) TO <fs_rbkpv>.
  IF <fs_rbkpv> IS ASSIGNED.
    <fs_rbkpv>-xblnr = 'VALUE'.
  ENDIF.
endmethod.


Other User-Exits and Other Enhancements related to MIRO:

INVOICE_UPDATE
AC_DOCUMENT

Enhancements:
LMR1M001 User exits in Logistics Invoice Verification
LMR1M002 Account grouping for GR/IR account maintenance
LMR1M003 Number assignment in Logistics Invoice Verification
LMR1M004 Logistics Invoice Verification: item text for follow-on docs
LMR1M005 Logistics Inv. Verification: Release Parked Doc. for Posting
LMR1M006 Logistics Invoice Verification: Process XML Invoice
MRMH0001 Logistics Invoice Verification: ERS procedure
MRMH0002 Logistics Invoice Verification: EDI inbound
MRMH0003 Logistics Invoice Verification: Revaluation/RAP
MRMN0001 Message output and creation: Logistics Invoice Verification

User exits are:
EXIT_SAPLMR1M_001 - MM08R002 - User exit for tolerance checks
EXIT_SAPLMR1M_002 - LMR1M001 - User exits in Logistics Invoice Verification
EXIT_SAPLMR1M_003 - LMR1M001 - User exits in Logistics Invoice Verification

BADI's are:
BADI_ENJ_ALT_ADR - Go to alternative vendor/customer data
MR_CIN_LMR1MI2G_SEL - BAdi in LIV for determining line selection
MR_CIN_LMR1MI2G - BAdI for India Version exit in include LMR1MI2G