POST

Example: Create SalesOrder

POST SalesOrder
 
{
"CardCode":"C23900",
"DocDueDate":"2019-09-30",

"BatchGroup":false, // don't sumarize lines
"DocumentLines": [
  {"ItemCode": "RM",
   "WhsCode":"01",
   "Quantity":2 
  }
  ]
}

 

jbscript-logo-small

let r=bsl.post("SalesOrder",
  {"CardCode":"C001",
   "BatchGroup":false, // don't sumarize lines
   "DocDueDate":Date(),
   "DocumentLines": [
           {"ItemCode": "FP","WhsCode":"01","Quantity":3.4}
          ]
      }
  );
alert(r.DocEntry);

 

 

beasscript-logo-small

instance bsl b
b.post=SalesOrder=&
{"CardCode":"C23900","DocDueDate":"2019-09-30","DocumentLines": [&
  {"ItemCode": "RM",   "WhsCode":"01",   "Quantity":2   } ]}
messagebox=Created document: <b.ret_text>

 

 

 

For Post documents you've special properties

hmtoggle_plus1See the complete List

 

Field

Type

Description

Address

String(255)

Address of Business Partner

Allocation

Boolean

Use this for Work order allocation function

only for transfer function

 

1. Define "Alocation":true

2. Define Work order reference on line level

 

beasscript-logo-small

instance bsl b
setvar=ll_workorder1=20
b.post=Transfer={"allocation":false,"DocumentLines":[&
  {"ItemCode":"RM","Quantity":0.1,"WhsCode":"01","ToWhsCode":"02","BaseType":"wo","BaseDocEntry":<ll_workorder1>,"BaseLinenumber":10,"BaseLineNumber2":10}]}

BaseDocEntry

Number

Base DocEntry or Work order

BaseLineNumber

Number

Base Line Number (example RDR1.LineNumber)

BaseType

String

Example: 17=Sales Order, 13=PreInvoice

Note:

Only  if RetrievalDocument=false

Base Information on Header Level have higher Priority. But use base information on line Level

BatchGroup

boolean

true (standard) = one line for all batches with same item code
Note: Group Batches, Serials, BinCode
If you've 2 lines with same item + warehouse, the system create only one line and sumarize the Quantity

For sales order set this to "false"

false = for every batch a new item line

CardCode

String(20)

Business Partner

CardName

String(100)

Name of Business Partner

Comments

String(255)

Long comments

DelReservation

boolean

Delete all resevation entries, which defined in

ReservationDocEntry,ReservationLineNumber

DocDueDate

Date

Sets or returns the document due date (for example, Delivery Date in sales orders, Value Date in invoices, Valid To in quotations, and so on). Mandatory in Sales documents

DocumentDate

Date

Document Date. Default=Today

DocumentLines

DocumentLines

This define the Document lines

More see the Line object from this document

 

Note: Current Text- and Sum line types not supported

DocumentPerWorkOrder

boolean

true=If you defined WoDocEntry, the system split this for every Work order

DocumentsOwner

String

Define the Document Owner

DontDelete

boolean

don't delete entries from table BEAS_PLANDOCUMENT_LINE

ExternalDocEntry

Number

Use this for provision - transfer process

set the externalDocentry (from ExternalPurchaseOrder) and Allocation:true

GenerateQcOrder

boolean

if true, the system create a QC document, if a QC document is defined for this transaction and item

Current supported:

- Manual Receipt

NumAtCard

String

Define the Reference Number from Business Partner

PDocType

String

empty: Read from Reservation. Define filter in property "Filter"

bsl: you define the line in the JSON string

all other: You read this from table BEAS_PLANDOCUMENT_LINE

Define the filter in "Filter" and the DocEntry in Parameter "PDocEntry"

 

Related to follow Properties

Filter=[filter for BEAS_RESERVATION" or "BEAS_PLANDOCUMENT_LINE"]

PDocEntry=[BEAS_PLANDOCUMENT_LINE.LineNumber]

PriceType

string

Define the price determination for every line

manuell  = use price defined in BEAS_PLANDOCUMENT_LINE or Json String

none = no price (use SAP Standard functionality)

zeroprice = price is always 0

 

if not defined:

if this is a retrieval document, then "none"

for all other: use beas standard price determination

(Related to setting "mw_zubuchen_price_e" and "mw_zubuchen_price_k"

 

PTICode

String

Point of Issue User Association. Reference to table USR8/OPTI for location Argentinia. beas 2020.09

Reference2

String(11)

Reference 2 on document level

ReservationDocEntry


Link to Reservation BEAS_RESERVATION_LINE.RES_DOCENTRY

ResevationLineNumber


Link to Reservation BEAS_RESERVATION_LINE.RES_LINENUM

RetrievalDocument

boolean

true=Retrieval document from SAP Document

Example Sales order to Delivery order

 

Note:

Define BaseDocument on LineLevel true

Header information are not copied from target to source document !

 

beas support "Expenses Management" from Sales Order to a target document

("CINF"."EnblExpns"=Y, system read entries from Table "RDR3")
Base document is the Document, which is defined in first line

 

false=save only link to another document (in beas fields)

Series

string

Define the Document Series
See Administration -> System Initialization -> Document Numbering

Sort

string(255)

none:  use same sorting as defined in JSON String
Example: "Sort":"none"

empty (=Not defined, Standard):
Retrieval document: By base line number, Warehouse, DistNumber

      New documents: By Warehouse, ItemCode, DistNumber

or define own order (DataWindow syntax)

Example: base document line descending: "Sort:","base_linenum desc"

Field names: See table BEAS_PLANDOCUMENT_LINE

specialLines

String

Not available in Incoming Goods or Work order receipt/issue function

 

This allow to define special lines in one String

 

lineType=afterLine [=Text] ++ lineType=afterLine [=Text] ++

 

lineType: T = Test, S=Summary

afterLine: -1 = in first row, all other: Number of item line

text = for Text lines:

 

Example:

specialline

you need follow string

T=-1=Text at first row++T=0=my textline++S=0

 

beas 2020.08

TaxDate

Date

Tax Date. Default=SAP Standard

TrackingNumber

String

Define the Tracking Number

TransportationCode

String

Define the Transportation code

WoDocEntry

Number

Linked Work order DocEntry

WoLineNumber

Number

Linked Work order Line Number

WoLineNumber2

Number

Linked Work order Bill of Material position