on 2019 Jul 24 3:53 PM
Hello,
I Have a mission to create a VBA macro that can extract a report directly from sq01 to an excel sheet, i was using RFC_READ_TABLE but this FM work just with one table at a time, so i found this FM RSAQ_REMOTE_QUERY_CALL which can query a report but i have this exception error "NO_SELECTION"
This is my code :
Sub z_Read_RFC_TAB_Function(R3 As Object)
Set func = R3.Add("RSAQ_REMOTE_QUERY_CALL")
func.Exports("WORKSPACE") = " "
func.Exports("QUERY") = "CLASSIF"
func.Exports("USERGROUP") = "CQ"
func.Exports("VARIANT") = " "
func.Exports("DBACC") = "0"
func.Exports("SKIP_SELSCREEN") = "X"
func.Exports("DATA_TO_MEMORY") = " "
func.Exports("EXTERNAL_PRESENTATION") = " "
Dim objLDataTable As Object
Set objLDataTable = func.Tables("LDATA")
Dim objLDescTable As Object
Set objLDescTable = func.Tables("LISTDESC")
objLDescTable.Rows.Add
objLDescTable(objLDescTable.RowCount, "FDESC") = "OBJEK"
If func.Call = False Then
MsgBox func.Exception
Exit Sub
Else
Sheets("SHEET1").Select
Dim objLDataRecord As Object
Dim objLDescRecord As Object
For Each objLDataRecord In objLDataTable.Rows
For Each objLDescRecord In objLDescTable.Rows
a = objLDataRecord("LINE")
Cells(objLDataRecord.Index + 1, objLDescRecord.Index) = objLDataRecord("LINE") 'Cells(objDatRec.Index + 1, objFldRec.Index) = Mid(objDatRec("WA"), objFldRec("OFFSET") + 1, objFldRec("LENGTH"))
Next
Next
End If
End Sub
**Thank you
Request clarification before answering.
User | Count |
---|---|
72 | |
21 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.