Skip to Content

Capture CardCode before oEventTypes.et_FORM_DATA_DELETE & pVal.ActionSuccess == true

Hi,

I'm new as a SAP developer. I'm making an add-on UI API that has to capture the BusinessPartner CardCode, on form 134, once the data is deleted.

SAP clears the screen once ActionSuccess == true.

I used the following code but it has problems when using the find function, if I search the Business Partner TEST01, and I write "TEST" and press ENTER key, SAP finds me the partner but the event only captures "TEST".

Here is my code:

privatevoid SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, outbool BubbleEvent)

{

BubbleEvent = true;

if (pVal.FormTypeEx == "134" & pVal.BeforeAction == false)

{

string evento = pVal.EventType.ToString();

EventEnum = 0;

EventEnum = pVal.EventType;

MyForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

Text = ((EditText)(MyForm.Items.Item("5").Specific));

}

if (pVal.FormTypeEx == "134" & pVal.EventType == BoEventTypes.et_CHOOSE_FROM_LIST)

{

try

{

if (Text.String != "")

{

partner = oCompany.GetBusinessObject(BoObjectTypes.oBusinessPartners);

if (partner.GetByKey(Text.String))

{

string id = partner.CardCode;

}

else

{

string id = "not found";

}

}

}

catch

{ }

}

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 24, 2017 at 06:53 AM

    Hi,


    You can used the SP_TransactionNotification for this if you want to capture data first before deleting in SAP tables. Please read this blog for some information of SP_TransactionNotification.

    https://blogs.sap.com/2009/05/22/the-sptransactionnotification-stored-procedure/

    You can check the parameter @transaction_type = 'D'

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 20, 2017 at 04:47 PM

    Here is my Business Partner Master Data, I want to capture the CardCode only if when I do the operation Remove Business Partner.

    A message pops asking if I want to remove.

    I click OK, and if ActionSucess, the forms cleans up.

    But i'm making an add-on that should save the CardCode and some other important data of the BusinessPartners that where

    successfully removed, I save that data on a external database, however I'm having trouble capturing the CardCode before it was deleted.

    If the user uses the Find option, and only enters some of the CardCode, for example, the usted wants to look for "test", and only enters the first 2 letters or so, "te", even though SAP completes the sentence, if the user clicks removes the BusinessPartner, the add-on only captures the word "te"...not "test". Capturing a wrong CardCode.

    Add comment
    10|10000 characters needed characters exceeded