Skip to Content
avatar image
Former Member

Get the contract distribution data in FM BBP_PD_CTR_GETDETAIL

Dear ,Experts :

I work in SRM 7.0 and Extended Classic Scenairo .

I want to check the contribution data (organization data )in the FM :BBP_PD_CTR_GETDETAIL in the document check BADI .

But if I use this Function to get the contract disttibution data in the BADI ,when I click the "check" button ,there is no error message .At this moment ,the Button -"Release"is not available .

I send SSO to SAP support .He said that

****************

The issue may be due to the use of the model class instance to get the detail of the contract in the Check BADI which will not give the updated buffer value.

And suggest that the FM BBP_PROCDOC_GETDETAIL is fine in this case .But I am sorry that I can't get the structure---

BBP_PDS_DIS in the contract .

So ,I am confused that ,I must do the check in the contract ,but I can't use the FM BBP_PD_CTR_GETDETAIL .What can I do now ,and how to handle the code in the check BADI .

Any suggestions welcome .

BestRegards !

Alex !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    May 08, 2011 at 12:16 PM

    Hi,

    Try this:

    DATA: lo_pd_model TYPE REF TO /sapsrm/if_pdo_model_access.
    data: lte_dep_attr     LIKE bbp_pds_dep OCCURS 0 WITH HEADER LINE,
    lt_dis type table of BBP_PDS_DIS.
    
    lo_pd_model = /sapsrm/cl_pdo_model_factory=>get_instance( ).
    * BBP_PROCDOC_GETDETAIL replaced by wrapper class call
      IF lv_with_itemdata IS INITIAL.
        CALL METHOD lo_pd_model->get_detail
          EXPORTING
            iv_guid                  = iv_doc_guid
            iv_object_type           = 'BUS2000113' "this is contract
          IMPORTING
            et_dep                   = lte_dep_attr[].
    
    * Map dependent attribute set data to distribution set structure
      CALL FUNCTION 'BBP_PDDEP_MAP_DEP_TO_DIS'
        TABLES
          it_dep_attr = lte_dep_attr
          et_dis      = lt_dis.
    
    

    Now in lt_dis local table check your data and throw message to user.

      IF '<any_value>' IS INITIAL.
        MESSAGE e010(zmessage) INTO lf_dummy.
    
        CLEAR ls_message.
    
        ls_message-msgty = sy-msgty.
        ls_message-msgid = sy-msgid.
        ls_message-msgno = sy-msgno.
    
        SELECT SINGLE text
          FROM t100
          INTO ls_message-message
         WHERE sprsl = sy-langu
           AND arbgb = sy-msgid
           AND msgnr = sy-msgno.
    
        APPEND ls_message TO et_messages.
      ENDIF.
    

    Regards,

    Marcin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI, Marcin

      Thanks for your reply .

      The symptom is like you said ,I chenck the contract ,and find no error .But the button of the "Release" is disabled .If I change the any data in the head data .the button will be fine .

      In my case ,the customer won't want to change anything if the contract has no error .So I am confused about it .

      Could you please give me some suggestions ?I really need your help .

      Thanks a lot !

      Alex !