on 06-15-2009 9:39 AM
While creating or changing BP, how can I know the mode whether it is creating or changing in PARTNER_UPDATE BADI.
Regards,
Aruna.
Hi Aruna,
Check the code snippet that I had implemented in partner_update badi. I am sure this will be of help to you,
-
DATA: ltb_but000_old TYPE TABLE OF but000,
ltb_but000_new TYPE TABLE OF but000,
lwa_but000 TYPE but000,
lwa_bus000 TYPE bus000___i.
DATA: lw_partner_id TYPE bu_partner.
REFRESH: ltb_but000_new, ltb_but000_old.
CLEAR : ltb_but000_new, ltb_but000_old.
Get the current BP.
CALL FUNCTION 'BUPA_GENERAL_CALLBACK'
TABLES
et_but000_old = ltb_but000_old
et_but000_new = ltb_but000_new.
Get the first record from the internal table.
READ TABLE ltb_but000_new INTO lwa_but000 INDEX 1.
CHECK sy-subrc = 0.
Determine if change or create
Check if the BP already exists and this is a change.
We only want to update the Marketing Attributes
in CREATION mode.
CLEAR lw_partner_id.
SELECT SINGLE partner
INTO lw_partner_id
FROM but000
WHERE partner = lwa_but000-partner.
CHECK sy-subrc <> 0.
-
In addition , I hope the FM BUP_BUT000_SELECT_SINGLE can also be used to check if the BP is available in database or not thereby you can determine if the BP is in create or change mode.
Best Regards, Adil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.