BADI-Urgent

Hi All,
     I have a requirement to add customized fields onto a standard IS-OIL screen.
The transaction related to it is o4_tiger and it belongs to MM -> Inventorymngt -> IS-OIL .(SILO management)
I have absolutely no knowledge in BADI and user exits. Can anyone pl help me out the step by step process about the adding of the fields.
The BADI definition  is OII_DIP_ADD_COLUMNS.
Pl help me out.
Regards.

Hi
the table control for O4_TIGER contains some custom fields predefined by sap (like roiitankdip-cust1). If you create an active implementation for badi OII_DIP_ADD_COLUMNS then these columns will appear on the screen.
Example:
You have added a custom field yy_field to the table oib_tankdip and to the struct roiitankdip in order to maintain this field in silo management.
Here use the screen field roiitankdip-cust1 to maintain yy_field and hide the rest of the predefined custom fields.
1. Implement badi method SET_COLUMN_NAMES
1. Handle table control (used in create/change mode)
  DATA: ls_col TYPE scxtab_column.
by activating BADI, additional fields proposed by sap are displayed
I hide them here as we need other additional fields and not them
  LOOP AT table_ctrl-cols INTO ls_col.
    IF ls_col-screen-name = 'ROIITANKDIP-TOTALHEIGHT_FT'
       OR ls_col-screen-name = 'ROIITANKDIP-TOTALHEIGHT_IN'
       OR ls_col-screen-name = 'ROIITANKDIP-TOTALHEIGHT_FR'
       OR ls_col-screen-name = 'ROIITANKDIP-WATERHEIGHT_FT'
       OR ls_col-screen-name = 'ROIITANKDIP-WATERHEIGHT_IN'
       OR ls_col-screen-name = 'ROIITANKDIP-WATERHEIGHT_FR'
      OR ls_col-screen-name = 'ROIITANKDIP-CUST1'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST2'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST3'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST4'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST5'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST6'
       OR ls_col-screen-name = 'ROIITANKDIP-CUST7'.
      ls_col-invisible = 'X'.
    ENDIF.
    MODIFY table_ctrl-cols FROM ls_col.
  ENDLOOP.
set header text -> col_name7 is linked to roiitankdip-cust1
  col_name7 = 'My new field'.
2. Handle field catalog (used in display mode)
  DATA: ls_fieldcat TYPE lvc_s_fcat.
  LOOP AT field_cat INTO ls_fieldcat.
    IF ls_fieldcat-fieldname = 'TOTALHEIGHT_FT'
       OR ls_fieldcat-fieldname = 'TOTALHEIGHT_IN'
       OR ls_fieldcat-fieldname = 'TOTALHEIGHT_FR'
       OR ls_fieldcat-fieldname = 'WATERHEIGHT_FT'
       OR ls_fieldcat-fieldname = 'WATERHEIGHT_IN'
       OR ls_fieldcat-fieldname = 'WATERHEIGHT_FR'
      OR ls_fieldcat-fieldname = 'CUST1'
       OR ls_fieldcat-fieldname = 'CUST2'
       OR ls_fieldcat-fieldname = 'CUST3'
       OR ls_fieldcat-fieldname = 'CUST4'
       OR ls_fieldcat-fieldname = 'CUST5'
       OR ls_fieldcat-fieldname = 'CUST6'
       OR ls_fieldcat-fieldname = 'CUST7'.
      ls_fieldcat-no_out = 'X'.
    ENDIF.
    IF ls_fieldcat-fieldname = 'CUST1'.
      ls_fieldcat-fieldname = 'YY_FIELD'.
      ls_fieldcat-coltext   = 'My new field'.
    ENDIF.
    MODIFY field_cat FROM ls_fieldcat.
  ENDLOOP.
and now you need to put the value of cust1 to yy_field
in badi method SET_CUST_FIELDS
  DATA: ls_tankdip TYPE roiitankdip.
  LOOP AT tankdip_tab INTO ls_tankdip.
    ls_tankdip-yy_field = ls_tankdip-cust1.
    MODIFY tankdip_tab FROM ls_tankdip.
  ENDLOOP.
and keep in mind that the cust1..7 fields are char type fields so you might want to do some formatting, validation etc
cheers

