cancel
Showing results for 
Search instead for 
Did you mean: 

Partner And Condition Details In BBP_PD_CTR_CREATE

Former Member
0 Kudos

Hello,

Iam trying to create the contracts using FM BBP_PD_CTR_CREATE but I cudnt see the partner details updated when i look into trancode bbp_pd. What might be the error cud u please help me out..

Thanks

Viky

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Viky,

The function modules should work, but since there are many parameters/fields to be populated, and not-so-clear error messages, this could be tricky.

I have just rewritten an upload program for GOA (with distribution to backend). I did not put in any conditions yet though, but it allowed me to create GOA for a start,.. visible in bbp_pd and of course, through the portal.

Try clearing <i>pc_item-CATEGORY, wa_part-ADDR_TYPE, wa_part-ADDR_NO,

wa_part-PERS_NO</i>. And try assigning a guid for <i>pc_org-guid</i>.

See if this helps. If it still fails, forward me your email address and I'll sort you out with some codes.

Good luck.

Foh

Answers (2)

Answers (2)

0 Kudos

Hi Vicky,

I am trying to create contract in SRM . i copied your above code and executed. Contract is created but the conditions are not created.

Could you please help me .... please let me know what i am missing or post the updated code which updates conditions too..

Former Member
0 Kudos

Hi

I guess the code you are doing is not correct.

Ensure that

CALL FUNCTION 'BAPI_COMMIT_WORK' is used after succeful execution of the function module.

Are there any messages coming in BBP_PD_CTR_CREATE - exceptions / return table in the function module call. ?

Please paste the code here for analysis.

Regards

- Atul

Former Member
0 Kudos

Thanks Atul For the Reply,

I didnt get any error messages and the function module exists normally but i still didnt see any partners. Here is the code.


data: pc_id like CRMD_ORDERADM_H-OBJECT_ID.

data: pc_header_out like BBP_PDS_CTR_HEADER_IC.

data: pc_header_in like BBP_PDS_CTR_HEADER_D.

*data: pc_item type table of BBP_PDS_CTR_ITEM_D with header line.

data: pc_item type table of BBP_PDS_CTR_ITEM_ICU with header line.

data: pc_text type table of BBP_PDS_LONGTEXT.

data: pc_partner type table of BBP_PDS_PARTNER.

data: wa_part like line of pc_partner.
data: wa_condition type BBP_PDS_CND_ICU occurs 0 .
data: ls_condition like line of wa_condition.

data: pc_org type table of BBP_PDS_ORG with header line.

data: pc_message type table of BBP_PDS_MESSAGES with header line.
DATA  pc_conditions_in type BBPT_PD_CND_D.
DATA  pc_item_mess type table of BBP_PDS_CTR_ITEM_D with header line.
DATA  pc_status type table of BBP_PDS_STATUS with header line..
DATA  pc_partner_mess type table of BBP_PDS_PARTNER with header line.

*Insert dummy data******************************************************
pc_header_out-CURRENCY = 'USD'.
pc_header_out-PROCESS_TYPE = 'GCTR'.
pc_header_out-description = 'Vin2 Test'.
pc_header_out-guid = 'B26BA487C505A84CBE22DDC3CCE80000'.
pc_header_out-vper_start = '20070322'.
pc_header_out-vper_end = '20080322'.
pc_header_out-posting_date = sy-datum.
pc_header_out-SUBTYPE = 'CC'.


* Insert Purchase Org data *********************************************
*pc_org-PROC_ORG_RESP_ID = 'O 50000026'.
*pc_org-PROC_ORG_ID = 'O 50000025'.
*pc_org-PROC_GROUP_ID = 'O 50000026'.

* Insert BP data - vendor, employee Purch Org and DSTA******************
*DSTA
*wa_part-PARTNER_NO = ' 9CAF79EC44ED3549AB247F40D607EB3B'.
wa_part-PARTNER_GUID = '26C665256EA6EE42B98E7CE5766C7D7F'.
wa_part-P_GUID = '433090A0A0E63940ADBB731523F8671B'.
wa_part-PARTNER_FCT = '00000019'.
wa_part-partner_no = '9CAF79EC44ED3549AB247F40D607EB3B'.
*wa_part-display_type = 'BP'.
wa_part-mainpartner = 'X'.
wa_part-ADDR_TYPE = '1'.
wa_part-addr_no = '0000010708'.
append wa_part to pc_partner.
clear wa_part.
**employee
*wa_part-PARTNER_ID = '0000000006'.
*wa_part-PARTNER_GUID = 'E3D4AAE842930D41B7B107F3CC60B44D'.
*wa_part-PARTNER_FCT = '00000026'.
*wa_part-ADDR_TYPE = '3'.
*wa_part-ADDR_NO = '0000010472'.
*wa_part-PERS_NO = '0000010474'.
*append wa_part to pc_partner.
*clear wa_part.
*
**vendor
*wa_part-PARTNER_ID = '0000000311'.
*wa_part-PARTNER_GUID = 'F0BC646129BE2D4BB7E301F8F3708B1E'.
*wa_part-PARTNER_FCT = '00000019'.
*wa_part-ADDR_TYPE = '1'.
*append wa_part to pc_partner.
*clear wa_part.
*
**purch org
*wa_part-PARTNER_ID = '0000000002'.
*wa_part-PARTNER_GUID = '48459C575651D04091BAF1B9A554CF51'.
*wa_part-PARTNER_FCT = '00000051'.
*wa_part-ADDR_TYPE = '1'.
*wa_part-ADDR_NO = '0000010470'.
*append wa_part to pc_partner.
*clear wa_part.

