cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in determining contract details in SRM in ABAP Development

Former Member
0 Kudos

Hi All,

I am new to SRM related developments. I have a requirement where I need to set a contract number in the header based on corresponding RFx number.

I need to set this number in method BBP_CTR_CHANGE of BAdI BBP_DOC_CHANGE_CTR with filter value = BUS2000113(Contract).

I am determining RFx and RFx response number using function module BBP_PROCDOC_GETDETAIL and then trying to determine if it is single contract or panel contract(multiple contracts). I want to know if am doing it in right way. I am not getting any value inside the tables of function module BBP_PROCDOC_GETDETAIL.

I also want to know how to read guids of RFx and/or RFx response at runtime inside BAdI method.

Thanks,

Ameet

Accepted Solutions (0)

Answers (1)

Answers (1)

robin_janke
Contributor
0 Kudos

Hi,

I don't understand your requirement. You need to set a contract number in a contract?

The doc change badi is only called for the current contract. If an rfx is the source you can get that from the current contract data.

To read RFx (BUS2200) I always use the BBP_PD_QUOT_GETDETAIL FM (or the class equivalent)

For RFx response (BUS2202) use BBP_PD_BID_GETDETAIL.

Check out transaction BBP_PD for all data and fields mostly available in the contract and check there what relations to other documents there are or what the source of a contract is.

Regards,

Robin

Former Member
0 Kudos

Hi Robin,

I have an extended classic scenario in SRM where user creates a contract from RFx response in SRM portal. While a new contract is getting created from RFx response, I want to set the contract number of the contract being newly created based on RFx number e.g. if corresponding RFx number is <400050> then I want to set contract number as <400050>-<xyz> where <xyz> = 000, 001 based on how many contracts are already created with reference to RFx response.

A BAdI BBP_DOC_CHANGE_BADI gets triggered during this process of contract creation. The method BBP_CTR_CHANGE is method I am looking at. In this method I want to read the RFx response number and then corresponding RFx number. To read RFx response, I do not see anything such as RFx response number or its guid in the IS_HEADER importing parameter of BAdI method.

If I get the guid of RFx response, I can further get RFx number using method BBP_PROCDOC_GETDETAIL and I can set the contract number as <RFx number>-<xyz> and send it into field object_id of exporting parameter ES_HEADER of the BAdI method.

I hope you got what I want to achieve.

Please let me know if the approach is incorrect for the solution. If it is incorrect approach then please suggest me the right approach to achieve it.

Thanks,

Ameet

Former Member
0 Kudos

Hi All,

When BBP_DOC_CHANGE_BADI gets triggerred during the contract creation from RFx response. But in the method BBP_CHG_CTR method the parameter is_header is not showing up any filled in values except some dates, guid as 1 and contract doc type as CCTR.

I want to know the RFx guid or RFx number in this BAdI.

Thanks,

Ameet

Former Member
0 Kudos

Hi Ameet,

Your requirement is quite strange. If I understood you right , you are saying you want to set the contract id to whatever is the Rfx number(first few digits) to that contract. I dont believe you can change that as it comes from the configuration . In the configuration you would have given the number range that you want the contract to follow.

In case you really want to store this Rfx number somewhere , have a Z field and store it there.

You can get the Rfx response guid from SRC_guid of the item structure. From this guid you can get the associated rfx number.

Hope this helps.

Regards,

Naveen

Former Member
0 Kudos

Hi Naveen,

I am now able to read RFx response and from that the RFx details. I could determine the RFx number and send it as parameter in field OBJECT_ID field in ES_HEADER. But when the control comes out of BAdI and contract gets created, system gives message that contract <contract#> is not completely created.

In the doc change BAdI method, do I need to pass on any further details in exporting or changing parameters from RFx to Contract. I guess message is due to Product Category, Purchasing Group and Purchasing Organization missing for contract while contract is getting created.

I would appreciate if someone can guide me as to where these details need to be passed inside BAdI method for contract creation.

Thanks,

Ameet

robin_janke
Contributor
0 Kudos

For the doc_change_badi I always map the import to the export parameters first before I do anything else, this keeps the system from losing a lot of values - it's not a bug, it is the SRM way .

Regards,

Robin