Similar Messages

  • CRM BADI URGENT?

    Hi I am using BADI BUPA_FURTHER_CHECKS...when creating a business partner (sold-to-party) in SAP CRM?
    I need to check the industry code with the attribute...and give an error message...
    But the problem is that this BADI is not getting triggered?
    Do u knw any other badi that gets trigerred...?
    PLease help its urgent...

    Hi,
       Try this BADI.  <b>BUPA_INDSEC_CHECK</b>
       Reward if it works.
    Cheers,
    Narasingam

  • MB1B User Exit , BAdi (Urgent)

    HI all !!
    What is the user-exit or BAdi which is triggered <b>after</b> saving (not <b>while</b> saving)a material document in t-code MB1B?
    Handsome points will be rewarded.
    Nikhil

    hi this will help u.
    REPORT z_find_userexit NO STANDARD PAGE HEADING.
    *&  Enter the transaction code that you want to search through in order
    &  to find which Standard SAP User Exits exists.&
    *& Tables
    TABLES : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    *& Selection Screen Parameters
    SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK a01.
    *& Start of main program
    START-OF-SELECTION.
    Validate Transaction Code
      SELECT SINGLE * FROM tstc
        WHERE tcode EQ p_tcode.
    Find Repository Objects for transaction code
      IF sy-subrc EQ 0.
        SELECT SINGLE * FROM tadir
           WHERE pgmid    = 'R3TR'
             AND object   = 'PROG'
             AND obj_name = tstc-pgmna.
        MOVE : tadir-devclass TO v_devclass.
        IF sy-subrc NE 0.
          SELECT SINGLE * FROM trdir
             WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir
              WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir
              WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir
              WHERE pgmid    = 'R3TR'
                AND object   = 'FUGR'
                AND obj_name = enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
    Find SAP Modifactions
        SELECT * FROM tadir
          INTO TABLE jtab
          WHERE pgmid    = 'R3TR'
            AND object   = 'SMOD'
            AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct
          WHERE sprsl EQ sy-langu
            AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(95) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          WRITE:/(95) sy-uline.
          LOOP AT jtab.
            SELECT SINGLE * FROM modsapt
            WHERE sprsl = sy-langu AND
            name = jtab-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
            WRITE:/1 sy-vline,
            2 jtab-obj_name HOTSPOT ON,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          ENDLOOP.
          WRITE:/(95) sy-uline.
          DESCRIBE TABLE jtab.
          SKIP.
          FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No of Exits:' , sy-tfill.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(95) 'No User Exit exists'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'Transaction Code Does Not Exist'.
      ENDIF.
    Take the user to SMOD for the Exit that was selected.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    with regards,
    Hema Sundara.
    reward if helpful.

  • Implementing Transport Naming convention with the help of BAdIs (Urgent)

    Hi Gurus,
    We need to implement Transport Naming convention in our landscape.
    Transport request should follow the following naming conventions and to enable this we have to enable some necessary BAdIs?
    Scenario  would be like this....!
    Customization
    LC-<Track>-<Description>  (Non Transportable Request)
    <Module>-<Track>-<Configuration Type>-<Change No>-<Description of the Customisation.>
    ABAP Developments
    AB-<Track>-<Configuration Type>-<Development No>-<Description of the Development>
    OSS Notes
    BC-<Track>-OSS#<OSS Note No>-<Version>-<Patch Number>-<Process Team>-<Note Description>
    Authorization
    BA-<Track>-<Version>-<Authorisation Description>
    Details :
    Track : 01 u2013 Hot fixing, 02 u2013 Implementation, 03 u2013 BIW / EP, 04 u2013 Support
    Module : SAP Module (FI, CO, MM, SD, PP, etc..)
    Configuration Type : I u2013 Initial Configuration, R u2013 Change due to TPR or Additional Functionality
    Change No / Development No : Unique no to trance the base documentation
    Please suggest .....................!
    Which are the necessary BAdIs needs to be enabled and what other configuration needs to be done.
    If anybody has any document please provide.
    Thanks in advance..............!!!
    Regards,
    Jai Sach

    Hello,
    SPRO --> SAP NetWeaver --> Application Server -->
    System administration --> Change & Transport domain
    --> BADI -->Business Add-In when Editing Requests
    IF_EX_CTS_REQUEST_CHECK~CHECK_BEFORE_CREATION
    Happy Tony

  • Need material on badis urgent

    need material on badis urgent

    Check this
    http://www.allsaplinks.com/badi.html
    <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="143565"></a>
    It gives you step by step details of implementing BADIS
    just run this report  u find all the badi and user exit associated with given transaction in parameter...
    *& Report  ZNEGI16                                                     *
    REPORT  ZNEGI16                                 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    * Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    * Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    * For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.

  • Do you have any sample program for HRPIQ00AUTHORITY Badi [ urgent]

    do you have any sample program for HRPIQ00AUTHORITY Badi and would be appreciated if you have over t me.
    regards,
    jin dal

    Thanks for the help.

  • BADI in O4_Tiger of OII_DIP_ADD_COLUMNS

    Hi~
    In present project,we need to add customer field in T-code:O4_TIGER,and then i find a badi : OII_DIP_ADD_COLUMNS.
    I search the web and get the message in forums : BADI-Urgent
    I copy Gabor Hornyak  's code but it's not work  as follow.
    and now you need to put the value of cust1 to yy_field
    in badi method SET_CUST_FIELDS
    DATA: ls_tankdip TYPE roiitankdip.
    LOOP AT tankdip_tab INTO ls_tankdip.
    ls_tankdip-yy_field = ls_tankdip-cust1.    <<<<----error
    MODIFY tankdip_tab FROM ls_tankdip.
    ENDLOOP.
    After i comment the error code,and i can see a customer field  named 'My new field' in O4_TIGER ,but it can't save the input value after save.
    Ths.
    Nicky

    great.
    just remodify the method in set_cust_field.
      DATA: ls_tankdip TYPE roiitankdip.
      DATA: l_g_tankdip_tab(29) VALUE '(SAPMOIIC_DIP)G_TANKDIP_TAB[]'.
      DATA:tank TYPE roiitankdip.
      TYPES t_roiitankdip  TYPE TABLE OF roiitankdip.
      FIELD-SYMBOLS: <fs_roiitankdip> TYPE  t_roiitankdip.
    display
      IF pm_type = ''.
        LOOP AT tankdip_tab INTO ls_tankdip.
          ls_tankdip-cust1 = ls_tankdip-vbeln.
          MODIFY tankdip_tab FROM ls_tankdip.
        ENDLOOP.
      ENDIF.
    modify
      IF pm_type = 'V'.
        LOOP AT tankdip_tab INTO ls_tankdip.
          IF ls_tankdip-cust1 IS INITIAL.
            ls_tankdip-cust1 = ls_tankdip-vbeln.
          ENDIF.
          ls_tankdip-vbeln = ls_tankdip-cust1.
          MODIFY tankdip_tab FROM ls_tankdip.
        ENDLOOP.
    endif.
    it work.
    but it have a bit wrong,,when i replace the old value with blank,,it still with old value ,cos  
        IF ls_tankdip-cust1 IS INITIAL.
            ls_tankdip-cust1 = ls_tankdip-vbeln.
          ENDIF.
    do you have a better way to deal it?
    Ths

  • Badi and Business event( Urgent)

    Hi experts,
          I am new to badi and business event 1120P. Please post how this business event exactly comes in to picture in this badi. also how to find this business event?
    And also Post the logic or code. The requirement is given below . Pls Post the solution. Its very urgent.
    Enhancement Summary
    Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
    Business Process
    Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
    There are no screens involved in this enhancement.
    Components
    Table: ZTABLE1
    Field     Data Element     Type     Length     Description
    MANDT     MANDT     CLNT (key)     3     Client
    DISTRIBUTION     Z_DISTRIBUTION     CHAR (key)     1     Distribution
    MOT     ZZDEF_MOT     CHAR (key)     2     Mode of Transportation
    MATKL     MATKL     CHAR (key)     9     Material group
    SAKNR     SAKNR     CHAR     10     G/L Account Number
    KOSTL     KOSTL     CHAR     10     Cost Center
    This table gets updated manually by the FI team.
    Values for Distribution are:
    ‘1’  =  Primary Distribution to Refinery
    ‘2’ = Primary and Secondary– Excluding refinery
    All entries must be checked against SAP config and master tables
    User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
    Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
    There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
    Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
    Function, Rules, Exits      Description of Functionality, Rules, Exits
    BADI_SCD_ACCTG     Business Add-In for Shipment Cost Account Assignment
    Business Framework     Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
    This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
    Custom Table     A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
    Transaction code     To maintain the new table
    Append Structure     To enhance structure BSEG_SUBST with MATNR
          Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
    Logic:
    •     Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module ZPLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.
    •     Product Group can be determined from the Material master through Material group field MARA-MATKL.
    •     Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
    •     Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.
    •     Move ZTABLE1-SAKNR  to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
    •     The Material group must be exported to memory in BADI_SCD_ACCTG
    •     The Material group must be imported from memory in Business Event BP1120P
    •     Free Memory in Business Event BP1120P
    This is VI01 – Creation of Freight Cost Item screen
    and also code for function module ZPLANTCLASSIFICATION below
    FUNCTION zplantclassification .
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(IP_SAPPLANT) LIKE  AUSP-OBJEK OPTIONAL
    *"     REFERENCE(IP_CPSPLANT) LIKE  AUSP-ATWRT OPTIONAL
    *"     REFERENCE(IP_SISLOC) LIKE  AUSP-ATWRT OPTIONAL
    *"  EXPORTING
    *"     VALUE(EP_SAPPLANT) LIKE  AUSP-OBJEK
    *"     VALUE(EP_CPSPLANT) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SISLOC) LIKE  AUSP-ATWRT
    *"     VALUE(EP_OWNERSHIP) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SMISTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SPOTREF) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SUBTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SUPPLYREGION) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_DISTAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_GEOGAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_HMF) LIKE  AUSP-ATWRT
    *"     VALUE(EP_IATACODE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_IRSTCN) LIKE  AUSP-ATWRT
    *"     VALUE(EP_OPSAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_PLANTSTAT) LIKE  AUSP-ATWRT
    *"     VALUE(EP_PORTCODE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_REFAREA) LIKE  AUSP-ATWRT
    *"     VALUE(EP_SAPTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_MFGWARRANTY) LIKE  AUSP-ATWRT
    *"     VALUE(EP_USERTYPE) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TRMCENTER) LIKE  AUSP-ATWRT
    *"     VALUE(EP_TRANSCENTER) LIKE  AUSP-ATWRT
    *"     VALUE(EP_FEIN) LIKE  AUSP-ATWRT
    *"  TABLES
    *"      INT_PLANTCHAR STRUCTURE  ZPLANTCLASSIFICATION OPTIONAL
    *"  EXCEPTIONS
    *"      NO_OBJEK_FOUND
    *"      NO_CPSPLANT_FOUND
    *"      NO_SISLOC_FOUND
    *"      NO_INPUT_FOUND
    *"      VALID_PLANT_NO_CHARACTERISTIC
    *"      ONE_TO_MANY_ISSUE
    *"      PLANT_NOT_FOUND_ZDEF_DELPLANT
    *"      UNKNOWN_ERRORS
    FM Name: ZPLANTCLASSIFICATION     
    Created By  :  SYUB                                                  *
    Description : Function Module to retrieve plant characteristics      *
    The function module has two capabilities:
    1. Retrieve only the necessary characteristics
    2. Retrieve the whole characteristics into an internal table.
    Parameter Description                                                *
    In the future, if there is a new characteristic added to the
    plant classification tables, the characteristic has to be added
    to the list of the export parameters and the loop statement.
      TABLES: ausp, cabn, ksml, zdef_delplant.
      DATA: ws_objek LIKE ausp-objek,
            ws_countchar TYPE i,
            ws_countplant TYPE i.
    *Internal table for SAP plant
      DATA: BEGIN OF int_plant OCCURS 0,
            plant LIKE ausp-objek,
            END OF int_plant.
    *sap plant code is the input parameter.Move objek, atnam, and atwrt to
    *internal table PLANTCHAR using inner join of AUSP, CABN, and KSML to
    *synch up the internal characteristic numbers throughout the 3 tables.
      IF NOT ip_sapplant IS INITIAL.
        SELECT auspobjek cabnatnam ausp~atwrt
          INTO CORRESPONDING FIELDS OF TABLE int_plantchar
          FROM ksml AS ksml
          INNER JOIN cabn AS cabn
            ON cabnatinn = ksmlimerk
          INNER JOIN ausp AS ausp
            ON ausp~objek = ip_sapplant
            AND auspatinn = cabnatinn
            AND ausp~mafid = 'O'
            AND ausp~klart = 'Z01'.
    *Checking the existence of ip_sapplant in the table, if it doesn't
    *exist, raise the exception else if it exists, check if it has
    *characteristic values.
        IF sy-subrc NE 0.
          RAISE no_objek_found.
        ELSE.
          DESCRIBE TABLE int_plantchar LINES ws_countchar.
          IF ws_countchar LT 2.
            RAISE valid_plant_no_characteristic.
          ENDIF.
        ENDIF.
    *cps plant code is the input parameter. Move objek from table AUSP to
    *ws_objek using inner join of CABN and AUSP to match up the internal
    *characteristic numbers from the 2 tables.
      ELSEIF NOT ip_cpsplant IS INITIAL.
        SELECT ausp~objek
          INTO TABLE int_plant
          FROM ausp AS ausp
          INNER JOIN cabn AS cabn
            ON cabn~atnam = 'OLDCODE'
              WHERE auspatinn = cabnatinn
                AND ausp~mafid = 'O'
                AND ausp~klart = 'Z01'
                AND ausp~atwrt = ip_cpsplant.
    *Checking the existence of ip_cpsplant in the table
        IF sy-subrc EQ 0.
    *Counting the number of SAP plants in the internal table int_plant
          DESCRIBE TABLE int_plant LINES ws_countplant.
    *Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
    *from ws_objek.
          IF ws_countplant EQ 1.
            LOOP AT int_plant.
              SELECT auspobjek cabnatnam ausp~atwrt
                INTO CORRESPONDING FIELDS OF TABLE int_plantchar
                FROM ksml AS ksml
                INNER JOIN cabn AS cabn
                  ON cabnatinn = ksmlimerk
                INNER JOIN ausp AS ausp
                  ON ausp~objek = int_plant-plant
                  AND auspatinn = cabnatinn
                  AND ausp~mafid = 'O'
                  AND ausp~klart = 'Z01'.
            ENDLOOP.
    *If there more than one SAP Plants, then raise an exception.
          ELSEIF ws_countplant GT 1.
            RAISE one_to_many_issue.
          ENDIF.
        ELSE.
          SELECT SINGLE werks FROM zdef_delplant
            INTO ws_objek
            WHERE cpsloc = ip_cpsplant.
          SELECT auspobjek cabnatnam ausp~atwrt
           INTO CORRESPONDING FIELDS OF TABLE int_plantchar
           FROM ksml AS ksml
           INNER JOIN cabn AS cabn
             ON cabnatinn = ksmlimerk
           INNER JOIN ausp AS ausp
             ON ausp~objek = ws_objek
             AND auspatinn = cabnatinn
             AND ausp~mafid = 'O'
             AND ausp~klart = 'Z01'.
          if sy-subrc ne 0.
            raise plant_not_found_zdef_delplant.
          endif.
        ENDIF.
    *cps plant code is the input parameter. Move objek from table AUSP to
    *ws_objek using inner join of CABN and AUSP to match up the internal
    *characteristic numbers from the 2 tables.
      ELSEIF NOT ip_sisloc IS INITIAL.
        SELECT ausp~objek
          INTO TABLE int_plant
          FROM ausp AS ausp
          INNER JOIN cabn AS cabn
            ON cabn~atnam = 'SISLOC'
              WHERE auspatinn = cabnatinn
                AND ausp~mafid = 'O'
                AND ausp~klart = 'Z01'
                AND ausp~atwrt = ip_sisloc.
    *Checking the existence of ip_sapplant in the table
        IF sy-subrc EQ 0.
          DESCRIBE TABLE int_plant LINES ws_countplant.
    *Moving the values of objek, atnam, and atwrt to PLANTCHAR using objek
    *from ws_objek.
          IF ws_countplant EQ 1.
            LOOP AT int_plant.
              SELECT auspobjek cabnatnam ausp~atwrt
                INTO CORRESPONDING FIELDS OF TABLE int_plantchar
                FROM ksml AS ksml
                INNER JOIN cabn AS cabn
                  ON cabnatinn = ksmlimerk
                INNER JOIN ausp AS ausp
                  ON ausp~objek = int_plant-plant
                  AND auspatinn = cabnatinn
                  AND ausp~mafid = 'O'
                  AND ausp~klart = 'Z01'.
            ENDLOOP.
    *If there more than one SAP Plants, then raise an exception.
          ELSEIF ws_countplant GT 1.
            RAISE one_to_many_issue.
          ENDIF.
        ELSE.
          SELECT SINGLE werks FROM zdef_delplant
            INTO ws_objek
            WHERE sisloc = ip_sisloc.
          SELECT auspobjek cabnatnam ausp~atwrt
           INTO CORRESPONDING FIELDS OF TABLE int_plantchar
           FROM ksml AS ksml
           INNER JOIN cabn AS cabn
             ON cabnatinn = ksmlimerk
           INNER JOIN ausp AS ausp
             ON ausp~objek = ws_objek
             AND auspatinn = cabnatinn
             AND ausp~mafid = 'O'
             AND ausp~klart = 'Z01'.
          if sy-subrc ne 0.
            raise plant_not_found_zdef_delplant.
          endif.
        ENDIF.
      ELSE.
    *Checking if there is an input parameter entered.
        RAISE no_input_found.
      ENDIF.
    Modified 7/30 by RFOR to validate SAP plant is in plant master
      data: wa_t001w like t001w.
      read table int_plantchar.
      SELECT SINGLE * from t001w into wa_t001w where
      werks = int_plantchar-objek.
      if sy-subrc ne 0.
        raise NO_OBJEK_FOUND.
      endif.
    *Moving all the characteristic values to the export parameters
      LOOP AT int_plantchar.
        MOVE int_plantchar-objek TO ep_sapplant.
        CASE int_plantchar-atnam.
          WHEN 'OLDCODE'.
            MOVE int_plantchar-atwrt TO ep_cpsplant.
          WHEN 'SISLOC'.
            MOVE int_plantchar-atwrt TO ep_sisloc.
          WHEN 'OWNERSHIP'.
            MOVE int_plantchar-atwrt TO ep_ownership.
          WHEN 'SMISTYPE'.
            MOVE int_plantchar-atwrt TO ep_smistype.
          WHEN 'SPOTREF'.
            MOVE int_plantchar-atwrt TO ep_spotref.
          WHEN 'SUBTYPE'.
            MOVE int_plantchar-atwrt TO ep_subtype.
          WHEN 'SUPPLYREGION'.
            MOVE int_plantchar-atwrt TO ep_supplyregion.
          WHEN 'TYPE'.
            MOVE int_plantchar-atwrt TO ep_type.
          WHEN 'DISTAREA'.
            MOVE int_plantchar-atwrt TO ep_distarea.
          WHEN 'GEOGAREA'.
            MOVE int_plantchar-atwrt TO ep_geogarea.
          WHEN 'HMF'.
            MOVE int_plantchar-atwrt TO ep_hmf.
          WHEN 'IATACODE'.
            MOVE int_plantchar-atwrt TO ep_iatacode.
          WHEN 'IRSTCN'.
            MOVE int_plantchar-atwrt TO ep_irstcn.
          WHEN 'OPSAREA'.
            MOVE int_plantchar-atwrt TO ep_opsarea.
          WHEN 'PLANTSTAT'.
            MOVE int_plantchar-atwrt TO ep_plantstat.
          WHEN 'PORTCODE'.
            MOVE int_plantchar-atwrt TO ep_portcode.
          WHEN 'REFAREA'.
            MOVE int_plantchar-atwrt TO ep_refarea.
          WHEN 'SAPTYPE'.
            MOVE int_plantchar-atwrt TO ep_saptype.
          WHEN 'MFG_WARRANTY'.
            MOVE int_plantchar-atwrt TO ep_mfgwarranty.
          WHEN 'USER_TYPE'.
            MOVE int_plantchar-atwrt TO ep_usertype.
          WHEN 'TERMINALCENTER'.
            MOVE int_plantchar-atwrt TO ep_trmcenter.
          WHEN 'TRANSPORTATIONCENTER'.
            MOVE int_plantchar-atwrt TO ep_transcenter.
          when 'FEIN'.
            move int_plantchar-atwrt to ep_fein.
        ENDCASE.
      ENDLOOP.
    ENDFUNCTION.
    Pls help me out from this problem its very urgent.
    Thanks

    hi SK ,
    process like this .
    in BADI
    method.
    1.Here u have to put ur logic based on the Requirement.
    2.then u have to call BTE like this
    <b>call function 'OPEN_FI_PERFORM_00001020_E'
          tables
            t_bseg = xbseg
            t_bkpf = xbkpf.</b>
    3.Update Ztables.
    endmethod.
    this is sample logic only.First get logic of TS then u will come to know how to do?
    regards
    prabhu

  • Urgent (userexit/badi)

    hi all ,
    in t-code 'VT01N'   i have to make f4 help on field 'Container ID' of third screen of this t-code..can i do it by using Userexit or badi? if yes then how?
    can anybody send me step by step procedure?
    its urgent .
    thanx in advance .
    saurabh srivastava .

    Hi,
       it may helps u..
       It is user exit for vt01n i. e .V56AFCCH
       check it..
    Regards,

  • Appraisals - BAdi calcuation display (urgent)

    Hello Experts,
    I have created a new BAdi for final result for Value determination. I have assigned it at Criteria group level but even after the completion, the value is not displayed. However, it is calculating properly at the backend and pushing to the relevant column. I have put a breakpoint and it is triggering..so I am able to view the calculation.
    Please let me know if there is any linkage/I have to do change any configuration in the front end so that it is displayed.
    Its very urgent..Please help on this.
    Thanks in advance!
    Swetha

    Dear Swetha,
    I suppose you have assigned standard BAdI name for your BAdI. Try to change the name of the implentation of the BAdI. That should do the job.
    Do reward points if the answer is helpful.
    Regards,
    AXE

  • Plz Urgent in BADI

    In production server in vl01n transaction server some one put BREAK-POINT  out bound delivery order when item level badi implementation..
    I used all method but its not showing in Method code.
    How i can find zbadi implementation where break point is set.
    Very urgent.
    Plz reply as sooon as possible.
    Durgesh

    Hi dugesh,
                       you can put the break point  in se19  --interface ---under the method <b>change_input_header_items</b>.The pariculer BADI will trigger when you click on PGI(post goods issue from the outbound delivery(VL02N).
    Hope now you have catch my point.
    and you can develop any objects in developemen server.In production server you can test the object only .You have no rights access Functional T.codes .
    regards

  • Badi's on vi01. Pls Its very urgent

    Hi Experts,
          I have given the requirement below I am not aware of badi's. Pls tell me the info about  Business event 1120P. And also post the coding for this functionality . Its very urgent
    Enhancement Summary
    Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.
    Business Process
    Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.
    There are no screens involved in this enhancement.
    Components
    Table: ZTABLE1
    Field     Data Element     Type     Length     Description
    MANDT     MANDT     CLNT (key)     3     Client
    DISTRIBUTION     Z_DISTRIBUTION     CHAR (key)     1     Distribution
    MOT     ZZDEF_MOT     CHAR (key)     2     Mode of Transportation
    MATKL     MATKL     CHAR (key)     9     Material group
    SAKNR     SAKNR     CHAR     10     G/L Account Number
    KOSTL     KOSTL     CHAR     10     Cost Center
    This table gets updated manually by the FI team.
    Values for Distribution are:
    ‘1’  =  Primary Distribution to Refinery
    ‘2’ = Primary and Secondary– Excluding refinery
    All entries must be checked against SAP config and master tables
    User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.
    Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.
    There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.
    Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.
    Function, Rules, Exits      Description of Functionality, Rules, Exits
    BADI_SCD_ACCTG     Business Add-In for Shipment Cost Account Assignment
    Business Framework     Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.
    This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.
    Custom Table     A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group
    Transaction code     To maintain the new table
    Append Structure     To enhance structure BSEG_SUBST with MATNR
          Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.
    Logic:
    •     Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module Z_M_GET_PLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.
    •     Product Group can be determined from the Material master through Material group field MARA-MATKL.
    •     Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.
    •     Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.
    •     Move ZTABLE1-SAKNR  to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl
    •     The Material group must be exported to memory in BADI_SCD_ACCTG
    •     The Material group must be imported from memory in Business Event BP1120P
    •     Free Memory in Business Event BP1120P
    This is VI01 – Creation of Freight Cost Item screen

    check the reply of ur Same Post .
    regards
    prabhu

  • !!URGENT!! BADI Implementation for creation of G/L accounts

    Please can you urgently help. I am trying to implement a user exit or badi to check the uniqueness of the description while creating a G/L account.
    I tried to create a BADI implementation to the definition FI_LIMIT_ACCOUNT but it gives error messages that this is for SAP internal use.
    The user exit ZXF03U01 used in enhancement SAPMF02H cannot be used as this exit passes only SKA1 and SKB1.I would like to check on SKAT. The fields affected in SKAT-TXT20 and SKAT-TXT50.
    Do you see a solution to this?
    I have the same to be implemented for KS01/KS02 - Create/Change Costcenter.
    A prompt response would be appreciated.

    Also try :
    CL_IM_QISR1_GL_ACCOUNT_CRE  Class
    Or FM`s
    GL_ACCOUNT_INSERT            
    GL_ACCOUNT_IN_COA_INSERT     
    GL_ACCOUNT_IN_COMPANY_INSERT 
    GL_ACCOUNT_SAMPLE_INSERT     
    GL_ACCT_CH_REQ_CREATE_ACCOUNT
    Thanks

  • Urgent: BADI for Auto packing a delivery at time of creating delivery

    Hi Gurus,
    I have an urgent requirement to tweak the user exit at time of autopack to sort the parts numbers by Storage Bins and pack the parts. When we create the delivery using VL10E or VL04 system checks if the delivery it’s going to create has packing instructions, If yes it considers volume and weights and pack’s accordingly based on the configuration and master data setup. When the pick list prints it prints by Handling units and the parts which needs to packed inside the handling units. To minimize pick times  when creating handling units  for the delivery through autopack functionality we  need to sort bins from descending to ascending order and submit the list to autopack function module to make sure it packs in the same order.
                      Standard SAP has given  user exits – BADI (BADI_HU_AUTOPACK) after 4.6C which is available in our system and also Packmodi (enhancement) to tweak the system.
    The storage bin we maintain in material master (MARD- LGPBE) field
    Please Help me and suggest me how to proceed with this development..
    Best points will surely be rewarded....
    Reagrds
    Nikki

    Hi,
    I tried to implement the customer function for this enhancement - XVHUPO01, but the function - EXIT_SAPLVHUPRT_001 does not exist.  I checked on OSS, but could not find anything.
    Could you please help.
    Thanks.
    JP

  • QE51N exit / BADi needed URGENTLY

    Hi experts,
    I'm having this following urgent problem, let's see if any1 can be of any assistance and brainstorm with me...
    We have a requirement that when executing the selection-screen of QE51N, a kind of popup screen comes out asking the user for data (this should only come out the first time the selection screen is executed). Once that's done filled and the user fills in the data of QE51N & presses the SAVE button, we should fill in a custom Z table with the data of our Popup screen and some data of QE51N.
    Ok, for the Popup screen we're using exit EXIT_SAPLQEEM_029 (which is one of the first exits that are executed) and as we only want it to be executed the first time, we're using a flag in memory to see if it's marked or not. However, the problem is when we finish with the data and want to go BACK or EXIT, we want to clean the memory flag (so that the Popup can appear again). I can't find any user exit or BADI that is executed when leaving QE51N.
    Another alternative is another exit / BADI which is executed <b>ONCE</b> right at the beginning of the transaction instead of EXIT_SAPLQEEM_029. That way there would be no need for a flag...
    Can anybody <b>PLEASE</b> try to help?
    PS - I tried all QEEM* exits, no luck
    PS2 - EXIT_SAPLQEEM_015 is used for saving the data
    PS3 - Thanks a lot! Points will be rewarded

    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
    Does anyone know if any of these could be used to handle the BACK / CANCEL / EXIT buttons?

Maybe you are looking for

  • What do i need to do to share TB and Lightning files between W7 and Ubuntu 14.04 on a dual boot system?

    I recently installed Ubuntu 14.04 alongside W7. Since I'm not comfortable dropping Windows completely yet, I want my W7 Thunderbird and my Ubuntu TB to have access to the same data file holding current messages, so I don't have to get out of one to u

  • BPH in Solution Manager

    I am new to this area. Here I have 3 question: 1. How I can download one of the BPH from BPR? So that it can be seen in the Project Admin-> Scope-> Template selection. 2. I have a created a BPH in form of xls fromat, how we can upload to the system s

  • RNR and CSS upgrade

    I have tried upgrading Rescue Recovery 3.0 and Client Security 6.0.  I am unable to delete these to upgrade to RNR 4 and CSS 8. Now I can not get the Password Mgr working for websites etc. and I was not unable to find a compatible replacement.

  • IT 0009 Bank Infotype

    I want to make Bank Account and Mode of payment as a mandatory field pls let me know how can i do that ? Regards, Ritika

  • Error Message Trying To Convert To PDF

    When printing to a PDF printer like Adobe PDF I get the following error message " the specified printer could not be initialized. Try a different printer or reinstall the printer driver" This may have happened after upgrading Adobe Distiller. The PDF