Sales Order Number from BSID.
How can I find Sales order no using the table bsid or bsad
Regards
Hi Nagabhushan,
Since you say you will be given the Invoice no as an input from the user you can use VBFA table to get the cooresponding Sales order no.
In VBFA table in the Prec.doc.categ. field enter C as the value which is Order and the system will give you the corresponding Sales Order that was created for the respective Sales Invoice.
Hope thsi will help.
Thanks and Regards,
J Nagesh
Similar Messages
-
How to get master sales order number from delivery number
Hi All,
I need logic for getting master sales order number from available Delivery number.
Note: There can be many SO's in diffrent levels.
Finally i need to pick up master sales order no.
Thanks in advance.
Thanks,
Deep.Hi,
I have a outbound delivery[VL03N] 'X' in my system .
Then for getting sales order no i am writing below code:
SELECT single vbelv vbeln
from vbfa
INTO (vbelv, vbeln)
where vbeln EQ p_vbeln AND
vbtyp_n EQ 'J'.
Then vbelv i need to pick up master sales order no.
SELECT vbelv vbeln
from vbfa
INTO TABLE i_so
where vbeln EQ l_vbelv AND
vbtyp_n EQ 'C'.
If i write code as above it is giving four sales orders which one of them is master sales order no!
Thanks,
Deep. -
Find Sales order number from IDOC number
I have a bunch of SO idocs, in status 64. They are then posted and Sales orders are created.
How can I programatically find the Sales order Number from the Sales Order idoc number once it is in status 53 (other than going to EDIDS and checking if status = '53' and grabbing the 'STAPA2' field there ).Look at table EDIDS for sales order idocs and you can see SO number in any of STAPA1/2/3/4 variable for specific message id and message number.
-
How to trace sales order number from delivery number, when batch is split
Hi All,
I have created a Sales Order and a Outbound Delivery against the sales order.
While creating the Outbound delivery, I have split the qty in two batches.
Now when I go in table LIPS, and search on the basis of the Delivery number, I get two rows, one for each batch. But here the sales order LIPS-VGBEL, and Sales order item no (LIPS-VGPOS) is updated only for the 1st batch line item, but is not updated for the second batch line item.
Please help me so that on the basis of the delivery number, i will be able to find record from tables for sales order for both the line items (i.e. for each batch).
Immediate help would be appreciated.
Thanks in Advance.
AnkushHi,
I have created delivery against sales order.
While picking (during delivery PGI), I selected two batches to suffice the delivery qty. Please refer the example quoted below.
Sales order (SO1) - Material (Mat1) - qty (15 ea)
Delivery against sales order (Del1) - batch split: batch1 - 10 ea
batch2 - 5 ea
In table LIPS: when I enter delivery number as "Del1" and execute, I get 2 records:
del no. Item No. Material Qty Batch no Sales Order no Sales Order Item no
1. DEL1 10 Mat1 10 ea batch1 SO1 10
2. DEL1 20 Mat1 5 ea batch2 ______ ____
Thus in the 2nd record, the Sales order no.(LIPS-VGBEL) and sales order item no. (LIPS-VGPOS) does not get updated.
I have to develop a report to display the Sales Order number and sales order line item number for each batch of the Delivery for the same item number. Please guide me to know how I can get the same.
Hope this clarifies the issue faced.
Regards,
Ankush -
Sales order number from Sales invoice
Hello All ,
I have a requirement in which when I am running a certain mass update program in which the sales invoice will be populated with a certain number in the Sales invoice text . However before running it I need to ensure that Sales order corresponding to the Sales invoice is updated with a certain number in the Sales order Text field . The user will give the input SAP invoice number > I need to identify the most efficient/quickest way to find the sales order corresponding to the Sales Invoice and check if a particular field is updated or not I tried used VBFA , but it will point to delivery and time take is also more .Hi Nagabhushan,
Since you say you will be given the Invoice no as an input from the user you can use VBFA table to get the cooresponding Sales order no.
In VBFA table in the Prec.doc.categ. field enter C as the value which is Order and the system will give you the corresponding Sales Order that was created for the respective Sales Invoice.
Hope thsi will help.
Thanks and Regards,
J Nagesh -
Get the Sales Order number from Service Notification
Hi Experts,
Please let me know if there are any BAPI's or standard Function modules to get the Sales order for a given Service Notification number.
Thanks a lotHi Ashish,
Hope the listed BAPI's let you solve the issue:
BAPI_SERVNOT_CLOSE Complete service notification
BAPI_SERVNOT_CREATE Create service notification
BAPI_SERVNOT_DEL_DATA Delete Items, Causes, Activities, Tasks, Partners of the service notif.
BAPI_SERVNOT_GET_DETAIL Get details about a service notification
BAPI_SERVNOT_MODIFY_DATA Modify a service notification or associated subdata
BAPI_SERVNOT_POSTPONE Postpone service notification
BAPI_SERVNOT_PUTINPROGRESS Put in process a service notification
BAPI_SERVNOT_SAVE Save service notification
BAPI_SERVICENOTIFICAT_CREATE Create service notification
BAPI_SERVICENOTIFICAT_GETLIST Select service notifications according to customer or contact person
BAPI_SERVNOT_CHANGEUSRSTAT Change the user status of a service notification
Regards,
Soundarya. -
Fetch Sales Order number VBELN from Purchase requisition number BANFN
Hi,
I'm not able to find a suitable method to fetch the sales order number(VBELN) from the purchase requisition number(BANFN).
I tried using VBEP table to fetch the data, but it is giving serious performance issues, as in for fetching one record it is taking approx 20 seconds!!!
Kindly suggest a suitable method for this.
I've used the query as folllows:
select single vbeln banfn
from vbep
into (wa_vbep-vbeln, wa_vbep-banfn)
where banfn eq wa_eban_zdd1_x-banfn.
where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
Scenario in brief described below:
Whenever a direct delivery sales order is created on a supply chain plant, a dummy purchase requisition without source of supply is created automatically at preferred supplying plant for the customer in the sales order. Direct Delivery Sales Orders which are still in Open status and for the associated dummy purchase requisitions with these sales order, the deletion flag set has to be unchecked.
in this case, only one sales order is created corresponding to a preq..
BAPI: BAPI_PR_GETDETAIL is not giving entries for the table as this is a special case of direct delivery from the production plant directly to the customer, bypassing the warehouse / distribution center...
selection screen has input fields preq, matnr(product) and plant. we fetch entries depending on the data filled in selection screen and also they should be of document type(BSART in EBAN table) ZDD1 and deletion indicator is set(LOEKZ in EBAN).
then we check if the sales order corresponding to the preq is in open status...
for this i need to programmatically fetch the sales order number corresponding to the preq...
this is causing a performance issue as i could find only one way -- fetching sales order number from VBEP table corresponding to BANFN... indexing for easier also didnt work...
no other way i could find to fetch sales order number corresponding to the preq number....
there is a bapi: BAPI_PR_GETDETAIL, but this is not fetching entries to the changing tables related to sales order...
also EBKN table doesnt have any entries as this is a special case of direct delivery preq..
Guess i couldnt find anyother way...
Thanks.I'm not sure as to why the select query was still throwing performance issues. I could see that the index had been created on only BANFN in the DB. Prior to creating the index, it was taking approx 20 seconds per entry, but after creating the index, it took 13seconds approx.
I used the select query as follows:
select single vbeln banfn
from vbep
into (wa_vbep-vbeln, wa_vbep-banfn)
where banfn eq wa_eban_zdd1_x-banfn.
where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
I tried a few other combinations also, but those also didnt work effectively:
select vbeln banfn
from vbep
into (wa_vbep-vbeln, wa_vbep-banfn)
where banfn eq wa_eban_zdd1_x-banfn.
without using SINGLE in the select query as the select query would implicitly pickup only a single record,
select vbeln banfn
from vbep
into wa_vbep
where banfn eq wa_eban_zdd1_x-banfn.
and another query where the INTO statement was directed directly to a workarea.
But unfortunately, nothing seemed to be working.
The index i had created was on BANFN alone in the VBEP table. -
How to look for sales order number if I know outbound delivery number?
How to look for sales order number if I know outbound delivery number?
Hi ,
If you want to see the Sales order Number from Outbound delivery or invoice,go to their respective T-codes,say for example,
for delivery,Goto Tcode: VL02N / VL03N.There you will find Document Flow Icon,click on that,or press F7.
You will get a window,there you can see the Sales order Number before your outbound delivery Number
With Thanks and Regards,
Priya -
Fetch Sales order & item from Prod ord to TR Header text when staging mat
Hello
We have a need to see Sales order and item number in TR header text when selecting TR to be processed in transaction LB10.
TR´s are created via transaction LP10. Is there any solution to get Sales order number from Production order to be automatically pasted to TR header text field when generating TR?
SO & item is always available in Production order General data.
Thanks for answers!
-A
Edited by: A_R_FIN on Feb 5, 2010 8:34 AMHi,
I hope the below link will help you.
Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
Thanks,
Khushboo. -
Unconstrained Plan looking for Internal Sales Order Number in Workbench
There is a column under the Order tab in the Supply/Demand form in ASCP that is titled INTERNAL SALES ORDER. The assumption is that this would in fact be the internal sales order number from the supplying inventory organization. However it comes in null. For all internal orders. Is there a profile or a checkbox that enables this field?
Thanks in advance!Hello,
In 11.5.10, this field is not used at all. In R12 it is used in distribution planning.
best regards
Geert -
Fetch Sales order number and PO number from ship to party and sold to party
HI,
I need to get Sales order number and PO number
from ship to party and sold to party.
I have only ______sold to party and ship to party and req del date_______ in selection screen as mandatory
Please let me know
SreekanthHi,
You can do this:-
SELECT VBELN FROM LIKP
INTO TABLE T_DELIVERIES
WHERE KUNNR = SHIP TO PARTY
AND KUNAG = SOLD TO PARTY
AND LFDAT = DEL DATE.
You will get a table containing the list of deliveries.
Use VBFA to get the sales orders from deliveries.
SELECT VBELV FROM VBFA
INTO TABLE T_SALESORDERS
WHERE VBTYP_N = 'J'
AND VBELN = T_DELIVERIES-VBELN.
T_SALESORDERS WILL give you list of sales orders.
From Sales Orders you can get Purchase orders through EKKN Table.
Using EKKN pass T_SALESORDERS-VBELN and get corresponding EBELN.
Regards,
SUbhashini -
Getting purchase order number from sales order number
Hi Experts,
My requirement is to fetch the following values from a sales-order number:
Purchase Order Number,
Delivery Date
Order Type(Source of Order EDI/EFAX/..)
Ship To,
Sold To.
We are trying to fetch this data from the ECC system in our CRM system.We are exploring the possibilty of RFC calls to get the data from ECC system.
Is there any standard FM present in ECC which gives the above information from the sales order number?
Thanks in advance
Regards
ShilpiHi,
Check the FM BAPISDORDER_GETDETAILEDLIST
It provides the whole data for a particular Sales order which you need to provide Sales order number in the table 'SALES_DOCUMENTS' in tables parameter.
You have to provide the view what you need and in the import parameter 'I_BAPI_VIEW' like all the views that are in the tables parameter...
HEADER, ITEM etc...
The fields
PO_METHOD
PURCH_NO
REQ_DATE_H
SOLD_TO " will provide you the details you need in the table 'ORDER_HEADERS_OUT'
SHIP_POINT in ORDER_ITEMS_OUT table provides the ship to
Regards
Sarves -
How to find the Purchase Orders from Sales Order number
Hi ...
Is there a way to write a query to find the Purchase orders
from the Sales Order number ....
I have notice the table POR9 (Purchase Order - base Document)
but it seems to be empty.
Could you please help me to figure this out,
Thank you very much
Kind Regards
Sanjayahi,
u did mistake in selecting the table
SELECT T0.DocNum FROM ORDR T0 for sales order
SELECT T0.DocNum FROM OPOR T0 for purchase order
how to find the table in SAP B1.
go to above menu view => system information. tick it(or select it)
then below status bar u can see the table and field name.
open the required form and just keep the mouse cursor on any field.
you can see the table and field name below.
hope now u can able to track the table name.
regards
sandip -
Sales order number in Assignment field
Hi,
The requirement is to capture Sales order number in the assignment field of the accounting document.
Pls adv how to meet this.
I have seen the tables BSEG and BKPF , but Sales order number is not coming in either of the tables.
RegarsdOK lets start at the begining you have a sales order or sales orders, then a delivery or deliveries and then a billing document.
OK the Sales Order is captured in table VBAK being the header and VBAP the line item detail.
VBRK and VBRP are the line items details of the Billing Document
The billing document can be found in the accounting document tables BSEG, or BSID, BSAD.
In the create Finance document BAPI from SD you can code in the sales order, however you need to consider that a single accounting document may have more than one sales order.
If you have processes where there is a single sales order for every accounting document then this will work.
Hope this helps, award points if this is useful. -
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.
Maybe you are looking for
-
Creation of Purchase Requisition
All, I have done configuration of material groups and G/L accounts . In PR , when the Requestor is selecting a material group then G/L account will be coming automatically . But requestor can select wrong material groups , he never thinks of G/L pos
-
Profit center field in FIBLFFP- free form payment
Hi, We need profit center field in the screen of FIBLFFP as it is not present currently in the t code FIBLFFP. We needed this field as New G/l has been implemented and document splitting is active based on the profit center but we have not marked man
-
[(somewhat) SOLVED] Dnsmasq simply won't work - crashed?
Hi there, I'm having a problem with dnsmasq (v2.54 [<- how is this possible anyway? I just reinstalled it, pacman calls it "2.53-1", 'dnsmasq --version' calls it '2.54'…]). I'm just trying to use it as a DNS cache, nothing special. It seems to be sta
-
New Computer: How to transfer apps without losing data & in-app purchases?
I just bought a new MacBook. I've moved everything from my old PC to the MacBook, but now that I hook up my iPhone, iTunes is telling me that to sync my apps with the new MacBook will mean replacing all app data on my iPhone with data from the comput
-
Handling appln errors in ABAP proxy
Hello All, How is application related exceptions handled in a ABAP server proxy. Say I update a customer record from a proxy(asynch). Now the customer data does not exist in R/3. Regards, Jai Shankar