cancel
Showing results for 
Search instead for 
Did you mean: 

Add the customs fields in BW reports

Former Member
0 Kudos

Hi ALL,

I am working on CRM 5.0 & BI 7.0

1.we have added Custom fields(19) in EEWB,

i have to add custom fields in BW Reports,

how can i get the custom fields in BW Report?

2.Suppose i have to implement CRM_BWA_MFLOW BADI?

what coding i have to write inside of the method?

i have to get the data in inside of the method ? or i have to change the structure?

3. can any one send me sample coding for geting atleast one custom field in BW?

i ll reward for helpful msg

Thanks,

Ganesh R

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
Active Contributor
0 Kudos

Hello,

you have to implement the BAdI CRM_BWA_MFLOW. Here is some sample Code extending the Opportunity Header with a custom defined Partner role:

METHOD if_ex_crm_bwa_mflow~enhance_data_source .
  DATA:
     lt_data_h TYPE TABLE OF crmt_bw_oppt_h,
     wa_data_h LIKE LINE OF lt_data_h,
     lt_CRMD_CUSTOMER_H type table of CRMD_CUSTOMER_H,
     wa_CRMD_CUSTOMER_H like line of lt_CRMD_CUSTOMER_H,
     lt_data_i TYPE TABLE OF crmt_bw_oppt_i,
     wa_data_i LIKE LINE OF lt_data_i,
     OPP_GUID TYPE  CRMT_OBJECT_GUID.

  data: LT_CRMT_PARTNER_DB_TAB TYPE CRMT_PARTNER_DB_TAB,
        WA_CRMT_PARTNER_DB_TAB like line of LT_CRMT_PARTNER_DB_TAB.
  data: wa_crmd_partner like line of LT_CRMT_PARTNER_DB_TAB.

  data: lt_but000 type table of but000,
        wa_but000 like line of lt_but000.

  FIELD-SYMBOLS:
     <ls_data_h> LIKE LINE OF lt_data_h,
     <ls_data_i> LIKE LINE OF lt_data_i.


  CASE i_datasource.

    WHEN '0CRM_OPPT_H'.

      lt_data_h[] = ct_data[].
      REFRESH ct_data.

      LOOP AT lt_data_h ASSIGNING <ls_data_h>.
        clear wa_crmd_customer_h.
        select single * from CRMD_CUSTOMER_H into wa_CRMD_CUSTOMER_H
          where GUID = <ls_data_h>-GUID.
        check sy-subrc = 0.
        MOVE-CORRESPONDING wa_CRMD_CUSTOMER_H TO <ls_data_h>.

* Read Additional Partners
        OPP_GUID = <ls_data_h>-GUID.
        REFRESH LT_CRMT_PARTNER_DB_TAB.
        CALL FUNCTION 'CRM_PARTNER_READ_DB'
          EXPORTING
            IV_REF_GUID                   = OPP_GUID
            IV_REF_KIND                   = 'A'
          IMPORTING
            ET_PARTNER_DB                 = LT_CRMT_PARTNER_DB_TAB
          EXCEPTIONS
            ENTRY_DOES_NOT_EXIST          = 1
            RECORD_NOT_FOUND              = 2
            AT_LEAST_ONE_RECORD_NOT_FOUND = 3
            PARAMETER_ERROR               = 4
            OTHERS                        = 5.

          loop at lt_crmt_partner_db_tab into wa_crmt_partner_db_tab.
* Check if this partner is a main partner
            check wa_crmt_partner_db_tab-mainpartner = 'X'.

            SELECT single * FROM  CRMD_PARTNER into wa_crmd_partner
             WHERE  PARTNER_GUID  = wa_crmt_partner_db_tab-partner_guid.

            SELECT        * FROM  BUT000 into wa_but000
                   WHERE  PARTNER_GUID  = wa_crmd_partner-partner_no.

            ENDSELECT.

            case wa_crmt_partner_db_tab-partner_fct.
              when 'Y0000006'.
*      write: 'General Employee'.
                <ls_data_h>-zzcrmt_gen_per = wa_but000-partner.
              when others.
            endcase.

          ENDLOOP.
        endif.
      endloop.

      ct_data = lt_data_h[].
    WHEN OTHERS.
  ENDCASE.
ENDMETHOD.

Best regards

Gregor

Former Member
0 Kudos

Hi gregor,

Thanks lots....

gregorw
Active Contributor
0 Kudos

Hello,

why didn't you awarded full points?

Regards

Gregor

Former Member
0 Kudos

Hi Gregor,

1.without imlementing BADI also that data source is giving data but ur example code is very helpful .

2. I have to get the custom fields in custom BW report

this is the second step

thats y i have given 6 point

thanks

Ganesh R

gregorw
Active Contributor
0 Kudos

Hi,

but that's another question. I think for the BW forum. Thanks for changing the Points.

Best regards

Gregor

Answers (0)