0

I use an Excel macro to get values from SAP, especially for planned orders.

Function GetOrders(ByVal ProductNumber As String)
    Dim OrderList As Object: Set OrderList = SAP.Add("BAPI_MATERIAL_MRP_LIST")
    Dim OrderMat As Object: Set OrderMat = OrderList.Exports("MATERIAL")
    Dim OrderPlant As Object: Set OrderPlant = OrderList.Exports("PLANT")
    Dim OrderTable As Object: Set OrderTable = OrderList.Tables("MRP_IND_LINES")

    OrderTable.FreeTable
    OrderMat = ProductNumber
    OrderPlant = "XXX"
    OrderList.Call

    Set GetOrders = OrderTable
    
    Set OrderMat = Nothing
    Set OrderPlant = Nothing
    Set OrderTable = Nothing
End Function

I changed the OrderPlant for the question.
It's working on one PC but using the same SAP account on another one we get some empty values. Specifically all the numbers > 10k are not shown.

On my PC I get something like this as a result from the MRP_IND_LINES table:

P.cons  00XXXXXXXX/XXXXXX/XXXX          -21.600.000
P.cons  00XXXXXXXX/XXXXXX/XXXX          -3.600.000

On another PC I the -21.600.000 is empty so it shows like this:

P.cons  00XXXXXXXX/XXXXXX/XXXX          
P.cons  00XXXXXXXX/XXXXXX/XXXX          -3.600.000

The disappearing field is the "REC_REQD_QTY", number 16 of the table BAPI_MRP_IND_LINES (MRP: Single Lines of MRP Elements), Data Type: "QUAN"

The only difference between the PCs is the SAP logon GUI version, 720 on mine and 750 on the other PC.

This happens only on the big numbers. The other fields in the row are downloaded correctly.

I'm not using SAP GUI scripting, but I've created the SAP Object with the row

Set SAP = CreateObject("SAP.Functions.Unicode")
Community
  • 1
  • 1
  • this doesn't look like SAPGUi-dependent issue, rather like Excel regional settings dependent issue, `REC_REQD_QTY` is 16-char field that may be [truncated](https://support.ordoro.com/how-to-avoid-the-annoyance-of-numbers-getting-truncated-in-excel-spreadsheets/) by Excel rules. Conclusion: try to compare two Excel versions and their settings – Suncatcher Oct 07 '22 at 00:51

0 Answers0