Monday 23 March 2015

                 Common mistakes


     1. Always Check for SY-SUBRC after READ statement.



2 . Using SELECT SINGLE:
           we have to use select single only if we are passing all the Key Fields in the Where Condition.
 in the below example for table MAKT  there are 2 key fileds( except MANDT), so we have to use SELECT SINGLE.



3. Using UPTO 1 ROW  Keyword :

 we have to Use SELECT ENDSELECT and UPTO 1 ROWS , when we are not able to pass the all key fields in the where Condition.

In T001L table we have 2 key Fields, i am passing only one Key Files in WHERE condition, so using SELECT ENDSELECT with UPTO 1 ROWS  is Desirable .



4. LOOP within LOOP is not desirable , so avoid it . Use Aggregate Functions to calculate SUM , then use READ statement within LOOP.



5. Avoid MODIFY Statement within LOOP ENDLOOP, when you use FIELD_SYMBOLS.field Symbols create Buffer, so the Value modified are automatically updated to buffer, we no need to Explicitly use MODIFY statement.






Do  validation for Vendor field and matnr field.for all other SAP fields we should have valid value in master data

No comments:

Post a Comment