on 07-29-2008 2:02 PM
hi,
I need to change the SC description which is automtaically generated in the form "username :server time :server date".
Can anyone tell me whether i can use the badi "BBP_DOC_CHNAGE_BADI" to overwrite the description with a custom one when creating a SC?
Yes, you can use the BADI BBP_DOC_CHANGE_BADI to achieve this. In the method BBP_SC_CHANGE follow the below logic:
MOVE-CORRESPONDING is_header TO es_header.
es_header-description = 'Your Description'.
Regards
Kathirvel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi kathir,
Thanks for the immediate repsonse.I wrote the foll code in the BADI and it gave a dump:
data : WA_PARTNER type BBP_PDS_PARTNER,
WA_ITEM type BBP_PDS_SC_ITEM_ICU.
data : W_VENDOR type BU_MCNAME1,
W_TEXT type STRING.
ET_PARTNER[] = IT_PARTNER[].
read table IT_ITEM into WA_ITEM index 1.
if ( WA_ITEM-CATALOGID is not initial and WA_ITEM-DEL_IND ne 'X' ).
if IT_PARTNER is not initial.
read table IT_PARTNER into WA_PARTNER with key PARTNER_FCT = '00000019'.
if SY-SUBRC = 0.
select single MC_NAME1
from BUT000
into W_VENDOR where PARTNER_GUID = WA_PARTNER-PARTNER_NO.
if SY-SUBRC = 0.
*Insert the vendor name in the description field
concatenate TEXT-001 W_VENDOR into W_TEXT separated by SPACE.
ES_HEADER-DESCRIPTION = W_TEXT.
endif.
endif.
endif.
endif.
I want to basically write the description as "Shopping cart for vendor (vendor name from catalog) ".
Can you tell me what is wrong?
Please try this
MOVE-CORRESPONDING is_header TO es_header.
READ TABLE it_item INTO ls_i_item INDEX 1.
IF ( ls_i_item-catalogid IS NOT INITIAL AND ls_i_item-del_ind NE 'X' ).
IF it_partner IS NOT INITIAL.
READ TABLE it_partner INTO ls_partner
WITH KEY partner_fct = '00000019'.
IF sy-subrc = 0.
CONCATENATE 'Shopping cart for vendor'
ls_partner-fullname
INTO es_header-description SEPARATED BY space.
ENDIF.
ENDIF.
ENDIF.
Note: A shopping cart can have multiple source of supplies. Please be aware of this as the requirement seems to a bit weird.
Hope your problem is solved now.
Regards
Kathirvel
Hi Kathrivel.,
Thanks for the immediate response.
I am still getting the same dump.
The code is as follows:
method IF_EX_BBP_DOC_CHANGE_BADI~BBP_SC_CHANGE.
data : WA_PARTNER type BBP_PDS_PARTNER,
WA_ITEM type BBP_PDS_SC_ITEM_ICU.
data :
W_TEXT type STRING.
move-corresponding IS_HEADER to ES_HEADER.
read table IT_ITEM into WA_ITEM index 1.
if ( WA_ITEM-CATALOGID is not initial and WA_ITEM-DEL_IND ne 'X' ).
if IT_PARTNER is not initial.
read table IT_PARTNER into WA_PARTNER
with key PARTNER_FCT = '00000019'.
if SY-SUBRC = 0.
concatenate TEXT-001
WA_PARTNER-FULLNAME
into ES_HEADER-DESCRIPTION separated by SPACE.
endif.
endif.
endif.
endmethod.
Please help.
Hi kathir,
I am able to get the things right now using the same code.
The only problem is when i insert a external/session break pt in the badi,itgives me a dump.
Can you explain why i sthis happening??
Also the field FULLNAME in the it_partner table has no value.SO i ha dto fetch the value from BUT000 table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.