Confirmation profile selection based on material

Hi All
Is it possible to have a confirmation profile based on the material which is being produced in the Production order? If yes then please give me your suggestions on how to achieve this.
regards
PK

Hi Madhu G
I have defined the confirmation profile in Opk0. I know that I can assign a different profile with reference to user.
I dont want confirmation profile based on Storage location
I want the confirmation screen to be different for different materials -plant combination. Does anyone have any idea how this can be achieved?
regards
PK

Similar Messages

  • Field Selection Based on Material Type

    Hello!!
    Can any one tell me how to make a single field mandatory in material master based on material type?
    I know we can use OMS9 to make it mandatory... the field i was looking is in a field selection group....when i make it mandatory i am actually making all the fields in the field selection group as mandatory...i dont want to do that...i just want to make only one field as mandatory.....
    If some one has any kind of training documents...could you please send it across?
    Thanks in advance.....

    Dear,
    Go through: http://help.sap.com/saphelp_45b/helpdata/en/08/6dec6eb435d1118b3f0060b03ca329/frameset.htm
    http://help.sap.com/saphelp_45b/helpdata/en/8e/204b6e5733d1118b3f0060b03ca329/frameset.htm
    Re: New Movement Type
    Define field in a particular movement type
    Regards,
    Syed Hussain.

  • Table Required to trace Confirmation of EBP based on Material Doc inR3

    Hi,
    can any one suggest the procedure to get the confirmation of EBP in R3 by giving the input parameter as Material document(GR).
    i can find through Query also let me know the procedure
    regards
    subhash

    Hi Subhash,
    It is not possible to get the EBP confirmation number from R3 material document number as of standard.
    However you can use the field 'Reference' of table MKPF in R3 to get the 'Reference document' field value of corresponding Confirmation in EBP. Then in EBP, use the table bbp_pdhgp to get the confirmation number  by passing  ref_doc_no field.
    Regards,
    Sanjeev

  • Purchase Group to be selected based on Material Group

    Dear Gurus,
    I would like the system to automatically suggest the purchase group based on the material group mentioned in the purchase requisition.
    Is there any way this can be done?
    Regards
    Veronica

    There is no standard config to achieve this requirement.
    You can create one  Z table to maintain the relation between PGrp and Mat.Grp and use exit to populate the corresponding PGrp for the line item

  • Material confirmation in ECC based on service confirmation in CRM

    The scenario is Service order & confirmation is in SAP CRM & the billing is in ECC
    The Issue is about material ( spare parts) issue in ECC based on the service confirmation in CRM. In ECC the spare parts are batch managed.
    So to do an automatic goods issue in ECC, we need to enable a BAPI for batch determination.
    Now we are contemplating of doing the goods issue in ECC manually.
    Request you to see if the below scenario works or a better solution is possible
    Can we assign a normal sales order type instead of a debit memo so that delivery of spare parts & then billing can take place.
    The menu path I am talking about is  ( ECC- SPRO- Integration with other mySAP components-CRM-Settings for service processing-billing integration-map transaction types & item categories)

    Hi Madhu G
    I have defined the confirmation profile in Opk0. I know that I can assign a different profile with reference to user.
    I dont want confirmation profile based on Storage location
    I want the confirmation screen to be different for different materials -plant combination. Does anyone have any idea how this can be achieved?
    regards
    PK

  • Production confirmation profile

    Hi;
    We would like to use a different confirmation profile for a single user.  If the user works in multiple areas, we want one area to propose labor hours, and another area to not.  This is set in the confirmation profile... and I know that the confirmation profile is set on the user master record.  Does anyone know how best to get this to be set on some other criteria - preferably on the production order type?

    Hi,
    Q - I want to confirm only with serial number is this not possible in SAP?
    A - Not Possible
    We need to fallow the standard process.
    1) Need to create serial No profile & same need to maintain in material master.
    2) Create the production order or Purchase order depending on the procurement type material master.
    Procurement Type E - In house produce material - Need to create production order. basically production order is the reference to start the priduction after release the production order.
    Procurement Type F - External Procurement - Need to create purchase order.
    3) We consider the production order, created & released.
    4) Confirmation CO11n- Need to enter production order no & opreation. That operation should final & auto GR relevent.
    5) If operation condition is true, then system will allow to create serial no equal to yield quantity. Confirm the serial no & save.
    6) Check MMBE whether selected serial no get created against material or not.
    Rgd,
    Chetan

  • Creation of a Marketing Profile Set based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset thru the WebUI Segment Builder

    Objective: Creation of a Marketing Profile Set based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset thru the WebUI Segment Builder.
    Problems: Standard CRM_MKTTG_BP_BIRTHDATE Infoset DOES NEVER RETURN ANY RESULTS on the segmentation builder of the WebUI client (no matter the filter you specify).
    Other cases:  However if we create a new Data source with data "Extraction from Query" (transaction RS02) based on this standard CRM_MKTTG_BP_BIRTHDATE Infoset and we test the functionality using transaction RSA3, IT DOES RETURN RESULTS (using the same filters as in the segmentation builder)! Of course the segmentation builder works with other attribute lists.
    NEW: IF WE DON’T ESPECIFY ANY SEGMENTATION BASE IN THE PROFILE GROUP, IT DOES RETURN RESULTS!!! (GO TO THE END OF THE DOCUMENT FOR DETAILS)
    Steps followed:
    Review Standard Infoset CRM_MKTTG_BP_BIRTHDATE (Transaction SQ02).Review Data Reading Program code: do we have to change the standard code? We have only remove the "BREAK-POINT" statement.
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset (Transaction CRMD_MKTDS).
    Creation of an Attribute List based on that standard Data source and selection the Birth date as a filter in the Attribute list (Transaction CRMD_MKTDS).
    On the segment builder of the WebUI set any filter (Example: “TODAY”).
    Steps in detail:
    Review Standard Infoset CRM_MKTTG_BP_BIRTHDATE
    SQ02.
    (Image deleted)
    Review Data Reading Program code (Code attached)
    (Image deleted)
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset
    Data source: Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation - Maintain Data Sources and Attribute Lists: CRMD_MKTDS
    Create Data Source
    (Image deleted)
    Infoset: CRM_MKTTG_BP_BIRTHDATE.
    Business Partner Field: CRMT_MKTTG_IS_BIRTHDATE-PARTNER_GUID
    (Image deleted)
    Result:
    (Image deleted)
    Attribute List
    Creation of the Attribute List
    (Image deleted)
    Assign Data Source:
    (Image deleted)
    Selection of the Birth date as a filter in the Attribute list:
    (Image deleted)
    Result:
    (Image deleted)
    Segment builder of the WebUI:
    Access to WebUI with marketing role.
    Create Segment:
    Creation of Profile Set
    Graphical modeler
    Create Filter: We have already tried many different filters (we already seen notes referring to this matter).
    Example1: “today”
    Count target group. Here I would like to stand out that once you click on the “Count” option, immediately it shows 0 results. In other words, it doesn’t process any information. With other attribute lists it takes some time to process, no matter the filter or the attribute list you use. However if we create a new Data source with data "Extraction from Query" (transaction RS02) based on this standard CRM_MKTTG_BP_BIRTHDATE Infoset and we test the functionality using transaction RSA3, IT DOES RETURN RESULTS (with “today” filter and other)! So it seems that the problem has to do with the segment builder, not the Infoset.
    Result: it never return any results no matter the filter you specify.
    Other cases:
    Creation of a new Data source with data "Extraction from Query" where you enter the name of your new query
    Creation of a Data source based on the standard CRM_MKTTG_BP_BIRTHDATE Infoset
    Standard Infoset CRM_MKTTG_BP_BIRTHDATE:
    We fill the form and select “Extraction from Query”:
    Press SAVE and define which fields will be available for selection and which of them will be visible.
    RSA3: Extractor checker in order to test the Data source:
    We specify the Data source:
    IT DOES RETURN RESULTS:
    ALV Grid:
    NEW: It seems that it has to do with the Segmentation Basis selected in the creation of a Profile Set, because if we do not select any, it does return results. But we need to create this Profile Set based on a particular Segmentation Basis called BS Usuarios Registrados.
    Segment builder – Profile Set of the WebUISegmentation Basis: we leave it in blanc.
    Graphical modeler
    Create Filter: We have already tried many different filters (we already seen notes referring to this matter).
    Example1: “today”
    Count target group.
    Result: IT DOES RETURN RESULTS!!! àConclusion: the problem is the Segmentation Basis
    Define Segmentation Basis:
    Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation – Classic Segmentation - Define Segmentation Basis.BS Usuarios Registrados:
    Define Reports for Creating Segmentation Bases
    Transaction: SPRO – Customer Relationship Management - Marketing – Segmentation – Classic Segmentation - Define Reports for Creating Segmentation BasesZMK_UTL_MGR_SITES_UREG
    Define Usage for Segments:
    Transacción: SPRO – Customer Relationship Management - Marketing – Segmentation – General Settings - Define Usage for Segments.ZBS_UR à02 Segmentatión Basis
    Attribute List:Category:
    There is no Category 02 Segmentatión Basis!!! Why?? Why is not posible to select Category 02 Segmentation Basis in the creation of the Attribute List???
    Usage ID
    NEW: It seems that it has to do with the Segmentation Basis selected in the creation of a Profile Set, because if we do not select any, it does return results. But we need to create this Profile Set based on a particular Segmentation Basis called BS Usuarios Registrados. Why is not posible to select Category 02 Segmentation Basis in the creation of the Attribute List???

    It seems that the standard Infoset doesn’t work by itself with Segmentation Basis. Two SAP notes have been applied and a new Field Group has been added to the Infoset (in order to distint the Segmentation Base).
    CRMT_MKTTG_IS_BIRTHDATE-MGRGUID
    1966298: MGR_GUID is not populated correctly to infoset read program
    2007687:Segmentation InfoSet queries saved with incorrect Master Group
    For that reason we had to create a new Infoset based on the standard CRMT_MKTTG_IS_BIRTHDATE, but adding this new Field MGRGUID to the Group Fields.
    Issue solved

  • Invoice Based on Material

    Hi Experts,
    I have a new customer requirement, Customer does not want invoices based on the order They want invoices on monthly basis and based on the material means like they want the invoice for all the orders with material A  for the month of April 2011.
    I tried to search something logical in forum but was not able to find it, any suggestions will be appreciated.
    Regards,
    Jain

    HI
    Better you go for yr customised programme where u can have option to enter material and check delivery table and get all delivery no for that particular material and then do billing and invoice. Take help of your ABAPer give him your requirement with logic for monthly billing and sure he will be able to write a customised programme to fulfill yr requirement.
    In short,  Here is the way..... Get a customised programme where you select all dliveries for a partuicular period by date range,  from delivery table based on material and call VF01 ( as u know billing is based on payer. Payer must be same for all deliveries. U can add to check payer criteria as well with material) and then invoice.
    Have a nice day!
    Thanks
    DK:)
    Edited by: Dwarkesh Thakkar on Jun 24, 2011 12:17 PM

  • Po's based on material created

    hi,
    please help me out in generation of the below report.
    <b>display the PO's based on material created by the user.</b>
    you can send your views on ' [email protected]'.
    thanks in advance.
    -Muraly.

    Hi
    Check this report
    REPORT  ZCOMMITMENT.
    *DATA: ED TYPE F.
    DATA : ED(15) TYPE N .
    TABLES: EKKO, EKBE, EKPO, KONH , KONV ,LFA1 ,ESLL.
    TYPE-POOLS: SLIS.
    DATA: val1  like konh-vakey.
    Data:GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
         G_REPID LIKE SY-REPID,
         G_GRID_TITLE TYPE LVC_TITLE.
    Data:G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
    DATA:G_TABNAME TYPE SLIS_TABNAME VALUE 'ITAB1',
    G_SAVE .
    DATA:GS_VARIANT LIKE DISVARIANT.
    DATA:LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA:GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
         G_SAVE = 'A'.
    DATA: BEGIN OF ITAB OCCURS 10,
              EBELN LIKE EKKO-EBELN,
    *          LIFNR  like p_vendor,
              LIFNR LIKE EKKO-LIFNR,
              NAME1 LIKE LFA1-NAME1,
              NAME2 LIKE LFA1-NAME2,
    *          EBELP LIKE EKBE-EBELP,
              BELNR LIKE EKBE-BELNR,
              VGABE LIKE EKBE-VGABE,
              GJAHR LIKE EKBE-GJAHR,
              KNUMV LIKE EKKO-KNUMV,
              EKORG LIKE EKKO-EKORG,
              BEDAT LIKE EKKO-BEDAT,
    *          VAKEY LIKE KONH-VAKEY,
         END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 10,
              NAME1 LIKE LFA1-NAME1,
              NAME2 LIKE LFA1-NAME2,
              EBELN LIKE EKPO-EBELN,
              LIFNR LIKE EKKO-LIFNR,
              EBELP LIKE EKPO-EBELP,
    *          EBELP LIKE EKBE-EBELP,
              KNUMH LIKE KONH-KNUMH,
              BELNR LIKE EKBE-BELNR,
              MATNR LIKE EKPO-MATNR,
              TXZ01 LIKE EKPO-TXZ01,
              PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
              EXTROW LIKE ESLL-EXTROW,
              SRVPOS LIKE ESLL-SRVPOS,
              KTEXT1 LIKE ESLL-KTEXT1,
              KOSTL LIKE EKKN-KOSTL,
              NETPR LIKE EKPO-NETPR,
              NETWR LIKE EKPO-NETWR,
              ED1  TYPE p decimals 2,
              KBETR2 LIKE KONV-KBETR,
              KBETR1 LIKE KONV-KBETR,
              KBETR LIKE KONV-KBETR,
    *          KBETR3 LIKE KONV-KBETR,
              KWERT LIKE KONV-KWERT, " THIS IS FOR FREIGHT
              KWERT1 LIKE KONV-KWERT, " THIS IS FOR PBXX OR PB00
              KWERT2 LIKE KONV-KWERT, " THIS FOR OTHER CONDITION
              MENGE LIKE EKPO-MENGE,
    *          TOTAL(15) type  .
              TOTAL TYPE p decimals 2,
              VAKEY LIKE KONH-VAKEY,
              WERKS LIKE EKPO-WERKS,
              MWSKZ LIKE EKPO-MWSKZ,
              PACKNO LIKE EKPO-PACKNO,
              KNUMV LIKE KONV-KNUMV,
              SUB_PACKNO LIKE ESLL-SUB_PACKNO,
              GJAHR LIKE RSEG-GJAHR,
          END OF ITAB1.
    DATA: BEGIN OF ITAB2 OCCURS 10,
             EBELN LIKE EKKN-EBELN,
             EBELP LIKE EKKN-EBELP,
             PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
             KOSTL      LIKE EKKN-KOSTL,
          END OF ITAB2.
    data: begin of itab3 occurs 10,
            KNUMH LIKE KONH-KNUMH,
            KSCHL LIKE KONH-KSCHL,
         end of itab3.
    data: begin of itab4 occurs 10,
            KBETR LIKE KONP-KBETR,
          end of itab4.
    data: begin of itab5 occurs 10,
            KPOSN LIKE KONV-KPOSN,
            KNUMV LIKE KONV-KNUMV,
            KSCHL LIKE KONV-KSCHL,
            KBETR LIKE KONV-KBETR,
            KWERT LIKE KONV-KWERT, " THIS IS FOR FREIGHT
    *          KAWRT LIKE KONV-KAWRT,
         end of itab5.
    DATA: BEGIN OF ITAB6 OCCURS 10,
    *          PACKNO LIKE EKPO-PACKNO,
              SUB_PACKNO LIKE ESLL-SUB_PACKNO,
            END OF ITAB6.
    DATA: BEGIN OF ITAB7 OCCURS 10,
           BELNR LIKE RSEG-BELNR,
           GJAHR LIKE RSEG-GJAHR,
    END OF ITAB7.
    DATA: BEGIN OF ITAB8 OCCURS 10,
           SUB_PACKNO LIKE ESLL-SUB_PACKNO,
           SRVPOS LIKE ESLL-SRVPOS,
           EXTROW LIKE ESLL-EXTROW,
           KTEXT1 LIKE ESLL-KTEXT1,
    END OF ITAB8.
    *selection-screen
    *SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *SELECTION-SCREEN SKIP 2.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-002.
    **SELECT-OPTIONS: s_lifnr FOR ekko-lifnr.
    *PARAMETERS:p_lifnr LIKE ekko-lifnr obligatory.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM get_data.
    *  PERFORM field_catalog.
    *  PERFORM display_data.
    END-OF-SELECTION.
    **&      Form  display_data
    **       text
    *FORM display_data.
    *data: new(15) TYPE N.
    *  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    *    EXPORTING
    *      i_callback_program = sy-repid
    *      it_fieldcat        = int_cat[]
    *    TABLES
    *      t_outtab           = int_out
    *    EXCEPTIONS
    *      program_error      = 1
    *      OTHERS             = 2.
    *ENDFORM.                    "display_data
    PERFORM GET_DATA.
    PERFORM CALL_ALV_GRID.
    FORM CALL_ALV_GRID.
    PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM                = G_repid
          I_CALLBACK_USER_COMMAND           = G_USER_COMMAND
          I_GRID_TITLE                      = G_GRID_TITLE
          IT_FIELDCAT                       = GT_FIELDCAT[]
          I_DEFAULT                         = 'X'
          I_SAVE                            =  G_SAVE
          IS_VARIANT                        =  Gs_VARIANT
        TABLES
          T_OUTTAB                          = ITAB1.
    ENDFORM.
    FORM FIELDCAT_INIT
           USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-seltext_l     = 'Vendo No'.
      LS_FIELDCAT-FIELDNAME     = 'LIFNR'.
      LS_FIELDCAT-REF_FIELDNAME = 'LIFNR'.
      LS_FIELDCAT-REF_TABNAME   = 'EKKO'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L  = 'Vendor Name'.
      LS_FIELDCAT-FIELDNAME     = 'NAME1'.
      LS_FIELDCAT-REF_FIELDNAME = 'NAME1'.
      LS_FIELDCAT-REF_TABNAME   = 'LFA1'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    * CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-FIELDNAME     = 'NAME2'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'NAME2'.
    *  LS_FIELDCAT-REF_TABNAME   = 'LFA1'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-seltext_l   = 'Purchase Document No'.
      LS_FIELDCAT-FIELDNAME     = 'EBELN'.
      LS_FIELDCAT-REF_FIELDNAME = 'EBELN'.
      LS_FIELDCAT-REF_TABNAME   = 'EKKO'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *  CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-FIELDNAME     = 'VGABE'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'VGABE'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKBE'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L     = 'Item No'.
      LS_FIELDCAT-FIELDNAME     = 'EBELP'.
      LS_FIELDCAT-REF_FIELDNAME = 'EBELP'.
      LS_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *  CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-FIELDNAME     = 'BELNR'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'BELNR'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKBE'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L     = 'Document Con'.
      LS_FIELDCAT-FIELDNAME     = 'KNUMH'.
      LS_FIELDCAT-REF_FIELDNAME = 'KNUMH'.
      LS_FIELDCAT-REF_TABNAME   = 'KONH'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L = 'Service/Material No'.
    *  LS_FIELDCAT-FIELDNAME     = 'MATNR'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'MATNR'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKPO'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L = 'Service / Material description' .
    *  LS_FIELDCAT-FIELDNAME     = 'TXZ01'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'TXZ01'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKPO'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L =  'WBS Element' .
    *  LS_FIELDCAT-FIELDNAME     = 'PS_PSP_PNR'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'PS_PSP_PNR'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKKN'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L =  'Serial Number' .
    *  LS_FIELDCAT-FIELDNAME     = 'EXTROW'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'PACKNO'.
    *  LS_FIELDCAT-REF_TABNAME   = 'ESLL'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *  CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L =  'Service Number' .
    *  LS_FIELDCAT-FIELDNAME     = 'SRVPOS'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'SRVPOS'.
    *  LS_FIELDCAT-REF_TABNAME   = 'ESLL'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L =  'Dscription' .
    *  LS_FIELDCAT-FIELDNAME     = 'KTEXT1'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'KTEXT1'.
    *  LS_FIELDCAT-REF_TABNAME   = 'ESLL'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *   CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *    LS_FIELDCAT-SELTEXT_L = 'Cost Center'.
    *  LS_FIELDCAT-FIELDNAME     = 'KOSTL'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'KOSTL'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKKN'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-FIELDNAME     = 'NETWR'.
      LS_FIELDCAT-FIELDNAME     = 'NETPR'.
      LS_FIELDCAT-reptext_ddic = 'Basic'.
    *  LS_FIELDCAT-SELTEXT_L    = 'Basic'.
       LS_FIELDCAT-REF_FIELDNAME = 'NETPR'.
      LS_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-FIELDNAME     = 'NETWR'.
    *  LS_FIELDCAT-FIELDNAME     = 'NETPR'.
    *  LS_FIELDCAT-reptext_ddic = ''.
    *  LS_FIELDCAT-SELTEXT_L    = 'Basic'.
       LS_FIELDCAT-REF_FIELDNAME = 'NETWR'.
      LS_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
        LS_FIELDCAT-SELTEXT_L = 'Excise'.
      LS_FIELDCAT-FIELDNAME     = 'ED1'.
      LS_FIELDCAT-REF_FIELDNAME = 'ED1'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKKN'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
       CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L = 'Insurance'.
      LS_FIELDCAT-FIELDNAME     = 'KBETR2'.
        LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
      LS_FIELDCAT-REF_TABNAME   = 'KONV'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L     = 'Frieght'.
      LS_FIELDCAT-FIELDNAME     = 'KWERT'.
      LS_FIELDCAT-REF_FIELDNAME = 'KWERT'.
      LS_FIELDCAT-REF_TABNAME   = 'KONV'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    * CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L     = '' .
    *  LS_FIELDCAT-FIELDNAME     = 'KBETR1'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
    *  LS_FIELDCAT-REF_TABNAME   = 'KONV'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    *CLEAR LS_FIELDCAT.
    *  LS_FIELDCAT-TABNAME       = G_TABNAME.
    *  LS_FIELDCAT-SELTEXT_L     = 'PBXX'.
    *  LS_FIELDCAT-FIELDNAME     = 'KWERT1'.
    *  LS_FIELDCAT-REF_FIELDNAME = 'KWERT'.
    *  LS_FIELDCAT-REF_TABNAME   = 'KONV'.
    *  APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L     = 'VAT/ST '.
      LS_FIELDCAT-FIELDNAME     = 'KBETR'.
      LS_FIELDCAT-REF_FIELDNAME = "KBETR".
      LS_FIELDCAT-REF_TABNAME   = 'KONV'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L     = 'OTHER '.
      LS_FIELDCAT-FIELDNAME     = 'KWERT2'.
      LS_FIELDCAT-REF_FIELDNAME = "KWERT".
      LS_FIELDCAT-REF_TABNAME   = 'KONV'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-SELTEXT_L = 'TOTAL'.
      LS_FIELDCAT-FIELDNAME     = 'TOTAL'.
      LS_FIELDCAT-REF_FIELDNAME = 'TOTAL'.
    *  LS_FIELDCAT-REF_TABNAME   = 'EKKN'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
       ENDFORM.                    " FIELDCAT_INIT
       FORM GET_DATA.
       SELECT  A~EBELN A~LIFNR  A~EKORG A~KNUMV B~VGABE  B~GJAHR B~BELNR
               L~NAME1 L~NAME2
            FROM  EKKO AS A
                          INNER JOIN EKBE  AS B ON  B~EBELN = A~EBELN
                          INNER JOIN LFA1 AS L ON L~LIFNR = A~LIFNR
                          INTO  CORRESPONDING
                          FIELDS OF TABLE ITAB.
    *                      WHERE B~VGABE = '2'.
    SELECT EKPO~EBELN EKPO~EBELP EKPO~MATNR EKPO~TXZ01 EKPO~WERKS
              EKPO~NETWR EKPO~MENGE EKPO~MWSKZ  EKPO~NETPR EKPO~PACKNO
              FROM EKPO
                        INTO CORRESPONDING FIELDS OF TABLE ITAB1
                        FOR ALL ENTRIES IN ITAB
                        WHERE EKPO~EBELN = ITAB-EBELN and
                              EKPO~BUKRS = 'GSPL'.
       SELECT EKKN~EBELN EKKN~EBELP EKKN~KOSTL EKKN~PS_PSP_PNR
          FROM EKKN
                   INTO CORRESPONDING FIELDS OF TABLE ITAB2
                   FOR ALL ENTRIES IN ITAB1
                   WHERE EKKN~EBELN = ITAB1-EBELN  AND
                         EKKN~EBELP = ITAB1-EBELP.
       SELECT KONV~KNUMV KONV~KSCHL KONV~KBETR KONV~KWERT KONV~KWERT
                  KONV~KPOSN
          FROM KONV
              INTO CORRESPONDING FIELDS OF TABLE ITAB5
              WHERE KONV~KNUMV =   ITAB1-KNUMV AND
                    KONV~KPOSN = ITAB1-EBELP.
    *    SELECT LFA1~NAME1 LFA1~NAME2 FROM LFA1
    *    INTO CORRESPONDING FIELDS OF TABLE ITAB1
    *    WHERE  LFA1~LIFNR = ITAB-LIFNR.
    *  SELECT ESLL~SUB_PACKNO ESLL~SRVPOS
    *           ESLL~EXTROW  ESLL~KTEXT1 FROM ESLL
    *       INTO CORRESPONDING FIELDS OF TABLE ITAB6
    *       FOR ALL ENTRIES IN ITAB1
    *       WHERE ESLL~PACKNO = ITAB1-PACKNO .
    **         SELECT ESLL~SUB_PACKNO FROM ESLL
    **       INTO CORRESPONDING FIELDS OF TABLE ITAB6
    **       FOR ALL ENTRIES IN ITAB1
    **       WHERE ESLL~PACKNO = ITAB1-PACKNO.
    *        SELECT ESLL~SUB_PACKNO ESLL~SRVPOS
    *           ESLL~EXTROW  ESLL~KTEXT1 FROM ESLL
    *       INTO CORRESPONDING FIELDS OF TABLE ITAB8
    *       FOR ALL ENTRIES IN ITAB6
    *       WHERE ESLL~PACKNO = ITAB6-SUB_PACKNO .
    * SELECT RSEG~BELNR RSEG~GJAHR FROM RSEG
    *        INTO CORRESPONDING FIELDS OF TABLE  ITAB7
    *        FOR ALL ENTRIES IN ITAB
    *        WHERE RSEG~BELNR = ITAB-BELNR AND
    *              RSEG~GJAHR = ITAB-GJAHR.
    *LOOP AT ITAB1.
    LOOP AT ITAB.
                  READ TABLE ITAB1 WITH KEY EBELN = ITAB-EBELN.
    *         IF ITAB1-EBELN = ITAB-EBELN.
                    IF sy-subrc eq 0.
    *                          ITAB1-EBELN = ITAB-EBELN.
                              ITAB1-LIFNR = ITAB-LIFNR.
    *                          ITAB1-EBELP = ITAB-EBELP.
                              ITAB1-BELNR = ITAB-BELNR.
                              ITAB1-KNUMV = ITAB-KNUMV.
                              ITAB1-NAME1  = ITAB-NAME1.
                              ITAB-NAME2 = ITAB-NAME2.
                              ITAB1-GJAHR = ITAB-GJAHR.
                    modify itab1 index   sy-tabix.
            ENDIF.
    ENDLOOP.
    *LOOP AT ITAB2.
    *         READ TABLE ITAB1 WITH KEY EBELN = ITAB2-EBELN.
    *          IF sy-subrc eq 0.
    *              ITAB1-EBELN = ITAB2-EBELN.
    *              ITAB1-PS_PSP_PNR = ITAB2-PS_PSP_PNR.
    *              ITAB1-KOSTL = ITAB2-KOSTL.
    *               modify itab1 transporting ps_psp_pnr kostl
    *               where ebeln = Itab2-ebeln AND EBELP = ITAB2-EBELP.
    *          ENDIF.
    *ENDLOOP.
    LOOP AT ITAB1.
    **ON CHANGE OF   ITAB1-ebeln or itab1-ebelp.
    *     concatenate itab1-werks itab1-lifnr itab1-matnr
    *         into val1.
    *   MOVE VAL1 TO ITAB1-VAKEY.
    *   MODIFY ITAB1.
    *    SELECT KONH~KNUMH KONH~KSCHL FROM KONH
    *        INTO  CORRESPONDING FIELDS OF TABLE ITAB3
    *        FOR ALL ENTRIES IN ITAB1
    *        WHERE KONH~VAKEY = ITAB1-VAKEY.
    **endon.
    **        sort Itab3 by kschl descending.
    **        Select konp-kbetr  from konp into itab4 where
    **        KONP~KNUMH = ITAB3-KNUMH AND KONP~KSCHL = ITAB3-KSCHL.
    **ON CHANGE OF  ITAB1-ebelp.
    **LOOP AT ITAB3
    **  ON CHANGE OF  ITAB1-ebelp.
    *              itab1-knumh = itab3-knumh.
    **              SELECT  KONP~KBETR FROM KONP INTO CORRESPONDING FIELDS
    **              OF  TABLE  ITAB4
    **              FOR ALL ENTRIES IN ITAB3   WHERE
    **              KONP~KNUMH = ITAB3-KNUMH AND KONP~KSCHL = ITAB3-KSCHL .
    **              IF ITAB3-KSCHL = 'JMOP' .
    **               ED = ITAB4-KBETR / 1000 * ITAB1-NETWR .
    **              ENDIF.
    **             IF ITAB3-KSCHL = 'JEC1'.
    **              Itab1-ed1 = ITAB4-KBETR / 1000 * ED.
    **              ADD ED TO ITAB1-ED1.
    **             modify  ITAB1 transporting ed1.
    **             ENDIF.
    *              IF ITAB3-KSCHL = 'JMOP' .
    *               ED = 16 / 100 * ITAB1-NETWR .
    *              ENDIF.
    *             IF ITAB3-KSCHL = 'JEC1'.
    *              Itab1-ed1 = 2 / 100 * ED.
    *              ADD ED TO ITAB1-ED1.
    *             modify  ITAB1 transporting ed1.
    *             ENDIF.
    **        ENDLOOP.
    **endon.
    modify  ITAB1.
    *endon.
      LOOP AT ITAB5.
         IF ITAB5-KSCHL = 'NAVS' OR ITAB5-KSCHL = 'NAVM'.
                ITAB1-KBETR = ITAB5-KBETR.
                 modify  ITAB1 transporting KBETR
                 where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP .
               ELSEIF ITAB5-KSCHL = 'FRA1' OR ITAB5-KSCHL = 'FRC1' OR
                    ITAB5-KSCHL = 'FRB1'.
                       ITAB1-KWERT = ITAB5-KWERT .
                       modify  ITAB1 transporting KWERT
                       where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    *               IF ITAB5-KSCHL = 'FRA1'.
    *                    ITAB1-KBETR1 = ITAB5-KBETR / 1000 * ITAB1-NETWR .
    *                   modify  ITAB1 transporting KBETR1
    *                   where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    *                 ELSEIF ITAB5-KSCHL = 'FRC1' .
    *                   ITAB1-KBETR1 = ITAB5-KBETR * ITAB1-MENGE .
    *                   modify  ITAB1 transporting KBETR1
    *                   where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    *                 ELSEIF ITAB5-KSCHL = 'FRB1' .
    *                    ITAB1-KBETR1 = ITAB5-KBETR .
    *                   modify  ITAB1 transporting KBETR1
    *                   where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    *              ENDIF.
    *           **THIS  CODE IS FOR iNSURANCE  CONDITION
               ELSEIF ITAB5-KSCHL = 'ZGIN' OR ITAB5-KSCHL = 'ZIN2'.
                       ITAB1-KBETR2 = ITAB5-KBETR.
                       modify  ITAB1 transporting KBETR2
                       where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    *           **THIS  CODE IS FOR PBXX OR PB00  CONDITION
    *          ELSEIF ITAB5-KSCHL = 'PBXX' OR ITAB5-KSCHL = 'PB00'.
    *                   ITAB1-KWERT1 = ITAB5-KWERT1.
    *                   modify  ITAB1 transporting KWERT1
    *                   where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
    **          ELSEIF ITAB5-KSCHL = 'JOCM' OR ITAB5-KSCHL = 'RA00' OR
    **                 ITAB5-KSCHL = 'RA01' OR ITAB5-KSCHL = 'RB00' OR
    **                 ITAB5-KSCHL = 'RC00' OR
    **THIS  CODE IS FOR OTHER CONDITION
               ELSEIF ITAB5-KSCHL = 'RL01' OR ITAB5-KSCHL = 'ZA00' OR
                     ITAB5-KSCHL = 'ZA01' OR ITAB5-KSCHL = 'ZAE1' OR
                     ITAB5-KSCHL = 'ZAED' OR
                     ITAB5-KSCHL = 'ZAFR' OR ITAB5-KSCHL = 'ZB00' OR
                     ITAB5-KSCHL = 'ZBCH' OR ITAB5-KSCHL = 'ZBED' OR
                     ITAB5-KSCHL = 'ZC00' OR
                     ITAB5-KSCHL = 'ZCEX' OR ITAB5-KSCHL = 'ZCIF' OR
                     ITAB5-KSCHL = 'ZHC1' OR ITAB5-KSCHL = 'ZHC2' OR
                     ITAB5-KSCHL = 'ZHCT' OR
                     ITAB5-KSCHL = 'ZHCV' OR ITAB5-KSCHL = 'ZJOC' OR
                     ITAB5-KSCHL = 'ZOTH' OR ITAB5-KSCHL = 'ZOTP' OR
                     ITAB5-KSCHL = 'ZOTT' OR
                     ITAB5-KSCHL = 'ZPK1' OR ITAB5-KSCHL = 'ZPK2' OR
                     ITAB5-KSCHL = 'ZPK3' OR ITAB5-KSCHL = 'ZPK4' OR
                     ITAB5-KSCHL = 'ZRPO' OR
                     ITAB5-KSCHL = 'ZSE1' OR ITAB5-KSCHL = 'ZSED' OR
                     ITAB5-KSCHL = 'ZSFR' OR ITAB5-KSCHL = 'ZSTX' OR
                     ITAB5-KSCHL = 'ZTPI' OR
                     ITAB5-KSCHL = 'ZTPV' OR ITAB5-KSCHL = 'ZTRD' OR
                     ITAB5-KSCHL = 'ZWCT'.
                       ITAB1-KWERT2 = ITAB5-KWERT.
                       modify  ITAB1 transporting KWERT2
                       where  KNUMV =  ITAB1-KNUMV AND EBELP = ITAB1-EBELP
              modify itab1.
           ENDIF.
    ENDLOOP .
    ITAB1-TOTAL = ITAB1-NETWR + ITAB1-KWERT2 + ITAB1-KWERT + ITAB1-KBETR.
    *              ITAB1-TOTAL = ITAB1-NETWR + ITAB1-ED1 + ITAB1-KBETR2 +
    *                     ITAB1-KBETR1 + ITAB1-KBETR + ITAB1-KWERT   .
                     modify  ITAB1 transporting TOTAL.
    LOOP AT ITAB6.
              ITAB1-SUB_PACKNO = ITAB6-SUB_PACKNO.
    *           modify  ITAB1.
    ENDLOOP.
    LOOP AT ITAB7.
            ITAB1-BELNR = ITAB7-BELNR.
            ITAB1-GJAHR = ITAB7-GJAHR.
      ENDLOOP.
    LOOP AT ITAB8.
              ITAB1-SUB_PACKNO = ITAB8-SUB_PACKNO.
              ITAB1-SRVPOS  = ITAB8-SRVPOS.
              ITAB1-EXTROW = ITAB8-EXTROW.
              ITAB1-KTEXT1 = ITAB8-KTEXT1.
              modify  ITAB1.
    ENDLOOP.
    * SELECT ESLL~PACKNO ESLL~SUB_PACKNO ESLL~SRVPOS ESLL~KTEXT1
    *          FROM ESLL
    *          INTO CORRESPONDING FIELDS OF TABLE ITAB6
    *          WHERE ESLL~PACKNO = ITAB1-PACKNO.
    ** delete  adjacent  duplicates  from itab1 comparing EBELN .
    modify  ITAB1.
    endloop.
    sort Itab1 by EBELN Ascending.
            SELECT KONV~KBETR FROM KONV
            INTO ITAB1-KBETR
            WHERE KONV~KSCHL =  'NAVS' OR KONV~KSCHL = 'NAVM'.
            ENDSELECT.
            ITAB1-KBETR = ITAB5-KBETR.
    *ENDLOOP.
    *ENDLOOP.
    *ENDLOOP.
    ENDFORM.
    Reward all helpfull answers
    Regards
    Pavan

  • How to get ATINN value based on material number and Class Type ?

    I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
    However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
    So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
    -Obtain the batch characterstic value for the Material******************
      SELECT atwrt
        UP TO 1 ROWS
        INTO v_charvalue
        FROM ausp
       WHERE objek = mcha-matnr
         AND atinn = '0000000381'   " 'US80_FRENCH_ON_LABEL'
         AND klart = '001'.
    THANKS N ADVANCE.

    Hi SAm,
    use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            classtype          = '023'       "Class type
            object             = w_object  "Material number with Leading zeros
            no_value_descript  = 'X'      "Default X
            objecttable        = 'MCH1'    "Table name Mara or MCH1 or MARC
          TABLES
            t_class            = t_class   "It return the Batch class available for the above combination
            t_objectdata       = t_char  "Return Batch characteristics(ATWRT) and their value ATINN in this table
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.
    Regards,
    Prabhudas

  • Pricing based on Material Master Classification

    Hi Guru's,
    Can we have a pricing based on material master classification.
    Scenario: Material can have few characteristic. If we select few of the classification, this should influence pricing.
    Any idea on this, has anybody worked on this before?
    Thanks,
    Anil

    I am not sure about classification, might work with Variant Config.
    Alternatively, you can use split valuation if you don't have many characteristics.
    Hope this helps-

  • Sales Order Incompletion log - Serial Number profile is missing for materia

    The sales order is incomplete with missing data = No. serial numbers
    System gives an information saying "Serial number profile is missing for material".
    Message no. V1192
    I maintained a serial no. profile for the material in "Work scheduling" view.  But still the document is incomplete.
    Please let me know how to make this document complete.
    Thanks,
    Shankar

    Hi,
    Goto the Sales document in VA02  ->Edit-> incompletion log.
    It will show the data which should be filled, select that and click on the COMPLETE DATA tab and it will lead to the field in which the data should be entered.
    Please do like that and save it
    then once again check the EIT-->INCOMPLETION LOG
    if the document is complete save it
    rgards,
    santosh

  • Regarding new confirmation profile

    Dear Experts,
    have created new confirmation profile(SAP001) through OPK0 and created all detail areas as required.but now i am facing following problems.
    1. I am not getting the message "Activities are recalculated due to quantity change (please note)" when i change
    Yield to conf quantity.
    2. Activities like POWER ext. are not reinitilizing as per Yield to conf quantity.
    Earlier it was working..
    Thanks&Regards
    rvyas

    Dear,
    Go to  OPK4 tab operation indiv entry make sure that qty and service all tick to be marked make sure that if the quty is changed the actvities are also changed. And in  OPK0 select your profile and go to detail in Default tab select the option immediate proposal for quants and services.
    Regards,
    R.Brahmankar

  • Select query in materialized view with two dblinks

    Hi All,
    We have oracle 10g On windows.
    We are trying to create materialized view. Scenario is we have base table on other database and we are creating mview on different database.
    Basa database have two schema's and i am selecting records from that two schema's using two private db links.
    But when i am tryin gto create mview its not getting created. After 15 hrs. its still showing creation command and not finished.
    Query is :-
    Is it good practice to have two db links in select query of materialized view.

    Billy  Verreynne  wrote:
    Chanchal Wankhade wrote:
    Is it good practice to have two db links in select query of materialized view.Same db link being used twice, or two different db links?
    If the former, you ideally want the local Oracle db to send the join to the remote database, and for the remote database to drive the join between those 2 tables. There is a hint (<i>driving_site</i>) that can be used - or the join query can be defined on the remote database as a view, and the local materialised view can then use that remote view.
    If you have 2 different db links and joining across these - usually a bad idea to perform distributed database joins. There are lots of limitations as to how the tables can be joined. Worse case, full table scans of both remote tables, pulling all the rows from the 2 remote database tables to the local database, and joining these on the local database.
    I have seen some severe performance issues in the past as a result of distributed joins. I'll rather use 2 materialised views for pulling both distributed tables's data locally, and then do the join on local data (using indexes, partition pruning, etc)Hi Billy,
    My scenario is i have two database database A and database B. Database A is having two schema's SCOTT AND HR. SCOTT schema have select privileges on HR schema.
    DB LINK is between Database B to Database A. name is db.link.B.A.oracle.com.
    What if i priovide while creating materialized view, the schema name before the table name in database B for this particuler table so it will pick up the table from that schema using same DB LINK(db.link.B.A.oracle.com.) that i am using to fetch records from SCOTT schema.
    Above schnario is like two base schema's and one db link using two schema.

  • How do I handle my Final SELECT based on a @ReportType Run Parameter

    So I have multiple CTEs in my SQL...
    WITH CTE_1 AS
    (SELECT...)
    CTE_2 AS
    (SELECT...)
    CTE_3 AS
    (SELECT...)
    My Final SELECT then will be based on my CTE drill-downs and the filtering will be based on the @ReportType that will be chosen within SSRS and Report Manager. How can I handle the varying portions of my FINAL SELECT based on @ReportType? Do I have to do
    this via dynamic SQL? I know that dynamic SQL is frowned upon. So this is what I'm talking about...
    SELECT ...
    CASE WHEN @ReportType = 'Renewal People'
    THEN INNER JOIN...
    WHEN @ReportType = 'New People'
    THEN NOT IN (SELECT...)
    END
    CASE WHEN @ReportType = 'Renewal People'
    THEN WHERE...
    WHEN @ReportType = 'New People'
    THEN WHERE...
    END

    > I know that dynamic SQL is frowned upon.
    That depends. I love (*) dynamic SQL for one thing:
    http://www.sqlusa.com/bestpractices/dynamicsql/
    Second, there are many things you cannot in static SQL:
    http://www.sqlusa.com/bestpractices2008/rebuild-all-indexes/
    * First choice is static SQL always.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Maybe you are looking for