Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Help on Shopping Cart Upload Program

Hi All,

I am trying develop a program for uploading Shopping Carts from EXCEL Spread Sheet.

I have gone through the following thread. But still I am facing the problems:

/message/3082168#3082168 [original link is broken]

Procedure 1: I developed program with 'BBP_PD_SC_CREATE_EXTERNAL', I got the following erros

Shopping Cart Upload Program
00001 E 008
No account assignment exists. Enter an account assignment
                     000000
00001 E 047
Please specify Account Assignment by selecting "Known" radio button for
                     000000 Please specify Account Assignment by selecting "Known" radio button for
00001 E 247
Plant for follow-on document missing
                     000000

Procedure 2: I used BBP_PD_SC_CREATE. I am getting the following Errors:

Shopping Cart Upload Program
A
Interface data contains errors
A
Interface data contains errors
A
Interface data contains errors
A
No data found
A
No data found
A
The document does not exist. Check entries
A
Incorrect interface data for set PDDEP in method C
A
Incorrect interface data for set PDDYN in method C
A
Incorrect interface data for set PDFRT in method C
A
Incorrect interface data for set PDHCF in method C
A
Incorrect interface data for set PDORG in method C
A
Incorrect interface data for set PDTAX in method C
A
Incorrect interface data for set PDTOL in method C
A
Incorrect interface data for set PDWGT in method C
E
Enter at least one item or one limit

Procedure 1 Sample Program:

DATA: i_basket        TYPE TABLE OF bbp_basket_ext_device,
      i_basket_back   TYPE TABLE OF bbp_basket_back,
      i_basket_errors TYPE TABLE OF bbp_oci_errors.

DATA: w_basket        TYPE bbp_basket_ext_device,
      w_basket_back   TYPE bbp_basket_back,
      w_basket_errors TYPE bbp_oci_errors.

PARAMETERS: p_user TYPE sy-uname DEFAULT 'REQUESTER'.

CLEAR w_basket.
w_basket-basket_name = 'Test Shopping Cart'.
w_basket-line = '00001'.
w_basket-description = 'Mat Desc New'.
w_basket-quantity = 1.
w_basket-unit = 'EA'.
w_basket-price = 10.
w_basket-priceunit = 1.
w_basket-currency = 'USD'.
w_basket-vendor = '0000301300'.
w_basket-category_id = 'L03621101'.
APPEND w_basket TO i_basket.

CALL FUNCTION 'BBP_PD_SC_CREATE_EXTERNAL'
  EXPORTING
    user_name     = p_user
  TABLES
    basket        = i_basket
    basket_back   = i_basket_back
    basket_errors = i_basket_errors
  EXCEPTIONS
    not_saved     = 1
    OTHERS        = 2.
IF sy-subrc EQ 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


LOOP AT i_basket_back INTO w_basket_back.
  WRITE:/ w_basket_back-basket, w_basket_back-basket_number.
ENDLOOP.

LOOP AT  i_basket_errors INTO w_basket_errors.
  WRITE:/ w_basket_errors-line,
          w_basket_errors-type,
          w_basket_errors-code,
          w_basket_errors-message,
          w_basket_errors-log_no,
          w_basket_errors-log_msg_no,
          w_basket_errors-message_v1,
          w_basket_errors-message_v2,
          w_basket_errors-message_v3,
          w_basket_errors-message_v4.
ENDLOOP.

Procedure 2 Sample Program:

DATA: v_header_guid  TYPE crmd_orderadm_h-guid,
      v_item_guid    TYPE crmd_orderadm_h-guid,
      v_account_guid TYPE crmd_orderadm_h-guid,
      v_partner_guid TYPE crmd_orderadm_h-guid,
      v_orgdata_guid TYPE crmd_orderadm_h-guid.

DATA: i_messages TYPE TABLE OF bbp_pds_messages,
      i_item     TYPE TABLE OF bbp_pds_sc_item_d,
      i_account  TYPE TABLE OF bbp_pds_acc,
      i_partner  TYPE TABLE OF bbp_pds_partner,
      i_orgdata  TYPE TABLE OF bbp_pds_org.

DATA: w_header   TYPE bbp_pds_sc_header_ic,
      w_e_header TYPE bbp_pds_sc_header_d,
      w_messages TYPE bbp_pds_messages,
      w_item     TYPE bbp_pds_sc_item_d,
      w_account  TYPE bbp_pds_acc,
      w_partner  TYPE bbp_pds_partner,
      w_orgdata  TYPE bbp_pds_org.


CLEAR i_messages.


v_header_guid  = 1.
v_item_guid = 2.
v_account_guid = 3.
v_partner_guid = 4.
v_orgdata_guid = 5.

*header-guid = 1.
*item-parent = 1.
*item-guid = 2.
*accounting-guid = 3.
*accounting-p_guid = item-guid.
*partner-partner_guid = 4.
*partner-p_guid = item-guid.
*organization-guid = 5.
*organization-p_guid = item-guid.

*I_HEADER
CLEAR w_header.
w_header-guid = v_header_guid.
w_header-object_id  = 'BUS2121'.
w_header-description = 'Test SC Upload'.
w_header-currency = 'GBP'.
w_header-process_type = 'SHC'.
w_header-posting_date = sy-datum.

