Skip to Content
author's profile photo Former Member
Former Member

Pricing exit CRM_COND_COM_BADI for MV45AFZZ PERFORM XVBPA_LESEN

ECC user exit MV45AFZZ has PERFORM XVBPA_LESEN that moves a the customer number of a partner function to a field.

PERFORM XVBPA_LESEN(SAPFV45K) USING 'Y1' VBAP-POSNR SY-TABIX.

MOVE XVBPA-KUNNR TO TKOMK-ZZKUNY1.

Is there an existing perform in CRM similiar to XVBPA-LESEN?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 10:32 PM

    Hi Glenn,

    ZZKUNY1 is a custom field and obviously you got to do it yourself.

    Since you are already using ZZKUNY1 as a part of the field catalog, I assume it is used in a pricing condition. Make sure that the condition is available in CRM also.

    Also make sure that the field ZZKUNY1 is defined in the CRM field catalog in the header fields (TKOMK). If you have already created this, then well ad good. If not, you have to see that the ZZKUNY1 in CRM and R/3 must match in data type etc.

    Now implement the BAdI CRM_COND_COM_BADI and since this is a header field, add right kind of code in the method HEADER_COMMUNICATION_STRUCTURE

      DATA: ls_crmt_acs_h_com TYPE crmt_acs_h_com,
            lt_header_guid    TYPE crmt_object_guid_tab,
            lt_req_obj        TYPE crmt_object_name_tab,
    //      etc. Define rest of the structures
    
      ls_crmt_acs_h_com = cs_acs_h_com.
    //
      APPEND ls_crmt_acs_h_com-header TO lt_header_guid.
      lv_guid = ls_crmt_acs_h_com-header.
    
      ls_req_obj =  gc_object_name-partner.
      INSERT ls_req_obj INTO TABLE lt_req_obj.
    
      CALL FUNCTION 'CRM_ORDER_READ_OW'
        EXPORTING
          it_header_guid       = lt_header_guid
          it_requested_objects = lt_req_obj
        IMPORTING
          et_partner           = lt_partner
        CHANGING
          cv_log_handle        = lv_log_handle.
    
      CHECK sy-subrc = 0.
    //Check your partner function type here
      READ TABLE lt_partner INTO ls_partner WITH KEY ref_guid = lv_guid
                                                     partner_fct = "0000001"
      IF sy-subrc = 0.
        lv_partner_guid  = ls_partner-bp_partner_guid.
    
        SELECT SINGLE partner INTO lv_customer FROM but000 WHERE partner_guid = lv_partner_guid.
    
    cs_acs_h_com-ZZKUNY1 = lv_customer 
      ENDIF.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.