0

I'm using the PYRFC library and so far I've managed to connect to SAP.

conn = Connection(ashost='xxxxxxxxx', sysnr='02', client='100', user='xxxxx', passwd='xxxxxxxx.')
result = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
print (result)

I did the connection test and everything was ok. But now I'm trying to run the queues created in SAP.

enter image description here

I performed some tests, trying to simulate the F8 but without success. Is there any way to make this execution using via python?

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
Danilo Marquiori
  • 85
  • 1
  • 1
  • 4
  • `trying to simulate the F8 but without success` what success do you expect? you are trying to run SMQ1/SMQ2 functionality from PyRFC? – Suncatcher Jul 27 '22 at 09:25
  • actually I needed to know how to run them by pyrfc. In the interface I use F8 to execute, but I would like to understand how it works through the pyrfc lib – Danilo Marquiori Jul 28 '22 at 20:44

1 Answers1

0

Directly you cannot query SMQ1/2 results, for an extended explanation read my answer here.

To get the SMQ results in Pyton you need to find a module with an equivalent functionality, and good news pa-pam!, I did it for you: this is TRFC_QIN_GET_CURRENT_QUEUES function module.

How to call you can find it in any pyrfc tutorial. Probable sample:

def func():
    import pyrfc
    from pyrfc import Connection
    conn=pyrfc.Connection(user='', passwd='', ashost='', etc.)

    queue_name = '*'
    client     = '100'

    result=con.call("TRFC_QIN_GET_CURRENT_QUEUES", qname=queue_name, 
                                                   client=client)
print(result['QVIEW'])

all you need to put here is queue name (qname parameter) and client value (what is it?).

Suncatcher
  • 10,355
  • 10
  • 52
  • 90