*I_ITEM
* DELIV_DATE, PRODUCT_TYPE, LOGSYS_FI, BE_CO_CODE.

CLEAR w_item.
w_item-guid = v_item_guid.
w_item-parent = v_header_guid.
w_item-number_int = '0000000001'.
w_item-number_ext = '0000000000'.
w_item-product = '45ACB1298F870099000000000A8E0327'.
w_item-description = 'Lay Main <=180'.
w_item-category = 'FC888C591C4CFC4081AE49F48750CBAB'.
w_item-category_id = 'L03621101'.
w_item-ext_quote_item = '0000000000'.
w_item-quantity = 1.
w_item-unit = 'EA'.
w_item-ordered_prod = '/EC_1A001'.
w_item-price = 2.
w_item-price_unit = 1.
w_item-gross_price = 2.
w_item-currency = 'USD'.
w_item-del_datcat = 1.
w_item-deliv_date = sy-datum.
w_item-product_type = '01'.
w_item-logsys_fi = 'DEVCLNT100'.
w_item-be_log_system = 'SRDCLNT100'.
*w_item-be_stge_loc = 'MAIN'.
w_item-be_plant = '1020'.
*w_item-be_move_type = '281'.
w_item-be_pur_group = '50002754'.
w_item-be_pur_org = '50000040'.
w_item-be_co_code = '1020'.
w_item-be_doc_type = 'ECPO'.
APPEND w_item TO i_item.


*I_ACCOUNT
CLEAR w_account.
w_account-guid = v_account_guid.
w_account-p_guid = v_item_guid.
w_account-distr_perc = 100.
w_account-acc_no = '0001'.
w_account-acc_cat = 'OR'.
*w_account-SRC_GUID 00000000000000000000000000000000
w_account-g_l_acct = '0000621101'.
*w_account-BUS_AREA VTRS
w_account-cost_ctr = ' 0000012061'.
w_account-sdoc_item = '000000'.
w_account-sched_line = '0000'.
w_account-co_area = 'EXEL'.
*w_account-profit_ctr = 'NM01'.
*w_account-PROF_SEGM 0000000000
*w_account-CMMT_ITEM 500411060
*w_account-FUNDS_CTR 6589
APPEND w_account TO i_account.

*I_PARTNER
CLEAR w_partner.
w_partner-partner_guid = v_partner_guid.
w_partner-p_guid  = v_item_guid.
w_partner-partner_fct = '00000016'.
w_partner-partner_no = '48ED292BF5193C52E1000000AC1D061F'.
w_partner-addr_type = '3'.
w_partner-addr_origin = 'A'.
w_partner-addr_no = '0000011078'.
w_partner-partner_id = '0000000941'.
APPEND w_partner TO i_partner.

CLEAR v_partner_guid.
CLEAR w_partner.
w_partner-partner_guid = v_partner_guid.
w_partner-p_guid  = v_item_guid.
w_partner-partner_fct = '00000020'.
w_partner-partner_no = '4896D1636F351467E1000000AC1D061F'.
w_partner-addr_type = '3'.
w_partner-addr_origin = 'A'.
w_partner-addr_no = '0000011078'.
w_partner-partner_id = '0000000941'.
APPEND w_partner TO i_partner.

CLEAR v_partner_guid.
CLEAR w_partner.
w_partner-partner_guid = v_partner_guid.
w_partner-p_guid  = v_item_guid.
w_partner-partner_fct = '00000027'.
w_partner-partner_no = 'B106B75848BC9B4584C8A1C1EB89EC94'.
w_partner-addr_type = '1'.
w_partner-addr_origin = 'B'.
w_partner-addr_no = '0000015958'.
w_partner-partner_id = '0000000915'.
APPEND w_partner TO i_partner.

*I_ORGDATA
CLEAR w_orgdata.
w_orgdata-guid = v_orgdata_guid.
w_orgdata-p_guid  = v_item_guid.
w_orgdata-proc_org_resp_id = '50002754'.
w_orgdata-proc_group_id = '50002754'.
w_orgdata-proc_org_id = '50000040'.
APPEND w_orgdata TO i_orgdata.

CALL FUNCTION 'BBP_PD_SC_CREATE'
  EXPORTING
    i_ref_guid = v_header_guid
    i_park     = 'X'
    i_save     = 'X'
    i_header   = w_header
  IMPORTING
    e_header   = w_e_header
  TABLES
    i_item     = i_item
    i_account  = i_account
    i_partner  = i_partner
    i_orgdata  = i_orgdata
    e_messages = i_messages.
LOOP AT i_messages INTO w_messages .
  WRITE:/ w_messages-msgty,
*  w_messages-msgid,
*  w_messages-msgno,
  w_messages-message
*  w_messages-msgv1,
*  w_messages-msgv2,
*  w_messages-msgv3,
*  w_messages-msgv4
.
ENDLOOP

Thanks a lot in advance to help me out this.

Please send if you have code to complete this to sudarsan.srm at gmail (gmail id - sudarsan.srm)

Best Regards,

Sudarsan

Former Member
Not what you were looking for? View more on this topic or Ask a question