* Item data
pc_item-guid = '021824CD6CD81640B0D25334245AE01B'.
pc_item-parent = 'B26BA487C505A84CBE22DDC3CCE80000'.
pc_item-number_int = '1'.
pc_item-CATEGORY = '97C0B614B2B99E48BDF05AE34E931A78'.
pc_item-CATEGORY_ID = '2010'.
pc_item-QUANTITY = '233'.
pc_item-PRICE = '1234'.
pc_item-PRICE_UNIT = '1'.
pc_item-ITM_RELEASED = 'X'.
pc_item-VALUE = '4321'.
pc_item-UNIT = 'EA'.
pc_item-PRODUCT_TYPE = '01'.
*pc_item-PRODUCT = 'B78A60018B6018418F6D0F1632E10F69'.
pc_item-DESCRIPTION = 'Russian T72 Tanks'.
append pc_item to pc_item.
clear pc_item.

*Item Condition Tables
ls_condition-guid = '021824CD6CD81640B0D25334245AE01B'.
ls_condition-COND_TYPE = '01CT'.
ls_condition-INVENT_LOC_ID = ' '.
ls_condition-COND_RATE = '1.00'.
ls_condition-COND_CURR = 'USD'.
ls_condition-COND_UNIT = 'EA'.
ls_condition-COND_PRC_UNIT = '1'.
ls_condition-DATE_FROM = sy-datum.
ls_condition-DATE_TO = '99991231'.
ls_condition-COND_TAB = 'SAP016'.
append ls_condition to wa_condition.
clear ls_condition.

*wa_condition-COND_TYPE = '01CT'.
*wa_condition-INVENT_LOC_ID = '125'.
*wa_condition-COND_RATE = '4.00'.
*wa_condition-COND_CURR = 'USD'.
*wa_condition-COND_UNIT = 'EA'.
*wa_condition-COND_PRC_UNIT = '1'.
*wa_condition-DATE_FROM = sy-datum.
*wa_condition-DATE_TO = '99991231'.
*wa_condition-COND_TAB = 'SAP068'.
*append wa_condition to wa_condition.
*clear pc_item.
*
*wa_condition-COND_TYPE = '01CT'.
*wa_condition-INVENT_LOC_ID = '102'.
*wa_condition-COND_RATE = '1.00'.
*wa_condition-COND_CURR = 'USD'.
*wa_condition-COND_UNIT = 'EA'.
*wa_condition-COND_PRC_UNIT = '1'.
*wa_condition-DATE_FROM = sy-datum.
*wa_condition-DATE_TO = '99991231'.
*wa_condition-COND_TAB = 'SAP068'.
*append wa_condition to wa_condition.
*clear pc_item.

*--Reset Buffer Tables
CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.

*Create PC**************************************************************

call function 'BBP_PD_CTR_CREATE'
  EXPORTING
    I_HEADER      = pc_header_out
    it_conditions = wa_condition
    I_BAPIMODE = 'X'
    I_SAVE = 'X'
  IMPORTING
    E_HEADER      = pc_header_in
    et_conditions = pc_conditions_in
  TABLES
    I_ITEM        = pc_item
    I_PARTNER     = pc_partner
    I_ORGDATA     = pc_org
    I_LONGTEXT    = pc_text
    E_MESSAGES    = pc_message
    E_PARTNER     = pc_partner_mess
    e_item        = pc_item_mess
    e_status      = pc_status.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .

break-point.
CALL FUNCTION 'BBP_PD_CTR_SAVE'
 EXPORTING
*   IV_WORKITEM_ID               =
*   IV_USERTYPE                  =
   IV_HEADER_GUID               = pc_header_in-guid
*   IV_CREATE_HIST_VERSION       =
*   IV_KEEP_OLD_CHANGER          =
*   IV_NEW_CHANGED_BY            =
          .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .


Former Member
0 Kudos

Hi

<b>Check whether Partner data and condition data with the GUID, partner ID etc. is existing in the system.</b>

<u>There is some problem with the code.

Do you want to create a new Contract or trying to update an existing contract ?</u>

Let me know your detailed business requirement.

Regards

- Atul

Former Member
0 Kudos

I want to create a new contract.

Thanks

Viky

Former Member
0 Kudos

I want to upload the contracts from ARIBA to SRM. I will be getting a flat file with all the details and I shud Upload them to SRM .

Thanks

Viky

Former Member
0 Kudos

Hi

Refer OSS notes.

734060 SRM:Upload and Download of Documents using MS Excel

734946 SRM: Restriction on upload and download.

Please see the link below

<b>http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAISMM/CABFAISMM.pdf</b>

-> This may help you to distribute the contract from backend to SRM system.

Refer to this link for details.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul