Dropped sales order report from SAP
Team,
There is a specific requirement regarding sales order..to analyze the dropped /undelivered order for a period.
Currently we are entering only those sales orders in the system which can be shipped/delivered to customer..all those SOs which can’t be delivered are not entering in system.
It is because if we are entering those orders in the stem, MRP will consider those orders for planning.
Now we need to include all the sales orders in SAP and MRP should only consider such orders which can be shipped. Can we do it in the system?
Thanks for the advise.
Regards,
Vijesh
MRP should only consider such orders which can be shipped. Can we do it in the system?
At what stage, you will come to know that sale order can be shipped as planned? Nevertheless, you can either change the MRP Type in material master to ND or change the schedule line category in sale order to CN so that system will not consider such of those materials for MRP. You have to decide which one is better but I would prefer the second one as changing the master data quite frequently is not recommended.
G. Lakshmipathi
Similar Messages
-
Sales Order iDoc from SAP SCM 7.0
Hi Experts
I have two question fro you guys.
1. Can we generate VMI sales order idoc from SAP SCM 7.0? I know is can generate xml message. If we can generate idoc for VMI sales order from SAP SCM , please give me some direction or path to explore.
2. Can I use idoc to to create to VMI sales order in ECC skiping CIF. But the changes in ECC to these order should use the CIF to update the VMI orders in SAP SCM.
Please share your experience on this.Hi,
Did you set up this scenario? I want something similar, but I want an ERP order to be created. Do you know if that is possible? Do you have som tips?
regards Camilla -
Faxing PDF format of Sales orders/PO from SAP
Hi,
My requirement is, when any sales order/PO is created, I have to automatically fax/email the output in PDF format.How do I do that?
(a)Do I have any user exit/Badi for these standard transaction where I convert the spool to PDF format?
(b)Even then, can I use the standard output determination technique to send the PDF format out as email or Fax?
Regards,
Bhaskar.hi ,
check this link..
create the output type and trigger the mail/fax program
via output type.
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
http://www.sap-img.com/abap/sending-fax-from-abap.htm
thanks
vijay
Message was edited by: Vijay Babu Dudla -
Email Sales order link from SAP Work Place
Dear SAP Gurus,
Well guys i have to mail the sales order link through the work place but its not working for the sales order. but its working for delivery order and billing document...so i want to know that why its not working?
Regards,
MohsinDear All,
Can u please help me on this situation? I will be very thankful to u....
Regards,
Mohsin -
Sales Order uplaod from JAVA to SAP R/3
Hi all,
My cousin is working on uploading Sales Order Document
from java server to R/3.
for that he is having a code from JCO jar.
the below is the file from which one can upload his SO details from JAVA to R/3.
But in this program he is just able to upload one Item detail for one Sales document.
but requirement is to upload 'n' item details for one Sales document.
Here is the Java code.
@author pega
TODO To change the template for this generated type comment go to
Window - Preferences - Java - Code Style - Code Templates
Created on Jun 24, 2004
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package com.sap.satyam.salesorder;
import java.sql.Timestamp;
import java.util.Calendar;
import com.sap.mw.jco.IFunctionTemplate;
import com.sap.mw.jco.IRepository;
import com.sap.mw.jco.JCO;
public class SalesOrder {
static final String SID = "R3";
static final String errorID = "E";
IRepository repository;
//String orderNumber = orderCreation("M-01","3000","0002",3,"ST");
int counter;
public SalesOrder()
try {
// Add a connection pool to the specified system
JCO.addClientPool(SID, // Alias for this pool
10, // Max. number of connections
"800", // SAP client
"develop", // userid
"bslabap", // password
"EN", // language
"172.18.33.20", // host name
"00");
// Create a new repository
repository = JCO.createRepository("MYRepository", SID);
catch (JCO.Exception ex) {
System.out.println("Caught an exception: \n" + ex);
// Retrieves and sales order Create
public void createSalesOrder(String PO_NO, String MAT,String RQTY,String CUSTMAT, String SOLD_NAME, String SOLD_STREET,String SOLD_COUNTRY, String SOLD_POST_CODE,String SHIP_NAME, String SHIP_STREET,String SHIP_COUNTRY, String SHIP_POST_CODE)
try {
// Get a function template from the repository
IFunctionTemplate ftemplate = repository.getFunctionTemplate("BAPI_SALESORDER_CREATEFROMDAT1");
JCO.MetaData so_metadata = new JCO.MetaData("BAPI_SALESORDER_CREATEFROMDAT1");
// Create a function from the template
JCO.Function function = new JCO.Function(ftemplate);
// Get a client from the pool
JCO.Client client = JCO.getClient(SID);
// Fill in input parameters
// Header
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList tables = function.getTableParameterList();
JCO.Structure input_header = input.getStructure("ORDER_HEADER_IN");
// Item details
JCO.Table table_item = tables.getTable("ORDER_ITEMS_IN");
//JCO.Structure input_item = table_item.getStructure("ORDER_ITEMS_IN");
// Partner details
JCO.Table table_partner = tables.getTable("ORDER_PARTNERS");
// Populate the header details
input_header.setValue("ZAD5","DOC_TYPE"); // Document Type
input_header.setValue("3000","SALES_ORG"); // Sales Organization
input_header.setValue("10","DISTR_CHAN"); // Distribution Channel
input_header.setValue("00","DIVISION"); // Distribution Channel
input_header.setValue("20041212","REQ_DATE_H");// can be changed in yyyymmdd (Requested date)
input_header.setValue(PO_NO,"PURCH_NO_C");// can be changed ( Customer PO Number )
//Populate the item detalis
table_item.appendRow();
table_item.setRow(1);
table_item.setValue("000010","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
table_item.appendRow();
table_item.setRow(2);
table_item.setValue("000020","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
//Populate the Partner details
// Sold to Party
table_partner.appendRow();
table_partner.setRow(1);
table_partner.setValue("AG","PARTN_ROLE");
//table_partner.setValue("0000002007","PARTN_NUMB");
table_partner.setValue("0000100067","PARTN_NUMB");
table_partner.setValue(SOLD_NAME,"NAME"); // can be changed
table_partner.setValue(SOLD_STREET,"STREET"); // can be changed
table_partner.setValue(SOLD_COUNTRY,"COUNTRY");
table_partner.setValue(SOLD_POST_CODE,"POSTL_CODE"); // can be changed
// Ship to party
table_partner.appendRow();
table_partner.setRow(2);
table_partner.setValue("WE","PARTN_ROLE");
table_partner.setValue("0000100067","PARTN_NUMB");
table_partner.setValue(SHIP_NAME,"NAME");// can be changed
table_partner.setValue(SHIP_STREET,"STREET"); // can be changed
table_partner.setValue(SHIP_COUNTRY,"COUNTRY");
table_partner.setValue(SHIP_POST_CODE,"POSTL_CODE");// can be changed
// Call the remote system
client.execute(function);
// Print return message
JCO.Structure ret = function.getExportParameterList().getStructure("RETURN");
System.out.println("BAPI_SALES_ORDER_GETLIST RETURN: " + ret.getString("MESSAGE"));
// Get table containing the orders
//JCO.Table sales_orders = function.getTableParameterList().getTable("SALES_ORDERS");
JCO.Field sales_order = function.getExportParameterList().getField("SALESDOCUMENT");
// Print results
String so = sales_order.getString();
String message = ret.getString("MESSAGE");
String message_type = ret.getString("TYPE");
if (message_type.equalsIgnoreCase("E")) {
System.out.println("Error in Sales Order Creation:" + message);
else{
System.out.println("Sales Order " + so + " Created Succesfully");
// Release the client into the pool
JCO.releaseClient(client);
catch (Exception ex) {
System.out.println("Caught an exception: \n" + ex);
// Retrieves and sales order Create
public void listSalesOrders()
try {
// Get a function template from the repository
IFunctionTemplate ftemplate = repository.getFunctionTemplate("BAPI_SALESORDER_GETLIST");
// Create a function from the template
JCO.Function function = new JCO.Function(ftemplate);
// Get a client from the pool
JCO.Client client = JCO.getClient(SID);
// Fill in input parameters
JCO.ParameterList input = function.getImportParameterList();
//input.setValue("0000002007", "CUSTOMER_NUMBER" );
input.setValue( "3000", "SALES_ORGANIZATION");
//input.setValue( "0", "TRANSACTION_GROUP" );
//input.setValue("PO_NUMBER_JAVA01","PURCHASE_ORDER_NUMBER");
// Call the remote system
client.execute(function);
// Print return message
JCO.Structure ret = function.getExportParameterList().getStructure("RETURN");
System.out.println("BAPI_SALES_ORDER_GETLIST RETURN: " + ret.getString("MESSAGE"));
// Get table containing the orders
JCO.Table sales_orders = function.getTableParameterList().getTable("SALES_ORDERS");
// Print results
if (sales_orders.getNumRows() > 0) {
// Loop over all rows
do {
counter++;
System.out.println("--" + counter + "--
// Loop over all columns in the current row
for (JCO.FieldIterator e = sales_orders.fields(); e.hasMoreElements(); ) {
JCO.Field field = e.nextField();
System.out.println(field.getName() + ":\t" + field.getString());
}//for
} while(sales_orders.nextRow());
else {
System.out.println("No results found");
}//if
// Release the client into the pool
JCO.releaseClient(client);
catch (Exception ex) {
System.out.println("Caught an exception: \n" + ex);
public static void main(String[] argv) {
SalesOrder so = new SalesOrder();
so.createSalesOrder("PO_NUMBER_JAVA02", "","0000000020000","121-223-2332-1231", "SOFTWARE SYSTEME GMBH-WE", "STREET-SH","US", "53125","SOFTWARE SYSTEME GMBH-WE", "STREET-SH","US", "53125");
//so.listSalesOrders();
>>>>Please if any of SDN users can help in resolving this issue. It will be very helpful to my cousin.Before:
//Populate the item detalis
table_item.appendRow();
table_item.setRow(1);
table_item.setValue("000010","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
table_item.appendRow();
table_item.setRow(2);
table_item.setValue("000020","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
Try to add:
//Populate the item detalis
table_item.appendRow();
table_item.setRow(2);
table_item.setValue("000020","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
table_item.appendRow();
table_item.setRow(2);
table_item.setValue("000020","ITM_NUMBER");
table_item.setValue("AA01","PO_ITM_NO");// can be changed
table_item.setValue("IAD-SC3000","MATERIAL");
table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
Regards. -
How to generate Top sales report from SAP data ?
Hello experts,
I am completely a newbie to SAP BO , can any one guide me how to generate TOP sales of the year report from SAP data ?Hi David,
First Let me know the Source & Tools to involve.
Let me go with the generic approach:
If the source is BW, then you can create the logic in query designer designer and then you can incorporate the data into the dashboard or webi or crystal report whatever its.
If the source is sql or anyother DB then it can also be achievable in crystal or webi to write the logic in top 10 values by ranking then you can incorporate the data into the dashboard, but here you can limit the top or bottom values.
Hope this helps, please revert for more clarifications on this.
--SumanT -
Sales order report with order attachments
Hi All
I am writing a program for a 2 part report that gives a list of sales orders with attachment flags and a list of invoices that do not have the output processed due to the presence of attachment flag.
Firstly i need help regarding few queries in the process of writing this program.
1. How can i distinguish between a sales order with attachement and one without an attachment.
2. What is the related field for attachment in sales header/sales item table(s) or any other sales related table which will contain information of the attachment in the sales order.
3. If I have an attachment in sales order, will it have an effect in the output being processed for the invoice for that order.
Thanks in Advance
--MikeHello Erik,
is there a sales order report with the complete line-item pricing
breakdown. For example, In VA05 I'm only able to get the Net
Price and Net Value as an output. I would also like to view the
breakdown of the conditions (e.g. disounts, tax, etc.)
Is there another report in SAP that will show this? Or a backend
table I can pull this information from to create a query?
The best way to handle your requirement is to create a Custom report using the standard table for Sales Order i.e. VBAK and you can pick up the Document Condition Number. You can pass this number to table KONV and pull up all the values for the active contion type which was responsible for Sales Order price calculation. Please reach out to a ABAPer to develop this sort of a custom report.
Just FYI, if you want to check out all the value for a specific condition type, then you can use the standard report i.e. V/LD.
Please update your post after carrying out this exercise.
Regards,
Sarthak -
Sales Order Report with Pricing Breakdown
HI, is there a sales order report with the complete line-item pricing breakdown. For example, In VA05 I'm only able to get the Net Price and Net Value as an output. I would also like to view the breakdown of the conditions (e.g. disounts, tax, etc.)
Is there another report in SAP that will show this? Or a backend table I can pull this information from to create a query?
Thanks, ErikHello Erik,
is there a sales order report with the complete line-item pricing
breakdown. For example, In VA05 I'm only able to get the Net
Price and Net Value as an output. I would also like to view the
breakdown of the conditions (e.g. disounts, tax, etc.)
Is there another report in SAP that will show this? Or a backend
table I can pull this information from to create a query?
The best way to handle your requirement is to create a Custom report using the standard table for Sales Order i.e. VBAK and you can pick up the Document Condition Number. You can pass this number to table KONV and pull up all the values for the active contion type which was responsible for Sales Order price calculation. Please reach out to a ABAPer to develop this sort of a custom report.
Just FYI, if you want to check out all the value for a specific condition type, then you can use the standard report i.e. V/LD.
Please update your post after carrying out this exercise.
Regards,
Sarthak -
Sales Order creation using SAP NCo 3.0 x64
Hi,
I have been trying to create a sales order using the SAP NCo from Visual Studio (C#) and I'm stuck.
The code I have used is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SAP.Middleware.Connector;
namespace ConsoleApplication2
class Program : IDestinationConfiguration
static void Main(string[] args)
RfcDestinationManager.RegisterDestinationConfiguration(new Program());
RfcDestination destination = RfcDestinationManager.GetDestination("EHP6");
try
RfcRepository repo = destination.Repository;
IRfcFunction salesDoc = repo.CreateFunction("BAPI_SALESORDER_CREATEFROMDAT2");
IRfcFunction salesDocCommit = repo.CreateFunction("BAPI_TRANSACTION_COMMIT");
IRfcStructure salesHeader = salesDoc.GetStructure("ORDER_HEADER_IN");
IRfcTable salesItems = salesDoc.GetTable("ORDER_ITEMS_IN");
IRfcTable salesPartners = salesDoc.GetTable("ORDER_PARTNERS");
IRfcStructure salesItemsStruct = salesItems.Metadata.LineType.CreateStructure();
IRfcStructure salesPartnersStruct = salesPartners.Metadata.LineType.CreateStructure();
//Sales Header
salesHeader.SetValue("DOC_TYPE", "MOR");
salesHeader.SetValue("DOC_DATE", Convert.ToDateTime("2014-06-19"));
salesHeader.SetValue("SALES_ORG", "M210");
salesHeader.SetValue("DISTR_CHAN", "01");
salesHeader.SetValue("DIVISION", "M1");
salesHeader.SetValue("CURRENCY", "USD");
//Sales Items
salesItemsStruct.SetValue("ITM_NUMBER", "000010");
salesItemsStruct.SetValue("MATERIAL", "MP_SHEET_22");
salesItemsStruct.SetValue("SHORT_TEXT", "Sheet Grade B, BWT 20lb/75gsm");
salesItemsStruct.SetValue("PLANT", "M210");
salesItemsStruct.SetValue("TARGET_QTY", "2000");
salesItemsStruct.SetValue("TARGET_QU","LBR");
salesItemsStruct.SetValue("TARGET_VAL", "11655.67");
// Partner
salesPartnersStruct.SetValue("PARTN_ROLE", "SP");
salesPartnersStruct.SetValue("PARTN_NUMB", "MP-CUST201");
RfcSessionManager.BeginContext(destination);
salesDoc.Invoke(destination);
salesDocCommit.Invoke(destination);
RfcSessionManager.EndContext(destination);
Console.WriteLine("Sales Order Created!!");
Console.ReadLine();
catch (RfcCommunicationException e)
e.ToString();
Console.WriteLine(e);
Console.ReadLine();
catch (RfcLogonException e)
e.ToString();
Console.WriteLine(e);
Console.ReadLine();
catch (RfcAbapRuntimeException e)
e.ToString();
Console.WriteLine(e);
Console.ReadLine();
catch (RfcAbapBaseException e)
e.ToString();
Console.WriteLine(e);
Console.ReadLine();
public RfcConfigParameters GetParameters(String destinationName)
if ("EHP6".Equals(destinationName))
RfcConfigParameters parms = new RfcConfigParameters();
parms.Add(RfcConfigParameters.AppServerHost, "xx.xxx.xxx.xx");
parms.Add(RfcConfigParameters.SystemNumber, "00");
parms.Add(RfcConfigParameters.SystemID, "IE6");
parms.Add(RfcConfigParameters.User, "user");
parms.Add(RfcConfigParameters.Password, "password");
parms.Add(RfcConfigParameters.Client, "800");
parms.Add(RfcConfigParameters.Language, "EN");
return parms;
else return null;
It returns me no error and even displays "Sales Order Created!!" from the try block. But when I check in VBAK, no Sales Order is being created.
Can somebody help me understand, if I have missed out something or if I'm going wrong somewhere?
All dependencies have been added correctly, platform being set to x64. No build/run-time errors.Hi Sreyan Choudhury
have you check if you have completed all the mandatory field?
the partner "SP" is the customer in your system?
here an example on how I've used this bapi in a webdynpro:
* Order Header Details
CLEAR w_order_header_in.
w_order_header_in-doc_type = zauart.
w_order_header_in-sales_org = zvkorg.
w_order_header_in-distr_chan = stru_order_header-distr_chan.
w_order_header_in-division = 'GN'.
w_order_header_in-purch_no_c = stru_order_header-purch_no_s.
w_order_header_in-purch_no_s = stru_order_header-purch_no_s.
w_order_header_in-sales_grp = zvkgrp.
w_order_header_in-sales_off = zvkbur.
w_order_header_in-compl_dlv = stru_order_header-compl_dlv.
w_order_header_in-req_date_h = stru_order_header-req_date_h.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_order_items_in-material
IMPORTING
output = w_order_items_in-material.
* Order Partner Details
CLEAR: i_order_partners,w_order_partners.
w_order_partners-partn_role = 'AG'.
w_order_partners-partn_numb = stru_order_partners-partn_numb.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_order_partners-partn_numb
IMPORTING
output = w_order_partners-partn_numb.
APPEND w_order_partners TO i_order_partners.
*partener roles
SELECT * INTO w_agenti FROM zagenti WHERE vkgrp = zvkgrp.
CLEAR w_order_partners.
w_order_partners-partn_role = w_agenti-parvw.
w_order_partners-partn_numb = w_agenti-lifnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_order_partners-partn_numb
IMPORTING
output = w_order_partners-partn_numb.
APPEND w_order_partners TO i_order_partners.
ENDSELECT.
* Order Items
LOOP AT stru_order_items INTO i_order_items.
CLEAR: w_order_items_in.
MOVE-CORRESPONDING i_order_items TO w_order_items_in.
w_order_items_in-store_loc = i_order_items-lgort.
w_order_items_in-itm_number = sy-tabix * 10.
w_order_items_in-item_categ = 'TAN'.
w_order_items_in-ship_point = 'LS00'.
w_order_items_in-plant = 'DS00'.
APPEND w_order_items_in TO i_order_items_in.
w_order_items_inx-itm_number = w_order_items_in-itm_number.
w_order_items_inx-target_qty = 'X'.
w_order_items_inx-item_categ = 'X'.
w_order_items_inx-ship_point = 'X'.
w_order_items_inx-plant = 'X'.
IF w_order_items_in-batch IS NOT INITIAL.
w_order_items_inx-batch = 'X'.
ENDIF.
IF w_order_items_in-store_loc IS NOT INITIAL.
w_order_items_inx-store_loc = 'X'.
ENDIF.
APPEND w_order_items_inx TO i_order_items_inx.
w_order_schedules_in-itm_number = w_order_items_in-itm_number.
w_order_schedules_in-sched_line = '0001'.
w_order_schedules_in-req_qty = w_order_items_in-target_qty.
APPEND w_order_schedules_in TO i_order_schedules_in.
w_order_schedules_inx-itm_number = w_order_items_in-itm_number.
w_order_schedules_inx-sched_line = '0001'.
w_order_schedules_inx-req_qty = 'X'.
w_order_schedules_inx-updateflag = 'I'.
APPEND w_order_schedules_inx TO i_order_schedules_inx.
* Order Condition Details
IF i_order_items-prriga <> i_order_items-prnet AND
i_order_items-prriga <> i_order_items-prbase.
CLEAR: w_order_conditions_in.
w_order_conditions_in-itm_number = w_order_items_in-itm_number.
w_order_conditions_in-cond_type = 'ZMAN'. “manual
price condition
w_order_conditions_in-cond_value = i_order_items-prriga / 10.
APPEND w_order_conditions_in TO i_order_conditions_in.
ENDIF.
DATA: v_message_riga TYPE string.
* Get message manager
DATA: l_current_controller TYPE REF TO if_wd_controller,
l_message_manager TYPE REF TO if_wd_message_manager.
l_current_controller ?= wd_this->wd_get_api( ).
CALL METHOD l_current_controller->get_message_manager
RECEIVING
message_manager = l_message_manager.
IF i_order_items-prriga = 0 AND i_order_items-omaggio = ''.
CONCATENATE 'Error during the creation '
'empty line INTO v_message_riga.
* v_message_riga = 'Errore durante la creazione. Riga non
*valorizzata'.
* Report Error message
CALL METHOD l_message_manager->report_error_message
EXPORTING
message_text = v_message_riga.
i_bloccasalva = 'X'.
ENDIF.
ENDLOOP. -
Hello..
my client wants to have the open sales Order report in following format :
======================================================================================================
Customer Name | Item 1 code | Item 2 code | Item 3 code | Item 4 code | Item 5 code | Item 6 code | Item 7 code |
=======================================================================================================
Jack Inc.......................987.................865.....................654.................543.......................739..................543...................987
Colt Inc.......................237.................213.....................799..................321.......................875...................187...................122
IOUU LLC...................127.................535.....................654..................777.......................211...................345...................777
=====================================================================================================
.................................1351..............1613...................2107.................1641.....................1825.................1075..................1886
=====================================================================================================
pls help me to create sql query for the above
rekha
Edited by: Rekhatiwari on Dec 16, 2010 10:46 AM
Edited by: Rekhatiwari on Dec 16, 2010 10:47 AMHi,
Try this:
SELECT T0.CardName,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%2\]') Item1,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%3\]') Item2,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%4\]') Item3,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%5\]') Item4,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%6\]') Item5,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%7\]') Item6,
(Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%8\]') Item7
FROM ORDR T0
WHERE T0.docdate between [%0\] and [%1\]
That might be the only way close to your requirement.
Thanks,
Gordon -
Which table I can get sales order no from delivery numbar.
Hi,
I want sales order no from delivery no. right now I am using table VBFA where I am passing VBELN and POSNN and geting sales order no. but performance of select query is very poor bcouse I am not passing first two key fields in the select query.
Is there any other tablefrom where we can get sales order no. from delivery no. so that performance of report can be improved.
Thanks,hi,
sales doc header ( table VBAK ) copy to Delivery header table( LIKP)
sales doc item table ( VBAP) copy to Delivery item table( LIPS)
you can see this in copy control VTLA ,
now u want slaes doc no. from dilv doc. no.
so go to t-code se11.....
fill table LIKP u will get VBELN field for deliv doc no, & TERNR field for sales doc. no.
so if u want to call sales doc no from dilv doc no.. u can use table LIKP in ur report.
i hope it will help u. -
Hi,
I have a code to display Sales order report. But i need to generate Sales order Line item wise Report. Can anyone help me to modify this code to suit my criteria?
DATA: IT_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.
DATA: IT_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE.
PARAMETERS: SORG LIKE VBAK-VKORG,
CCODE LIKE VBAK-BUKRS_VF.
SELECT * FROM VBAK INTO TABLE IT_VBAK UP TO 100 ROWS
WHERE
VKORG = SORG AND
BUKRS_VF = CCODE.
SELECT * FROM VBAP INTO TABLE IT_VBAP UP TO 100 ROWS
FOR ALL ENTRIES IN IT_VBAK
WHERE
VBELN = IT_VBAK-VBELN.
LOOP AT IT_VBAP.
WRITE: / IT_VBAP-VBELN, IT_VBAP-ERNAM, IT_VBAP-POSNR.
ENDLOOP.
Thanks in advance..
Any help will be greatly appritiatedHi
Hope it will help you..
Reward if help.
REPORT ZVRDOC0 no standard page heading
line-size 300
line-count 50(5).
TABLES : vbak, "Sales Document Header Level
vbap, "Sales Document Header Level
kna1. "General Data in customer Master
*INTERNAL TABLE T_VBAP
DATA : Begin of t_vbap occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
posnr like vbap-posnr,
arktx like vbap-arktx,
kwmeng like vbap-kwmeng,
cmkua like vbap-cmkua,
end of t_vbap.
*INTERNAL TABLE T_TAB.
DATA : Begin of t_tab occurs 0,
vbeln like vbak-vbeln,
kunnr like vbak-kunnr,
audat like vbak-audat,
netwr like vbak-netwr,
vkorg like vbak-vkorg,
name1 like kna1-name1,
land1 like kna1-land1,
end of t_tab.
*INTERNAL TABLE T_FINAL.
DATA : Begin of t_final occurs 0,
vbeln like vbap-vbeln,
kunnr like vbak-kunnr,
matnr like vbap-matnr,
posnr like vbap-posnr,
arktx like vbap-arktx,
kwmeng like vbap-kwmeng,
cmkua like vbap-cmkua,
audat like vbak-audat,
netwr like vbak-netwr,
vkorg like vbak-vkorg,
name1 like kna1-name1,
land1 like kna1-land1,
end of t_final.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-bO3.
parameters : P_kunnr like vbak-kunnr.
select-options : S_vbeln for vbak-vbeln,
S_audat for vbak-audat.
SELECTION-SCREEN END OF BLOCK B1.
start-of-selection.
select vbeln matnr posnr arktx kwmeng cmkua from vbap
into corresponding fields of table t_vbap where vbeln in S_vbeln .
IF sy-subrc EQ 0.
select vbakkunnr vbakvbeln vbakaudat vbaknetwr vbak~vkorg
kna1name1 kna1land1 into table t_Tab from
vbak join kna1 on kna1kunnr = vbakkunnr
FOR ALL ENTRIES IN t_vbap
where vbak~vbeln = t_vbap-Vbeln and
vbak~kunnr = p_kunnr and
vbak~audat in S_audat .
ENDIF.
*end-of-selection.
loop at t_vbap.
read table t_tab with key vbeln = t_vbap-vbeln.
move :
t_vbap-vbeln to t_final-vbeln,
t_vbap-matnr to t_final-matnr,
t_vbap-posnr to t_final-posnr,
t_vbap-arktx to t_final-arktx,
t_vbap-kwmeng to t_final-kwmeng,
t_vbap-cmkua to t_final-cmkua,
t_tab-kunnr to t_final-kunnr,
t_tab-audat to t_final-audat,
t_tab-netwr to t_final-netwr,
t_tab-vkorg to t_final-vkorg,
t_tab-name1 to t_final-name1,
t_tab-land1 to t_final-land1.
append t_final.
clear t_Final.
endloop.
sort t_Final by vbeln Kunnr matnr posnr .
loop at t_final.
at new vbeln.
write : /1 SY-VLINE, 2 t_final-vbeln color 5 inverse.
ULINE /1(250).
endat.
write : /1 SY-VLINE, 2 t_final-vbeln color 5 inverse,
20 SY-VLINE, 21 t_final-posnr color 5 inverse,
40 SY-VLINE, 41 t_final-matnr color 5 inverse,
60 SY-VLINE, 61 t_final-arktx color 4 inverse,
80 SY-VLINE, 81 t_final-kwmeng color 4 inverse,
100 SY-VLINE, 101 t_final-cmkua color 4 inverse,
120 SY-VLINE, 121 t_final-kunnr color 3 inverse,
140 SY-VLINE, 141 t_final-audat color 3 inverse,
160 SY-VLINE, 161 t_final-netwr color 2 inverse,
180 SY-VLINE, 181 t_final-vkorg color 2 inverse,
210 SY-VLINE, 211 t_final-name1 color 1 inverse,
230 SY-VLINE, 231 t_final-land1 color 1 inverse,
250 SY-VLINE.
at end of vbeln.
sum.
ULINE /1(250).
write: /60 SY-VLINE, 'Total' ,
81 t_final-kwmeng color 4 inverse ,100 SY-VLINE,
101 t_final-cmkua color 4 inverse,120 SY-VLINE.
ULINE /1(250).
endat.
at last.
SKIP 2.
sum.
ULINE /1(250).
write: /1 SY-VLINE, 60 SY-VLINE, 'Grand Total' ,
81 t_final-kwmeng color 4 inverse , 100 SY-VLINE ,
101 t_final-cmkua color 4 inverse,120 SY-VLINE.
ULINE /1(250).
endat.
endloop.
TOP-OF-PAGE.
ULINE /50(24).
WRITE : /50 SY-VLINE , 52 'SALES ORDER DETAILS' COLOR 5,
73 SY-VLINE.
ULINE /50(24).
ULINE .
WRITE: /10 'CURRENT DATE :', 25 SY-DATUM COLOR 1 INVERSE,
100 'CURRENT TIME :', 115 SY-UZEIT color 5 INVERSE.
WRITE: /10 'USERNAME :', 25 SY-UNAME COLOR 1 INVERSE,
100 'PAGE NO :', 113 SY-PAGNO COLOR 5 INVERSE.
WRITE: /10 'LOGON CLIENT :', 25 SY-MANDT COLOR 1 INVERSE,
100 'COLON N0 :', 114 SY-COLNO COLOR 5 INVERSE.
WRITE: /10 'CURRENT REPROT:', 25 SY-REPID COLOR 1 INVERSE,
100 'LANGUAGE :', 116 SY-LANGU COLOR 5 INVERSE.
ULINE.
ULINE /1(250).
write : /1 SY-VLINE, 2 'SALES DOC NO' color 6 inverse,
20 SY-VLINE, 21 'SALES DOC ITEM' color 6 inverse,
40 SY-VLINE,41 'MATERIAL NO' color 6 inverse,
60 SY-VLINE, 61 'SHORT SALES TEXT' color 6 inverse,
80 SY-VLINE, 81 'CUMM ORDER SALES' color 6 inverse,
100 SY-VLINE, 101 'CREDIT DATA' color 6 inverse,
120 SY-VLINE, 121 'CUSTOMER NO' color 6 inverse,
140 SY-VLINE, 141 'DOC DATE' color 6 inverse,
160 SY-VLINE, 161 'NET VALUE SALES' color 6 inverse,
180 SY-VLINE, 181 'SALES ORG' color 6 inverse,
210 SY-VLINE, 211 'CUSTOMER NAME' color 6 inverse,
230 SY-VLINE, 231 'CUSTOMER CONTY' color 6 inverse,
250 SY-VLINE.
ULINE /1(250).
END-OF-PAGE.
ULINE.
WRITE: /45 ' THIS IS END OF PAGE FOR SALES DOCUMENT DETAILS'
COLOR 6 . -
Credit Block released Sales order report
Hi Experts,
My client is given few sales orders (around 4)no and requesting us, to prepare the credit block released sales orders report (include released person user ID).
*.No change logs is existing for all sales order and deliveries.
For above requirement I am using CDHDR table data but I am not getting credit block released sales order report.
Below fields I am using in CDHDR Table.
Change doc.Object (objectclas) : VERKBELEG
Document No (CHANGENR): Sales order no XXXXXXX
Transaction no (TCODE) : VKM1,VKM2,VKM3
Date(UDATE) : 25.09.2011 to 09.11.2011
Experts, Can you please help me out for this.
Thanking you!!!!
Regards,
Vijaykumar Kola
*.I'm already aware of this is a new development.Try this, simple report... Here we check the new value of credit status field VBUK-CMGST and if it is 'D' we know that someone used VKM* transaction to release the document. Also you need to format the sales order number with leading zeros so it occupies all 10 digits and pass it to CDHDR-OBJECTID field (and not CHANGENR field). In the below code I am using select option for sales order number, so I know it will be formatted with leading zeros and so select on CDHDR will be successful.
*& Report ZTV_TEST
REPORT ztv_test.
TABLES: vbak, cdhdr.
SELECT-OPTIONS: s_saldoc FOR vbak-vbeln OBLIGATORY,
s_udate FOR cdhdr-udate.
RANGES: r_objid FOR cdhdr-objectclas.
DATA: ls_cdhdr TYPE cdhdr,
ls_cdpos TYPE cdpos.
IF NOT s_saldoc IS INITIAL.
LOOP AT s_saldoc.
MOVE-CORRESPONDING s_saldoc TO r_objid.
CONDENSE: r_objid-high, r_objid-low.
APPEND r_objid.
ENDLOOP.
ENDIF.
CHECK NOT r_objid[] IS INITIAL.
SELECT *
INTO ls_cdhdr
FROM cdhdr
WHERE objectclas = 'VERKBELEG' AND
objectid IN r_objid AND
udate IN s_udate AND
tcode LIKE 'VKM%'.
SELECT SINGLE *
INTO ls_cdpos
FROM cdpos
WHERE objectclas = ls_cdhdr-objectclas AND
objectid = ls_cdhdr-objectid AND
changenr = ls_cdhdr-changenr AND
tabname = 'VBUK' AND
fname = 'CMGST' AND
value_new = 'D'.
IF sy-subrc = 0.
WRITE:/ ls_cdhdr-objectid(10), ls_cdhdr-username,
ls_cdhdr-udate, ls_cdhdr-utime.
ENDIF.
ENDSELECT. -
Automatic Sales Order Creation from PO in B1
Hi,
I have this scenario. Purchase order is created in SAP B1 (Business One) which triggers automatic Sales Order creation in SAP ECC 6.0.
The requirement:
For the combination of PO number and Sold to party there should be only one sales order created.
The problem:
Sometimes for the same PO duplicate Sales orders(sometimes 3,4) are getting created in ECC.
Possible causes:
Probably no validations in the interface.
Question:
1. First of all, is it an SD issue or PI (process integration) issue.
2. If it is an SD issue, as a functional consultant what / where can we do to prevent this.
Thanks.
Edited by: SAP SD_Newbie on Oct 20, 2011 6:59 PM
Edited by: SAP SD_Newbie on Oct 20, 2011 6:59 PM
How do I move this to "ERP - Sales and Distribution (SD) General", because this question is not just related to "ERP SD Sales" but SD in general. Isn't there an option for the users to a question from one forum to another.1. First of all, is it an SD issue or PI (process integration) issue.
- May be PI, or SD or both. I am not sure about the integration mechanism/program so I am not able to pinpoint.
2. If it is an SD issue, as a functional consultant what / where can we do to prevent this.
In t.code VOV8, go to the sales document type. Select value A in the field, check Purchase order Number. Then go to t.code OVAH, there make the message number V4 115 as error message. This will not allow the creation of the sales order, if the Purchase order number duplicates. I assume in your process, the purchase order number is populated in the PO number field of the sales order overview screen.
Regards, -
Workflow fo returned sales order modified from updating the billing block t
please tell me how to find returned sales order modified from updating the billing block to delivery block and how to create blocks here.i want to know updating means what is happening here.
Thread locked.
Beginner questions are very welcome, but your question makes it obvious that you didn't even bother looking at the help or searching on SDN.
Please read the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to post a good question and make a little effort yourself before expecting people to give up their time to help you.
Maybe you are looking for
-
How do I get my incoming emails in Mail on my Imac to automatically go to Icloud? My sent emails go there automatically but not my incoming emails. I'm using OS X 10.8.5.
-
Need SharePoint Hosted App for Stock quotes.
Hi All, I need a code for SharePoint hosted app wherein I want to show stock quotes of company. This App part should be configurable. Specifically Looking for code which developed in NAPA tool. But any help would be greatly appricieated. Thanks, Dhan
-
Using interactive QuickTime movie on Windows is fixed!!
With the release of 7.2, the problem listed in this thread http://discussions.apple.com/thread.jspa?threadID=154423&tstart=0 has been resolved! If you update your PC to QuickTime 7.2, interactive QuickTime movies exported from Keynote will work witho
-
Why does TopLink roll back transactions without displaying any error?
I am trying to do bulk inserts via a stored procedure that takes in a VARRAY of varchars (complete insert statements). Becuase of integrity constraint, the stored procedure can only be executed after the parent record has been inserted via registerOb
-
I cannot open my Photoshop CS6 due to a pop up offering me a trial for CS6 Extended.
I don't need the 'extended' version. I have only 3 choices in this pop-up window. Join the Cloud @ $$ per month, start a trial or 'license this software'. I choose to simply close the window and for that, I was asked if I was sure... I declined to si