Skip to Content
0
Former Member
Mar 09, 2011 at 01:29 AM

Price get re-set to zero

32 Views

Hi All,

I am facing a problem.

Detail Problem:

When user is creating a Shopping cart based on a contract item whose price is zero then whatever user is entering as price is get overwritten by zero (the contract price)

We contacted SAP and they said that it is standard behaviour.

We want to restrict this by some custom code.

I am writing code in BADI BBP_SOS_BADI inside method BBP_SOS_PD_CHECK.

as

DATA: ls_header TYPE bbp_pds_sc_header_d,

lt_item TYPE TABLE OF bbp_pds_sc_item_d,

ls_item LIKE LINE OF lt_item.

data LS_Header_price type BBP_PDS_HEADER.

data IT_ITEM type table of bbp_pds_sc_item_d.

data LT_Item_price type table of BBP_PDS_ITEM.

data Ls_item_price type BBP_PDS_ITEM.

DATA: lt_messages TYPE TABLE OF bbp_pds_messages.

import B = IT_ITEM[] from memory id 'PRICE_RESET'.

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

I_GUID = IS_PD_ITEM-PARENT

  • I_OBJECT_ID =

  • I_ATTACH_WITH_DOC = ' '

  • I_WITH_ITEMDATA = 'X'

  • I_ITEM_SORTED_BY_HIERARCHY =

  • I_WITHOUT_HEADER_TOTALS =

  • I_READ_FROM_ARCHIVE = ' '

IMPORTING

E_HEADER = ls_header

  • EV_IS_PD =

  • ET_ATTACH =

TABLES

E_ITEM = lt_item

  • E_ACCOUNT =

  • E_PARTNER =

  • E_CONFIRM =

  • E_LONGTEXT =

  • E_LIMIT =

  • E_ORGDATA =

  • E_TAX =

  • E_PRIDOC =

  • E_HCF =

  • E_ICF =

  • E_MESSAGES =

  • E_ACTVAL =

  • E_ACC_ACTVAL =

  • E_HEADER_REL =

  • E_ITMLIM_REL =

  • E_STATUS =

.

Move-corresponding LS_Header to Ls_header_price.

loop at IT_ITEM into ls_item.

MOVE-CORRESPONDING ls_item to Ls_item_price.

append Ls_item_price to LT_Item_price.

end loop.

CALL FUNCTION 'BBP_PROCDOC_UPDATE'

EXPORTING

  • I_BAPIMODE =

  • I_PARK =

  • I_SAVE =

  • IV_REJECT =

  • I_TESTRUN =

I_HEADER = LS_Header_price

  • IT_ATTACH =

  • IT_CONDITIONS =

  • IV_MSG_SCENARIO =

  • IV_WITH_CHANGE_APPROVAL = 'X'

  • IT_DYN_ATTR =

  • IMPORTING

  • ES_HEADER =

TABLES

I_ITEM = LT_Item_price "IT_ITEM

  • I_ACCOUNT =

  • I_PARTNER =

  • I_CONFIRM =

  • I_LONGTEXT =

  • I_LIMIT =

  • I_ORGDATA =

  • I_FREIGHT =

  • I_TAX =

  • I_PRIDOC =

  • I_SDLN =

E_MESSAGES = LT_Messages

  • I_ICF =

  • I_HCF =

  • I_TOL =

  • I_WEIGHT =

  • I_DEP =

  • CHANGING

  • E_CHANGED =

.

*****CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'

  • EXPORTING

  • I_NO_STATUS = ' '

  • .

CALL FUNCTION 'BBP_PROCDOC_SAVE'

EXPORTING

  • IV_WORKITEM_ID =

  • IV_USERTYPE =

IV_HEADER_GUID = LS_Header_price-guid

  • IV_OBJECT_TYPE =

  • IV_CREATE_HIST_VERSION =

  • IV_RESET_CHANGES =

  • IV_BUFFER_COND =

.

BUT this set of code is not working. Regards

Praveen