Query to get Inventory ITEM details
Hi All,
Can any one give me the query to get the following details of an ITEM
ITEM
Description
Onhand availability
Org_id
Item status
Pricelist name
Subinventory
Revision
Lot
UOM
Unit Price
Thanks,
Srikanth
Edited by: 925743 on Apr 16, 2012 1:03 AM
use the following query you will get max columns
select segment1 as "ITEM",description,inventory_item_status_code,a.organization_id,list_price_per_unit,lot_control_code,primary_unit_of_measure,transaction_quantity,subinventory_code,revision,revision_qty_control_code from mtl_system_items_b a,
mtl_onhand_quantities b
Regards
Raju
Similar Messages
-
FI drilldown reports- cant get Line item details in dynamic selection
Hi,
In FI drill down reports line item analysis, i create form in FDI4.I get document currency as a key figure.
While executing a report in tcode FDI0. i gave company code,dealer and currency as 'EUR' in dynamic selection,.
the correct output value '1245678.98' also displaying ,but i am not able to get line item details for the value '1245678.98'.
the path to get line items is Extras-->Line items.
it shows message as 'The value for characteristic Currency is not unique. Reposition the cursor'.
how to display line item details.
plz help.Hi,
You can get this functionality with Virtual Key figures.
You will have the complete dataset in the RSR00002 Enhancement in CMOD.
Thank you
Arun -
How to get work item details programatically ?
Hi All,
I have a list of work items (process instances) and I want to retrieve each item details such as: attachments, notes, id, ...
All the items are filtered and represented as Fuego.Papi.Instance:
Fuego.Papi.Instance[] inst = busProcess.getInstancesByFilter(filter : instFilter);
But the work item details are inherited from Fuego.Lib.ProcessInstance. So, how to get the item details from inst[] ?
Would appreciate any help, may be Dan will have an advise ?
Regards,
KimIf you have instances returned by your filter, you could extract variable information for each instance by doing something like this:
for each inst in getInstancesByFilter(ps, filter : instF) do
// here's how to get the value inside a primitive instance variable
orderAmtObj as Object = getVar(inst, var : "orderAmount")
// here's how to get the value of attributes inside a complex BPM Object instance variable
// - in this case this is an "order" object with two attributes (customerName and amount)
orderObj as Object = (getVar(inst, var : "order"))
xmlObject = Fuego.Xml.XMLObject(createXmlTextFor(DynamicXml, object : orderObj, topLevelTag : "xsi"))
logMessage "The value of the order object's customer name is: " +
selectString(xmlObject, xpath : "customerName")
logMessage "The value of the order object's order amount is: " +
selectNumber(xmlObject, xpath : "amount")
// here's a rather uninspired way to retrieve who the participant is that was assigned the instance
logMessage "The participant assigned to this instance is: " + inst.participantId
endInside the above "for" loop, you could retrieve these predefined variables (this example assumes you use "inst" in your "for" loop):
objRet as Any
objRet = inst.getVar(var : "PREDEFINE_ACTIVITY")
logMessage "Activity name = " + objRet using severity = DEBUGSubstitute "PREDEFINE_ACTIVITY" in the above logic to get this information:
PREDEFINE_PRIORITY (priority)
PREDEFINE_ACTIVITY_DEADLINE (activity.deadline)
PREDEFINE_CREATION_TIME (creation.time)
PREDEFINE_PROCESS_DEADLINE (deadline)
PREDEFINE_DESCRIPTION (description)
PREDEFINE_PROCESS (process)
PREDEFINE_RECEIVED_TIME (receptionTime)
PREDEFINE_PARTICIPANT (participant)
PREDEFINE_COPY (id.copy)
PREDEFINE_STATUS (status)
Similarly, you might want to try to get instance information using the Fuego.Papi.VarDefinition object a try. Never used it, but the logic might be as simple as:
logMessage "who created? = " + inst.getVar(Fuego.Papi.VarDefinition.CREATOR_ID) using severity = DEBUG
logMessage "does it have attachments? = " + inst.getVar(Fuego.Papi.VarDefinition.HAS_ATTACHMENTS) using severity = DEBUG
logMessage "does it have notes? = " + inst.getVar(Fuego.Papi.VarDefinition.hasnotes) using severity = DEBUGDan -
Bapi or Function module for getting Bom Item Details (Urgent)
Hi All,
I Want to get the Bom Item Details Corresponding to Production Order Number.
So Please Provide me Some Function Module or Bapi So that by giving the
Production Order number I will get all material related to that PO.
Thanks In Advance.Hi,
use the function module.
call function 'CS_BOM_EXPL_MAT_V2'
exporting
capid = 'STD1'
datuv = sy-datum
mktls = 'X'
mehrs = 'X'
mmory = '1'
mtnrv = matnr
werks = werks
tables
stb = it_stb2
matcat = it_matcat
exceptions
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
others = 8.
Regards,
Sankar. -
i want to extract po item details using BAPI function module.but im not getting data into the int.table 'I_POITEM'.please correct the program and send me some links to learn BAPI.
DATA : BEGIN OF I_POITEM OCCURS 0.
INCLUDE STRUCTURE BAPIEKpo.
DATA : END OF I_POITEM.
PARAMETERS P_EBELN LIKE EKKO-EBELN.
CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
PURCHASEORDER = p_ebeln
ITEMS = 'X'
ACCOUNT_ASSIGNMENT = ' '
SCHEDULES = ' '
HISTORY = ' '
ITEM_TEXTS = ' '
HEADER_TEXTS = ' '
SERVICES = ' '
CONFIRMATIONS = ' '
SERVICE_TEXTS = ' '
EXTENSIONS = ' '
IMPORTING
PO_HEADER =
PO_ADDRESS =
TABLES
PO_HEADER_TEXTS =
PO_ITEMS = I_POITEM
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_SCHEDULES =
PO_ITEM_CONFIRMATIONS =
PO_ITEM_TEXTS =
PO_ITEM_HISTORY =
PO_ITEM_HISTORY_TOTALS =
PO_ITEM_LIMITS =
PO_ITEM_CONTRACT_LIMITS =
PO_ITEM_SERVICES =
PO_ITEM_SRV_ACCASS_VALUES =
RETURN =
PO_SERVICES_TEXTS =
EXTENSIONOUT =
loop at i_poitem.
endloop.Hello Srinivas
Evaluate the result of TABLES parameter RETURN. There may be different problems (wrong PO number, no authority, etc.) which will be returned as the corresponding messages.
Please note that if you use the BAPI within a report you have to take care that the PO number is properly formatted (conversion exits, leading zeros).
Regards,
Uwe -
Query to get summarized and detailed data
Hi experts,
The scenario is as follows:
Generic extractor -> DSO -> Infocube
Now, the cube have item level details. My concern is, the cube might grow very big and impact the performance.
Is it possible to have a query that retrieves summarized information from the cube and for details do a jump to target to the DSO and get the details?
Pls give me a hint on this.Yes you can have summerized query on Cube & item level query on DSO.
Using RRI (tcode RSBBS) you can jump from Summerized Query to Detailed Query.
You can also pass values from summerized query to detailed query through RRI if required, provided the same infoobject is used in both cube & DSO. -
CAML query to get Published items in javascript client object
Hi,
I am using the Javascript client object model.
I am trying to use the CAML query to fetch the Published items. (excluding checked-in but not published) .
I have tried the below code, but I am not able to get the published items alone. I am getting the checked-in but not published items as well.
function FetchPages() {
var clientcontext = new SP.ClientContext.get_current();
var oweb = clientcontext.get_web();
var olist = oweb.get_lists().getByTitle("Pages");
var query = new SP.CamlQuery();
query.ViewXml = "<Where>
<Eq><FieldRef Name=\"_Level\" /><Value Type=\"Integer\">1</Value></Eq></Where>";
query.set_viewXml();
pagesItems = olist.getItems(query);
clientcontext.load(NewsItems, 'Include(Title,FileLeafRef,FileDirRef)');
clientcontext.executeQueryAsync(Function.createDelegate(this, this.RenderHtmlOnSuccess), Function.createDelegate(this, this.RenderHtmlOnFailure));
function RenderHtmlOnSuccess() {
var enumerator = this.pagesItems.getEnumerator();
while (enumerator.moveNext()) {
var currentItem = enumerator.get_current();
I am getting items which are published as well as items which are checked-in but not published.
Update: I have tried this query, but the same result:
<FieldRef Name='_ModerationStatus' /><Value Type='ModStat'>0</Value></Eq>
How to fix this?
Also, I checked this:
http://mysharepointwork.blogspot.com/2011/03/get-published-version-of-list-item.html
for (int index = 0; index < item.Versions.Count; index++)
if (item.Versions[index].Level == SPFileLevel.Published)
// Got the Item
How to modify the above code for Javascript client object model?
ThanksHi,
Please try to modify the query statement as below and do the test again, it works in my environment:
var query = new SP.CamlQuery();
query.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'_Level\'/><Value Type=\'Integer\'>1</Value></Eq></Where></Query></View>');
pagesItems = olist.getItems(query);
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support -
How to build a query to get the item properties is tick or not?
hello everybody. i'm 1 of the sap b1 user. i face a problem in build a query to check one of the item properties is tick or not? pls help...
Hi Grace,
your query could look like this:
Select itemcode from oitm where qrygroup1= "Y"
qrygroup1 is item property 1, qrygroup2 is item property 2 etc.
Regards
Ad -
Hi,
I am using the Javascript Client object model.
I have a custom list and a custom document library.
Custom list contains 2 columns - dlName , dlValue
The document library contains 2 folders - "folder1" , "folder2" and contains some images.
The image name starts with the "dlValue" available in the custom list
I am using a visual webpart and using javascript client object model.
I am trying to achieve the below functionality:
1) Load a dropdown with the custom list.
2) set the image based on the value in dropdown.
I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
Below is the code i have used so far:
//In Visual webpart
<select id="ddlTest" >
</select>
<br/>
<div id="PreviewLayer">
<img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
</div>
// In Javascript file
function RenderHtmlOnSuccess() {
var ddlTest = this.document.getElementById("ddlTest");
ddlTest.options.length = 0;
var enumerator = this.customListItems.getEnumerator();
while (enumerator.moveNext()) {
var currentItem = enumerator.get_current();
var dropdownValue = currentItem.get_item("dlValue");
ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
// Also if dropdown value is changed, corresponding image should be shown
How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
ThanksHi,
Here are two links for your reference:
Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
In SharePoint 2013, we can also use REST API to achieve it.
http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Formatted search query for displaying invoice items details
hi all,
i need to display all the items in AP invoice.kindly suggest me a query for that.
in AP invoice
Ex. row items
code--descqtyprice--
total
I0001--XXXXXXX5--
100 -
500
query should display this row as
code--desc--
price
I0001--XXXXXXX--
100
I0001--XXXXXXX--
100
I0001--XXXXXXX--
100
I0001--XXXXXXX--
100
I0001--XXXXXXX--
100
=================================
the query should display as the qty is 5 so it will display the same item 5 times
kindly suggest me some query for formatted search
its very urgent
regards
sandipHi Sandip,
DoQuery("Select b.ItemCode from OINV a,INV1 b Where a.DocEntry=b.DocEntry")
Hope its help for you
Give me reward points,
Regards,
G.Suresh. -
UserExit/Badi to get Excise Item Details For MIGO Transaction
Hi Experts ,
I want to do a validation for chapter id of Material that is undrer Excise item tab in migo .
Can anyone tell me any userexit or Badi name for that?
Waiting for your replySOLVED
-
Query to get the followng details
(related to IO) Table Activity for the 26 Most Active
with the following fields Table name, location, reads, write, updates and DeletesI dont think the Oracle statistics track down to delete and update DML separately.
Another way to do this if you want to track the statement counts (INSERT, UPDATE, DELETE) and dont mind the overheads, you could turn on auditing to track successful usage and use the audit table to generate that report.
However this only counts the number of statements executed against those tables, it does not track the actual number of rows affected for each statement.
SQL> AUDIT INSERT, UPDATE, DELETE ON <table name> BY ACCESS;Then query the view dba_audit_trail:
SELECT owner,
obj_name,
SUM ( DECODE( action_name, 'DELETE',1,0) ) DEL_CNT,
SUM ( DECODE( action_name, 'INSERT',1,0) ) INS_CNT,
SUM ( DECODE( action_name, 'UPDATE',1,0) ) UPD_CNT
FROM dba_audit_trail
WHERE owner = <object owner>
AND returncode = 0 -- Successful
AND timestamp > sysdate - 30 -- Last 30 days, adjust as required
GROUP BY owner, obj_name -
To get line item and confirmation details from CRM_ORDER_READ
Hi,
Please can anybody let me know which the field from which i can get line item details and material for the service order given?
I am using CRM_ORDER_READ to retrieve the values. In that i am exporting 4 fields - et_orderadm_h, et_orderadm_i, et_product_i, et_doc_flow. So from where to get line items and material id from these fields?
I will be very thankful if i get the answer of this question.Hi,
The attribute NUMBER_INT of ET_ORDERADM_I contains the Item Number.
Hope this helps!
Regards,
Rohit -
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 -
Hi,
Can any body please provide me the query by which I can get all the details of customer entered in customer form. I know there is a standard report available but my client want it in excel format. Only best way I feel is, I have to use a query to get all the details from back end.
Thanks in advance.
Reagrds,
SurenHello. Here's the query of the report.
SELECT substrb ( PARTY . PARTY_NAME , 1 , 50 ) CUSTOMER_NAME , DECODE ( upper
(:P_ORDER_BY ) , 'PHONETIC' , DECODE ( party.party_type , 'PERSON' ,
SUBSTR ( per_prof.person_name_phonetic , 1 , 50 ) , SUBSTR ( party .
organization_name_phonetic , 1 , 50 ) ) , null ) ALTERNATE_NAME , RACU .
ACCOUNT_NUMBER CUSTOMER_NUMBER , RALU1.MEANING STATUS , RACU .
ORIG_SYSTEM_REFERENCE REFERENCE , ARCPC.NAME CREDIT_PROFILE_CLASS , RACU
.TAX_CODE TAX_CODE , ARVT.TAX_RATE TAX_RATE , PARTY.TAX_REFERENCE
TAX_REFERENCE , RALU9.MEANING SHIP_PARTIAL_MAIN , RALU8.MEANING FOB ,
RALU7.MEANING GSA_INDICATOR_MAIN , RALU6.MEANING CATEGORY , RALU5 .
MEANING CUSTOMER_CLASS , RALU3.MEANING CUSTOMER_TYPE , SOOT.NAME
ORDER_TYPE , SOPL.NAME PRICE_LIST , DECODE ( PARTY.PARTY_TYPE ,
'ORGANIZATION' , PARTY.SIC_CODE , NULL ) SIC_CODE , SOLU1.MEANING
SALES_CHANNEL , SOLU2.MEANING FREIGHT_TERMS , RASR.NAME
PRIMARY_SALESPERSON , RACU.CUST_ACCOUNT_ID CUSTOMER_ID , ORGD .
ORGANIZATION_NAME WAREHOUSE_MAIN , ORGF.DESCRIPTION CARRIER , PARTY .
JGZZ_FISCAL_CODE JGZZ_FISCAL_CODE
FROM
HZ_CUST_ACCOUNTS_ALL RACU , HZ_PARTIES PARTY , AR_LOOKUPS RALU1 , AR_LOOKUPS
RALU3 , AR_LOOKUPS RALU5 , AR_LOOKUPS RALU6 , AR_LOOKUPS RALU7 , AR_LOOKUPS
RALU8 , AR_LOOKUPS RALU9 , HZ_CUSTOMER_PROFILES ARCP ,
HZ_CUST_PROFILE_CLASSES ARCPC , SO_ORDER_TYPES SOOT , RA_SALESREPS RASR ,
SO_PRICE_LISTS SOPL , SO_LOOKUPS SOLU1 , SO_LOOKUPS SOLU2 ,
ORG_ORGANIZATION_DEFINITIONS ORGD , AR_VAT_TAX ARVT , ORG_FREIGHT ORGF ,
HZ_PERSON_PROFILES PER_PROF WHERE RALU1.LOOKUP_CODE = RACU.STATUS AND
RALU1.LOOKUP_TYPE = 'CODE_STATUS' AND PARTY.PARTY_NAME >=
<customer_name_low> AND PARTY.PARTY_NAME <= <customer_name_high> AND
PARTY.PARTY_ID = PER_PROF.PARTY_ID (+) AND ARCP.CUST_ACCOUNT_ID (+) =
RACU.CUST_ACCOUNT_ID AND RACU.PARTY_ID = PARTY.PARTY_ID AND ARCP .
SITE_USE_ID IS NULL AND ARCPC.PROFILE_CLASS_ID (+) = ARCP .
PROFILE_CLASS_ID AND RALU3.LOOKUP_CODE (+) = RACU.CUSTOMER_TYPE AND
RALU3.LOOKUP_TYPE (+) = 'CUSTOMER_TYPE' AND RALU5.LOOKUP_CODE (+) =
RACU.CUSTOMER_CLASS_CODE AND RALU5.LOOKUP_TYPE (+) = 'CUSTOMER CLASS'
AND RALU6.LOOKUP_CODE (+) = PARTY.CATEGORY_CODE AND RALU6.LOOKUP_TYPE
(+) = 'CUSTOMER_CATEGORY' AND RALU7.LOOKUP_CODE (+) = DECODE ( PARTY .
PARTY_TYPE , 'ORGANIZATION' , PARTY.GSA_INDICATOR_FLAG , 'N' ) AND RALU7
.LOOKUP_TYPE (+) = 'YES/NO' AND RALU8.LOOKUP_CODE (+) = RACU.FOB_POINT
AND RALU8.LOOKUP_TYPE (+) = 'FOB' AND RALU9.LOOKUP_CODE (+) = RACU .
SHIP_PARTIAL AND RALU9.LOOKUP_TYPE (+) = 'YES/NO' AND ORGD .
ORGANIZATION_ID (+) = RACU.WAREHOUSE_ID AND ARVT.TAX_CODE (+) = RACU .
TAX_CODE AND TRUNC ( SYSDATE ) BETWEEN NVL ( ARVT.START_DATE , TRUNC (
SYSDATE ) ) AND NVL ( ARVT.END_DATE , TRUNC ( SYSDATE ) ) AND SOOT .
ORDER_TYPE_ID (+) = RACU.ORDER_TYPE_ID AND RASR.SALESREP_ID (+) = RACU
.PRIMARY_SALESREP_ID AND SOPL.PRICE_LIST_ID (+) = RACU.PRICE_LIST_ID
AND SOLU1.LOOKUP_CODE (+) = RACU.SALES_CHANNEL_CODE AND SOLU1 .
LOOKUP_TYPE (+) = 'SALES_CHANNEL' AND SOLU2.LOOKUP_CODE (+) = RACU .
FREIGHT_TERM AND SOLU2.LOOKUP_TYPE (+) = 'FREIGHT_TERMS' AND ORGF .
FREIGHT_CODE (+) = RACU.SHIP_VIA AND ORGF.ORGANIZATION_ID (+) =
:ITEM_FLEX_STRUCTURE ORDER BY DECODE ( upper ( 'Customer' ) , 'CUSTOMER
NUMBER' , RACU.ACCOUNT_NUMBER , 'CUSTOMER' , PARTY.PARTY_NAME ,
'PHONETIC' , DECODE ( party.PARTY_TYPE , 'PERSON' , PER_PROF .
PERSON_NAME_PHONETIC , PARTY.ORGANIZATION_NAME_PHONETIC ) , PARTY .
PARTY_NAME )
Hope this helps.
Octavio
Maybe you are looking for
-
Error when deploying new version of application on ALBPM 6.0.4
I keep getting this error on our dev box when trying to deploy a new version of the application: <May 21, 2010 12:25:41 PM CDT> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(
-
hi, does anybody know 1) When will 9iAS Release 2 be out for production which has mod_oc4j. 2) Configuring Apache in the current release of 9iAS 1.0.2.2.x with OC4J for performance issues, instead of using OC4J as a standalone server. thank you,
-
Hi All - Does any one know how to retrieve the password from LDAP in plain text form? Thanks, Giri
-
How to run Acrobat OCR in batch mode?
I have many pdf files that I need to run OCR on. It is tedious to open each file and run OCR manually. I'm wondering if there is a way to automatically run OCR on all the files.
-
Been using Avid Unity storage for years, along with Adobe Production Premiuem, Mostly PhotoShop and After Effects, without any issues. However, after ungrading to 10.7, I'm having major issues with both of these apps. In Photoshop, when ever I save a