Search on this Website

Saturday, November 5, 2011

MBO BADI List in SAP HR

BADI Name Description

HRHAP00_ACC_HEADER Appraisal Document - Header Data Access
HRHAP00_ACTION_LOG Appraisal Document - Action Log
HRHAP00_ADD_HEADER Appraisal Document - Additional Header Data
HRHAP00_ADD_ON_APPL Development: Add-On Application
HRHAP00_ADMIN Appraisal Document - Admin. Functions
HRHAP00_ATT_ACCESS Document - Attachments: Authorization Handling
HRHAP00_AUTHORITY Appraisal Document - Authorization Check
HRHAP00_BC_ELEMENT Business Check Elements

HRHAP00_BSP_TMPL Appraisal Document - Web Layout (BSP)
HRHAP00_BUT_ACCESS Appraisal Document - Pushbutton Access
HRHAP00_CATALOG_ACT Development: Catalog - Action
HRHAP00_CATEG_CREATE Development: Catalog - Category Creation
HRHAP00_CATEG_EXMPLE Catalog - Create Example Category
HRHAP00_CHECK_CUSTOM Development: Customizing - Check Tables and Se
HRHAP00_COL_ACCESS Appraisal Document - Column Access
HRHAP00_COL_OWNER Appraisal Document - Column Owner
HRHAP00_DEFAULT_OBJ Runtime - Generate Default (User <-> Object)
HRHAP00_DOC_BC Appraisal Document - Business Check
HRHAP00_DOC_DEF_D1 Appraisal Document - Default Appraiser
HRHAP00_DOC_DEF_D2 Appraisal Document - Default Appraisee
HRHAP00_DOC_DEF_DE Appraisal Document - Default Completion Period
HRHAP00_DOC_DEF_DN Appraisal Document - Default Appraisal Documen
HRHAP00_DOC_DEF_DO Appraisal - Default Further Participants
HRHAP00_DOC_DEF_DP Appraisal Document - Default Part Appraisers
HRHAP00_DOC_DEF_DR Appraisal Document - Default Review Date
HRHAP00_DOC_DEF_DV Appraisal Document - Default App. Document Val
HRHAP00_DOC_DELETE Appraisal Document - Delete
HRHAP00_DOC_PREPARE Appraisal Document - Prepare Appraisal Documen
HRHAP00_DOC_SAVE Appraisal Document - Save Appraisal Document
HRHAP00_DOC_STATNAME Appraisal Document - Alternative for Status Na
HRHAP00_DYN_EVENT Appraisal Document - Dynamic Cell Value Event
HRHAP00_ENHANCE_DEL Appraisal Document - Delete Element
HRHAP00_ENHANCE_FIX Appraisal Document - Fixed Enhancement
HRHAP00_ENHANCE_FREE Appraisal Document - Free Enhancement
HRHAP00_FOLLOW_UP Appraisal Document - Follow-Up Processing (Bac
HRHAP00_FOLLOW_UP_D Appraisal Document - Follow-Up Processing (Dia
HRHAP00_GET_LIST_FLT Appraisal Documents - Filter HRHAP_DOCUMENT_GE
HRHAP00_INIT_CATALOG Development: Catalog - On Initialization
HRHAP00_LINK Appraisal Document - Relationships
HRHAP00_MAX_P_APPER Maximum Number of Part Appraisers
HRHAP00_OFFLINE Appraisal Document - Offline
HRHAP00_REP_GEN_VAR Appraisal Document - Reporting (Generic Varian
HRHAP00_REPORTING Appraisal Document - Reporting
HRHAP00_SELECTION Appraisal Document - Object Selection (Role an
HRHAP00_SMARTFORMS Appraisal Document - Print Preview (Smart Form
HRHAP00_TEXT_SUBST Appraisal Document - Text Replacement
HRHAP00_TMPL_608 Development: Applic. - Add-On Dependent Templa
HRHAP00_TMPL_EXAMPLE Catalog - Create Example Templates
HRHAP00_TMPL_GETLIST Appraisal Document - Get Template List
HRHAP00_TMPL_RESTR Add-On Dependent Restriction of Search Help
HRHAP00_TMPL_WIZARD Catalog - Create Templates Using Wizard
HRHAP00_VAL_DET Appraisal Document - Value Determination
HRHAP00_VALUE_TYPE Appraisal Document - Value List
HRHAP00_WF_RULE_ID Workflow Executor

Click Here to Read More !!!!

Saturday, July 23, 2011

Different Types of Selection Screens events

What is:
1. at selection-screen on field
2. at selection-screen output
3. at selection-screen block
4. at selection-screen on value-request
5. at selection-screen on help-request and their difference?
For knowing Selection-screens:

First you must have right understanding of Events.
- Events are introduced by Event Keyword. They end when again next processs begins.
Selection-screens are special screen defined in ABAP.
- This ABAP at run time only controls the flow logic of Selection-screens. The PBO and PAI triggers the num of. selection-screens.

The basic form of the selection screen events is the AT SELECTION-SCREEN event. This event occurs after the runtime environment has passed all input data from the selection screen to the ABAP program. The other selection screen events allow programmers to modify the selection screen before it is sent and specifically check user input.

At Selection-screen OUTPUT is trigerred in PBO of selection-screen.
- This allows you to modify the Selection-screen, before it is displayed.

At Selection-screen On Field is triggered in PAI of selection-screens.
- The input fields can be checked,in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.

At Selection-screen On Block is trigerred in PAI event.
- You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK block - END OF BLOCK block. You can use this event block to check the consistency of the input fields in the block.

At Selection-screen On value request.
- This event is trigerred for F4 help.

At Selection-screen On help request .
- This event is triggered when the user clicks F1 for help on fileds.


Click Here to Read More !!!!

BAPI_SALESORDER_CHANGE Sample program

Here's what we did: This is a two step process because the BAPI to change
sales orders, BAPI_SALESORDER_CHANGE, doesn't have the functionality
to update conditions. So, what we have to do is call the change BAPI first
with the bare minimum fields populated and the logic switch set to 'B' carry
out new pricing). This will reset the conditions we needed to reset, ZR00
and ZN02 prices. Of course, after this call we need to commit the changes
to the database. Secondly, we make another call to the change BAPI, this
time we include the new ZR00 and ZN02 prices. And then commit the
changes to the DB. This ain't the prettiest thing in the world, but it works.


Code:
REPORT Y_SD_ORDER_REPRICE_BAPI.

TABLES: VBAP.

DATA: IRETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE,
IORDER_KEYS TYPE STANDARD TABLE OF BAPISDKEY WITH HEADER LINE,
IORDER_HDR_IN TYPE STANDARD TABLE OF BAPISDHD1 WITH HEADER LINE,
IORDER_HDR_INX TYPE STANDARD TABLE OF BAPISDHD1X WITH HEADER LINE,
IORDER_ITEM_IN TYPE STANDARD TABLE OF BAPISDITM WITH HEADER LINE,
IORDER_ITEM_INX TYPE STANDARD TABLE OF BAPISDITMX WITH HEADER LINE,
IORDER_COND_IN TYPE STANDARD TABLE OF BAPICOND WITH HEADER LINE,
IORDER_COND_INX TYPE STANDARD TABLE OF BAPICONDX WITH HEADER LINE,
IORDER_TEXT TYPE STANDARD TABLE OF BAPISDTEXT WITH HEADER LINE,
COMMIT_RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE,
IORDER_NUMBER LIKE BAPIVBELN-VBELN,
V_MSG_TXT(220),
MSG_ID LIKE SY-MSGID,
MSG_NO LIKE SY-MSGNO,
MSG_V1 LIKE SY-MSGV1,
CHANGE_ITEM_NUMBER LIKE VBAP-POSNR.

DATA: ILOGIC_SWITCH LIKE BAPISDLS.

PARAMETER: ORDER LIKE VBAK-VBELN MATCHCODE OBJECT VMVA,
ITEM LIKE VBAP-POSNR.

START-OF-SELECTION.

PERFORM NEW_PRICING.
PERFORM COMMIT_ORDER.
PERFORM ADD_NEW_CONDITIONS.
PERFORM COMMIT_ORDER.

*&---------------------------------------------------------------------*
*& Form NEW_PRICING
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM NEW_PRICING.

SKIP.
WRITE:/ '* * * CARRY OUT NEW PRICING * * *'.
SKIP.

SELECT SINGLE * FROM VBAP WHERE VBELN = ORDER
AND POSNR = ITEM.

IORDER_NUMBER = VBAP-VBELN.

*........Insert New Item......................................................
*........Load Sales Order Item Table....................................

CLEAR IORDER_ITEM_IN.
IORDER_ITEM_IN-ITM_NUMBER = VBAP-POSNR.
IORDER_ITEM_IN-MATERIAL = VBAP-MATNR.
IORDER_ITEM_IN-ITEM_CATEG = VBAP-PSTYV.
APPEND IORDER_ITEM_IN.

CLEAR IORDER_ITEM_INX.
IORDER_ITEM_INX-ITM_NUMBER = VBAP-POSNR.
IORDER_ITEM_INX-UPDATEFLAG = 'U'.
APPEND IORDER_ITEM_INX.

ILOGIC_SWITCH-PRICING = 'B'. "CARRY OUT NEW PRICING

*........Call Sales Order Create RFC....................................
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = IORDER_NUMBER
ORDER_HEADER_INX = 'U'
LOGIC_SWITCH = ILOGIC_SWITCH
TABLES
RETURN = IRETURN
ORDER_KEYS = IORDER_KEYS
ORDER_ITEM_IN = IORDER_ITEM_IN
ORDER_ITEM_INX = IORDER_ITEM_INX
CONDITIONS_IN = IORDER_COND_IN
CONDITIONS_INX = IORDER_COND_INX.

ENDFORM. "new pricing
*&---------------------------------------------------------------------*
*& Form commit_order
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM COMMIT_ORDER.

WRITE:/5 'ORDER NUMBER -->', IORDER_NUMBER.
SKIP.

LOOP AT IRETURN.

CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = IRETURN-ID
MSGNR = IRETURN-NUMBER
MSGV1 = IRETURN-MESSAGE
IMPORTING
MESSAGE_TEXT_OUTPUT = V_MSG_TXT
EXCEPTIONS
OTHERS = 1.

WRITE: / V_MSG_TXT.
ENDLOOP.

*........Order has to be commited to database...........................

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
RETURN = COMMIT_RETURN.

REFRESH: IORDER_HDR_IN, IORDER_ITEM_IN, IRETURN.

ENDFORM. " commit_order
*&---------------------------------------------------------------------*
*& Form ADD_NEW_CONDITIONS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM ADD_NEW_CONDITIONS.

SKIP.
WRITE:/ '* * * ADD NEW PRICES * * *'.
SKIP.

REFRESH: IRETURN, IORDER_ITEM_IN, IORDER_ITEM_INX, IORDER_COND_IN,
IORDER_COND_INX.

IORDER_NUMBER = VBAP-VBELN.

*........Load Sales Order Item Table....................................
CLEAR IORDER_ITEM_IN.
IORDER_ITEM_IN-ITM_NUMBER = VBAP-POSNR.
IORDER_ITEM_IN-MATERIAL = VBAP-MATNR.
IORDER_ITEM_IN-ITEM_CATEG = VBAP-PSTYV.
APPEND IORDER_ITEM_IN.

CLEAR IORDER_ITEM_INX.
IORDER_ITEM_INX-ITM_NUMBER = VBAP-POSNR.
IORDER_ITEM_INX-UPDATEFLAG = 'U'.
APPEND IORDER_ITEM_INX.

*........Load Sales Order Pricing Conditions............................
CLEAR IORDER_COND_IN.
IORDER_COND_IN-ITM_NUMBER = VBAP-POSNR.
IORDER_COND_IN-COND_TYPE = 'ZR00'.
IORDER_COND_IN-COND_VALUE = '175'.
IORDER_COND_IN-CURRENCY = 'USD'.
APPEND IORDER_COND_IN.

*........Indicate Change to Condition...................................
CLEAR IORDER_COND_INX.
IORDER_COND_INX-ITM_NUMBER = VBAP-POSNR.
IORDER_COND_INX-COND_TYPE = 'ZR00'.
IORDER_COND_INX-UPDATEFLAG = 'I'.
IORDER_COND_INX-COND_VALUE = 'X'.
IORDER_COND_INX-CURRENCY = 'X'.
APPEND IORDER_COND_INX.

*........Load Sales Order Pricing Conditions............................
CLEAR IORDER_COND_IN.
IORDER_COND_IN-ITM_NUMBER = VBAP-POSNR.
IORDER_COND_IN-COND_TYPE = 'ZN02'.
IORDER_COND_IN-COND_VALUE = '175'.
IORDER_COND_IN-CURRENCY = 'USD'.
APPEND IORDER_COND_IN.

*........Indicate Change to Condition...................................
CLEAR IORDER_COND_INX.
IORDER_COND_INX-ITM_NUMBER = VBAP-POSNR.
IORDER_COND_INX-COND_TYPE = 'ZN02'.
IORDER_COND_INX-UPDATEFLAG = 'I'.
IORDER_COND_INX-COND_VALUE = 'X'.
IORDER_COND_INX-CURRENCY = 'X'.
APPEND IORDER_COND_INX.

*........Call Sales Order Create RFC....................................
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = IORDER_NUMBER
ORDER_HEADER_INX = 'U'
TABLES
RETURN = IRETURN
ORDER_ITEM_IN = IORDER_ITEM_IN
ORDER_ITEM_INX = IORDER_ITEM_INX
CONDITIONS_IN = IORDER_COND_IN
CONDITIONS_INX = IORDER_COND_INX.

ENDFORM. " ADD_NEW_CONDITIONSGood Luck Mike - I hope this helps!
__________________

Click Here to Read More !!!!