cancel
Showing results for 
Search instead for 
Did you mean: 

Overwrite the default SC description when creating a SC

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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?

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

1. The short dump could be bacause of authorization, please check with your basis team

2. If FULLNAME is blank you can use the FIRSTNAME and LASTNAME fields is the partner structure. By this method you can avoid an additional select query.

Regards

Kathirvel

Answers (0)