Skip to Content

get new object key from blanket agreement

Hi, i'm trying to get the key when I add a new blanket agreement.

Here is my code so far.

private void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo pVal, out bool BubbleEvent)
{
BubbleEvent = true;
if (pVal.FormTypeEx == "1250000100" && pVal.BeforeAction == false)
{
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD && pVal.ActionSuccess == true)
{
try
{
string LocDocEntry = "";
XmlDocument XmlDoc = new XmlDocument();
XmlDoc.LoadXml(pVal.ObjectKey);
LocDocEntry = "";
string sDocType = pVal.Type;
}
catch (Exception ex)
{
SBO_Application.MessageBox("Error :: " + ex.Message);
}
}
}
}

However the PVal is empty, is there any function or something I can use?

Please help me,

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 08 at 04:08 PM

    Maybe it's not the best method but I used the following query

    string sSql = "SELECT TOP 1 T0.AbsID FROM OOAT T0 INNER JOIN OUSR T1 ON T0.UserSign = T1.USERID WHERE T0.Cancelled = 'N' AND (CAST(T0.CreateDate AS DATE) = CAST(CURRENT_TIMESTAMP AS DATE)) AND T1.USER_CODE = '" + _oCompany.UserName + "' ORDER BY T0.AbsID DESC";

    Add comment
    10|10000 characters needed characters exceeded