cancel
Showing results for 
Search instead for 
Did you mean: 

Get the contract distribution data in FM BBP_PD_CTR_GETDETAIL

Former Member
0 Kudos

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 !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

HI,Marcin

Thanks a lot,It is useful for me !I do the code like you said .Cool!

BestRegards!

Alex

Former Member
0 Kudos

HI,Marcin

I am sorry for the disdurbing ,and I open this forums again .

I use the function code that you gave me . But now ,the button of the release is still not available .

If I deactive the check BADI ,the button will be available .I am so confused about it .

Could you please give me some suggestions ?

Thanks !

BestRegards !

Alex !

Former Member
0 Kudos

The "Release" button would not be enabled if your contract document contains errors. If your CHECK BADI populates some errors during check (implicit or explicit button click), the "Release" button won't be enabled. Put an external break point inside your CHECK BADI and see what errors you have.

Former Member
0 Kudos

HI,

On my system in some cases Release button is disabled when I manually enter distribution on header level.

When I go to the header and chnge some other data, Release button is enabled.

Check that case. Return to header data or overview (or item data) change something and hit enter.

Regards,

Marcin

Former Member
0 Kudos

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 !

Answers (0)