cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the addition of documents

Former Member
0 Kudos

Hi Experts ,

I have a scenario in which i need some method to stop the addition of a marketing document of SAP .

Lets suppose the GRPO ,i need if any error occurs in my add on then GRPO should also not to be added.

Thanks'

Amit

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Amit,

You need to do validation before adding the data Like...


'You need to check this in  before action=true
   If BusinessObjectInfo.FormTypeEx = "143" And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And BusinessObjectInfo.BeforeAction = True Then
  if omatrix.Columns.Item("Status").Cells.Item( 1).Specific.value="" then
  bubbleevent=False 
end if 
End If

Thanks

Shafi

Edited by: shafi_sunshine on Aug 23, 2011 10:06 AM

Former Member
0 Kudos

Hi Amit,

Try This......



'You need to insert the data into the user defined table 

 Dim orecordset As SAPbobsCOM.Recordset
 Dim orecordset As SAPbobsCOM.Recordset
 orecordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
  For i As Integer = 0 To omatrix.RowCount - 1
  orecordset.DoQuery("insert into [@sales](Code,Name,U_frmdate,U_ToDate)values( " & code & " ,'" & name & "','" & matrixfield1 & "' ,'" & matrixfield2 & "'  )")
next
  omatrix.Clear()

Thanks

Shafi

Former Member
0 Kudos

Thanks For reply but i think i could not made you understand my problem.

Let's suppose your code if any error occurs in that code then GRPO should not be added. i need some code for that

Former Member
0 Kudos

Hi

Are you opening your user form from GRPO itself and is there any reference of your GRPO exists in your user form??

Regards

Former Member
0 Kudos

Hi Amit,

I think ur adding a extra tab and a matrix to a system form and want to insert data

Try This.......


'In Form Data Event

 If BusinessObjectInfo.FormTypeEx = "143" And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And BusinessObjectInfo.BeforeAction = False And BusinessObjectInfo.ActionSuccess = True Then

'Write ur code here

end if

Thanks

Shafi

Edited by: shafi_sunshine on Aug 23, 2011 6:57 AM

Former Member
0 Kudos

Hi Shafi,

Thanks for reply...

But the scenario is that

'In Form Data Event

If BusinessObjectInfo.FormTypeEx = "143" And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And BusinessObjectInfo.BeforeAction = False And BusinessObjectInfo.ActionSuccess = True Then

'My code should run

end if

it will ensure that my code will run only when the GRPO will be added successfully but i need the vice versa also if any error occurs in my code the GRPO should also not to be added

Former Member
0 Kudos

Hi Amit,

You may try SP_TN to block the addition of documents. It would be difficult within your code to block the same.

Thanks,

Gordon

Former Member
0 Kudos

Hi Amit.......

If any error occurs anyhow system wont allow to add the document. But still it is allowing then you must have to manage it with SDK Code of your Addon..........

Regards,

Rahul

Former Member
0 Kudos

Hi,

Can you give me some sample code ?????

Thanks

Amit