cancel
Showing results for 
Search instead for 
Did you mean: 

GetByKey() not working on a specific user

0 Kudos

So I have this problem where I want to get DocEntry in OPCH table so I use the GetByKey(). The problem is that it works in all users except this particular user where GetByKey() returns false when I logged in to this specific user.

here is my code:

Sub SaveTransmit(ByVal tForm As SAPbouiCOM.Form)

     Dim tMatrix As SAPbouiCOM.Matrix = Nothing
     tMatrix = tForm.Items.Item("3").Specific

     Dim MyDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)

     Dim mtRow As Integer = tMatrix.RowCount

     For xxxt As Integer = 1 To mtRow
          tCheckE = tMatrix.Columns.Item("Col0").Cells.Item(xxxt).Specific
          tCheckB = tMatrix.Columns.Item("Col1").Cells.Item(xxxt).Specific 'Checkbox

          Dim koji As Boolean = tCheckB.Checked

          If koji = True Then
               If MyDoc.GetByKey(tCheckE.Value) Then
                    'some codes
               End if
          End if
     Next
End Sub<br>

I don't know if this is a bug in SAP B1 or I need to configure this specific user.

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with: https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members.

For example, you can:
- outline what steps you took to find answers (and why they weren't helpful)
- make sure you've applied the appropriate tags
- use a more descriptive subject line

The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial at: https://developers.sap.com/tutorials/community-qa.html

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM

View Entire Topic
Johan_H
Active Contributor

Hi,

Does this user have rights to A/P Invoice?

Regards,

Johan

0 Kudos

where can i find that setting in SAP B1?

Johan_H
Active Contributor

Hi,

Administration > System Initialization > Authorizations > General Authorizations > [affected user] > Purchasing - A/P

Regards,

Johan

0 Kudos

Thanks, everything is working fine but I encountered another problem. I gave full authorization in AP Invoice but when the user clicks the AP Invoice module in SAP it gives error: To generate this document, first define the numbering series in the Administration module

Johan_H
Active Contributor
0 Kudos

Administration > System Initialization > Document Numbering