Posting a 311 Movement Through API_MATERIAL_DOCUMENT_SRV - s4sdk

I am trying to move inventory from unrestricted to blocked stock using an API. The API I am using is API_MATERIAL_DOCUMENT_SRV. I am getting the following error:
"Field InventoryStockType cannot be set for this operation on item level"
The message I am posting through Postman is the following:
{
"PostingDate": "2018-08-14T00:00:00",
"GoodsMovementCode": "01",
"to_MaterialDocumentItem": [{
"Material": "MZ-FG-E11",
"Plant": "1710",
"StorageLocation": "171A",
"GoodsMovementType": "311",
"Batch" : "0000000001",
"InventoryStockType": "01",
"EntryUnit": "PC",
"QuantityInEntryUnit": "11",
"IssuingOrReceivingStockType":"02",
"IssgOrRcvgMaterial":"MZ-FG-E11",
"IssgOrRcvgBatch":"0000000001",
"IssuingOrReceivingPlant":"1710",
"IssuingOrReceivingStorageLoc":"171A"
}]
}
Can anyone advise on what this message should look like?

I use a 344 for this:
{
"PostingDate": "2018-08-14T00:00:00",
"GoodsMovementCode": "04",
"to_MaterialDocumentItem": [{
"Material": "MZ-FG-E11",
"Plant": "1710",
"StorageLocation": "171A",
"GoodsMovementType": "344",
"Batch" : "0000000001",
"QuantityInEntryUnit": "11",
"IssuingOrReceivingStorageLoc":"171A"
}]
}

Related

Directus Filtering multiple fields

I'm trying to filter Directus CMS data set through URL parameters.
This is a sample data set. I can successfully filter data set by single parameter.
{
"data":[
{
"id": "1",
"status": "published",
"category": "Novel",
"section": "Kids"
},
{
"id": "2",
"status": "published",
"category": "Novel",
"section": "Adults"
}
]
}
/items/books?filter[category][_eq]=Novel
gives me exactly what I expected which is 1 & 2 data records.
But I need to filter both "category" & "section" fields
/items/books?filter[category][_eq]=Novel&filter[section][_eq]=Adults
For above I receive an empty data set.
Why is this getting failed ? Where do I need to fix? Appreciate your support in advance. Thanks!
Try the following query:
/items/books?filter={"_or":[{"category":{"_eq": "Novel"}},{"section":{"_eq":"Adults"}}]}
An expanded version of the filter:
"_or": [
{
"category": {
"_eq": "Novel"
}
},
{
"section": {
"_eq": "Adults"
}
}
]
Visit the official docs to read more about filtering rules and logical operators.

Cannot retreive virtual card number in test mode via stripe API using Go examples

Trying to follow the example here: https://stripe.com/docs/issuing/cards/virtual
When I add params.AddExpand("number"), no number is returned, yet via the dashboard I was able to see the card numbers. Here's sample code and redacted info for the Req and Resp.
func (ac *appContext) CardRetrieve(id string) *stripe.IssuingCard {
stripe.Key = ac.Config.Stripe.SecretKey
params := stripe.IssuingCardParams{}
params.AddExpand("number")
params.AddExpand("cvc")
ic_num, _ := card.Get(id, &params)
return ic_num
}
Returns:
{
"id": "ic_redacted",
"object": "issuing.card",
"brand": "Visa",
"cancellation_reason": null,
"cardholder": {
"id": "ich_redacted",
"object": "issuing.cardholder",
"billing": {
"address": {
"city": "A Beach",
"country": "US",
"line1": "404 Main St.",
"line2": "Suite #302",
"postal_code": "19001",
"state": "DE"
}
},
"company": null,
"created": 1613338532,
"email": "redacted#notreal.com",
"individual": {
"dob": {
"day": 20,
"month": 10,
"year": 1990
},
"first_name": "User",
"last_name": "Testing",
"verification": {
"document": {
"back": null,
"front": null
}
}
},
"livemode": false,
"metadata": {
},
"name": "User Testing",
"phone_number": "+15165551212",
"requirements": {
"disabled_reason": "under_review",
"past_due": [
]
},
"spending_controls": {
"allowed_categories": [
],
"blocked_categories": [
],
"spending_limits": [
{
"amount": 1,
"categories": [
],
"interval": "daily"
}
],
"spending_limits_currency": "usd"
},
"status": "active",
"type": "individual"
},
"created": 1613338532,
"currency": "usd",
"exp_month": 1,
"exp_year": 2024,
"last4": "0088",
"livemode": false,
"metadata": {
},
"replaced_by": null,
"replacement_for": null,
"replacement_reason": null,
"shipping": null,
"spending_controls": {
"allowed_categories": null,
"blocked_categories": null,
"spending_limits": [
{
"amount": 1,
"categories": [
],
"interval": "daily"
}
],
"spending_limits_currency": "usd"
},
"status": "inactive",
"type": "virtual"
}
What confuses me is the documentation found here:
https://stripe.com/docs/issuing/cards/virtual
It says: You can retrieve both the full unredacted card number and CVC from the API. For security reasons, these fields are only available for virtual cards and will be omitted unless you explicitly request them with the expand property. Additionally, they are only available through the Retrieve a card endpoint. That links to the issue card retrieval end point, but the params defined in the virtual cards example references the CardParams{} struct.
No of the examples show what imported module their aliasing for card to exec card.Get, but it stands to reason given the flow of the documentation that this should be IssuingCardParams{} and that the card alias is referencing: "github.com/stripe/stripe-go/issuing/card"
I also find it strange that we're defining params in the example but not passing it into the card.Get()
Edit:
I went digging through the module and it seems like to get the card details you have to call: details, _ := card.Details(id, params) but I get a 404 when trying to call that. The object returned is actually the right object and I see number and cvc, albeit nil.
I get the following error:
2021/02/15 00:33:06 Request error from Stripe (status 404): {"status":404,"message":"Unrecognized request URL (GET: /v1/issuing/cards/ic_redacted/details). Please see https://stripe.com/docs
So it seems you need to include a /v72 in the import:
"github.com/stripe/stripe-go/v72"
The documentation should be updated to show this and the virtual card example for go should also be updated.

Google Actions Smart Home Air Conditioning Unit Can Not Temperature Setting

My google actions SYNC response is..
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"agentUserId": "1836.15267389",
"devices": [
{
"id": "3",
"type": "action.devices.types.AC_UNIT",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.TemperatureSetting"
],
"name": {
"name": "AC",
"nicknames": [
"AC"
]
},
"willReportState": false,
"attributes": {
"availableThermostatModes": "off,heat,cool,on",
"thermostatTemperatureUnit": "C"
}
}
]
}
}
When I told google mini to set the AC temperature.
Then google replied that this instruction is not supported.
But turn on/off is working.
How can I fix it?
Use action.devices.types.THERMOSTAT
can fix the issue

Parameterize POST body in JMeter HTTP POST

I am using Apache JMeter to run a few performance tests against RESTFUL API for an application that we have developed. I have an end point "api/create/empListJob", which basically adds one or more employee records in the MongoDB. The payload for the POST call looks like this:
{
"employeeList": [
{
"first_name": "josh",
"last_name": "don",
"age": "25",
"address": {
"street1": "xyz",
"street2": "apt-10",
"city" : "def",
"state" : "CA",
"zip" : "95055"
},
"deptType": {
"deptID": "1",
"deptName": "R&D"
}
},
{
"first_name": "mary",
"last_name": "jane",
"age": "22",
"address": {
"street1": "zzz",
"street2": "apt-15",
"city" : "yyy",
"state" : "CA",
"zip" : "95054"
},
"deptType": {
"deptID": "2",
"deptName": "HR"
}
}
]
}
As you can see, the payload takes a list of employee data, and it should have atleast one employee record. I have a requirement in which i want JMeter thread group to have 10 threads and each of these threads should make a concurrent POST to "api/create/empListJob" such that the body has 10 unique employee records, thus creating a total of 100 records. What is the best way that i could parameterize the payload?
Take a look at JMeter Functions, like:
__threadNum() - returns the number of current thread (virtual user)
__Random() - returns a random number in a given range
__RandomString() - returns a random string from specified input characters
__UUID() - returns random GUID structure
So for example if you change your JSON payload to look like:
"employeeList": [
{
"first_name": "josh-${__threadNum}",
"last_name": "don-${__threadNum}",
"age": "25",
"address": {
"street1": "xyz",
"street2": "apt-10",
"city" : "def",
"state" : "CA",
"zip" : "95055"
},
"deptType": {
"deptID": "1",
"deptName": "R&D"
}
},
{
"first_name": "mary-${__threadNum}",
"last_name": "jane-${__threadNum}",
"age": "22",
"address": {
"street1": "zzz",
"street2": "apt-15",
"city" : "yyy",
"state" : "CA",
"zip" : "95054"
},
"deptType": {
"deptID": "2",
"deptName": "HR"
}
}
]
}
JMeter will create:
- `josh-1` for 1st virtual user
- `josh-2` for 2nd virtual usre
- etc.
See Apache JMeter Functions - An Introduction to get familiarized with JMeter Functions concept.

error given Sending json array in ajax request? using javascript

hihi i am doing a project regarding ajax (xmlHttRequest),
how am i going to call the title in the note session, because normally if you call start year is like, detail = eval....
then for loop it
inside should be
var start year=""
startyear += ...[i].startyear
something like this, but how am i going to call the title inside the note?
i try to call detail.notes.note.title it say is null or is not a object
this is json data:
{
"infos": {
"info": [
{
"startYear": "1900",
"endYear": "1930",
"timeZoneDesc": "daweerrewereopreproewropewredfkfdufssfsfsfsfrerewrBlahhhhh..",
"timeZoneID": "1",
"note": {
"notes": [
{
"id": "1",
"title": "Mmm"
},
{
"id": "2",
"title": "Wmm"
},
{
"id": "3",
"title": "Smm"
}
]
},
"links": [
{
"id": "1",
"title": "Red House",
"url": "http://infopedia.nl.sg/articles/SIP_611_2004-12-24.html"
},
{
"id": "2",
"title": "Joo Chiat",
"url": "http://www.the-inncrowd.com/joochiat.htm"
},
{
"id": "3",
"title": "Bake",
"url": "https://thelongnwindingroad.wordpress.com/tag/red-house-bakery"
}
]
}
]
}
}
Use http://jsonlint.com/ to help you out with JSON.
I got this...
Parse error on line 30:
... ] }
----------------------^
Expecting '}', ',', ']'

Resources