Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8392

RSDRI_ODSO_DELETE_RFC. (RFC functions for table, how use?)

$
0
0

Hi, all. Please, talk about RFC functions.
I need to change record in table (sap) from Excel.
I have read much, but don't understand group of rfc functions to work with tables.
'RSDRI_ODSO_DELETE_RFC
'RSDRI_ODSO_INSERT_RFC
'RSDRI_ODSO_MODIFY_RFC
'RSDRI_ODSO_UPDATE_RFC

 

I can read table (pass-OK!):

 

Set oTestFunc = oSapFunc.Add("RFC_GET_TABLE_ENTRIES")
oTestFunc.Exports("TABLE_NAME") = "/POSDW/RETTYT"
Dim TABENTRY As Object
If oTestFunc.Call = True Then
      Set TABENTRY = oTestFunc.Tables("ENTRIES")
      i = TABENTRY.Rows.Count
      j = TABENTRY.Columns.Count
      ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value = "rows " & Str(i)
      ThisWorkbook.Sheets("Sheet1").Cells(1, 2).Value = "columns " & Str(j)
      ThisWorkbook.Sheets("Sheet1").Cells(2, 1).Value = TABENTRY(2, 1)
      ThisWorkbook.Sheets("Sheet1").Cells(3, 1).Value = TABENTRY(TABENTRY.Rows.Count, 1)
End If


I hope (but I'm not sure, need test), I can change values so: TABENTRY(2, 1)="aaa"

I need change values, add and delete rows in the table. I have read i can do it by RFC functions. How?


Please, show example.

CALL FUNCTION 'RSDRI_ODSO_DELETE_RFC' "Deletes Data Records in a Transactional ODS Object (RFC Version)
  EXPORTING
    i_odsobject =               " bapi6116-odsobject  ODS Object
*   i_delete_all =              " bapi6116xx-allinfoobjects  Delete All Table Entries
  IMPORTING
    e_numrows =                 " bapi6116xx-numrows  Number of deleted records
* TABLES
*   i_t_range =                 " bapi6116slio  Selection Criteria for InfoObjects
  EXCEPTIONS
...

Set oTestFuncDel = oSapFunc.Add("RSDRI_ODSO_DELETE_RFC")
oTestFuncDel.Exports("i_odsobject") = "/POSDW/RETTYT"
1) which Value of i_delete_all to delete all rows?
2) how delete rows(2)?
3) what is i_t_range? Can I delete all rows having value in columns(1) = "aaa"?


I have read about SAPTableFactoryCtrl - I can change tables (records) by it,
but don't know how use it (assign to real table)
OK, I setup wdtaocx.ocx:

Dim oTableFactoryCtrl As Object, oTable As Object

Set oTableFactoryCtrl = CreateObject("SAP.TableFactory.1")
Set oTable = oTableFactoryCtrl.NewTable()


How can I connect oTable to real table ("/POSDW/RETTYT") to change record in the table?

I think, so task is not rare, but I can't find any example.


Viewing all articles
Browse latest Browse all 8392

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>