cancel
Showing results for 
Search instead for 
Did you mean: 

Creating SC using BBP_PD_SC_CREATE

Former Member
0 Kudos

Hi All,

Iam creating SC using  BBP_PD_SC_CREATE with the following sequence.

1.BBP_PD_SC_CREATE

2.BBP_PD_SC_UPDATE

3.BBP_PD_SC_SAVE'

4.BBP_PROCDOC_RESET_BUFFER'

5.Commit

I can see SC created in BBP_PD Transaction,but with out any data.

This is my code:

iv_header-guid = '00000000000000000000000000001'.

iv_header-description = 'welcome'.

iv_header-currency = 'GBP'.

iv_header-process_type = 'SHC'.

iv_header-subtype = 'ER'.

iv_header-posting_date = sy-datum.

ls_item-guid=  '00000000000000000000000000000002'.
ls_item-parent  = ' 00000000000000000000000000000001'. "header guid

ls_item-product = '00000000000000000000000000000000'.

ls_item-description = 'Test'.

ls_item-category =  '000C29B4A62C1EE1ADBFC8AA8C9BFC7F'.   "00000000000000000000000000000000'.

ls_item-category_id = 'VALVES'.   " '65.10'.

ls_item-number_int = '0000000001'.

ls_item-number_ext = '0000000000'.

ls_item-product_type = '01'.

ls_item-quantity = '1.000'.

ls_item-unit = 'HIT'.

ls_item-price = '1'.

ls_item-gross_price = '39.0000'.

ls_item-catalog_price = '0.00'.

ls_item-price_unit = '1'.

ls_item-deliv_date =  sy-datum + 1.

ls_item-logsys_fi = 'ONECLNTERP'.

ls_item-be_stge_loc = '0001'.

ls_item-be_co_code = '1000'.

ls_item-currency = 'GBP'.

ls_item-be_plant = '1000'.

ls_item-be_pur_group = 'SRM'.

ls_item-be_pur_org = '1000'.

ls_item-be_log_system  = 'ONECLNTERP' ."CFG300

ls_item-be_doc_type = 'SHC' .  "ECPO

APPEND ls_item TO lt_item.

ls_account-guid =   '00000000000000000000000000000004'.

ls_account-p_guid = '00000000000000000000000000000002'.      "item guid

ls_account-distr_perc  = '100.00'.

ls_account-acc_no = '0001'.

ls_account-src_guid = '00000000000000000000000000000000'.

ls_account-g_l_acct = '520000'.

ls_account-cost_ctr = '10010001'.

ls_account-co_area = '1000'.

ls_account-profit_ctr = '1002'.

ls_account-acc_cat = 'CC'.

APPEND ls_account TO lt_account.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000020'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = '000C29B4A62C1EE1AEDA35BDC3303C7F'.

ls_bup-addr_type  = '3'.

ls_bup-addr_origin = 'A'.

ls_bup-partner_id  = '0000000705'.

ls_bup-addr_no  = '0000029710'.

ls_bup-pers_no = '0000029973'.

APPEND ls_bup TO lt_bup.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000027'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = 'DD3FFE214117D0F1B1A10014C2593DCB'.

ls_bup-addr_type  = '1'.

ls_bup-addr_origin = 'B'.

ls_bup-partner_id  = '0000000411'.

ls_bup-addr_no  = '0000028605'.

APPEND ls_bup TO lt_bup.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000019'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = '000C29B4A62C1EE1AEF5CB90A851BC7F'.

ls_bup-addr_type  = '1'.

ls_bup-addr_origin = 'A'.

ls_bup-partner_id  = '0000100063'.

ls_bup-addr_no  = '0000030204'.

APPEND ls_bup TO lt_bup.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000016'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = '000C29B4A62C1EE1AEDA35BDC3303C7F'.

ls_bup-addr_type  = '3'.

ls_bup-addr_origin = 'A'.

ls_bup-partner_id  = '0000000705'.

ls_bup-addr_no  = '0000029710'.

ls_bup-pers_no = '0000029973'.

APPEND ls_bup TO lt_bup.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000075'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = '000C29B4A62C1ED1AACC35E21C8DE770'.

ls_bup-addr_type  = '1'.

ls_bup-addr_origin = 'A'.

ls_bup-partner_id  = '0000000656'.

ls_bup-addr_no  = '0000029676'.

APPEND ls_bup TO lt_bup.

ls_org-proc_org_ot = 'O'.

ls_org-proc_org_id = '50001351'.

ls_org-proc_group_ot = 'O'.

ls_org-proc_group_id = '50001284'.

ls_org-p_guid = '00000000000000000000000000000002'.   "header guid  (I tried item guid and header guid as well)

ls_org-guid = '00000000000000000000000000000005'..

CALL FUNCTION 'BBP_PD_SC_CREATE'

  EXPORTING

    i_save     = 'X'

    i_header   = iv_header

  IMPORTING

    e_header   = ls_header_u

  TABLES

    i_item     = lt_item

    i_account  = lt_account

    i_partner  = lt_bup

    i_orgdata  = lt_org

    e_messages = lt_message1.

MOVE-CORRESPONDING ls_header_u TO e_header.

CALL FUNCTION 'BBP_PD_SC_UPDATE'

  EXPORTING

    i_header   = e_header

  TABLES

    i_item     = lt_item

    i_account  = lt_account

    i_partner  = lt_bup

    i_orgdata  = lt_org

    e_messages = lt_message1.

CALL FUNCTION 'BBP_PD_SC_SAVE'.

* EXPORTING

*      iv_header_guid = e_header-guid.

*CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.

COMMIT WORK.

Please any one help me.

