Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Rebate Agreement (VBO2 )

Former Member
0 Kudos

Hi experts, I'm traying to create a program to delete a Rebate Agreement in background. At first I've created a BI program but it did'nt work, (in foreground whe I chose delete it apear a pop-up do confirm deletition). I also try the using BAPI_AGREEMENTS, passing in the structure TI_BAPIAGRMNT the field OPERATION = 003 (DELETE) and also the field DEL_FLAG =  'X'. Can any one help me? Best regards , Elisete Fonseca

1 ACCEPTED SOLUTION

michael_kozlowski
Active Contributor
0 Kudos

check class CL_EX_SD_ENH_REBATES Method IF_EX_SD_ENH_REBATES~V13A_DELETE to delete rebate agreement.

9 REPLIES 9

michael_kozlowski
Active Contributor
0 Kudos

check class CL_EX_SD_ENH_REBATES Method IF_EX_SD_ENH_REBATES~V13A_DELETE to delete rebate agreement.

0 Kudos

Hello Michael,

I've try the method, but it didn't work.

thanks.

0 Kudos

Please provide more details. Are there any error messages?

0 Kudos

Micheal, inside the method IF_EX_SD_ENH_REBATES~V13A_DELETE is call CALL METHOD CL_EXIT_MASTER=>CREATE_OBJ_BY_INTERFACE_FILTER, which returns the table EXIT_OBJ_TAB,converted into INSTANCE_FLT_CACHE, after that, it fails in the validation : "valid = sxrt_true' line 63.

JL23
Active Contributor
0 Kudos

Pretty much in the beginning (about line 40) of the coding in FM BAPI_AGREEMENTS

SAP is checking whether it is a deletion and reacts with an error message:

* Check whether agreement has to be deleted

PERFORM error_message_agrmnt USING '152'

Former Member
0 Kudos

Jürgen, In the  FM BAPI_AGREEMENTS, in fact inside the perform is call the FM 'AGR_MAP_KNUMA_AG_GUID_GET_NEW', in case of deleting. In this FM, is reading a table (agr_map_knuma) which is empty. the place where this table is fullfilld FM AGREEMENTS_INBOUND, and is also empty in de DDIC table AGR_MAP_KNUMA.

JL23
Active Contributor
0 Kudos

Sorry I don't see this call that you mentioned.

I refer to this very initial section in the program:

And in the first call SAP is just checking the OPERATION = 003 (DELETE)

Operation 003 is something very different from adding a deletion indicator to an agreement.

Adding a deletion indicator is usually nothing else than an UPDATE operation.

Operation 003 is used to delete data permanently, which can't be allowed if there is other data depending on that.

Former Member
0 Kudos

Jurden,

I maybe didn't explain my self. I want to create a program to do the same action of de Tcode :

VBO2>delete: (deletes all the conditions and the Rebate Agreement):

acording to the operation in the BAPI_AGREEMENTS: you select in the CALL FUNCTION 'CND_MAP_OPERATION_TO_UPDKZ' (line35),returns: 003 Delete: Message contains objects to be deleted  -> 'D' => Dump

004 Change: Message contains changes -> 'U' => Dump

005 Replace: This message replaces previous messages -> ' ' => do nothing

009 Original: First message for process  -> 'I' => OK ( for creating a new)

023 Wait/Adjust: Data should not be imported -> ' ' => do nothing

and i can't solve may issue.

Thanks.

JL23
Active Contributor
0 Kudos

if you  get a dump then read the information from the dump or share the dump.

See how to read a dump: