material.py 669 B

123456789101112131415161718192021222324252627282930
  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. },
  10. "DATA": {
  11. "BUDAT_B": "20220501",
  12. "BUDAT_E": "20221201",
  13. "TMATNR": {},
  14. "TMTART": {},
  15. "TMATKL": {}
  16. }
  17. }
  18. username ="zinf_user"
  19. password="init@1234"
  20. url ="https://app.modernfarming.cn:7443/sap/Common/MM002/QueryMaterial/"
  21. response =requests.post(url, json=params,auth=(username,password))
  22. print(response.text)
  23. # m =response.json()
  24. # for k in m["DEST"]:
  25. # print(k,m["DEST"][k])
  26. # for k in m["DATA"]["TMARA"]:
  27. # for mater in k:
  28. # print(mater,k[mater])