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?

2
  • trying to simulate the F8 but without success what success do you expect? you are trying to run SMQ1/SMQ2 functionality from PyRFC? Commented Jul 27, 2022 at 9: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 Commented Jul 28, 2022 at 20:44

1 Answer 1

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?).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.