I would like to assign a notification to a work order. The following does not work:
* Fill method structure
ls_methods-refnumber = 1.
ls_methods-method = 'SAVE'.
APPEND ls_methods TO lt_methods.
ls_methods-refnumber = 1.
ls_methods-objecttype = 'OBJECTLIST'.
ls_methods-method = 'CHANGE'.
ls_methods-objectkey = '000480000020'.
APPEND ls_methods TO lt_methods.
ls_methods-refnumber = 1.
ls_methods-objecttype = 'HEADER'.
ls_methods-method = 'CHANGE'.
ls_methods-objectkey = '000480000020'.
APPEND ls_methods TO lt_methods.
* Fill header structure
ls_header-orderid = '000480000020'.
ls_header-notif_no = '100000356980'.
APPEND ls_header TO lt_header.
* Fill header up structure
ls_header_up-orderid = '000480000020'.
ls_header_up-notif_no = '100000356980' .
APPEND ls_header_up TO lt_header_up.
* Fill object list structure
ls_object_list-notif_no = '100000356980'.
APPEND ls_object_list TO lt_object_list.
* Fill object list up structure
ls_object_list_up-processing_ind = 'X'.
APPEND ls_object_list_up TO lt_object_list_up.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
it_header = lt_header
it_header_up = lt_header_up
it_objectlist = lt_object_list
it_objectlist_up = lt_object_list_up
return = lt_return .
For OBJECTLIST I would actually need something like an 'ADD' method. Any ideas are appreciated.
The following works for me:
ls_methods-refnumber = 1.
ls_methods-objecttype = 'OBJECTLIST'.
ls_methods-method = 'CREATE'.
ls_methods-objectkey = '000480000020'.
APPEND ls_methods TO lt_methods.
* Fill method structure
ls_methods-refnumber = 1.
ls_methods-method = 'SAVE'.
ls_methods-objecttype = ''.
ls_methods-objectkey = '000480000020'.
APPEND ls_methods TO lt_methods.
* Fill object list structure
ls_object_list-notif_no = '100000356980'.
APPEND ls_object_list TO lt_object_list.
* Fill object list up structure
ls_object_list_up-processing_ind = 'X'.
APPEND ls_object_list_up TO lt_object_list_up.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
it_objectlist = lt_object_list
it_objectlist_up = lt_object_list_up
return = lt_return.
Related
I have the following example:
using DifferentialEquations
function test1(du,u,p,t)
a,b,c = p
d=a^0.1*(t+1)
e=u[1]/a
f=u[2]/d
du[1] = a*u[1]
du[2] = d*u[2]
du[3] = b*u[2] - c*u[3]
end
p = (2,0.75,0.8)
u0 = [1.0;1.0;1.0]
tspan = (0.0,3.0)
prob = ODEProblem(test1,u0,tspan,p)
sol = solve(prob,saveat=0.3)
The sol objects contain state outputs but, I need efficiently other variables ("d","e","f") as well.
The closest I can get is:
function test2(du,u,p,t)
global i
global Out_values
global sampletimes
a,b,c = p
d=a^0.1*(t+1)
e=u[1]/a
f=u[2]/d
if t in sampletimes
Out_values[1,i] = d
Out_values[2,i] = e
Out_values[3,i] = f
i=i+1
end
du[1] = a*u[1]
du[2] = d*u[2]
du[3] = b*u[2] - c*u[3]
end
sampletimes = tspan[1]:0.3:tspan[2]
Out_values = Array{Float64}(undef, 3, 2*11)
i=1
prob = ODEProblem(test2,u0,tspan,p)
sol = solve(prob,saveat=0.3,tstops=sampletimes)
However, this solution is not ideal because:
it duplicates saveat and I get two sets of slightly different outputs (not sure why), and
it can't expand if I decide not to use saveat and I want to output all solutions, i.e. sol = solve(prob).
Any help is appreciated.
I have already been searched solution and can't get the right solution yet.
ObjDRow = DataDataSet.Client.Rows.Find(strClientNo)
With ObjDRow
.ClientName = txtClientName.Text.Trim
.ClientAddr = txtAddr.Text.Trim
If txtRegOffice.Text = "" Then
.ClientRegOfficeAddr = txtAddr.Text.Trim
Else
.ClientRegOfficeAddr = txtRegOffice.Text.Trim
End If
.MailtoCorresAddr = RBtnCorresAddr.Checked
.MailtoRegOffice = RBtnRegOffice.Checked
.ClientHPhone = mskHandPhone.Text.Trim
.ClientPager = mskPagerNo.Text.Trim
.ClientTel = mskTelephone.Text.Trim
.ClientFaxNo = mskFax.Text.Trim
.ClientEmail = txtEmail.Text.Trim
.PrimaryPartner = txtPriPartner.Text.Trim
.SecondPartner = txtSecPartner.Text.Trim
.BroughtInBy = cboPreferredBy.Text.Trim
.PersonIncharge = cboPersonIncharge.Text.Trim
.GLAC = cboGLAcode.Text.Trim
.ContactPerson = txtContactPerson.Text.Trim
.AcraNo = txtAcraNo.Text.Trim
.Active = chkActive.Checked
If dtpfyear.Checked = True Then
.YearEnd = dtpfyear.Text
End If
.DeptNo = cboDeptNo.Text.Trim
.DateJoined = dtDateJoined.Value
If cboClientName.SelectedIndex = -1 Then
.Group = txtClientNo.Text
Else
.Group = cboClientName.SelectedValue
End If
.GroupStatus = RButtonMainYes.Checked
.MainGroup = RButtonSubYes.Checked
If IsDate(dtIncorporationDate.Text) Then
.DateOfIncorporation = dtIncorporationDate.Text
Else
.SetDateOfIncorporationNull()
End If
End With
ObjDRow.EndEdit()
ClientTableAdapter.Update(DataDataSet.Client)
Error is occurs when ClientTableAdapter Update.
This error occurs for some client only.
I already check datatype of database and table adapter's datatype and all datatype are same.
My input value datatype and table adapter's datatype are same.
This error occurs even I command all line of update code (.ClientName to last line) but this error still occurs.WTF
Most answers say this is a single quote problem but In my case, There is no single quote.
All data types are same and input values are the same with datatype.
** Updated**
This error still occurs even I do like=>
ObjDRow = DataDataSet.Client.Rows.Find(strClientNo)
ObjDRow.EndEdit()
ClientTableAdapter.Update(DataDataSet.Client)
There is nothing change just select and update.
But if I remove ObjDRow.EndEdit().All are fine. There is no error.
I am fairly new to ABAP and wrote a SQL statement to return a list of items into an ALV. However when I execute the program, it returns nothing. Below is the code I wrote. I created a table type to show only the columns I needed in the results.
REPORT Z_DISPLAY_RESULTS.
TYPES: BEGIN OF t_Display,
foodItem TYPE foodList-foodItem,
foodDescription TYPE foodList-foodDescription,
END OF t_Display.
DATA: it_Display TYPE STANDARD TABLE OF t_Display INITIAL SIZE 0,
wa_Display TYPE t_Display,
wa_Display1 LIKE LINE OF it_Display.
START-OF-SELECTION.
SELECT foodItem foodDescription
FROM foodList INTO TABLE it_Display
WHERE foodID = '00001'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'foodList'
* IS_LAYOUT =
* IT_FIELDCAT =
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = it_Display
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
ENDIF.
Don't learn obsolete stuff - use the new class-based API.
Double-check whether the table is actually filled using the debugger.
I_STRUCTURE_NAME refers to a global DDIC type. If you're using a local type, you will probably need to supply the field catalog yourself - with this obsolete function module. With the new class-based API, this is not (no longer?) needed.
i made a app the connects to facebook and pulls off a group of links leading to each post on a group page and i want to check each link ever 30 seconds to see of the link has changed position in the array which would ether mean a new post has been posted or a new post has been pinned or a post has been updated. i have some psudo code of what i think i need to make but i need help figuring out how to do the logic at the bottom were it checks if the data of the array has changed then check if it just moved down one spot in the array
set var1 = "void1"
set var2 = "void2"
set var3 = "void3"
set array = ("Data1","Data2","Data3")
check if var1 = array(0) // "void1" = "Data1" = new_data
check if var2 = array(1) // "void2" = "Data2" = new_data
check if var3 = array(2) // "void3" = "Data3" = new_data
set var1 = array(0) // "Data1"
set var2 = array(1) // "data2"
set var3 = array(2) // "data3"
check if var1 = array(0) // "Data1" = "Data1" = old_data
check if var2 = array(1) // "Data2" = "Data2" = old_data
check if var3 = array(2) // "Data3" = "Data3" = old_data
array = ("Data0","Data1","Data2")
set var1 = array(0) // "Data0"
set var2 = array(1) // "data1"
set var3 = array(2) // "data2"
check if var1 = array(0) // "Data1" = "Data0" = new_data
check if var2 = array(1) // "Data2" = "Data1" = new_data does array(1) = var1 "Data1" = "Data1" change to old_data
check if var3 = array(2) // "Data3" = "Data2" = new_data does array(2) = var2 "Data2" = "Data2" change to old_data
If I understand you correctly, what you'll need to do is, per iteration, have an original list of links, then a new one, which you'll compare on an item to item basis (though we need to know whether new links will go to the beginning of the list when you grab them). If the items are not the same, update the 'initial' list with the new list's contents. Some pseudo-code:
InitialList = grabLinks()
Every 30 seconds:
NewList = grabLinks()
If Not InitialList(0) = NewList(0) Then
InitialList = NewList
End If
You will probably need to use a built-in timing function for polling every thirty seconds.
I want to read the position using this FM HRWPC_RPT_COSTCENTER_EVALPATH where the cost center is given.
There are 3 result tables. from which table I can read the position value ?
here how I call the FM:
DATA i_hrrootob TYPE TABLE OF hrrootob.
DATA w_hrrootob LIKE LINE OF i_hrrootob.
DATA i_object_tab TYPE TABLE OF objec.
DATA w_object_tab LIKE LINE OF i_object_tab.
data i_STRUC TYPE TABLE OF STRUC.
w_hrrootob-otype = 'K'.
w_hrrootob-objid = w_orgdata-costcenter_key-costcenter.
APPEND w_hrrootob TO i_hrrootob.
CALL FUNCTION 'HRWPC_RPT_COSTCENTER_EVALPATH'
EXPORTING
depth = 0
evpath = 'KOSTDIUP'
* PLVAR = 01
* BEGDA = SY-DATUM
* ENDDA = SY-DATUM
* LEVEL = 1
TABLES
root_objects = i_hrrootob
result_objec = i_object_tab
result_struc = i_STRUC
EXCEPTIONS
NO_OBJECTS_FOUND = 1
OTHERS = 2
.
I got it by myself.
The result table result_objec has the value in the field stext, where the obtype ='S'