PP Table Combination

Dear All,
We are maintaining price based on Batch & material but system is not allowing to maintain Cond Record based on Batch & Material. Can't we maintain 2 fields from Line Item in the pricing Table, e.g. Batch & Material?
Thanks in advance.

Hi
Check tables:
MCHA(Batches),
MCHB (Batch Stock ),
MSEG(Document Segment: Material).
I hope this will help you.

Similar Messages

  • Table Combination for SERIALNO Field - 101 Document No

    Dear friends,
           Kindly provide us a table link for the Feild SERIALNO for the given 101 Documentno(MBLNR). The serialNo can be viewed in Migo T.code. Also, Provide us with a Primary Field combination table or FM to Fetch the data for a report.
    Thanks in Advance.
    Moderator message: please do more research before asking, show what you have done when posting.
    Edited by: Thomas Zloch on Feb 14, 2012

    Try this one:
    SELECT T1.CardCode Customer, T1.CardName 'Customer Name', Case T0.InvType WHEN '13' THEN 'INVOICE' WHEN '14' THEN 'CR Memo' END AS 'TYPE', T0.DocEntry AS 'Invoice/CR#', T1.DocCurr AS 'BY',Case WHEN T1.DocCurr = '$' THEN T0.SumApplied ELSE T0.AppliedFC END AS 'Paid Amount', CASE WHEN T1.CashSum > 0 THEN 'Cash' WHEN T1.CreditSum > 0 THEN 'CC' WHEN T1.TrsfrSum > 0 THEN 'WIRE' ELSE 'Check' END AS 'Method', T1.DocNum AS 'RC#', T1.DocDate AS 'Posted' 
    FROM dbo.ORCT T1   INNER JOIN dbo.RCT2 T0 ON T1.DocNum = T0.DocNum  WHERE Month(T1.DocDate) = Month(GetDate()) AND Year(T1.DocDate) = Year(GetDate()) AND T1.JrnlMemo != 'Cancelled' AND T1.NoDocSumSy > 0.02
    Thanks,
    Gordon

  • Sorting table combine with Assending n DESCENDING  value

    Dear All ...
    i want to sort by table  with some field.  which some of the field in assending  n some in desending.
    example: this my table itab .
                 1.1.09       a            H 
                 1.1.09       c            H
                 1.1.09       c           S
                 1.1.09       a           S
    after sort  become
               1.1.09       a          S   
               1.1.09       a          H   
               1.1.09       c          S   
               1.1.09       c         H   
    from above sample ....... 1st n 2nd value is sort in assending , but 3th sort in desending ....
    any idea ?

    Hi,
    Try this,
    DATA: BEGIN OF itab OCCURS 0,
            f1(15) TYPE c,
            f2(15) TYPE c,
            f3(15) TYPE c,
          END OF itab.
    itab-f1 = 1.
    itab-f2 = 'a'.
    itab-f3 = 'H'.
    APPEND itab.
    itab-f1 = 1.
    itab-f2 = 'c'.
    itab-f3 = 'H'.
    APPEND itab.
    itab-f1 = 1.
    itab-f2 = 'c'.
    itab-f3 = 'S'.
    APPEND itab.
    itab-f1 = 1.
    itab-f2 = 'a'.
    itab-f3 = 'S'.
    APPEND itab.
    SORT itab by f1 f2 f3 DESCENDING.
    LOOP AT itab.
      WRITE:/ itab-f1, itab-f2, itab-f3.
    ENDLOOP.

  • Master/Detail? Repeating Tables - Combine data from 2 repeating tables to one cell in sharepoint

    Hi there, new to infopath.  I have 2 sections in my form which are hidden and display based on the department selected.  So Department A versus Department B, a section opens for details pertaining to that Department.  So in each
    section I have similar information requirements, similar but not exactly the same.  Now I was able to create hidden fields that will concat the values from both sections in the instances of similar data (i.e. Name, Department location, etc, so if Department
    A fills in Name on their section, then someone else submits the same form for Department B I still have one column of metadata in SP to displace the Name regardless of department or section they filled data into). However now I am stuck, I have repeating
    tables in both sections and I want to concate the entries to output to the sharepoint list for that cell.  However everything I have tried so far only concats the 1st value in the repeating table.  Is there a way to take ALL of the data from
    two repeating tables and merge them into one column/cell in sharepoint (metadata for the one form entry)???  I want to avoid having to create a excessive "views" of a list in order to accomodate the needs for BOTH departments.  I hope
    this is clear.  Thanks for your help!
    from msn forum

    Hi Meera,
        I apologise for delay. Anyways you can goto the
    following link:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36f08758-0a01-0010-c291-c03004aeb1af
    for details.
    Hope this will clear you. However, you further require
    any more information then please feel free to mail.
    Note:
    ty_t_sender, cl_abap_char_utilities DEFINITION LOAD
    all these are present in alsmex function group if you
    place your function module in this function group then
    you'll be able to access these things. Further, like
    if you have security options and can't place your code
    in this function group then create your own function
    group in your own package and copy the contents from
    alsmex function group.
        Hope that answer your questions.
    Regards,
    Mirza Ifthekhar Baig.

  • Combining two tables into one result

    Hi all, I am fairly inexperienced with Crystal but have gained good results from the reports I have created, I am fluent in SQL and Basic to an extent.  I am interigating a Pronto database and I want concatenate two tables into one report.
    Table One: Customer Orders
    Fields:  Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
    Table Two: Archived Customer Orders
    Fields:  Customer No, Invoice Number, Invoice date, Invoice Amount, Cost Amount.
    I want to complete a report that will tell me the sales for a given period and the outstanding orders for each customer total for all fields in each table combined into one figure.
    Any help would be greatly appreciated.
    Thanks in advance

    Hi Grant,
    As you said you are goot at writing SQL, in Crystal write a SQL statement in Add Command to join both table using Union / Union all
    If you use Union then it will filter duplicate records and pull the data from database, If you use Union All then it will include all your duplicate records.  Please use Union / Union All as required.
    Once you get all data into the report create a parameter for date range and generate the summaries as required.
    Thanks,
    Sastry

  • Strategy in Data Warehouse Table Structure

    I'm building a relational data warehouse, and there are two approaches that seem almost interchangeable to me, despite being quite different from each other. 
    The first approach is rather simple.  I have a "User" table with a bunch of foreign keys, and then I have a bunch of other tables containing user attributes.  One table for "department," another for "payroll type,"
    another for "primary location," and so on for 20 different user attributes.
    The second approach, instead of using 20+ tables, combines this down into far fewer.  I would have an "Attribute Type" table and "Attribute" table.  These two, in conjunction with a bridge table, could accommodate as many
    attributes as necessary within three tables.  If the business wants to track a new "user-related" attribute, I don't need any new tables.  I would simply add the new attribute into the "Attribute Type" table as, say, "attribute
    21," and begin tracking it.  All the work could be done without ever adding new tables or columns.
    Both approaches seem to maintain (at least) 3NF.  Is one approach better in certain circumstances, and the other approach more appropriate at other times?  Any insight is appreciated!
    BrainE

    Hi Brian,
    The second approach with three tables is not really good here. Query Optimizer in SQL Server has a few enhancements for Star/Snowflake schemas in DW environment and 3-table schema would not be able to benefit from them. It would be also harder to maintain,
    load data and query. Finally, your attributes could have different data types, which you need to store. 
    I would suggest to go with first solution (multiple dimensions table) and follow a few extra rules:
    Avoid nullable attributes
    Choose attribute data types as narrow as possible
    Avoid string attributes. If needed create separate dimension tables for them
    Use columnstore indexes and
    Upgrade to SQL Server 2014 if it is all possible - there are multiple enhancementsin batch-mode processing there
    Thank you!
    Dmitri V. Korotkevitch (MVP, MCM, MCPD)
    My blog: http://aboutsqlserver.com

  • Why we use Cluster Tables in SAP Hr

    hai friends, i am new to  ABAP-HR and SAP HR, Actually i am core abaper ( working on SD, MM and Fi Modules ) , can any one explain me why and what is the use of Cluster tables in SAP HR, why we use in SAP HR function Module ?
    Thnx in advance
    Vijaya

    Hi Vijaya,
    This may help for ur question..
    Why cluster table:
    Cluster tables combine the data from several tables with identical (or almost identical) keys into one physical record on the database.
    Data is written to a database in compressed form.
    Retrieval of data is very fast if the primary key is known.
    Cluster tables are defined in the data dictionary as transparent tables.
    External programs can NOT interpret the data in a cluster table.
    Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE  FROM DATABASE are used to process data in the cluster tables.
    PCL1 - Database for HR work area; (long text, etc)
    PCL2 - Accounting Results (time, travel expense and payroll); (payroll results)
    PCL3 - Applicant tracking data;
    PCL4 - Documents, Payroll year-end Tax data (change logs, etc)

  • How to improve performance by pulling data instead of BSEG table?

    Hi,
    We are facing issue in which we have to pull material no for some non copa postings.
    But if we use BSEG table then serious performance issues are coming up..
    so are there any other tables / combination of tables that we can look for instead of BSEG?

    Hi,
    BSEG is Cluster table, you can only select with key fields.
    if you have a select:
    select belnr budat wrbtr from bseg
              into table it_bseg
               where bukrs = bukrs
                   and belnr = belnr
                   and gjahr = gjahr
                   and bschl = 31.
    it's much better to select of this way:
    select belnr budat wrbtr from bseg
              into table it_bseg
               where bukrs = bukrs
                   and belnr = belnr
                   and gjahr = gjahr.
    delete it_bseg where bschl ne '31'.
    Regards,
    Fernando

  • HR Cluster Tables

    Hi
    I need the HR cluster table names. Can you please provide?
    Regards
    Praveen

    hi praveen,
                    go through this
    Cluster Table
    u2022 Cluster tables combine the data from several tables with identical (or almost identical) keys
      into one physical record on the database.
    . Data is written to a database in compressed form.
    u2022 Retrieval of data is very fast if the primary key is known.
    u2022 Cluster tables are defined in the data dictionary as transparent tables.
    u2022 External programs can NOT interpret the data in a cluster table.
    u2022 Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE
      FROM DATABASE are used to process data in the cluster tables.
    PCL1 - Database for HR work area;
    PCL2 - Accounting Results (time, travel expense and payroll);
    PCL3 - Applicant tracking data;
    PCL4 - Documents, Payroll year-end Tax data
    Database Tables PCLn
    u2022 PCLn database tables are divided into subareas known as data clusters.
    u2022 Data Clusters are identified by a two-character code. e.g RU for US payroll result, B2 for
      time evaluation result...
    u2022 Each HR subarea has its own cluster.
    u2022 Each subarea has its own key.
    Database Table PCL1
    u2022 The database table PCL1 contains the following data areas:
      B1 time events/PDC
      G1 group incentive wages
      L1 individual incentive wages
      PC personal calendar
      TE travel expenses/payroll results
      TS travel expenses/master data
      TX infotype texts
      ZI PDC interface -> cost account
    Database Table PCL2
    u2022 The database table PCL2 contains the following data areas:
      B2 time accounting results
      CD cluster directory of the CD manager
      PS generated schemas
      PT texts for generated schemas
      RX payroll accounting results/international
      Rn payroll accounting results/country-specific ( n = HR country indicator )
      ZL personal work schedule
    Database Table PCL3
    u2022 The database table PCL3 contains the following data areas:
      AP action log / time schedule
      TY texts for applicant data infotypes
    Data Management of PCLn
    u2022 The ABAP commands IMPORT and EXPORT are used for management of read/write to
      database tables PCLn.
    u2022 A unique key has to be used when reading data from or writing data to the PCLn.
      Field Name KEY Length Text
      MANDT X 3 Client
      RELID X 2 Relation ID (RU,B2..)
      SRTFD X 40 Work Area Key
      SRTF2 X 4 Sort key for dup. key
    Cluster Definition
    u2022 The data definition of a work area for PCLn is specified in separate programs which comply  
       with fixed naming conventions.
    u2022 They are defined as INCLUDE programs (RPCnxxy0). The following naming convention applies:
       n = 1 or 2 (PCL1 or PCL2)
       xx = Relation ID (e.g. RX)
       y = 0 for international clusters or country indicator (T500L) for different country cluster
    Exporting Data (I)
    u2022 The EXPORT command causes one or more 'xy' KEY data objects to be written to cluster xy.
    u2022 The cluster definition is integrated with the INCLUDE statement.
    REPORT ZHREXPRT.
    TABLES: PCLn.
    INCLUDE: RPCnxxy0. "Cluster definition
    * Fill cluster KEY
    xy-key-field = <value>.
    * Fill data object
    * Export record
    EXPORT TABLE1 TO DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
           WRITE: / 'Update successful'.
       ENDIF.
    Exporting Data (II)
    . Export data using macro RP-EXP-Cn-xy.
    u2022 When data records are exported using macro, they are not written to the database but to a  
      main memory buffer.
    u2022 To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
    REPORT ZHREXPRT.
    *Buffer definition
    INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    RP-EXP-Cn-xy.
    IF SY-SUBRC EQ 0.
        PERFORM PREPARE_UPDATE USING 'V'..
    ENDIF.
    Importing Data (I)
    u2022 The IMPORT command causes data objects with the specified key values to be read from
       PCLn.
    u2022 If the import is successful, SY-SUBRC is 0; if not, it is 4.
    REPORT RPIMPORT.
    TABLES: PCLn.
    INCLUDE RPCnxxy0. "Cluster definition
    * Fill cluster Key
    * Import record
    IMPORT TABLE1 FROM DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
          * Display data object
       ENDIF.
    Importing data (II)
    u2022 Import data using macro RP-IMP-Cn-xy.
    u2022 Check return code SY-SUBRC. If 0, it is successful. If 4, error.
    u2022 Need include buffer management routines RPPPXM00
    REPORT RPIMPORT.
    *Buffer definition
    INCLUDE RPPPXD00.
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    *import data to buffer
    RP-IMP-Cn-xy.
    *Buffer management routines
    INCLUDE RPPPXM00.
    Cluster Authorization
    u2022 Simple EXPORT/IMPORT statement does not check for cluster authorization.
    u2022 Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
      authorization.
    Payroll Results (I)
    u2022 Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
      n - country identifier.
    u2022 Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
      report RPCEDTn0 lists the results on a payroll form.
    Payroll Results (II)
    u2022 The cluster definition of payroll results is stored in two INLCUDE reports:
      include: rpc2rx09. "Definition Cluster Ru (I)
      include: rpc2ruu0. "Definition Cluster Ru (II)
    The first INCLUDE defines the country-independent part; The second INCLUDE defines the country-specific part (US).
    u2022 The cluster key is stored in the field string RX-KEY.
    Payroll Results (III)
    u2022 All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This
      allows you to use the same structures in different definitions and nonetheless maintain data
      consistency.
    u2022 The structures for cluster definition comply with the name convention PCnnn. Unfortunately, 
       'nnn' can be any set of alphanumeric characters.
    *Key definition
    DATA: BEGIN OF RX-KEY.
         INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    *Payroll directory
    DATA: BEGIN OF RGDIR OCCURS 100.
         INCLUDE STRUCTURE PC261.
    DATA: END OF RGDIR.
    Payroll Cluster Directory
    u2022 To read payroll results, you need two keys: pernr and seqno
    . You can get SEQNO by importing the cluster directory (CD) first.
    REPORT ZHRIMPRT.
    TABLES: PERNR, PCL1, PCL2.
    INLCUDE: rpc2cd09. "definition cluster CD
    PARAMETERS: PERSON LIKE PERNR-PERNR.
    RP-INIT-BUFFER.
    *Import cluster Directory
       CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
       CHECK SY-SUBRC = 0.
    LOOP AT RGDIR.
       RX-KEY-PERNR = PERSON.
       UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
       *Import data from PCL2
       RP-IMP-C2-RU.
       INLCUDE: RPPPXM00. "PCL1/PCL2 BUFFER HANDLING
    Function Module (I)
      CD_EVALUATION_PERIODS
    u2022 After importing the payroll directory, which record to read is up to the programmer.
    u2022 Each payroll result has a status.
      'P' - previous result
      'A' - current (actual) result
      'O' - old result
    u2022 Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period
       when that payroll is initially run. It also will select all the relevant periods to be evaluated.
    Function Module (II)
    CD_EVALUATION_PERIODS
    call function 'CD_EVALUATION_PERIODS'
         exporting
              bonus_date = ref_periods-bondt
              inper_modif = pn-permo
              inper = ref_periods-inper
              pay_type = ref_periods-payty
              pay_ident = ref_periods-payid
         tables
              rgdir = rgdir
              evpdir = evp
              iabkrs = pnpabkrs
         exceptions
              no_record_found = 1.
    Authorization Check
       Authorization for Persons
    u2022  In the authorization check for persons, the system determines whether the user has the 
       authorizations required for the organizational features of the employees selected with
       GET PERNR.
    u2022  Employees for which the user has no authorization are skipped and appear in a list at the end
       of the report.
    u2022  Authorization object: 'HR: Master data'
    Authorization for Data
    u2022 In the authorization check for data, the system determines whether the user is authorized to
      read the infotypes specified in the report.
    u2022 If the authorization for a particular infotype is missing, the evaluation is terminated and an error
      message is displayed.
    Deactivating the Authorization Check
    u2022 In certain reports, it may be useful to deactivate the authorization check in order to improve
      performance. (e.g. when running payroll)
    u2022 You can store this information in the object 'HR: Reporting'.

  • Tables Proration/Spliting Logic required

    Hi Friends
    I have 3 internal tables:
    IT_0001:
    PERNR     BEGDA     ENDDA     WERKS     BTRTL     ABKRS     KOSTL     ORGEH
    10774     20080101     20081028     US11     14     CB          0
    10774     20081029     99991231     US11     14     CB     1125100     30084829
    IT_0008_1:
    PERNR     BEGDA     ENDDA     TRFGR     BAND1
    10774     20080101     20080803     1     1
    IT_0008:
    PERNR     BEGDA     ENDDA     TRFST     BAND
    10774     20080804     20081231     6     6
    WITH THE ABOVE TABLES COMBINATION,BY SPLITING THE TABLES BASED ON BEGDA,ENDDA
    MY FINAL TABLE HAS TO COME AS FOLLOWS:
    IT_FINAL:
    PERNR     BEGDA     ENDDA     WERKS     BTRTL     MOLGA     BAND     BONUSPRCNTAGE
    10774     20080101     20080803     US11     14     10     1     8
    10774     20080804     20081028     US11     14     10     6     8
    10774     20081029     20081231     US11     14     10     6     8
    Can any one please provide me the logic for this.
    Thanks for your cooperation.
    Regards,
    Sree

    Hi Gourav
    Thanks for your suggestion!
    Let me ask the same question in this way then:
    Please correct me the code where I am wrong:
    Logic for Proration calculation for Bonus Percentage when Band
          maintained in TRFGR field.
                SORT it_0001_1 BY pernr begda endda.
                SORT it_0008_1 BY pernr begda endda.
                LOOP AT it_0001_1 INTO wa_0001_1.
                  LOOP AT it_0008_1 INTO wa_0008_1 WHERE pernr = wa_0001_1-pernr.
    To check the end date is 12/31/9999, if yes then set it to bonus year end date
                    IF wa_0008_1-endda = c_year OR wa_0008_1-endda0(4) > gv_endyear0(4).
                      wa_0008_1-endda = c_aug_e.
                      MODIFY it_0008_1 FROM wa_0008_1 TRANSPORTING endda.
                    ELSEIF wa_0001_1-endda = c_year.
                      wa_0001_1-endda = gv_endyear.
                    ENDIF.
    ***Condition to split the records based on the records in PA0001 and Pa0008 tables data
                    IF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda = wa_0008_1-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0001_1-begda.
                      wa_final-endda = wa_0001_1-endda.
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_0001_1-kostl IS NOT INITIAL.
                        APPEND wa_final TO it_final.
                      ELSE.
                        APPEND wa_final TO it_costcenter.
                      ENDIF.
                      EXIT.
                    ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda > wa_0008_1-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0001_1-begda.
                      wa_final-endda = wa_0008_1-endda.
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_final-begda < wa_final-endda.
                        IF wa_0001_1-kostl IS NOT INITIAL.
                          APPEND wa_final TO it_final.
                        ELSE.
                          APPEND wa_final TO it_costcenter.
                        ENDIF.
                        gv_date  = wa_0008_1-endda.
                        IF ( gv_date+4(4) EQ c_leap ).           " to check date is feb 28th
                          gv_mod = wa_0008_1-endda+0(4) MOD 4.
                          gv_mod1 = wa_0008_1-endda+0(4) MOD 4.
                          IF ( gv_mod EQ 0  OR gv_mod1 EQ 0 ).   " to check for leap year
                            wa_0008_1-endda+4(4) = c_leap1.
                            wa_final-pernr = wa_0001_1-pernr.
                            wa_final-begda = wa_0008_1-endda.
                            wa_final-endda = wa_0001_1-endda.
                            wa_final-werks = wa_0001_1-werks.
                            wa_final-btrtl = wa_0001_1-btrtl.
                            wa_final-kostl = wa_0001_1-kostl.
                            IF wa_0001_1-kostl IS NOT INITIAL.
                              APPEND wa_final TO it_final.
                            ELSE.
                              APPEND wa_final TO it_costcenter.
                            ENDIF.
                          ENDIF.
                        ENDIF.
                      ENDIF.
                      EXIT.
                    ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda < wa_0008_1-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0001_1-begda.
                      wa_final-endda = wa_0001_1-endda.
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_final-begda < wa_final-endda.
                        IF wa_0001_1-kostl IS NOT INITIAL.
                          APPEND wa_final TO it_final.
                        ELSE.
                          APPEND wa_final TO it_costcenter.
                        ENDIF.
                        gv_date  = wa_0008_1-endda.
                        IF ( gv_date+4(4) EQ c_leap ).             " to check date is feb 29th
                          gv_mod = wa_0008_1-endda+0(4) MOD 4.
                          gv_mod1 = wa_0008_1-endda+0(4) MOD 4.
                          IF ( gv_mod EQ 0  OR gv_mod1 EQ 0 ).     " to check for leap year
                            wa_0008_1-endda+4(4) = c_leap1.
                            wa_final-pernr = wa_0001_1-pernr.
                            wa_final-begda = wa_0008_1-endda.
                            wa_final-endda = wa_0001_1-endda.
                            wa_final-werks = wa_0001_1-werks.
                            wa_final-btrtl = wa_0001_1-btrtl.
                            wa_final-kostl = wa_0001_1-kostl.
                            IF wa_0001_1-kostl IS NOT INITIAL.
                              APPEND wa_final TO it_final.
                            ELSE.
                              APPEND wa_final TO it_costcenter.
                            ENDIF.
                          ENDIF.
                        ELSEIF wa_0001_1-begda >= wa_0008_1-begda AND wa_0001_1-endda >= wa_0008_1-endda.
                          wa_final-pernr = wa_0001_1-pernr.
                          wa_final-begda = wa_0001_1-endda + 1.
                          wa_final-endda = wa_0008_1-endda.
                          wa_final-werks = wa_0001_1-werks.
                          wa_final-btrtl = wa_0001_1-btrtl.
                          wa_final-kostl = wa_0001_1-kostl.
                          IF wa_0001_1-kostl IS NOT INITIAL.
                            APPEND wa_final TO it_final.
                          ELSE.
                            APPEND wa_final TO it_costcenter.
                          ENDIF.
                        ENDIF.
                      ENDIF.
                      EXIT.
                    ENDIF.
                    CLEAR: wa_0008_1,
                           gv_date.
                  ENDLOOP.
    ***** 23/07/2008
                  LOOP AT it_0008 INTO wa_0008 WHERE pernr = wa_0001_1-pernr.
    To check the end date is 12/31/9999, if yes then set it to bonus year end date
                    IF wa_0008-endda = c_year OR wa_0008-endda0(4) > c_end0(4).
                      wa_0008-endda = c_end.
                      MODIFY it_0008 FROM wa_0008 TRANSPORTING endda.
                    ELSEIF wa_0001_1-endda = c_year.
                      wa_0001_1-endda = c_end.
                    ENDIF.
    ***Condition to split the records based on the records in PA0001 and Pa0008 tables data
                    IF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda = wa_0008-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0008-begda. "CHANGED FROM 0001 TO 0008
                      wa_final-endda = wa_0008-endda. "CHANGED FROM 0001 TO 0008
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_0001_1-kostl IS NOT INITIAL.
                        APPEND wa_final TO it_final.
                      ELSE.
                        APPEND wa_final TO it_costcenter.
                      ENDIF.
                      EXIT.
                    ELSEIF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda > wa_0008-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0008-begda. "look here
                      wa_final-endda = wa_0008-endda.
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_final-begda < wa_final-endda.
                        IF wa_0001_1-kostl IS NOT INITIAL.
                          APPEND wa_final TO it_final.
                        ELSE.
                          APPEND wa_final TO it_costcenter.
                        ENDIF.
                      ENDIF.
                    ELSEIF wa_0001_1-begda <= wa_0008-begda AND wa_0001_1-endda < wa_0008-endda.
                      wa_final-pernr = wa_0001_1-pernr.
                      wa_final-begda = wa_0008-begda.
                      wa_final-endda = wa_0001_1-endda.
                      wa_final-werks = wa_0001_1-werks.
                      wa_final-btrtl = wa_0001_1-btrtl.
                      wa_final-kostl = wa_0001_1-kostl.
                      IF wa_final-begda < wa_final-endda.
                        IF wa_0001_1-kostl IS NOT INITIAL.
                          APPEND wa_final TO it_final.
                        ELSE.
                          APPEND wa_final TO it_costcenter.
                        ENDIF.
                      ENDIF.
                    ENDIF.
                  ENDLOOP.
    ****23/07/2007
                ENDLOOP.
    ***Updating the IT_0001_1 and IT_COSTCENTER tables with band information.
                IF it_final[] IS NOT INITIAL.
                  LOOP AT it_final INTO wa_final.
                    gv_tabix = sy-tabix.
                    LOOP AT it_0008_1 INTO wa_0008_1  WHERE pernr EQ wa_final-pernr
                                                      AND   begda LE wa_final-begda
                                                      AND   endda GE wa_final-endda.
                      READ TABLE it_cgroup INTO wa_cgroup WITH KEY werks = wa_final-werks
                                                                   btrtl = wa_final-btrtl.
                      IF sy-subrc EQ 0.
                        wa_final-band = wa_0008_1-trfgr.
                        wa_final-molga = wa_cgroup-molga.
                        MODIFY it_final FROM wa_final INDEX gv_tabix TRANSPORTING band molga.
                        CLEAR: wa_0008_1,
                               wa_final,
                               gv_tabix.
                      ENDIF.
                    ENDLOOP.
      ***TRFST CALCULATION.
                    LOOP AT it_0008 INTO wa_0008  WHERE pernr EQ wa_final-pernr
                                                  AND   begda LE wa_final-begda
                                                  AND   endda GE wa_final-endda.
                      READ TABLE it_cgroup INTO wa_cgroup WITH KEY werks = wa_final-werks
                                                                   btrtl = wa_final-btrtl.
                      IF sy-subrc EQ 0.
                        wa_final-band = wa_0008-trfst.
                        wa_final-molga = wa_cgroup-molga.
                        MODIFY it_final FROM wa_final INDEX gv_tabix TRANSPORTING band molga.
                        CLEAR: wa_0008,
                               wa_final,
                               gv_tabix.
                      ENDIF.
                    ENDLOOP.
                    CLEAR: wa_final.
                  ENDLOOP.
                ENDIF.
    Actually I have developed code but it's not giving the required results.
    That's why I asked for the solution .My intension in asking the solution is to get various types of approaches of the solution but not to waste the comunity time.
    Anyhow thanks!
    Regards,
    Sree

  • Can the Primary Key also be Primary key in another table

    Hi all,
    I am working on a project. The project specification says:
    Project table contains details of projects and the project number *(proj_no)* is the key.
    project ( proj_no , proj_date, proj_desc, proj_type, proj_status, s_no, cust_no)
    purchase_order table contains details of the purchase orders for each project and the combination of project
    number and a purchase order number *(proj_no, po_no) form the key.*
    purchase_order ( proj_no , po_no, po_date)
    How can I have proj_no in the project table and in the purchase_order as primary keys?
    If I create a composite key in the purchase_order table making the ( proj_no, po_no) as primary key. How can I make the project_no in the project table a primary key too?
    Is there a solution for it?
    CREATE TABLE purchase_order(
    po_no NUMBER(5) NOT NULL,
    proj_no NUMBER(5) NOT NULL,
    po_date date,
    CONSTRAINT p_o_po_no_proj_no_pk PRIMARY KEY (po_no,proj_no));
    Thanks!!!

    Hi,
    I think I'd set the project no in the projects table a primary key, and project no in the purchase orders table a foreign key constraint to the projects table, combined with a unique, not null constraint in the table.
    That, in addition to a unique, not null constraint on the purchase orders column, and a composite primary key should fulfill the requirements.
    Best of luck!
    Johan

  • SAP Pricing Condition Tables

    Hello All,
    Kindly look at this situation and recommend a possible Solution.
    There is a SAP Standard Table XXX with combination Sales Org/ Dist Chan/Division/ Material and the description as Sales Org/ Dist Chan/Division/Material.. With Validity Period Checked and Release Status Unchecked.
    I want to have a Pricing Condition Table as Sales Org/ Dist Channel/Division/ Material but with description Division/material. with Validity Periods Checked and Release Status Unchecked. When i try to do this i am getting a message " This table combination Already exiits", and i am unable to create further. Is there a way to create the Said table without this error.
    Kindly Suggest a possible Solution. Your help will be highly appreciated.
    Regards
    Vittal

    Hi Sai,
    the message you are getting is not an error but just a warning message indicating the same combination of fields with which you are trying to create a table is already existing. And the descriptions of the fields are copied as it is as per their field names when you create a condition table.
    Practically, the condition records that you can store against the available condition table and the one you are trying to create if at all with a new description is absolutely same. so there is no reason why you should create a condition table with the same combination again. However pl clarify if i could answer your query.
    Regards,
    sadhu kishore

  • Required Table for Available Amount Budget

    Hi Experts ,
    Could you please any body help me out for Available Amount Budget  Table (Combination of Fundcenter/Commitment Item/etc)
    Regards
    Srinivas
    9603351848

    Hi, Samar
    for getting TDS the required table is WITH_ITEM where you will find the data related to TDS deduction. On the basis of Customers & Vendors.
    Regards
    Surender Bhomia

  • Cluster table defination not as per book give me own defination

    Hi gurus,
    Please give me the cluster table defination and how to create it step by step method.
    Dont give answer Tables assigned to a table cluster are referred to as cluster tables.
    I know that give explanation what is the need of this tables already there is database tables. why we need to create cluster tables? how to retrive the data and how we maintained those cluster tables in data dictionary
    Thanks,
    Harikiran
    Edited by: harikiran mitnala on Jul 14, 2008 11:02 PM
    Edited by: harikiran mitnala on Jul 14, 2008 11:05 PM

    Hi Hari,
    1. Cluster tables combine the data from several tables with 
       identical (or almost identical) keys into one physical record
       on the database.
    2. Data is written to a database in compressed form.
    3.    Retrieval of data is very fast if the primary key is known.
    4.. Cluster tables are defined in the data dictionary as transparent tables.
    5. External programs can NOT interpret the data in a cluster table.
    6. Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE  FROM DATABASE are used to process data in the cluster tables.
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Orace CDC tables (built in package)

    Hi,
    Currently I am working on a project about the CDC(Change Data Capture) tables: after I enable the cdc tables in the oracle database for some tables, I need to query some data from these cdc tables. since this related to very complex pl sql, so I am wondering are there some built in packages which allow me to use directly to query some useful data from the cdc tables?
    Please let me know if you know something, thank you very much.
    here is a simple example:
    there are several tables about a users application to some program:
    the online application form will be saved in the table: application
    Now I enable the cdc table of application table, and now I have the cdc table: application_cdc
    this cdc table will record any changes of the application table that the applicant made,
    Now I need to get some table from table: application_cdc,
    is there some good built in functions or procedure that i can use directly?

    Hi,
    Thank you for the information, and sorry for the confusion, yes, I am looking for the packages that allow me to get some information from those cdc tables(I already have cdc tables with change records in it). what you told me about the DBMS_CDC_UTILITY package is useful, but it is too general(high level) that I can not use.
    For the CDC tables I have, there are many changes records over there, I just need some useful records(rows), now it is difficult for me to write plsql to get it directly.
    The Oracle DB I am using is 11g, Synchronous, and related to the subscriber, and I have the dw_.._cdc tables already, if there are not so many built in package for me to query the dw_.._cdc tables, what I can do is:
    (1) to write complex plsql directly to query these cdc tables
    or
    (2)recreate the cdc tables(many original tables combined to one table): to modify the publisher part to make the data(for subscriber) more related to what I want
    Im new to the cdc concept, please give me some advise, Thank you.

Maybe you are looking for