Thanks,

Anitha

Accepted Solutions (1)

Accepted Solutions (1)

konstantin_anikeev
Active Contributor
0 Kudos

Please check following blog posts.

Regards

Konstantin

konstantin_anikeev
Active Contributor
0 Kudos

Also this.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

I agree with Konstantin, guids have not to filled with this method.

Please try to reserve a guid with the MF  GUID_CREATE for the header before calling the MF  BBP_PD_SC_CREATE.

konstantin_anikeev
Active Contributor
0 Kudos

Hi Anitha,

what do you have in your message table?

Regards

Konstantin

Former Member
0 Kudos

Hi Konstantin,

I have 0 messages.Iam not getting any Error messages.

Thanks,

Anitha

konstantin_anikeev
Active Contributor
0 Kudos

Try to call SC create only for header and update for the rest of the items.

Regards

Konstantin

Former Member
0 Kudos

Hi Konstantin,

I have tried as you proposed.But same status.

Please can you let me know any other FM which will help me in creating SC.

Thanks,

Anitha

konstantin_anikeev
Active Contributor
0 Kudos

Hi Anitha,

if you work with SRM 6.0+ I would say you should use classes, not the functions.

But anyway, try following.

Do not fill HEADER or PARENT for Item. Take GUID 00000000000000000000000000000001 fro position.

Do not provide GUIDS for Account, Partners, Org's - they should be determined automatically (P_GUID still should be filled with item guid, i.e. 00000000000000000000000000000001). Do not fill fields with zero-only guids.

For partners it should be enough to provide only partner_fct and partner_no.

Do not fill SUBTYPE with 'ER' on header level. Sourcing of external requirements is a very specific process. Just leave it empty.

Regards

Konstantin

Former Member
0 Kudos

Hi Konstantin,

If i use classes also, it is calling the same FM.

If i remove the GUID of header or item , iam getting different message "BUFFER TABLE NOT UPTODATE''.

Any other suggestions.

Thanks,

Anitha

konstantin_anikeev
Active Contributor
0 Kudos

Then, try to put them back, but

Do not provide GUIDS for Account, Partners, Org's - they should be determined automatically (P_GUID still should be filled with item guid, i.e.00000000000000000000000000000001).


Do not fill SUBTYPE with 'ER' on header level.


Regards

Konstantin

Former Member
0 Kudos

Hi Konstantin,


I tired all the options you have provided. But same result.

Shall i paste my code with the changes.

Thanks,

Anitha


konstantin_anikeev
Active Contributor
0 Kudos

Hi Anitha,

yes please.

But I will not able to test it in my system due to different customizing settings.

Regards

Konstantin

Former Member
0 Kudos

Hi Konstantin,

This is the changed code.

iv_header-guid = '00000000000000000000000000001'.   "Buffer table not uptodate (If i remove)

iv_header-description = 'welcome1'.

iv_header-currency = 'GBP'.

iv_header-process_type = 'SHC'.

iv_header-posting_date = sy-datum.

ls_item-guid  =  '00000000000000000000000000000002'.  (I tried with 1 as well as 2 ) - if i remove ,bugger table error

ls_item-parent  = ' 00000000000000000000000000000001'.   "header guid

ls_item-description = 'Test'.

ls_item-category =  '000C29B4A62C1EE1ADBFC8AA8C9BFC7F'.   "00000000000000000000000000000000'.

ls_item-category_id = 'VALVES'.   " '65.10'.

ls_item-number_int = '0000000001'.

ls_item-number_ext = '0000000000'.

ls_item-product_type = '01'.

ls_item-quantity = '1.000'.

ls_item-unit = 'HIT'.

ls_item-price = '1'.

ls_item-gross_price = '39.0000'.

ls_item-catalog_price = '0.00'.

ls_item-price_unit = '1'.

ls_item-deliv_date =  sy-datum + 1.

ls_item-logsys_fi = 'ONECLNTERP'.

ls_item-be_stge_loc = '0001'.

ls_item-be_co_code = '1000'.

ls_item-currency = 'GBP'.

ls_item-be_plant = '1000'.

ls_item-be_pur_group = 'SRM'.

ls_item-be_pur_org = '1000'.

ls_item-be_log_system  = 'ONECLNTERP' .    "CFG300

ls_item-be_doc_type = 'SHC' .  "ECPO

APPEND ls_item TO lt_item.

ls_account-guid =   '00000000000000000000000000000003'.

ls_account-p_guid = '00000000000000000000000000000002'.      "item guid

ls_account-distr_perc  = '100.00'.

ls_account-acc_no = '0001'.

*ls_account-src_guid = '00000000000000000000000000000000'.

ls_account-g_l_acct = '520000'.

ls_account-cost_ctr = '10010001'.

ls_account-co_area = '1000'.

ls_account-profit_ctr = '1002'.

ls_account-acc_cat = 'CC'.

APPEND ls_account TO lt_account.

ls_bup-partner_guid =  '00000000000000000000000000000004'..

ls_bup-p_guid = '00000000000000000000000000000002'.   "header guid

ls_bup-partner_fct = '00000020'.

ls_bup-mainpartner = 'X'.

ls_bup-partner_no = '000C29B4A62C1EE1AEDA35BDC3303C7F'. (followed same for other partners)

ls_org-proc_org_ot = 'O'.

ls_org-proc_org_id = '50001351'.

ls_org-proc_group_ot = 'O'.

ls_org-proc_group_id = '50001284'.

ls_org-p_guid = '00000000000000000000000000000002'.   "header guid  (I tried item guid and header guid as well)

ls_org-guid = '00000000000000000000000000000005'..

Thanks,

Anitha