How to Join VBRK, VBRP and BSEG

Dear Guys
I have Billing No from VBRP/VBRK and want to join these tables with BSEG to pick Accounting Doc No.
How to Join these tables.
Thanks

Hi,
What you can do is to use FM AC_DOCUMENT_RECORD. Please check my example below:
MOVE: 'VBRK'          TO lv_awtyp,
              wa_vbrk-vbeln TO lv_awref,
              '2007'      TO lv_aworg.
        CALL FUNCTION 'AC_DOCUMENT_RECORD'
          EXPORTING
            i_awtyp            = lv_awtyp
            i_awref            = lv_awref
            i_aworg            = lv_aworg
*           I_AWSYS            = ' '
*           I_AWTYP_INCL       = ' '
*           I_AWTYP_EXCL       = ' '
*           I_BUKRS            = ' '
*           I_VALUTYP          = '0'
            x_dialog           = ''
          TABLES
            t_documents        = lt_documents
          EXCEPTIONS
            no_reference       = 1
            no_document        = 2
            OTHERS             = 3
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
Hope it helps...
P.S. Please award points if it helps...

Similar Messages

  • Relation field between table VBRK/VBRP and BSEG

    Can any body guide on the common fields between VBRK/ VBRP and BSEG, except field "assignment".

    Hi,
    If you know the accounting document number, Goto SE16. enter BSEG table and enter.
    Enter the accounting document number in selection screen. E.g 90000498.
    You will get multiple lines. E.g normal billing document(Not credit memo /debit memo)
    Customer information will be available in posting key 01 line (Header). And Item information will be avilable in Posting key 50 line.
    List of fields available in Header.
    Billing document number
    Customer
    Payment terms
    Amount.
    Company code
    Controlling area
    Reconciliation account number
    Assignment
    Item level information in Posting key 50.
    Material
    Plant
    Amount
    Tax amount
    Tax code
    As per my knowledge for reporting purpose we don't use BSEG  bcoz of performance issue.
    BKPF -  Accounting document Header
    BSID
    BSIS
    Regards,
    Chandra

  • Link between KONA and VBRK/VBRP and KONP and VBRK/VBRP

    Hi
    please suggest me the link between KONA and VBRK/VBRP and
    KONP and VBRK/VBRP
    I want to give link of rebate agreement and invoice no/Inv Qty
    My requirement is I want a report where i can see Under one Rebate agreement ,how many Commercial Invoice use
    e.g. Rebate Agreement no -125 ( for 10 Rs / unit)
    I have created 10 Invoice for 10 qty each so accrual Amount is 10* 10= 100
    I want such report where for agreement No 125- 10 Invoice No should be reflected.
    I don't want to go into VBO2 and go to verification level that concept i know
    i want one report where i will see all
    Regards
    Hemant

    Hi
    In my case i want commercial invoice no (billing type F2) but if i try to find link between KONA and VBRK for field KNUMA i can only see credit Memo No(Billing type-B3-rebate billing type) ,
    I want to display commericial invoice and not rebate credit memo
    Pls advice
    Regards
    Hemant Gaikwad

  • How to join /sapsll/ctsnum and /sapsll/pntpr. ?

    Hi
    How to join /sapsll/ctsnum and /sapsll/pntpr. ? What i sthe common key or field.
    Do I have use some  other table to make the relation work.
    It looks like
    "/sapsll/pntprguid_pr  EQ /sapsll/ctsnumguid_ctsnum"  don't match, no records are fetched.
    thanks
    siva

    Hi,
    Try on
    "/sapsll/pntprGUID_PRVSY EQ /sapsll/ctsnumguid_ctsnum"
    Regards,
    Raju.

  • Joining VBRK, VBRP, VBAK, VBAP, LIKP, LIPS

    Hello,
    I just wanted to ask how to join the above subject in one table? Or it isnt possible?
    I read that joining 3 or more tables would degrade the performance But i need to get the data in those tables. Any help would greatly appreciated. Thanks!

    Hi,
    Please take a look at my program below. There you can see how to join the tables that you mentioned. Hope it helps...
    P.S. Please award points if it helps...
    *=====================================================================
    * Program Name : ZSD_ORDERSTAGE_V2
    * Author       : Aris Hidalgo
    * Date Created : June 5, 2007
    * Description  : Display sales orders status for a given customer
    *=====================================================================
    REPORT  zsd_orderstage_v2
            NO STANDARD PAGE HEADING
            MESSAGE-ID zsd.
    * Data Dictionary Table/s                      *
    TABLES: vbak,
            vttp.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * Global Data/s                                *
    DATA: gt_fieldcat         TYPE lvc_t_fcat,
          ok_code             TYPE syst-ucomm,
          save_ok             TYPE syst-ucomm,
          g_repid             TYPE syst-repid,
          gs_layout           TYPE lvc_s_layo,
          gv_container        TYPE scrfname VALUE 'CUSTOM_CONTROL',
          grid1               TYPE REF TO cl_gui_alv_grid,
          custom_container    TYPE REF TO cl_gui_custom_container,
          grid2               TYPE REF TO cl_gui_alv_grid,
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
          event_receiver      TYPE REF TO lcl_event_receiver.
    * Global Structure/s                           *
    TYPES: BEGIN OF t_output,
            creation_date  TYPE vbak-erdat,
            creation_time  TYPE vbak-erzet,
            sales_doc      TYPE vbak-vbeln,
            cust_code      TYPE vbak-kunnr,
            cust_desc      TYPE kna1-name1,
            ship_to_code   TYPE likp-kunnr,
            ship_to_desc   TYPE kna1-name1,
            po_num         TYPE vbak-bstnk,
            doc_type       TYPE vbak-auart,
            req_dlv_date   TYPE vbak-vdatu,
            so_status(02)  TYPE c,
            created_by     TYPE vbak-ernam,
            del_doc        TYPE likp-vbeln,
            bill_doc       TYPE vbrk-vbeln,
           END OF t_output.
    TYPES: BEGIN OF t_column,
            fname TYPE lvc_fname,
            level TYPE lvc_level,
           END OF t_column.
    * Global Internal Table/s                      *
    DATA: gt_output TYPE STANDARD TABLE OF t_output,
          gt_column TYPE STANDARD TABLE OF t_column.
    * Global Work Area/s                           *
    DATA: wa_output LIKE LINE OF gt_output.
    * SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_kunnr TYPE vbak-kunnr OBLIGATORY.
    SELECT-OPTIONS: s_vkgrp FOR vbak-vkgrp,
                    s_auart FOR vbak-auart,
                    s_erdat FOR vbak-erdat  OBLIGATORY,
                    s_ernam FOR vbak-ernam.
    SELECTION-SCREEN END OF BLOCK b1.
    */ CLASS DEFINITION/S
    CLASS lcl_process_data DEFINITION DEFERRED.
    *       CLASS lcl_get_data DEFINITION
    CLASS lcl_get_data DEFINITION.
      PUBLIC SECTION.
        TYPES: BEGIN OF t_vbak,
                vbeln TYPE vbak-vbeln,
                erdat TYPE vbak-erdat,
                erzet TYPE vbak-erzet,
                ernam TYPE vbak-ernam,
                auart TYPE vbak-auart,
                vdatu TYPE vbak-vdatu,
                bstnk TYPE vbak-bstnk,
                kunnr TYPE vbak-kunnr,
               END OF t_vbak.
        TYPES: BEGIN OF t_kna1,
                kunnr TYPE kna1-kunnr,
                name1 TYPE kna1-name1,
               END OF t_kna1.
        TYPES: BEGIN OF t_delivery,
                vgbel TYPE lips-vgbel,
                vbeln TYPE likp-vbeln,
                kunnr TYPE likp-kunnr,
               END OF t_delivery.
        TYPES: BEGIN OF t_billing,
                vbelv   TYPE vbfa-vbelv,
                vbtyp_n TYPE vbfa-vbtyp_n,
                vbeln   TYPE vbfa-vbeln,
               END OF t_billing.
        TYPES: BEGIN OF t_status,
                vbeln TYPE vbuk-vbeln,      "Sales and Distribution Document Number
                cmgst TYPE vbuk-cmgst,      "Overall status of credit checks
                lfstk TYPE vbuk-lfstk,      "Delivery status
                kostk TYPE vbuk-kostk,      "Overall picking / putaway status
                fkstk TYPE vbuk-fkstk,      "Billing status
                trsta TYPE vbuk-trsta,      "Transportation planning status
               END OF t_status.
        TYPES: BEGIN OF t_status_do,
                vbeln TYPE vbuk-vbeln,      "Delivery Document Number
                kostk TYPE vbuk-kostk,      "Overall picking / putaway status
                fkstk TYPE vbuk-fkstk,      "Billing status
                trsta TYPE vbuk-trsta,      "Transportation planning status
               END OF t_status_do.
        METHODS: get_sales_docs    FINAL,
                 get_customer_desc FINAL,
                 get_ship_to_desc  FINAL,
                 get_delivery_docs FINAL,
                 get_billing_docs  FINAL,
                 get_so_status     FINAL.
      PROTECTED SECTION.
        CLASS-DATA: gt_vbak            TYPE STANDARD TABLE OF t_vbak,
                    gt_kna1            TYPE HASHED   TABLE OF t_kna1
                                       WITH UNIQUE KEY kunnr,
                    gt_kna2            TYPE HASHED   TABLE OF t_kna1
                                       WITH UNIQUE KEY kunnr,
                    gt_delivery        TYPE STANDARD TABLE OF t_delivery,
                    gt_billing         TYPE STANDARD TABLE OF t_billing,
                    gt_status          TYPE STANDARD TABLE OF t_status,
                    gt_status_do       TYPE STANDARD TABLE OF t_status_do,
                    o_lcl_process_data TYPE REF TO lcl_process_data.
      PRIVATE SECTION.
        CLASS-DATA: wa_status LIKE LINE OF gt_status.
    ENDCLASS.                    "lcl_get_data DEFINITION
    *       CLASS lcl_process_data DEFINITION
    CLASS lcl_process_data DEFINITION INHERITING FROM lcl_get_data.
      PUBLIC SECTION.
        METHODS: combine_data FINAL
                   IMPORTING
                     im_sales_tab LIKE gt_vbak
                     im_cust_tab  LIKE gt_kna1
                     im_desc_tab  LIKE gt_kna2     OPTIONAL
                     im_dlv_tab   LIKE gt_delivery OPTIONAL
                     im_bill_tab  LIKE gt_billing  OPTIONAL
                   EXPORTING
                     ex_output    LIKE gt_output,
                 get_status
                   IMPORTING
                     im_so        TYPE vbak-vbeln
                     im_do        TYPE likp-vbeln   OPTIONAL
                   EXPORTING
                     ex_status    TYPE crmchar2.
      PRIVATE SECTION.
        DATA: lv_vbelv    TYPE vbfa-vbelv,
              lv_bill_doc TYPE vbfa-vbeln,
              lv_kunnr    TYPE vbpa-kunnr,
              lv_name1    TYPE kna1-name1,
              lv_parvw    TYPE vbpa-parvw,
              lv_flag1    TYPE flag.
    ENDCLASS.                    "lcl_process_data DEFINITION
    *       CLASS lcl_alv_routines DEFINITION
    CLASS lcl_alv_routines DEFINITION INHERITING FROM lcl_process_data.
      PUBLIC SECTION.
        TYPES: BEGIN OF t_status_history,
                 cr_hold(50)        TYPE c,
                 cr_rel_on(10)      TYPE c,
                 cr_rel_at(10)      TYPE c,
                 do_created_on(10)  TYPE c,
                 do_created_time(8) TYPE c,
                 picked_on(10)      TYPE c,
                 picked_time(8)     TYPE c,
                 inv_created_on(10) TYPE c,
                 dispatched_on(10)  TYPE c,
                 dispatched_at(10)  TYPE c,
               END OF t_status_history.
        TYPES: BEGIN OF t_confirmation,
                 podat TYPE likp-podat,
                 potim TYPE likp-potim,
               END OF t_confirmation.
        CLASS-DATA: wa_fieldcat       LIKE LINE OF gt_fieldcat,
                    gt_status_history TYPE STANDARD TABLE OF t_status_history,
                    gt_confirmation   TYPE STANDARD TABLE OF t_confirmation,
                    wa_status_history LIKE LINE OF gt_status_history,
                    wa_confirmation   LIKE LINE OF gt_confirmation,
                    wa_column         LIKE LINE OF gt_column,
                    gt_domain_val     TYPE STANDARD TABLE OF dd07v,
                    wa_domain_val     LIKE LINE OF gt_domain_val.
        METHODS: build_fieldcat FINAL,
                 popup_routines
                   IMPORTING
                     im_column LIKE gt_column
                     im_output LIKE wa_output
                   EXPORTING
                     ex_status_history LIKE gt_status_history
                     ex_confirmation   LIKE gt_confirmation,
                 get_domain_values FINAL
                   IMPORTING
                     value(im_tabname)    TYPE ddobjname
                     value(im_fieldname)  TYPE dfies-fieldname
                   EXPORTING
                     value(ex_values_tab) LIKE gt_domain_val.
      PRIVATE SECTION.
        CLASS-DATA: lt_dfies_tab TYPE STANDARD TABLE OF dfies,
                    wa_dfies_tab LIKE LINE OF lt_dfies_tab.
    ENDCLASS.                    "lcl_alv_routines DEFINITION
    *       CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION INHERITING FROM lcl_alv_routines FINAL.
      PUBLIC SECTION.
        METHODS: handle_double_click
                   FOR EVENT double_click OF cl_gui_alv_grid
                     IMPORTING
                       e_row
                       e_column,
                 handle_close
                   FOR EVENT close OF cl_gui_dialogbox_container
                     IMPORTING
                       sender,
                 handle_hotspot_click
                   FOR EVENT hotspot_click OF cl_gui_alv_grid
                     IMPORTING
                       e_row_id
                       e_column_id
                       es_row_no,
                 create_detail_list
                   IMPORTING
                     im_column         LIKE gt_column
                     im_status         LIKE gt_status_history
                     im_confirmation   LIKE gt_confirmation.
      PRIVATE SECTION.
        CLASS-DATA: o_lcl_alv_routines TYPE REF TO lcl_alv_routines.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    */ CLASS IMPLEMENTATION/S
    *       CLASS lcl_get_data IMPLEMENTATION
    CLASS lcl_get_data IMPLEMENTATION.
    * METHOD get_sales_docs
      METHOD get_sales_docs.
        SELECT vbeln erdat erzet ernam auart vdatu bstnk kunnr
          FROM vbak
          INTO TABLE gt_vbak
         WHERE erdat IN s_erdat
           AND ernam IN s_ernam
           AND auart IN s_auart
           AND vkgrp IN s_vkgrp
           AND kunnr =  p_kunnr.
        IF NOT gt_vbak[] IS INITIAL.
          CALL METHOD: me->get_customer_desc,
                           get_delivery_docs,
                           get_so_status,
                           get_billing_docs.
          CREATE OBJECT o_lcl_process_data.
          CALL METHOD o_lcl_process_data->combine_data
            EXPORTING
              im_sales_tab = gt_vbak
              im_cust_tab  = gt_kna1
              im_desc_tab  = gt_kna2
              im_dlv_tab   = gt_delivery
              im_bill_tab  = gt_billing
            IMPORTING
              ex_output    = gt_output.
        ELSE.
          MESSAGE i000 WITH text-032.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDMETHOD.                    "get_sales_docs
    * METHOD get_customer_desc
      METHOD get_customer_desc.
        SELECT kunnr name1
          FROM kna1
          INTO TABLE gt_kna1
           FOR ALL ENTRIES IN gt_vbak
         WHERE kunnr = gt_vbak-kunnr.
      ENDMETHOD.                    "get_customer_desc
    * METHOD get_ship_to_desc
      METHOD get_ship_to_desc.
        SELECT kunnr name1
          FROM kna1
          INTO TABLE gt_kna2
           FOR ALL ENTRIES IN gt_delivery
         WHERE kunnr = gt_delivery-kunnr.
      ENDMETHOD.                    "get_ship_to_desc
    * METHOD get_delivery_docs
      METHOD get_delivery_docs.
        SELECT lips~vgbel likp~vbeln likp~kunnr
          FROM likp
         INNER JOIN lips
            ON likp~vbeln = lips~vbeln
          INTO TABLE gt_delivery
           FOR ALL ENTRIES IN gt_vbak
         WHERE lips~vgbel = gt_vbak-vbeln.
        IF NOT gt_delivery[] IS INITIAL.
          SORT gt_delivery ASCENDING BY: vgbel vbeln kunnr.
          DELETE ADJACENT DUPLICATES FROM gt_delivery COMPARING vgbel vbeln kunnr.
    *     Get ship-to description
          CALL METHOD me->get_ship_to_desc.
    *     Get status of delivery documents
          SELECT vbeln kostk fkstk trsta
            FROM vbuk
            INTO TABLE gt_status_do
             FOR ALL ENTRIES IN gt_delivery
           WHERE vbeln = gt_delivery-vbeln.
        ENDIF.
      ENDMETHOD.                    "get_delivery_docs
    * METHOD get_billing_docs
      METHOD get_billing_docs.
        SELECT vbelv vbtyp_n vbeln
          FROM vbfa
          INTO TABLE gt_billing
           FOR ALL ENTRIES IN gt_delivery
         WHERE vbelv   = gt_delivery-vbeln
           AND vbtyp_n = 'M'.
        SORT gt_billing ASCENDING BY: vbelv vbtyp_n vbeln.
        DELETE ADJACENT DUPLICATES FROM gt_billing COMPARING vbelv vbtyp_n vbeln.
      ENDMETHOD.                    "get_billing_docs
    * METHOD get_so_status
      METHOD get_so_status.
        DATA: lv_curr_so TYPE vbak-vbeln,
              lv_lines   TYPE i.
        FIELD-SYMBOLS: <fs_status>    LIKE LINE OF gt_status,
                       <fs_delivery>  LIKE LINE OF gt_delivery,
                       <fs_status_do> LIKE LINE OF gt_status_do.
        SELECT vbeln cmgst lfstk
          FROM vbuk
          INTO CORRESPONDING FIELDS OF TABLE gt_status
           FOR ALL ENTRIES IN gt_vbak
         WHERE vbeln = gt_vbak-vbeln.
        SORT gt_status_do BY vbeln ASCENDING.
        DESCRIBE TABLE gt_status LINES lv_lines.
        LOOP AT gt_status ASSIGNING <fs_status>.
          IF sy-tabix > lv_lines.
            EXIT.
          ENDIF.
          LOOP AT gt_delivery ASSIGNING <fs_delivery> WHERE vgbel = <fs_status>-vbeln.
            IF lv_curr_so = <fs_delivery>-vgbel.
              wa_status-vbeln = <fs_status>-vbeln.
              wa_status-cmgst = <fs_status>-cmgst.
              wa_status-lfstk = <fs_status>-lfstk.
              READ TABLE gt_status_do ASSIGNING <fs_status_do> WITH KEY vbeln = <fs_delivery>-vbeln
                                                                                BINARY SEARCH.
              IF sy-subrc = 0.
                wa_status-kostk = <fs_status_do>-kostk.
                wa_status-fkstk = <fs_status_do>-fkstk.
                wa_status-trsta = <fs_status_do>-trsta.
              ENDIF.
              APPEND wa_status TO gt_status.
              CLEAR wa_status.
            ELSE.
              READ TABLE gt_status_do ASSIGNING <fs_status_do> WITH KEY vbeln = <fs_delivery>-vbeln
                                                                                BINARY SEARCH.
              <fs_status>-kostk = <fs_status_do>-kostk.
              <fs_status>-fkstk = <fs_status_do>-fkstk.
              <fs_status>-trsta = <fs_status_do>-trsta.
            ENDIF.
            lv_curr_so = <fs_delivery>-vgbel.
          ENDLOOP.
        ENDLOOP.
      ENDMETHOD.                    "get_do_status
    ENDCLASS.                    "lcl_get_data IMPLEMENTATION
    *       CLASS lcl_process_data IMPLEMENTATION
    CLASS lcl_process_data IMPLEMENTATION.
    * METHOD combine_data
      METHOD combine_data.
        FIELD-SYMBOLS: <fs_sales_tab> LIKE LINE OF im_sales_tab,
                       <fs_cust_tab>  LIKE LINE OF im_cust_tab,
                       <fs_desc_tab>  LIKE LINE OF im_desc_tab,
                       <fs_dlv_tab>   LIKE LINE OF im_dlv_tab,
                       <fs_bill_tab>  LIKE LINE OF im_bill_tab.
        SORT gt_status BY vbeln ASCENDING.
        LOOP AT im_sales_tab ASSIGNING <fs_sales_tab>.
          CLEAR: lv_flag1, wa_output,lv_vbelv,
                 lv_bill_doc, lv_kunnr,
                 lv_name1, lv_parvw.
          wa_output-creation_date = <fs_sales_tab>-erdat.  "SO creation date
          wa_output-creation_time = <fs_sales_tab>-erzet.  "SO creation time
          wa_output-sales_doc     = <fs_sales_tab>-vbeln.  "Sales document
          wa_output-cust_code     = <fs_sales_tab>-kunnr.  "SO customer code
    *     Customer description
          READ TABLE im_cust_tab ASSIGNING <fs_cust_tab> WITH KEY kunnr = <fs_sales_tab>-kunnr.
          IF sy-subrc = 0.
            MOVE <fs_cust_tab>-name1 TO: wa_output-cust_desc.    "SO customer description
          ENDIF.
          wa_output-po_num       = <fs_sales_tab>-bstnk.   "PO number
          wa_output-doc_type     = <fs_sales_tab>-auart.   "SO document type
          wa_output-req_dlv_date = <fs_sales_tab>-vdatu.   "SO req. delivery date
          wa_output-created_by   = <fs_sales_tab>-ernam.   "SO created by
          READ TABLE im_dlv_tab ASSIGNING <fs_dlv_tab> WITH KEY vgbel = <fs_sales_tab>-vbeln.
          IF sy-subrc <> 0.
            CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'
              EXPORTING
                input  = 'SH'
              IMPORTING
                output = lv_parvw.
    */Get ship-to party and description based from sales document
    * if delivery document is non-existent
            SELECT SINGLE kunnr
              FROM vbpa
              INTO lv_kunnr
             WHERE vbeln = <fs_sales_tab>-vbeln
               AND parvw = lv_parvw.             "Ship-to party
            IF sy-subrc = 0.
              SELECT SINGLE name1
                FROM kna1
                INTO lv_name1
               WHERE kunnr = lv_kunnr.
              IF sy-subrc = 0.
                wa_output-ship_to_code = lv_kunnr.
                wa_output-ship_to_desc = lv_name1.
              ENDIF.
            ENDIF.
    *       Sales order status
            CALL METHOD me->get_status
              EXPORTING
                im_so     = wa_output-sales_doc
              IMPORTING
                ex_status = wa_output-so_status.
            APPEND wa_output TO ex_output.
            CLEAR wa_output.
            CONTINUE.
          ENDIF.
    *     Ship-to code/party and delivery document
          LOOP AT im_dlv_tab ASSIGNING <fs_dlv_tab> WHERE vgbel = <fs_sales_tab>-vbeln.
            CLEAR: lv_flag1.
            wa_output-ship_to_code = <fs_dlv_tab>-kunnr.   "Ship-to code
            wa_output-del_doc      = <fs_dlv_tab>-vbeln.   "Delivery document
    *       Ship-to description
            READ TABLE im_desc_tab ASSIGNING <fs_desc_tab> WITH KEY kunnr = <fs_dlv_tab>-kunnr.
            IF sy-subrc = 0.
              wa_output-ship_to_desc = <fs_desc_tab>-name1.
            ENDIF.
    *       Sales order and delivery order status
            CALL METHOD me->get_status
              EXPORTING
                im_so     = wa_output-sales_doc
                im_do     = wa_output-del_doc
              IMPORTING
                ex_status = wa_output-so_status.
    *       Billing document
            LOOP AT im_bill_tab ASSIGNING <fs_bill_tab> WHERE vbelv   = <fs_dlv_tab>-vbeln
                                                          AND vbtyp_n =  'M'.
              CLEAR lv_flag1.
              IF lv_vbelv    = <fs_bill_tab>-vbelv AND
                 lv_bill_doc = <fs_bill_tab>-vbeln.
                CONTINUE.
              ENDIF.
              lv_vbelv    = <fs_bill_tab>-vbelv.
              lv_bill_doc = <fs_bill_tab>-vbeln.
              wa_output-bill_doc = <fs_bill_tab>-vbeln.    "Billing document
              MOVE 'X' TO lv_flag1.
              APPEND wa_output TO ex_output.
              CLEAR: wa_output-ship_to_code, wa_output-del_doc,
                     wa_output-so_status, wa_output-bill_doc.
              EXIT.
            ENDLOOP.
            IF lv_flag1 = 'X'.
              CONTINUE.
            ELSE.
              APPEND wa_output TO ex_output.
              CLEAR: wa_output-ship_to_code, wa_output-del_doc,
                     wa_output-ship_to_desc, wa_output-so_status.
            ENDIF.
          ENDLOOP.
        ENDLOOP.
        SORT ex_output BY sales_doc.
      ENDMETHOD.                    "combine_data
    * METHOD get_status
      METHOD get_status.
        FIELD-SYMBOLS: <fs_status>    LIKE LINE OF gt_status,
                       <fs_status_do> LIKE LINE OF gt_status_do.
    */Check the current stage of a given sales order in descending order
    * starting with the shipment status
        READ TABLE gt_status_do ASSIGNING <fs_status_do> WITH KEY vbeln = im_do
                                                                          BINARY SEARCH.
        IF sy-subrc = 0.
    *     Shipment/dispatch status
          IF <fs_status_do>-trsta = 'B' OR
             <fs_status_do>-trsta = 'C'.
            ex_status = 'SH'.
    *     Invoice status
          ELSEIF <fs_status_do>-fkstk = 'B' OR
                 <fs_status_do>-fkstk = 'C'.
            ex_status = 'IN'.
    *     Picking status
          ELSEIF <fs_status_do>-kostk = 'B' OR
                 <fs_status_do>-kostk = 'C'.
            ex_status = 'PS'.
          ENDIF.
        ENDIF.
        IF ex_status IS INITIAL.
          READ TABLE gt_status ASSIGNING <fs_status> WITH KEY vbeln = im_so
                                                                      BINARY SEARCH.
          IF sy-subrc = 0.
    *       Delivery order status
            IF <fs_status>-lfstk = 'B' OR
               <fs_status>-lfstk = 'C'.
              ex_status = 'DO'.
    *       Credit released
            ELSEIF <fs_status>-cmgst = 'A' OR
                   <fs_status>-cmgst = 'D'.
              ex_status = 'CR'.
    *       Credit hold
            ELSEIF <fs_status>-cmgst = 'B' OR
                   <fs_status>-cmgst = 'C'.
              ex_status = 'CH'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "get_status
    ENDCLASS.                    "lcl_process_data IMPLEMENTATION
    *       CLASS lcl_alv_routines IMPLEMENTATION
    CLASS lcl_alv_routines IMPLEMENTATION.
    * METHOD build_fieldcat
      METHOD build_fieldcat.
        REFRESH: gt_fieldcat.
        CLEAR wa_fieldcat.
        DEFINE m_fieldcat.
          add 1 to wa_fieldcat-col_pos.
          wa_fieldcat-fieldname   = &1.
          wa_fieldcat-tabname     = &2.
          wa_fieldcat-coltext     = &3.
          wa_fieldcat-outputlen   = &4.
          wa_fieldcat-fix_column  = &5.
          wa_fieldcat-just        = &6.
          wa_fieldcat-do_sum      = &7.
          wa_fieldcat-emphasize   = &8.
          wa_fieldcat-hotspot     = &9.
          append wa_fieldcat to gt_fieldcat.
        END-OF-DEFINITION.
        IF wa_column-fname = 'SO_STATUS'.
          m_fieldcat 'CR_HOLD'         'GT_STATUS_HISTORY'  text-002  '50' 'X' '' '' '' ''.
          m_fieldcat 'CR_REL_ON'       'GT_STATUS_HISTORY'  text-003  '18' 'X' '' '' '' ''.
          m_fieldcat 'CR_REL_AT'       'GT_STATUS_HISTORY'  text-004  '18' 'X' '' '' '' ''.
          m_fieldcat 'DO_CREATED_ON'   'GT_STATUS_HISTORY'  text-005  '13' 'X' '' '' '' ''.
          m_fieldcat 'DO_CREATED_TIME' 'GT_STATUS_HISTORY'  text-030  '15' 'X' '' '' '' ''.
          m_fieldcat 'PICKED_ON'       'GT_STATUS_HISTORY'  text-006  '12' 'X' '' '' '' ''.
          m_fieldcat 'PICKED_TIME'     'GT_STATUS_HISTORY'  text-031  '12' 'X' '' '' '' ''.
          m_fieldcat 'INV_CREATED_ON'  'GT_STATUS_HISTORY'  text-007  '15' 'X' '' '' '' ''.
          m_fieldcat 'DISPATCHED_ON'   'GT_STATUS_HISTORY'  text-008  '13' 'X' '' '' '' ''.
          m_fieldcat 'DISPATCHED_AT'   'GT_STATUS_HISTORY'  text-009  '13' 'X' '' '' '' ''.
        ELSEIF wa_column-fname = 'BILL_DOC'.
          m_fieldcat 'PODAT'          'GT_CONFIRMATION'    text-010  '17' 'X' '' '' '' ''.
          m_fieldcat 'POTIM'          'GT_CONFIRMATION'    text-011  '17' 'X' '' '' '' ''.
        ELSE.
          m_fieldcat 'CREATION_DATE' 'GT_OUTPUT' text-012 '10' 'X' '' '' '' ''.
          m_fieldcat 'CREATION_TIME' 'GT_OUTPUT' text-013 '10' 'X' '' '' '' ''.
          m_fieldcat 'SALES_DOC'     'GT_OUTPUT' text-014 '10' 'X' '' '' 'X' 'X'.
          m_fieldcat 'CUST_CODE'     'GT_OUTPUT' text-015 '16' 'X' '' '' '' ''.
          m_fieldcat 'CUST_DESC'     'GT_OUTPUT' text-016 '40' 'X' '' '' '' ''.
          m_fieldcat 'SHIP_TO_CODE'  'GT_OUTPUT' text-017 '15' 'X' '' '' '' ''.
          m_fieldcat 'SHIP_TO_DESC'  'GT_OUTPUT' text-018 '40' 'X' '' '' '' ''.
          m_fieldcat 'PO_NUM'        'GT_OUTPUT' text-019 '24' 'X' '' '' '' ''.
          m_fieldcat 'DOC_TYPE'      'GT_OUTPUT' text-020 '16' 'X' '' '' '' ''.
          m_fieldcat 'REQ_DLV_DATE'  'GT_OUTPUT' text-021 '21' 'X' '' '' '' ''.
          m_fieldcat 'SO_STATUS'     'GT_OUTPUT' text-022 '09' 'X' '' '' 'C400' ''.
          m_fieldcat 'CREATED_BY'    'GT_OUTPUT' text-023 '13' 'X' '' '' '' ''.
          m_fieldcat 'DEL_DOC'       'GT_OUTPUT' text-024 '18' 'X' '' '' '' ''.
          m_fieldcat 'BILL_DOC'      'GT_OUTPUT' text-025 '11' 'X' '' '' 'C600' ''.
        ENDIF.
      ENDMETHOD.                    "build_fieldcat
    * METHOD popup_routines
      METHOD popup_routines.
        READ TABLE im_column INDEX 1 INTO wa_column.
        FIELD-SYMBOLS: <fs_status> LIKE LINE OF gt_status.
        DATA: lv_datum TYPE syst-datum,
              lv_uzeit TYPE syst-uzeit.
        CLEAR: wa_status_history, lv_datum, lv_uzeit.
        REFRESH gt_status_history.
    */Popup routine if user clicked on the SO status
        IF wa_column-fname = 'SO_STATUS'.
          CALL METHOD me->get_domain_values
            EXPORTING
              im_tabname    = 'VBUK'
              im_fieldname  = 'CMGST'
            IMPORTING
              ex_values_tab = gt_domain_val.
    *     Credit hold
          READ TABLE gt_status ASSIGNING <fs_status> WITH KEY vbeln = im_output-sales_doc.
          IF sy-subrc = 0.
            wa_status_history-cr_hold = <fs_status>-cmgst.
          ENDIF.
          READ TABLE gt_domain_val INTO wa_domain_val WITH
                                    KEY domvalue_l = wa_status_history-cr_hold
                                    TRANSPORTING ddtext.
          IF sy-subrc = 0.
            wa_status_history-cr_hold = wa_domain_val-ddtext.
          ENDIF.
    *     Credit released date and time
          SELECT SINGLE udate utime
            FROM cdhdr
            INTO (lv_datum, lv_uzeit)
           WHERE objectid = im_output-sales_doc
             AND tcode    = 'VKM3'.
          IF sy-subrc = 0.
            WRITE lv_datum TO wa_status_history-cr_rel_on
            USING EDIT MASK '__/__/____'.
            CLEAR lv_datum.
            WRITE lv_uzeit TO wa_status_history-cr_rel_at
            USING EDIT MASK '__:__:__'.
            CLEAR lv_uzeit.
          ENDIF.
    *     DO creation date and time
          IF NOT im_output-del_doc IS INITIAL.
            SELECT SINGLE erdat erzet
              FROM likp
              INTO (lv_datum, lv_uzeit)
             WHERE vbeln = im_output-del_doc.
            IF sy-subrc = 0.
              WRITE lv_datum TO wa_status_history-do_created_on
              USING EDIT MASK '__/__/____'.
              CLEAR lv_datum.
              WRITE lv_uzeit TO wa_status_history-do_created_time
              USING EDIT MASK '__:__:__'.
              CLEAR lv_uzeit.
            ENDIF.
    *       Picking date and time
            SELECT SINGLE bdatu bzeit
              FROM ltak
              INTO (lv_datum, lv_uzeit)
             WHERE vbeln = im_output-del_doc.
            IF sy-subrc = 0.
              WRITE lv_datum TO wa_status_history-picked_on
              USING EDIT MASK '__/__/____'.
              CLEAR lv_datum.
              WRITE lv_uzeit TO wa_status_history-picked_time
              USING EDIT MASK '__:__:__'.
              CLEAR lv_uzeit.
            ENDIF.
          ENDIF.
    *     Invoice created on
          SELECT SINGLE erdat
            FROM vbrk
            INTO lv_datum
           WHERE vbeln = im_output-bill_doc.
          WRITE lv_datum TO wa_status_history-inv_created_on
          USING EDIT MASK '__/__/____'.
          CLEAR lv_datum.
    *     Dispatched on and dispatched at
          SELECT SINGLE tknum
            FROM vttp
            INTO vttp-tknum
           WHERE vbeln = im_output-del_doc.
          IF sy-subrc = 0.
            SELECT SINGLE dtabf uzabf
              FROM vttk
              INTO (lv_datum, lv_uzeit)
             WHERE tknum = vttp-tknum.
            WRITE lv_datum TO wa_status_history-dispatched_on
            USING EDIT MASK '__/__/____'.
            CLEAR lv_datum.
            WRITE lv_uzeit TO wa_status_history-dispatched_at
            USING EDIT MASK '__:__:__'.
            CLEAR lv_uzeit.
          ENDIF.
          APPEND wa_status_history TO gt_status_history.
          ex_status_history[] = gt_status_history[].
          CLEAR wa_status_history.
    */Popup routine if the user clicked on the billing document
        ELSEIF wa_column-fname = 'BILL_DOC'.
          IF NOT im_output-del_doc IS INITIAL.
            SELECT SINGLE podat potim
              FROM likp
              INTO (wa_confirmation-podat, wa_confirmation-potim)
             WHERE vbeln = im_output-del_doc.
            APPEND wa_confirmation TO gt_confirmation.
            ex_confirmation[] = gt_confirmation[].
            CLEAR wa_confirmation.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "popup_routines
    * METHOD get_domain_values
      METHOD   get_domain_values.
        CALL FUNCTION 'DDIF_FIELDINFO_GET'
          EXPORTING
            tabname              = im_tabname
            fieldname            = im_fieldname
            langu                = sy-langu
    *       LFIELDNAME           = ' '
    *       ALL_TYPES            = ' '
    *       GROUP_NAMES          = ' '
    *       UCLEN                =
    *     IMPORTING
    *       X030L_WA             =
    *       DDOBJTYPE            =
    *       DFIES_WA             =
    *       LINES_DESCR          =
          TABLES
            dfies_tab            = lt_dfies_tab
    *       FIXED_VALUES         =
    *     EXCEPTIONS
    *       NOT_FOUND            = 1
    *       INTERNAL_ERROR       = 2
    *       OTHERS               = 3
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        READ TABLE lt_dfies_tab INDEX 1 INTO wa_dfies_tab
                                        TRANSPORTING domname.
        CALL FUNCTION 'GET_DOMAIN_VALUES'
           EXPORTING
             domname               = wa_dfies_tab-domname
    *       TEXT                  = 'X'
    *       FILL_DD07L_TAB        = ' '
           TABLES
             values_tab            = ex_values_tab
    *       VALUES_DD07L          =
    *     EXCEPTIONS
    *       NO_VALUES_FOUND       = 1
    *       OTHERS                = 2
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDMETHOD.                    "get_domain_values
    ENDCLASS.                    "lcl_alv_routines IMPLEMENTATION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    * METHOD handle_double_click
      METHOD handle_double_click.
        IF e_column = 'SO_STATUS' OR
           e_column = 'BILL_DOC'.
          CREATE OBJECT: o_lcl_alv_routines.
          CLEAR: wa_output.
          REFRESH: gt_fieldcat,
                   gt_column,
                   gt_status_history,
                   gt_confirmation.
          MOVE: e_column-fieldname TO wa_column-fname,
                e_column-hierlevel TO wa_column-level.
          APPEND wa_column TO gt_column.
    *     Get record based on what the user clicked
          READ TABLE gt_output INDEX e_row-index INTO wa_output.
    *     Build fieldcatalog depending on what the user clicked
          CALL METHOD o_lcl_alv_routines->build_fieldcat.
    *     Call popup routine/s
          CALL METHOD o_lcl_alv_routines->popup_routines
            EXPORTING
              im_column         = gt_column
              im_output         = wa_output
            IMPORTING
              ex_status_history = gt_status_history
              ex_confirmation   = gt_confirmation.
          CALL METHOD me->create_detail_list
            EXPORTING
              im_column       = gt_column
              im_status       = gt_status_history
              im_confirmation = gt_confirmation.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    * METHOD handle_close
      METHOD handle_close.
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
      ENDMETHOD.                    "handle_close
    * METHOD handle_hotspot_click
      METHOD handle_hotspot_click.
        READ TABLE gt_output INDEX e_row_id INTO wa_output.
        IF NOT wa_output-sales_doc IS INITIAL
           AND e_column_id = 'SALES_DOC'.
          SET PARAMETER ID 'AUN' FIELD wa_output-sales_doc.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    * METHOD create_detail_list
      METHOD create_detail_list.
        DATA: lv_caption(200) TYPE c.
        CLEAR wa_column.
    *   Create popup window
        CREATE OBJECT dialogbox_container
            EXPORTING
              top = 100
              left = 150
              lifetime = cntl_lifetime_dynpro
              caption = lv_caption
              width = 800
              height = 200.
        CREATE OBJECT grid2
            EXPORTING i_parent = dialogbox_container.
    *   Trigger event when user closes the popup window
        SET HANDLER event_receiver->handle_close FOR dialogbox_container.
        READ TABLE im_column INDEX 1 INTO wa_column.
    *   Display popup window
        IF wa_column-fname = 'SO_STATUS'.
          gs_layout-grid_title = text-026.
          CALL METHOD grid2->set_table_for_first_display
           EXPORTING
    *        i_structure_name = 'T_OUTPUT'
             is_layout        = gs_layout
           CHANGING
             it_outtab        = gt_status_history
             it_fieldcatalog  = gt_fieldcat.
        ELSEIF wa_column-fname = 'BILL_DOC'.
          gs_layout-grid_title = text-027.
          CALL METHOD grid2->set_table_for_first_display
           EXPORTING
    *        i_structure_name = 'T_OUTPUT'
             is_layout        = gs_layout
           CHANGING
             it_outtab        = gt_confirmation
             it_fieldcatalog  = gt_fieldcat.
        ENDIF.
        CALL METHOD cl_gui_control=>set_focus
          EXPORTING
            control = grid2.
      ENDMETHOD.                    "create_detail_list
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    * START-OF-SELECTION                           *
    START-OF-SELECTION.
      DATA: o_lcl_get_data TYPE REF TO lcl_get_data.
      CREATE OBJECT o_lcl_get_data.
      CALL METHOD o_lcl_get_data->get_sales_docs.
    * END-OF-SELECTION                             *
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS '100'.
      SET TITLEBAR  'TITLE100'.
      DATA: o_lcl_alv_routines TYPE REF TO lcl_alv_routines,
            gv_text            TYPE string,
            gv_name1           TYPE kna1-name1,
            gv_date_low(10)    TYPE c,
            gv_date_high(10)   TYPE c.
      CREATE OBJECT o_lcl_alv_routines.
      g_repid = sy-repid.
      IF custom_container IS INITIAL.
        CREATE OBJECT custom_container
          EXPORTING
            container_name = gv_container
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = text-028.
        ENDIF.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = custom_container.
    *   Build fieldcatalog for initial display
        CALL METHOD o_lcl_alv_routines->build_fieldcat.
        SELECT SINGLE name1
          FROM kna1
          INTO gv_name1
         WHERE kunnr = p_kunnr.
        WRITE: s_erdat-low  TO gv_date_low  USING EDIT MASK '__/__/____',
               s_erdat-high TO gv_date_high USING EDIT MASK '__/__/____'.
        CONCATENATE: gv_name1 'from:' gv_date_low '-' gv_date_high
               INTO gv_text
          SEPARATED BY space.
        gs_layout-grid_title = gv_text.
    *   Display initial window
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
    *        i_structure_name = ''
            is_layout        = gs_layout
          CHANGING
            it_outtab        = gt_output
            it_fieldcatalog  = gt_fieldcat.
        CREATE OBJECT event_receiver.
    *   Trigger event when user double clicks initial window
        SET HANDLER event_receiver->handle_double_click FOR grid1.
    *   Trigger event when user clicks hotspot field
        SET HANDLER event_receiver->handle_hotspot_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CASE save_ok.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          CALL METHOD custom_container->free.
          CALL METHOD cl_gui_cfw=>flush.
          IF sy-subrc <> 0.
            CALL FUNCTION 'POPUP_TO_INFORM'
              EXPORTING
                titel = g_repid
                txt2  = sy-subrc
                txt1  = text-029.
          ENDIF.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

  • How to join two lists and display the results in datasheet view.?

    hello,
    i have two lists that i would like to join, i know a method that has been described  in the link below
    http://www.codeproject.com/Articles/194252/How-to-Link-Two-Lists-and-Create-a-Combined-Ciew-i
    however, here the data view is only limited to 30 rows and my resultant list is huge. I would like to know if there is a possibility to view the resultant list in a data sheet view ?

    I don't believe you can use the OOTB Datasheet view when joining lists. However, you should be able to increase your limit from 30 items to as many as you need (that doesn't trip the threshold set in Central Admin).
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Urgent - How to join multiple facts and dimensions in OBIEE rpd??

    Hi,
    In my RPD I have 3 facts and 4 dimensions and the joins defined are as below
    Physical layer - All joins are FK and inner (1:N)
    FACTA-------------- DIM_TIME, DIM_CUST,DIM_CAL
    FACTB-------------- DIM_TIME, DIM_CUST,DIM_CAL
    FACTC-------------- DIM_TIME, DIM_CUST,DIM_CAL, DIM_XYZ
    BM layer - All joins are complex, inner
    The logical table F1 pulls columns from FACTA, FACTB and FACTC . Complex join exists between all 4 dimensions DIM_TIME, DIM_CUST,DIM_CAL, DIM_XYZ to logical table F1.
    Issue: I need to build a report with $ column from FACTA, FACTB and FACTC and need to add filter conditions using columns from DIM_TIME, DIM_CUST,DIM_CAL, DIM_XYZ.
    However when ever I add a filter condition from DIM_XYZ the physical query generated is not generating code to access data from FACTA and FACTB. Instead it is subsituting a NULL and just pulls data frm FACTC.
    My Questions: What is the best way to build the physical and BMM layer using FACTA, FACTB,FACTC, DIM_TIME, DIM_CUST,DIM_CAL and DIM_XYZ??
    I need to resolve this issue ASAP so any help is appreciated. Thanks
    Edited by: user11935561 on Feb 10, 2010 6:27 AM
    Edited by: user11935561 on Feb 10, 2010 6:28 AM

    You can find the same issue in
    Logic of queries in OBIEE
    or
    Connection between 2 fact tables
    Follow the link
    http://there-n-back-again.blogspot.com/2009/04/oracle-analytics-how-to-report-over-non.html
    Put 'All' or 'Total' at levels for dim_xxx for those facts you need in your report from facta and factb
    Regards
    Nicolae

  • HOW TO JOIN  CABN CABNT AND CAWN

    DEAR EXPERTS,
    CAN ANY ONE SUGGEST ME HOW TO JOIN TABLES CABN CABNT AND CAWN
    THANX IN ADVANCE

    Ramesh,
    SELECT CABNATINN CABNTADZHL CABNTATINN CABNTSPRAS CAWN~ADZHL
           CAWNATINN CAWNSPRAS
    INTO (CABN-ATINN , CABNT-ADZHL , CABNT-ATINN , CABNT-SPRAS , CAWN-ADZHL
         , CAWN-ATINN , CAWN-SPRAS )
    FROM ( CABN
           INNER JOIN CABNT
           ON CABNTATINN = CABNATINN
           INNER JOIN CAWN
           ON CAWNADZHL = CABNTADZHL
           AND CAWNATINN = CABNTATINN
           AND CAWNSPRAS = CABNTSPRAS ).
    Pls. mark if useful

  • How to join a  cube and a Attribute of it's Char. without navigation

    How to join a&#12288;cube and a Attribute of it's Characteristic
    without navigation Attribute.
    example
    &#9312; Cube X&#65306;(data)
    &#12539;0material&#65306; apple
    &#12539;0company&#65306; firmA
    &#12539;Sales&#65306;$100
    &#9313;ODS(marerial-company master)
    (Key)0material&#65306; apple
    (Key)0company&#65306; firmA
    &#12539;Sales-Employee&#65306;Mr.Y
    &#8595;
    Mr.Y&#65306;$100
    Now,Cube X has many realdata.
    So, we do not hope to repair Cube X itself.

    Hello sakurai
    1. you should use multiprovider on ODS and cube to get the desired field .
    2. Infoset is a flat structure you use for characteristic reporting, in you case you need attribute in reporting so can use it.
    3. If u r in BI 7 , add extra field in cube and populate by loopback process....
    Award points if help...
    Revert back in case of any doubt
    Thanks
    Tripple k

  • JOIN VBRK VBRP : BAD performance

    I have a big performance problem with this :
    SELECT  vvbeln vfkart vfkdat vvbtyp vkunrg vvkorg v~bukrs
              bPOSNR bmatnr bfkimg bprsdt b~werks
              FROM VBRK As v
              JOIN VBRP AS b ON bvbeln = vvbeln
       APPENDING corresponding fields of table t_vbrk
             WHERE v~fkart IN s_fkart
               AND b~matnr IN s_matnr
               AND b~ean11 IN s_ean11.
    Any idea to solve this issue to improve the perfromance ?
    Thank you.

    HI
    Use for all entries instead of joins and remove corresponding fields of, use into table with exact strucutre fields.

  • How to join three tables and practical difference between 10g and 11g

    I want to know with example how to outer join three different tables in Oracle.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!

    Hi,
    897293 wrote:
    I want to know with example how to outer join three different tables in Oracle.The 3rd table comes into the result set the same way the 2nd one did:
    FROM           table_1  t1
    LEFT OUTER JOIN      table_2  t2  ON   ...
    LEFT OUTER JOIN      table_3  t3  ON   ...The join condition(s) for t3 can reference t1, or t2, or both.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!The main manuals all have "What's New" sections near the beginning. For example:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/wnsql.htm#sthref5
    Hoek,
    We've missed you. Welcome back!

  • How to join multiple clips and music?

    Hi. I have finish a project, but I want to include new music with news clips in the middle of it . How can I join the multiples clips and the music I have edited so far in order to move them in the timeline as is they were a single clip, that is, without broken them? Thank you

    You can find the same issue in
    Logic of queries in OBIEE
    or
    Connection between 2 fact tables
    Follow the link
    http://there-n-back-again.blogspot.com/2009/04/oracle-analytics-how-to-report-over-non.html
    Put 'All' or 'Total' at levels for dim_xxx for those facts you need in your report from facta and factb
    Regards
    Nicolae

  • How to join two tables and get the supply delivery date next to order?

    So there are two tables. One has customer's order no, ordered date, order quantity, available quantity and code of article-
    The other table comes form supply side where we have supply order no, article number, ordered qty, and delivery date.
    We keep stock so this can not be MOT (made to order) system.
    What i need is correct date of arrival to appear next to cusotmers spoecirfic order. The older cusotmers order get's the parts first, second oldest order is next in line etc.
    here is any example
    customer's order
    ref order
    art. code
    ordered qty
    available qty
    order date
    1809202491
    700497
    60
    0
    3.7.2014
    1809200528
    700497
    13
    0
    20.6.2014
    1809198640
    700497
    7
    0
    9.6.2014
    supply order
    supply order
    art. code
    qty orderd
    date of arrival
    4501243378
    700497
    50
    4.8.2014
    4501263437
    700497
    20
    6.10.2014
    There is actually a 3rd "table" and that sort of connects the two and that is stock on hand per art. code.
    The main issue is that stock is assigned to purchase orders only when it actually arrives in the warehouse.
    A human can easilly connect the dates of when the stock will arrive and quantities with correct customer's order. In this case the firts order will get 50 pcs in August while 10 pcs will remain on backorders. The missing 10 pcs Will arrive in October. The second order will get 10 pcs in october and 3 will remain on backorders with no delivery date. While the third customer orders does not have a delivery date.
    So how to make the SAP do this calculations and display the arrival date next to date of customer's order?

    I checked the instructions as i do not have access to this part. It seem this is a query. We had issues with queries in the past as not all codes from orders would appear in them. They never found the reason why that is happening.
    However, I think the main issue is that the information here is not connected and is separately provided for supply and for sales. So i doubt it can be connected in this query.
    edit: as you can see the only connection is stock on hand.
    and total number of various items we have is close to 100.000 of various article codes.

  • How to create analytic view with tables  VBRK VBRP KONV ?

    Hi Gurus,
    What is the best way to combine in a analytic view tables VBRK VBRP and KONV for better optimization or
    how to make the relationship tables VBRK VBRP KONV with better performance in Hana Studio ?
    This analytic view should be used in a calculation view to the final calculations.
    Thanks !

    Hi Rogerio,
    Greetings.
    Basically , when you design your analytic views , while designing your data foundation , you can directly join the tables with the corresponding key attributes . Analytic views are capable of optimizing the join operation when we access the view.Logic of joining is purely depends on your business requirement
    Sreehari.

  • Link betwwen KONA and VBRK/VBRP

    Hi
    please suggest me the link between KONA and VBRK/VBRP and
    KONP and VBRK/VBRP
    I want to give link of rebate agreement and invoice no/Inv Qty
    My requirement is I want a report where i can see Under one Rebate agreement ,how many Commercial  Invoice use
    e.g.  Rebate Agreement no -125 ( for 10 Rs / unit)
    I have created 10 Invoice for 10 qty each so accrual Amount is 10* 10= 100
    I want such report where for agreement No 125- 10 Invoice No should be reflected.
    I don't want to go into VBO2 and go to verification level that concept i know
    i want one report where i will see all
    Regards
    Hemant

    You can go via KONH - KONV to VBRP but you will have big performance issues especially with the KONV table when you enter the condition record number from KONH only.
    Much easier go to KONH enter your Agreement number. Get the KNUMH from your rebate agreement and enter it in Table S136. This will give you all the invoices associated with your rebate.
    Good Luck.

Maybe you are looking for