sup.py 681 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3. import requests
  4. import json
  5. params ={
  6. "DEST": {
  7. "DEST_ID": "EQMAN",
  8. "BUSS_TP": "MM002",
  9. "BUKRS":"1005"
  10. },
  11. "DATA": {
  12. "BUDAT_B": "20220101",
  13. "BUDAT_E": "20220701",
  14. "TMATNR": {},
  15. "TMTART": {},
  16. "TMATKL": {}
  17. }
  18. }
  19. username ="zinf_user"
  20. password="init@1234"
  21. url ="https://app.modernfarming.cn:7443/sap/Common/MM004/QuerySupplier/"
  22. resp =requests.post(url, json=params,auth=(username,password))
  23. print(resp.text)
  24. # m =resp.json()
  25. # for k in m["DEST"]:
  26. # print(k,m["DEST"][k])
  27. # for k in m["DATA"]["TMARA"]:
  28. # for mater in k:
  29. # print(mater,k[mater])