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
Sreekanth

Hi,
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

Similar Messages

  • 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.

  • Sales order information to be captured from a java based website

    Sales order information entered in java nabled website needs to be retrieved into SAP system and a sales order needs to be created in this system.
    And as soon as a sales order is created an bdoc needs to be triggered and sent to the CRM system...
    Middleware available for Java SAP interface.
    Do i need to call BAPI to retrieve the sales  info from middleware ??
    How does an idoc trigger as soon as a sales order created i SAP  system???
    Can any one help me out .Its urgent!!!
    Regards ,
    Lavanya

    Hi,
    You have to create a BAPI to read the data from java, the structure has to be the same as in the java system. once the data is read into the SAP system then you need the idoc to carry the data.
    regards
    Gokul
    <b>Reward Points if Useful</b>

  • How to check the sales order that has been PGI from a range of dates.

    Hi SAP Gurus,
    I have a query on how can I check the sales order that has been PGI from a range of dates in SAP?
    Thanks,
    Madelyn

    Dear Madelyn
    Go to VA05, give the date range and execute.  List of sale orders will be generated.  There you can see a tab "Status"  in which, the status would be like
    -  Not delivered
    -  Partially delivered
    So based on this, you can decide whether the order is still open or completed.
    thanks
    G. Lakshmipathi

  • Can "order combination" field be copied from ship-to party?

    We want "order combination" field on sales order to be copied from ship-to party, not the sold-to party, is there any way to do so? Do we have to modify the user exit? anyway to do this, without modify the user exit?
    Thanks!

    Thank you for reply!
    Business has customers with different ship-to parties. Some ship-to party requires 'order combination', other ship-to do not need 'order combination', so the businees users want to make this field copied from ship-to, instead of sold-to.
    As I can see almost all business relevant data, for example, inco term, payment term, shipping conditions.... are all copied from sold-to party, by standard SAP. I am wondering is there anyway to make them to be copied from other partnership, when require. I know we can do this by modify the user exit, but just wondering is there anyway in configuration settings....& without program change, can achieve this?

  • How do I select a black and white sketch from a white background and keep the filled in area of the sketch?  I want to copy it to a colored background. I amusing elements 12.

    How do I select a black and white sketch from a white background and keep the filled in area of the sketch?  I want to copy it to a colored background. I am using elements 12.

    oesrowstreasurer
    Please clarify your "Elements 12". Is that as in Photoshop Elements 12 (photo editor) or Premiere Elements 12 (video editor). And, on what computer operating system is the program running?
    Your question is pointing to Photoshop Elements 12 and that you have posted in the wrong forum. If this is a Photoshop Elements 12 question as I believe it is, please post your thread in the Adobe Premiere Elements Forum using the following link provided for your convenience
    https://forums.adobe.com/community/photoshop_elements
    The alternative is to wait for a moderator to see your thread here and move it from here to the Adobe Photoshop Elements Forum..
    We will be watching for a confirmation on what program you are using.
    ATR

  • Can you share alert and ring tones from iTunes between iPad and iPhone

    Can you share alert and ring tones from iTunes between iPad and iPhone like you can music and movies?

    iOS: Device not recognized in iTunes for Windows

  • I have iWeb '08 and just switched from Mobileme to GoDaddy and using Filezilla.  Now when I make changes through iWeb it doesn't actually publish to my desktop folder.  In fact, it doesn't publish at all but says that it did.

    I have iWeb '08 and just switched from Mobileme to GoDaddy and using Filezilla.  I also just upgraded to Lion.  Now when I make changes through iWeb it doesn't actually publish to my desktop folder.  In fact, it doesn't publish at all but says that it did.  How can I make changes in iWeb and publish to a folder?

    Choose the destination in the publish settings page as shown in the second example on this page...
    http://www.iwebformusicians.com/iWeb/Publish-Website.html

  • I updated to io7 and the photos from the welcome screen and the wallpaper are like too much zoomed thank you

    I updated to io7 and the photos from the welcome screen and the wallpaper are like too much zoomed thank you

    View your landscape photo with your phone in the upright position.
    Tap on the photo once so the background goes black
    Take a screenshot now by pressing the round button and the top button together.
    Go back into your photos and find this new screenshot - then apply this as your wallpaper. You should be able to resize it :)

  • How to Fetch Sales Order Item Quantity from Customer table(ztable)?

    Dear Guru's,
    My scenario:
    While creating Sales order the item quantity should be fetched from a Ztable. So iam using the Userexit "V46H0001 - - Customer functions for resource-related billing", in that i have implemented my code in the Function Exit - EXIT_SAPLV46H_001 and the FM documentation says
    This function module allows you to change item information for generating a new item.
    In order to achieve this, you must change the relevant field in the structure C_VBAPKOM.
    So i activated that exit and wrote the following code to test it as follows;
    break-point.
    C_VBAPKOM-zmeng = 10.
    But it seems not working, even it doesn't stop at the break-point when i type the material number for the item in the sales order and press enter...
    Please guide me in this regard, am i correct in choosing the User-Exit? what else have to be done in order to fetch the item quantity from the ztable....
    Please suggest if there is some other way to do this, i also heard that we can do this through Routines...
    Thanks in Advance...
    Regards
    Karthik D

    I have solved this  and you can found how i solved in the last reply of the following thread....
    [SD UserExit - V46H0001 - Customer functions for resource-related billing|SD UserExit - V46H0001 - Customer functions for resource-related billing]
    Thanks
    Karthik D

  • 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 AM

    Hi,
    I hope the below link will help you.
    Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
    Thanks,
    Khushboo.

  • Invoice Split: Sales orders with Differnt PO number

    Hi Experts,
    I was created two sales orders (OR) with different Purchase order number and done collective delivery using VL10, while create the invoice; Invoice was spited based PO number. (Reference doc is delivery I was given)
    I am wondering there was no Purchase order number in delivery document but how system has done Invoice splittingu201D. Can you please explain me How Invoice split had done in above case.
    I have maintained everything stranded settings onlyu2026 
    Thanks in advance,
    Regards,
    Pa1 _Jackson Robert

    Dear vijay kumar      
    This is due to the copy controls in between "VTFL" in that you can find the reference number and assignment number. These fields will be use full to pass the SD information to FI.
    In our issue The  "Reference number" you must have mentioned "A"(Purchase order number) Change this and maintain either D or E.
    Because in sales order you have given different purchase order numbers and try to make ot one single invoice with reference to one single delivery documnet.
    When you are combining the sales documents in to one invoice system is confusing , which reference purchase order number it should take in order to pass the information to FI.
    So it is splitting the invoice.
    Please revert if you have any further clarifications
    Thanks&Regards
    Raghu.k

  • Inbound IDoc for Sales Order Creation with Serial Number

    I would like to create Sales Order with Serial Number input at Item Level using IDoc. I have tried to use the followings:
    1) Basic Type : ORDERS05
    2) Message Type : ORDERS
    3) Process Code : ORDE
    I have used segment E1EDP19 with the followings:
    1) QUALF = '014'
    2) IDTNR = Serial Number
    However, it fails. It seems that the system just expects us to input BOM explosion number (VBAP-SERNR) instead of the Serial Number that I want.
    If we use VA01, we can input the Serial Number from Menu: Extra --> Technical Objects.
    Is there any idea what should I do ?

    The error message is "Entry 1276 does not exist in SNUM - check your entry" (Message no. 00058).
    1276 is the Serial Number that I input. It treats the Serial Number that I input as the BOM explosion number (VBAP-SERNR).
    Regards,
    Alan.

  • Sales Order Incompletion log - Serial Number profile is missing for materia

    The sales order is incomplete with missing data = No. serial numbers
    System gives an information saying "Serial number profile is missing for material".
    Message no. V1192
    I maintained a serial no. profile for the material in "Work scheduling" view.  But still the document is incomplete.
    Please let me know how to make this document complete.
    Thanks,
    Shankar

    Hi,
    Goto the Sales document in VA02  ->Edit-> incompletion log.
    It will show the data which should be filled, select that and click on the COMPLETE DATA tab and it will lead to the field in which the data should be entered.
    Please do like that and save it
    then once again check the EIT-->INCOMPLETION LOG
    if the document is complete save it
    rgards,
    santosh

  • Sales Order/Delivery for particular customer From his Reserve stock?

    Dear Couleague,
    There is one scenario that faulty material from customer Co. get back by
    Return Order (RE), Then return Delivery --& post goods receipt, Of the sold material,
    Now co. (PP/QM) do rework Process (assemble, dismantle ...... whatever on the basis of return order) & make perfect material ok
    Now this stock PP/QM people put under RESERVE STOCK because it belongs to that particular customer
    Now I want to deliver that stock to that Particular customer,
    1) HOW CAN I DO?
    2) HOW CAN I PICK UP THAT ReserveMaterial while doing Sales Order/ delivery?
    Even though I maintain copy control from RE to OR & AvailabilityCheck?                                                                               
    Thanks
    Suresh

    Hi Suresh,
    As and when you get a return order for repair, then you do the PGR and place that stock into a different storage location and you get that repaired and when you are doing PGI then fetch the stock from the same storage where you have placed the stock when you did the PGR.
    If you are having serial number concept that will help you to give the same piece which you have collected from the customer to return the same piece.
    We have implemented the system in the same way in our previous implementation.
    Thanks,
    Mahesh.

Maybe you are looking for

  • Iphone  won't play purchased music

    Songs ripped from cds play fine, even songs purchased from the iphone play fine. But songs purchased on my mac now won't play on the iphone. I have been away from home for a couple of weeks, so no sync recently. The music stops, the pause button chan

  • Can I mix memory modules?

    I have some memory modules left over from various upgrades and I would like to use them to upgrade my daughter's iMac which is a 2.0 GHz machine using 667 MHz DDR2 SDRAM PC2-5300. I have 1 Gb of that memory from wife's iMac which is the same model bu

  • Email interface bug

    Hi everyone, Ive got an iphone 3gs running the latest iphone software 3.x.x. and I had a first generation Iphone. When I first got my 3GS in September I noticed an email bug. if you are reading an email horizontally, and flip the phone to vertical an

  • How to print an attachment of an e-mail double sided?

    HP Photosmart 6510. When I print a document from my computer, it will be printed double sided. However, when I send the same document by e-mail to my printer, it will be printed only single sided. How to solve this problem?

  • Dynamic Charting question - On maximum rows and omiy label interval values

    Hi, I was wondering if it was possible to define a application variable and then reference it from within a Chart series definition. I frequenctly need to go in and exapnd the maximum number of rows for my chart series definitions to a value greater