Skip to Content
0
Former Member
Jul 09, 2007 at 08:08 AM

defaulting dummy bidder

36 Views

I have to default a dummy Bidder , in BBP_BID_INV

I have added the following code in in DOC CHANGE BADI implementation

IF et_partner IS INITIAL.

SELECT SINGLE partner partner_guid FROM but000 INTO wa_dummy WHERE

bu_sort1 = 'DUMMY VENDOR'.

IF sy-subrc EQ 0.

CLEAR wa_partner.

MOVE wa_dummy-partner_id TO wa_partner-partner_id.

MOVE wa_dummy-partner_guid TO wa_partner-partner_no.

wa_partner-partner_fct = '00000018'.

wa_partner-addr_type = '1'.

wa_partner-ADDR_ORIGIN = 'A'.

MOVE is_header-guid TO wa_partner-p_guid.

APPEND wa_partner TO et_partner.

ENDIF.

ENDIF.

This works fine , but as I see the document in BBP_PD , the same bidder is repeated many times , in the partner table. Perhaps as many times as the BADI is hit, as it_partner and et_partner are empty everytime.

To ensure the defaulting happens only once, i used the FM

CALL FUNCTION 'BBP_PD_BID_GETDETAIL'

EXPORTING

i_guid = is_header-guid

i_with_itemdata = 'X'

IMPORTING

e_header = wa_header_tab

TABLES

e_partner = it_bidder.

and enclosed the above defaulting code under the condition

IF it_bidder IS INITIAL.

This works fine in SAPGUI , i can see the default bidder on screen , but this doesn't happen in ITS.

Any clue where i am going wrong.

Thanks in advance .

Regards

Alok Pathak