Problem binding a matrix in the Sales Order Form
Hi everybody!
I am working in an Add-On. What I do is modify the sales order form in runtime. I catch the event when the form is loading and then I add a new folder with some fields and a matrix.
I've got a matrix in this form with the employees that participate in an order and when I go through all the orders by using the next and previous record buttons I have to rebind it to show the participants in a specific order. The code for the event is the following:
If (pVal.ItemUID = "57") And pVal.Before_Action = False And pVal.EventType = et_ITEM_PRESSED Then
BindParticipantGrid
BubbleEvent = False
End If
After bind the grid, BO shows a System message indicating that the form has been changed and asking me if I want to save the changes to the order. Looks like, whenever the bind function finds rows to add to the matrix it changes the mode of the form by adding rows to the matrix. How can I prevent that when I'm in view mode?
This is the code for the binding function
Sub BindParticipantGrid()
Dim myForm As SAPbouiCOM.Form
Dim oMatrix As SAPbouiCOM.Matrix
Dim rs As sapbobsCOM.Recordset
Dim strSQL, OrdreNr As String
Dim oText As SAPbouiCOM.EditText
Set myForm = SBOApplication.Forms.GetFormByTypeAndCount(139, 1)
Set oText = myForm.Items("8").Specific
If oText.Value <> "" Then
OrdreNr = oText.Value
Else
OrdreNr = "0"
End If
Set oMatrix = myForm.Items("matrix").Specific
oMatrix.Clear
Set rs = myCompany.GetBusinessObject(sapbobsCOM.BoObjectTypes.BoRecordset)
strSQL = "SELECT [@HL_PART].Code as Code, [@HL_PART].U_DocNum as DocNum, [@HL_PART].U_EmpId as EmpId, [@HL_PART].U_EmpName as EmpName, [@HL_PART].U_Message as Message, [@HL_PART].U_MessRead as MessRead, [@HL_PART].U_MainPart as MainPart, [@HL_PART].U_StartDt as StartDt, [@HL_PART].U_StartHr as StartHr, [@HL_PART].U_FinishDt as FinishDt, [@HL_PART].U_FinishHr as FinishHr, [@HL_PART].U_Finished as Finished FROM [@HL_PART] WHERE [@HL_PART].U_DocNum = " & OrdreNr
rs.DoQuery strSQL
While Not rs.EOF
myForm.DataSources.UserDataSources.Item("EmpId").Value = rs.fields("EmpId").Value
myForm.DataSources.UserDataSources.Item("EmpName").Value = rs.fields("EmpName").Value
myForm.DataSources.UserDataSources.Item("Message").Value = rs.fields("Message").Value
myForm.DataSources.UserDataSources.Item("MessRead").Value = rs.fields("MessRead").Value
myForm.DataSources.UserDataSources.Item("MainPart").Value = rs.fields("MainPart").Value
myForm.DataSources.UserDataSources.Item("StartDt").Value = rs.fields("StartDt").Value
myForm.DataSources.UserDataSources.Item("StartHr").Value = rs.fields("StartHr").Value
myForm.DataSources.UserDataSources.Item("FinishDt").Value = rs.fields("FinishDt").Value
myForm.DataSources.UserDataSources.Item("FinishHr").Value = rs.fields("FinishHr").Value
myForm.DataSources.UserDataSources.Item("Finished").Value = rs.fields("Finished").Value
oMatrix.AddRow
rs.MoveNext
Wend
oMatrix.SelectionMode = ms_Auto
End Sub
I will apreciate all king of help
Thanks in advance.
You have a property of the form which allows you to change the mode
myForm.Mode = fm_ADD_MODE
myForm.Mode = fm_EDIT_MODE
myForm.Mode = fm_VIEWMODE_MODE
You may change it after you modify you matrix data to fm_VIEWMODE_MODE and I guess you won't have the system question again.
Sebastien
Similar Messages
-
Doubt in the sales order form - Technical
Hi Frenz,
i have a small doubt in custom.pll.
we have a requirement to give a pop up message, wenever we do scheduling action in the sales order form (Oracle 11i).
i have written the code like below
if
((block_name = 'LINE') AND ( event_name = 'SPECIAL14'))
then the pop up message.
the problem im facing is, the pop up is working fine, when we schedule action is done by(Tools--> scheduling)
but it is not working whenever i right click on the sales order line and do scheduling.
what code do i need to include for the right click scheduling?
please advice.
thanks,
LpHi All,
Does any1 have any suggestion for my question...
Thanks,
Lp -
Getting FRM-40105 in the sales order form when applying sales credits
Hi,
i'm trying to apply sales credits at the line level.
1.I get FRM-40105 unable to resolve reference to item SALES_CREDITS while trying to save the data in the sales credits window of the sales order form-OEXOEORD(this happens only if i say save and proceed).
2.If i simply say 'ok' in the sales credits window the data entered in the salesrep field and quota and percentage gets saved but the data i entered in the 'ADDITIONAL SALES CREDIT INFORMATION' flexfield
doesn't get saved.If i query the order number and if i go back to the sales credits window i'm not able to see the data i entered in the flexfield popup.
Any idea of why this is happening so? we are in vision 11.5.5.
Regards,
NithyaHi All,
Does any1 have any suggestion for my question...
Thanks,
Lp -
Missing Check Box in the Sales Order form
Hi guys and gals. I am faced with a very strange problem. Actually when we create a sales order, in the Account Assignment tab we have a column which asks for Account Type. There we would be having a dropdown/combo box along with a checkbox 'more'. but i am unable to view this dropdown box. some how this field is missing. so what do i need to do to retain that dropdown box.
Hi Kiran,
Please check your screen variants and you have been authorised for it .
Use
SHD0
T-code to see screen variants and the tables.
SHDSCCI
and
SHDSVCI
<i>Hope This Info Helps YOU.</i>
Regards,
Raghav -
Payment term in the sales order & credit limit exceed.
Dear Guru,
Problem 1:
1. In the sales order, there are 3 lines items. As per there requirement each line item they want enter diffrent payment term.
for example
Material code Payment terms
1. Fixed z045
2. Variable z030
3. Pipes z015
how you can archive this goal. In customer master payment term is maintained only one. Please suggest me.
Problem 2:
1. Credit managment, If the credit block is there in the sales order(Due to credit limit exceed) order confirmation is no goes to customer.
how we can archive this goal by using the standard functionality.Hi,
1. You can achieve it through manual entries
If you have 3 line item then at item level >> Billing document maintain payment terms
2. If credit limit exceed then confirmation should not go to customer
Can you tell me currently how you sending confirmation to customers
If it is through simple mail then go to
IMG >> SD >> Basic functions >> Output control >> Output determination using condition techniques >> maintain out put determination for sales document >> maintain out put determination procedure
Select procedure V10000 >> go to control data
for condition type MAIL maintain requirement 9/11
(If this is not work then create new routine and add your logic that if credit limit exceeds then do not(trigger) send confirmation)
kapil -
BAPI to get the Sales order line item details
Hi,
My program gets Sale sorder and item as the input and I need to fetch all the item (Given item) details for this Sales Order from VBAP. Is there any BAPI to get the item details?Hi,
This is a sample code of BAPI.Try to map it to your requirement.This is not related to vendor.This is related to sales order.
Constants
CONSTANTS: c_contract LIKE vbak-vbeln VALUE '0020000720',
c_item LIKE vbap-posnr VALUE '000010'.
Structures
Structure to hold BAPI Header
DATA: st_bapisdhd1 LIKE bapisdhd1.
Internal Tables
Sales Order Create BAPI Return Messages
DATA: tbl_return TYPE STANDARD TABLE OF bapiret2
WITH HEADER LINE.
Sales Order BAPI Line Item
DATA: tbl_bapisditm TYPE STANDARD TABLE OF bapisditm
WITH HEADER LINE.
Sales Order BAPI Line Item
DATA: tbl_bapisditmx TYPE STANDARD TABLE OF bapisditmx
WITH HEADER LINE.
Sales Order BAPI Pricing Conditions
DATA: tbl_bapicond TYPE STANDARD TABLE OF bapicond
WITH HEADER LINE.
Sales Order BAPI Partner Functions
DATA: tbl_bapiparnr TYPE STANDARD TABLE OF bapiparnr
WITH HEADER LINE.
Sales Order BAPI Schedule Lines
DATA: tbl_bapischdl TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Sales Order BAPI Schedule Lines
DATA: tbl_bapischdlx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
Sales Order BAPI Pricing Conditions
DATA: tbl_bapicondx TYPE STANDARD TABLE OF bapicondx
WITH HEADER LINE.
Customer Enhancement for VBAK, VBAP, VBEP
DATA: tbl_bapiparex TYPE STANDARD TABLE OF bapiparex
WITH HEADER LINE.
Table to hold BAPI Detail Conditions
DATA: tbl_bapisdcond TYPE STANDARD TABLE OF bapisdcond
WITH HEADER LINE.
Table to hold Return Messages from Sales Order Change BAPI
DATA: tbl_return_chg TYPE STANDARD TABLE OF bapiret2
WITH HEADER LINE.
Variables
DATA: g_vbeln_created LIKE vbak-vbeln,
g_valid_contract TYPE c,
g_cont_price_date TYPE d.
Start of Selection
START-OF-SELECTION.
PERFORM validate_contract.
PERFORM create_sales_ord.
PERFORM update_sales_ord.
End of Selection
END-OF-SELECTION.
PERFORM write_output_report.
Subroutines
*& Form create_sales_ord
Create the Sales Order
FORM create_sales_ord .
PERFORM populate_bapi_tables.
PERFORM call_create_sales_ord_bapi.
ENDFORM. " create_sales_ord
*& Form populate_bapi_tables
Fill up the BAPI Tables
FORM populate_bapi_tables .
PERFORM populate_bapi_header.
PERFORM build_bapi_partners.
PERFORM build_bapi_items.
PERFORM build_bapi_sched_lines.
ENDFORM. " populate_bapi_tables
*& Form populate_bapi_header
Build BAPI Header Details
FORM populate_bapi_header .
CLEAR st_bapisdhd1.
st_bapisdhd1-doc_type = 'ZOC'. "Order type
st_bapisdhd1-sales_org = '026'. "Sales Org
st_bapisdhd1-distr_chan = '00'. "Dist Channel
st_bapisdhd1-division = '00'. "Division
st_bapisdhd1-purch_no_c = 'Cust Po No'. "Cust PO No
st_bapisdhd1-name = 'Orderer'. "Name of Orderer
st_bapisdhd1-ord_reason = ''. "Order Reason
st_bapisdhd1-sales_off = '3001'. "Sales Office
st_bapisdhd1-sales_grp = '301'. "Market Area
IF g_valid_contract = 'X'.
st_bapisdhd1-price_date = g_cont_price_date.
ENDIF.
ENDFORM. " populate_bapi_header
*& Form build_bapi_partners
Build BAPI Partner Functions
FORM build_bapi_partners .
CLEAR tbl_bapiparnr.
tbl_bapiparnr-partn_role = 'AG'.
tbl_bapiparnr-partn_numb = '0000100750'.
APPEND tbl_bapiparnr.
CLEAR tbl_bapiparnr.
tbl_bapiparnr-partn_role = 'WE'.
tbl_bapiparnr-partn_numb = '0000504472'.
APPEND tbl_bapiparnr.
ENDFORM. " build_bapi_partners
*& Form build_bapi_items
Build The BAPI Line Items
FORM build_bapi_items .
DATA: l_matnr LIKE mara-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '10000072'
IMPORTING
output = l_matnr.
CLEAR tbl_bapisditm.
tbl_bapisditm-itm_number = c_item.
IF g_valid_contract = 'X'.
tbl_bapisditm-ref_doc = c_contract.
tbl_bapisditm-ref_doc_it = c_item.
tbl_bapisditm-ref_doc_ca = 'G'. "Contract
ENDIF.
tbl_bapisditm-material = l_matnr.
tbl_bapisditm-plant = '3012'.
tbl_bapisditm-target_qty = '5.000'.
tbl_bapisditm-target_qu = 'M3'.
tbl_bapisditm-item_categ = 'ZZOC'.
tbl_bapisditm-sales_dist = '301'.
tbl_bapisditm-dlv_prio = '02'.
tbl_bapisditm-prc_group5 = '080'.
tbl_bapisditm-cust_mat35 = 'kdmat'.
tbl_bapisditm-route = 'TESYS'.
tbl_bapisditm-usage_ind = 'CIV'.
APPEND tbl_bapisditm.
CLEAR tbl_bapisditmx.
tbl_bapisditmx-itm_number = c_item.
tbl_bapisditmx-ref_doc = 'X'.
tbl_bapisditmx-ref_doc_it = 'X'.
tbl_bapisditmx-ref_doc_ca = 'X'.
tbl_bapisditmx-material = 'X'.
tbl_bapisditmx-updateflag = 'I'.
tbl_bapisditmx-plant = 'X'.
tbl_bapisditmx-target_qty = 'X'.
tbl_bapisditmx-target_qu = 'X'.
tbl_bapisditmx-item_categ = 'X'.
tbl_bapisditmx-sales_dist = 'X'.
tbl_bapisditmx-dlv_prio = 'X'.
tbl_bapisditmx-prc_group5 = 'X'.
tbl_bapisditmx-cust_mat35 = 'X'.
tbl_bapisditmx-usage_ind = 'X'.
tbl_bapisditmx-route = 'X'.
APPEND tbl_bapisditmx.
ENDFORM. " build_bapi_items
*& Form build_bapi_sched_lines
Build the BAPI Schedule Lines
FORM build_bapi_sched_lines .
CLEAR tbl_bapischdl.
tbl_bapischdl-itm_number = c_item.
tbl_bapischdl-req_qty = '1'.
tbl_bapischdl-req_date = sy-datum.
APPEND tbl_bapischdl.
ENDFORM. " build_bapi_sched_lines
*& Form build_bapi_conditions
Pull the BAPI Pricing Conditions from the Contract
FORM build_bapi_conditions .
LOOP AT tbl_bapisdcond.
CLEAR tbl_bapicond.
MOVE-CORRESPONDING tbl_bapisdcond TO tbl_bapicond.
APPEND tbl_bapicond.
CLEAR tbl_bapicondx.
tbl_bapicondx-itm_number = tbl_bapicond-itm_number.
tbl_bapicondx-cond_st_no = tbl_bapicond-cond_st_no.
tbl_bapicondx-cond_count = tbl_bapicond-cond_count.
tbl_bapicondx-cond_type = tbl_bapicond-cond_type.
tbl_bapicondx-updateflag = 'I'.
tbl_bapicondx-cond_value = 'X'.
tbl_bapicondx-currency = 'X'.
tbl_bapicondx-cond_unit = 'X'.
tbl_bapicondx-cond_p_unt = 'X'.
tbl_bapicondx-varcond = tbl_bapicond-varcond.
APPEND tbl_bapicondx.
ENDLOOP.
ENDFORM. " build_bapi_conditions
*& Form call_create_sales_ord_bapi
Call the Sales Order Create BAPI
FORM call_create_sales_ord_bapi .
CLEAR g_vbeln_created.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = st_bapisdhd1
IMPORTING
salesdocument = g_vbeln_created
TABLES
return = tbl_return
order_items_in = tbl_bapisditm
order_items_inx = tbl_bapisditmx
order_partners = tbl_bapiparnr
order_schedules_in = tbl_bapischdl.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDFORM. " call_create_sales_ord_bapi
*& Form update_sales_ord
Update the newly created Sales Order with the Pricing Conditions
from the Contract
FORM update_sales_ord .
CHECK g_valid_contract EQ 'X'.
PERFORM get_contract_details.
PERFORM build_bapi_conditions.
PERFORM call_change_sales_ord_bapi.
ENDFORM. " update_sales_ord
*& Form get_contract_details
Get Contract Details
FORM get_contract_details .
Need to manually get the relevant Pricing Conditions as the BAPI
BAPISDORDER_GETDETAILEDLIST causes problems when we call the BAPI
BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE (I think
this is due to the fact that these BAPIs belong to the same Function
Group and there must be some common structures that are not cleared
causing us all sorts of grief when we try and call the next BAPI)
DATA: tbl_konv TYPE STANDARD TABLE OF konv WITH HEADER LINE.
DATA: tbl_komv TYPE STANDARD TABLE OF komv WITH HEADER LINE.
DATA: tbl_vbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
Pricing Condition Master
DATA: BEGIN OF tbl_t685a OCCURS 0,
kschl LIKE t685a-kschl,
kaend_wrt LIKE t685a-kaend_wrt,
END OF tbl_t685a.
SELECT *
INTO TABLE tbl_vbak
FROM vbak
WHERE vbeln = c_contract.
READ TABLE tbl_vbak INDEX 1.
SELECT *
INTO TABLE tbl_konv
FROM konv
WHERE knumv = tbl_vbak-knumv AND
kposn = c_item.
CHECK sy-subrc EQ 0.
We now need to make sure we only bring across the Condition Types that
are EDITABLE. If we bring across non editable conditions (such as
'ZPR1') the Change Sales Order BAPI will fail
SELECT kschl kaend_wrt
INTO TABLE tbl_t685a
FROM t685a
FOR ALL ENTRIES IN tbl_konv
WHERE kappl EQ 'V' AND "Sales
kschl EQ tbl_konv-kschl AND
kaend_wrt EQ 'X' AND "Value is Editable
kmanu NE 'D'. "Process manually
Prepare for Binary Search
SORT tbl_t685a BY kschl.
LOOP AT tbl_konv.
READ TABLE tbl_t685a WITH KEY kschl = tbl_konv-kschl BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING tbl_konv TO tbl_komv.
APPEND tbl_komv.
ENDIF.
ENDLOOP.
CHECK NOT tbl_komv[] IS INITIAL.
Map KOMV into the more BAPI friendly BAPISDCOND structure
CALL FUNCTION 'MAP_INT_TO_EXT_STRUCTURE'
TABLES
fxvbak = tbl_vbak
fxkomv = tbl_komv
fxbapikomv = tbl_bapisdcond
EXCEPTIONS
entry_missing = 1
OTHERS = 2.
ENDFORM. " get_contract_details
*& Form call_change_sales_ord_bapi
Call the Change Sales Order BAPI
FORM call_change_sales_ord_bapi .
DATA: st_head_chg LIKE bapisdh1x,
st_logic_switch TYPE bapisdls.
CHECK NOT g_vbeln_created IS INITIAL.
CHECK g_valid_contract EQ 'X'.
st_head_chg-updateflag = 'U'.
st_logic_switch-cond_handl = 'X'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = g_vbeln_created
order_header_inx = st_head_chg
logic_switch = st_logic_switch
TABLES
return = tbl_return_chg
conditions_in = tbl_bapicond
conditions_inx = tbl_bapicondx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDFORM. " call_change_sales_ord_bapi
*& Form write_output_report
Produce Output Report
FORM write_output_report .
IF NOT g_vbeln_created IS INITIAL.
WRITE:/ 'Success! Sales Order', g_vbeln_created, 'was created!'.
ELSE.
WRITE:/ 'Failure! Sales Order was not created!'.
ENDIF.
SKIP.
WRITE:/ 'Sales Order Create Log'.
LOOP AT tbl_return.
WRITE:/ tbl_return-type, tbl_return-id, tbl_return-number,
tbl_return-message.
ENDLOOP.
SKIP.
WRITE:/ 'Sales Order Change Log'.
LOOP AT tbl_return_chg.
WRITE:/ tbl_return_chg-type, tbl_return_chg-id,
tbl_return_chg-number, tbl_return_chg-message.
ENDLOOP.
ENDFORM. " write_output_report
*& Form validate_contract
Make sure that the Contract is Valid
FORM validate_contract .
DATA: l_gueen LIKE vbak-gueen,
l_prsdt LIKE vbkd-prsdt.
SELECT SINGLE vbakgueen vbkdprsdt
INTO (l_gueen, l_prsdt)
FROM vbak
INNER JOIN vbkd
ON vbakvbeln = vbkdvbeln
WHERE vbak~vbeln = c_contract AND
vbkd~posnr = '000000'.
IF sy-datum LE l_gueen.
Contract is valid! Set Order Price Date
g_valid_contract = 'X'.
g_cont_price_date = l_prsdt.
ENDIF.
ENDFORM. " validate_contract
Regards
Rajesh Kumar -
Any way to hide the Option CLASS in the sales order line
Any way to hide the Option CLASSes in the sales order line ? Not thru personalization .and also is there a way to explode the model automatically when we open the sales order form and line details ,rather than going to Tool--Show details everytime
1) Don't know.
2) Set "OM: Show Line Details" profile option to Yes.
Hope this helps,
Sandeep Gandhi -
Unable to Query item number in Sales order form
Hi Gurus,
After selecting customer name in the sales order form, i am trying query the part number but application is hangs.
Can you please let me know is it problem with DBA or technical?
Recently we uploaded (migrated ) part numbers to oracle..
Please advise.
thanks
AKHi AK,
check this link
*PERFORMANCE: ITEM LOV TAKING TOO MUCH TIME ON SALES ORDER FORM IN 12.1.1 [ID 1066964.1]*
Thanks
-Arif. -
Change in an LOV query of Sales Order Form not working
Hi,
I wish to change the the Order Type (in the Sales Header) displayed in the Sales Order Form when viewed from a particular Responsibility.(11i Instance)
To be specific only certain order types should be displayed in the LOV when the User tries to create Order from that Responsibility.
In that process I created an FP with Action --> Builtin -->Create Record Group From Query
Then in Property-->Object Type-->LOV and Target Object -->ORDER_TYPE Value-->Name of my Query Group
I downloaded the Sales Order Form and modified the Query of the Group keeping the columns selected and the view used same and added in the Group I created.
But it didn't work out.
I tried out by changing my Target Object to SRV_ORDER_TYPE and its corresponding query from the Oracle Form.
But still it didn't work.
Please tell me where I'm going wrong.
Am I not choosing the correct target record group LOV?Hi Robert,
I have successfully accessed a matrix using Visual Basic .Net. It has been quite a challenge while I was at it.
One important thing to understand is that (unless you access the datasource) in order to access a particular control in a matrix object, this control needs to be visible and enabled. It is like simulating a user accessing the matrix via GUI... if a control is not enabled, you cannot access it (as said via control). That might explain question 1.
Short sample on matrix handling is here:
http://www.itwiki.net/ow.asp?SboHowToReadFromAndWriteIntoMatrix
<b>Q2 - Cell count:</b>
I have personally never used the Cells count method. It should always return the number of rows. My only guess here is that you are using an old reference on the matrix object in which the rows are not there yet.
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumn As SAPbouiCOM.Column
Dim oEditText as SAPbouiCOM.EditText
oMatrix=YourSboForm.Items.Item(38).Specific
oColumn=oMatrix.columns.item(strColumnname).specific
oEditText=oColumn.items.Item(1).specific
Msgbox(oEditText.String)
The above code should get you the first cell of the first row of the given matrix.
HTH Lutz Morrien
P.S.: If you need any more sample code, check with the SAP matrix sample or send me a mail (adress see Http://www.itwiki.net) -
Value Set error msg when opening sales order Form
Hi
I created a value Set(where the values are populated at run time based on a view) which is attached to DFF (column eg Attribute13),The Value set would get value populated only if any sales order lines are cancelled, as the value of Attribute13 on cancelled line would be inserted to new Order Line.
The Problem is when ever the Sales order Form is opened it throws the error message
"Value XX For the FlexField Segment dosent not exists in the valueset (Valueset name)" as the oe_order_lines_all.attribute13 has value and the value set has null, it matches it and throw the above error.
Could you guys give any suggestion how to avoid it, or is there any workarould , Thanks
ThanksThis tells me that the same attribute is used for something else and there is a value in that the column that is not your table which you are validating against. Or the value you are setting is not in that table.
About the context: If the same attribute is used under a different context AND if that context gets set when you open the sales order AND if the validation type is different under that context for attribute13, you will get this error.
Thanks
Nagamohan -
Update Production Order Form if Sales Order Form has been updated
Hi Experts, how can you update the "Due Date" in the Production Order form if the "Delivery Date" in the Sales Order form has been updated? I am having problem catching the actual event if the Date was modified. I'm not sure if I'm coding this correctly, but this is what I have so far:
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE) And (pVal.Before_Action = True)) Then
strSQL = "SELECT DueDate FROM OWOR WHERE DueDate = '" & strDueDate & "'"
orecordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
orecordset.DoQuery(strSQL)
End If
Please share your examples.All, thank you for your help. I understand why it is not working now. I was able to accomplish what I was lookin for with the following code (for anyone who was having the same problem as me:
If pVal.FormTypeEx = "139" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_VALIDATE Then
If pVal.ItemUID = "12" And pVal.BeforeAction = False And pVal.ActionSuccess = True Then
oEditText = oForm.Items.Item("12").Specific
myNewDate = ConvertDateString(oEditText.Value, "test")
SODocEntry = oForm.Items.Item("8").Specific.Value
oPdo = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders) '
oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oRecordSet.DoQuery("SELECT DocEntry from OWOR where OriginABS = '" & SODocEntry & "'")
If Not oRecordSet.EoF Then
oPdo.GetByKey(oRecordSet.Fields.Item(0).Value)
oPdo.DueDate = myNewDate
intResult = oPdo.Update
If intResult <> 0 Then
oCompany.GetLastError(errInt, errString)
oApplication.MessageBox("oApplication_ItemEvent: " & errString)
End If
oRecordSet.MoveNext()
End If
End If
End If -
Copying Sales Order Form Settings
Hi,
How can i copy the Sales Order Form Settings from one user ot another? Everytime i create a new user code, the form settings are not arranged as same as i set from the customized form settings. Is there any query or solutions that i can use to prevent to this issue?
Thanks and Regards,
vin<<Copied from http://www.sbonotes.com/content/how-copy-one-screen-layout-another-user>>
Edited by: Matt on May 10, 2010 9:27 AM -
Restricting Sales Order Form header notes appearing on delivery header
Hi,
Can someone please advice as to how to we can restrict the sales order form header text appearing on the delivery header?
Thanks
KeshiDear Keshi
In VOTX find out the procedure for your sales order header and Delivery header
Go to delivery procedure for header you will find Text Id (which you want to remove in delivery header) which is also present in sales order header.
Remove that text id from the procedure .
Please check if that procedure is not used for other deliveries, if it is used than define new procedure for your deliveries.
Regards
Jitesh -
Problem while creating new item in the sale order in case of Thirdparty
Dear Gurus
The following error is coming
while adding the new item with quantity in the sale order in case of third party .
Error Info... 00 671: ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC
Update key... 482ACBD89C7D0067E10080000A8C681C
Can give any idea abt this.
Rgds
SuryaHi
This error comes up due to number range problem in the
tables.
As you have said this is a third party Sales order, just check if this is relevant to the PR being generated or the Sales order getting created.
Check the Current number of the PR document type in the EBAN table & check if it is the same for the Number ranges in customizingin OMH7.
If they are not the same... & the current number in OMH7 is smaller than the Number in the table EBAN , you need to change the current number equal to the EBAN table.
If this is the case fior sales orders similarly check for Sales order table & sales order number range object.
reward points if useful
Thanks & Regards
Kishore -
Problem in blocking that amount in the sales order through routein
Dear Experts,
We are facing a problem in Routine,
We have developed a Z rebate module in that we are saving the accrual value for a perticular customer in "Z" Table.
We are having a senerio of adjusting that perticular accrued amount in the next month sales order as a discount at the item level. In table itself we fix this much amount as to flow to sales order for a Perticular material (EX- for 100001 material 5 rs per TON).
We have devaloped 901 routine that will go to "z" table and check any accrued amount is there then depending on the quantity ordered it will take accrual amount (simultanusly it will block the respective amount in the "z" table) and it will come and update in sales order pricing. Once we save sales order then it will reduse the perticular amount in from "z" table.
Now we are facing a problem, when we create a sales order first time depending on quantity routine will pull the value from "z" table and it will block respective amount in the "z" table. but before saving the sales order if you change the quantity again (EX- from 100 qty to 200 qty) then the routine is not pulling any value because the amount is already blocked.
Can any one tell me how check in run time this was the earlier quantity and this is changes quantity Or is there any logic to block that perticular amount.
Regards
NageshHI Sree
Could you please justify your post stating
"Now we are facing a problem, when we create a sales order first time depending on quantity routine will pull the value from "z" table and it will block respective amount in the "z" table. but before saving the sales order if you change the quantity again (EX- from 100 qty to 200 qty) then the routine is not pulling any value because the amount is already blocked. "
Your discount is based on qty, so when you are adding new item means order qty increased, so discount is applicable.
Or please put your requirement clearly
Maybe you are looking for
-
How to get the number of lines of a FileReader
I need to calculate the number of lines of a FileReader object. How can I do that ?
-
Panorama is no longer working in 4.0b7 (button or new shortcut)
I have tried using ctrl+E, pressing the button in the corner, and the option from the menu bar. None of them are working. I also have a mouse gesture extension that uses the "Browser:ToggleTabView" command and that's not working either (I'm not sure
-
How to replace a Motorola NVG589 with a Time Capsule?
I have a few questions. Today ATT came and set up wireless for me. The only problem is they had to put my Wireless Gateway in a seperate room from my home theatre. I am experienceing a little bit of a slow down in my home theatre. Is there any way i
-
BerkeleyDB hangs trying to read corrupted database
The provided corrupted database file causes reproducible hang in db->get method of Berkeley DB. Reproduced with Berkeley DB 4.8.30 and 4.3.29 under Linux. Corrupted database file: https://cfengine.com/bugtracker/file_download.php?file_id=123&type=bug
-
IWeb is only importing 644 of 1064 pics... help
I have no idea why iWeb refuses to make a complete gallery of my event in iPhoto (1000+ pic/mov). It stops at 643 for some reason. I've tried creating a new site, etc. etc. I'm not getting anywhere. Any suggestions?