cancel
Showing results for 
Search instead for 
Did you mean: 

Why BBP_DOC_CHANGE_BADI run 3 times?

Former Member
0 Kudos

Hi Experts.

Anybody know why when I use the BBP_DOC_CHANGE_BADI it run 3 times after I click the buttom "Check" or "Publish" in a Bid Invitation.

Im trying to change the structure ET_LONGTEXT. In the first time it run correctly but in the others it doesn't.

Im filtering by FLT_VAL and SY-UCOMM:

IF flt_val = 'BUS2200'.

IF sy-ucomm EQ 'PARK' OR

sy-ucomm EQ 'PUBL'.

Could anybody help me, please?

Victor

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The BADI "BBP_DOC_CHNAGE_BADI" is called in all the 3 modes,i.e. CREATE,CHANGE,DISPLAY.

But you can always add the condition based on the SY-UCOMM i.e. action taken in the BADI,and then the logic in the badi will be processed only for that action.

BR,

Disha.

Do reward points for useful answers.

Former Member
0 Kudos

Hi Disha

Thanks for you answer but how I said Im using de SY-UCOMM:

IF sy-ucomm EQ 'PARK' OR

sy-ucomm EQ 'PUBL'.

In the 3 times is the same SY-UCOMM, or PARK or PUBL.

Thank You

Former Member
0 Kudos

Hi,

When do you want the logic written in the BADI to be processed?When you click on the button PUBLISH or HELD??Acc you can write the condition for SY-UCOMM.

Can you explain what do you mean by BADI is not running properly second time?What are you trying to accomplish through the BADI,If possible pls paste the code here for further analysis.

BR,

Disha.

Do reward points for useful answers.

Former Member
0 Kudos

I want to include one text in the Documents(Internal Note) of Bid Invitation when I hold or publish a Bid Invitation.

IF flt_val = 'BUS2200'.

IF sy-ucomm EQ 'PARK' OR

sy-ucomm EQ 'PUBL'.

DATA: v_flag TYPE c,

wa_longtext TYPE bbp_pds_longtext,

wa_longtext2 TYPE bbp_pds_longtext,

wa_header TYPE bbp_pds_bid_header_d,

v_cont TYPE i.

DO.

IF v_flag = 'x'.

EXIT.

ENDIF.

ENDDO.

CLEAR: wa_longtext,

wa_longtext2,

v_cont.

DESCRIBE TABLE et_longtext LINES v_cont.

wa_longtext2-tdid = 'HTXT'.

wa_longtext2-tdspras = sy-langu.

wa_longtext2-counter = v_cont.

  • Rescue the number of the Bid Invitation

CALL FUNCTION 'BBP_PD_BID_GETDETAIL'

EXPORTING

i_guid = is_header-guid

IMPORTING

e_header = wa_header.

CONCATENATE text-001 wa_header-object_id INTO wa_longtext2-tdline SEPARATED BY space.

IF v_cont = 0.

APPEND wa_longtext2 TO et_longtext.

ELSE.

LOOP AT et_longtext INTO wa_longtext.

IF wa_longtext-tdline(33) = text-001.

EXIT.

ELSE.

IF sy-tabix LT v_cont.

CONTINUE.

ELSE.

IF wa_longtext-tdline = space.

MODIFY et_longtext INDEX sy-tabix FROM wa_longtext2.

ELSE.

APPEND wa_longtext2 TO et_longtext.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

Thank You

Former Member
0 Kudos

Hi,

So is the value for the text field(internal note) getting changed when you click on HOLD or PUBLISH button?

Also refer this thread which discusses something similar:

BR,

Disha.

Do reward points for useful answers.

Former Member
0 Kudos

It could work if I was only change a text because in this case I had already a GUID, but in my case I have possibilities of this text is empty (doesnt exist yet) so will not have I GUID and I have not how to find a object by GUID to change.

Answers (0)