Suda! Again to restriction of items from PO based on SO

Hi Suda!
Let me remind u abt the thread "Restriction for items from Purchase Order based on Sale Order" ( Restriction for items from Purchase Order based on Sale Order ), after tht
I have Tried in bringing out the stored procedure for Serial Number block too similarly from Batch Block stored procedure. as the client has many serial numbered item, i did so. it is working well Suda. But the problem is i cud'nt bring the SONO in the error message. Here is the procedure.
IF @Object_type = '15' AND @transaction_type = 'A'
BEGIN
If NOT Exists (SELECT DISTINCT T0.IntrSerial AS 'GR PO Serial', T10.ItemCode AS 'GRPO ItemNo.',
T10.BaseEntry AS 'GRPO DocEntry', T3.BaseEntry AS 'Delivery DocEntry'
FROM  [dbo].[OSRI] T0
INNER JOIN [dbo].[SRI1] T10 ON T0.SysSerial = T10.SysSerial AND T0.ItemCode = T10.ItemCode
INNER JOIN [dbo].[PDN1] T1 ON T1.DocEntry = T0.BaseEntry
INNER JOIN [dbo].[POR1] T2  ON T2.DocEntry = T1.BaseEntry
INNER JOIN  [dbo].[SRI1] T3 ON T3.SysSerial = T10.SysSerial
INNER JOIN  [dbo].[DLN1] T4 ON T4.DocEntry = T3.BaseEntry
Where T2.BaseEntry != -1 AND T2.BaseEntry = T4.BaseEntry AND T4.DocEntry = @list_of_cols_val_tab_del)
BEGIN
DECLARE @SONO1 VARCHAR(10) SELECT DISTINCT @SONO1 = T3.DocEntry FROM  [dbo].[OSRI] T0
INNER JOIN [dbo].[SRI1] T10 ON T0.SysSerial = T10.SysSerial and T0.ItemCode = T10.ItemCode
INNER JOIN [dbo].[PDN1] T1 ON T1.DocEntry = T10.BaseEntry
INNER JOIN [dbo].[POR1] T2  ON T2.DocEntry = T1.BaseEntry
INNER JOIN [dbo].[ORDR] T3 ON T3.DocEntry = T2.BaseEntry
WHERE T0.IntrSerial = (SELECT T4.IntrSerial FROM OSRI T4 INNER JOIN SRI1 T5 ON T4.SysSerial = T5.SysSerial and
T4.ItemCode = T5.ItemCode where T5.BaseType = 15 AND T4.BaseEntry = @list_of_cols_val_tab_del AND
T5.ItemCode = T0.ItemCode)
SELECT @Error = 1, @error_message = 'This SERIAL no. linked with another Sales Order ' + @SONO1
END
END
I think some where i am going wrong in this above high lightened Procedure. Kindly help me to bring the Value of @SONO1.
i tried a lot to bring tht but failed to bring tht SONO num alone. The error msg is thrown as 'ADOC' alone.
thanking you in advance,
Meera.

You had everything correct but instead of T5.BaseEntry you had it as T4.BaseEntry.  Please change it to T5.BaseEntry as shown below and it should work.
where T5.BaseType = 15 AND <Font Color="Brown" > T5.BaseEntry </Font> = @list_of_cols_val_tab_del
It had nothing to do with DataType.
Suda

Similar Messages

  • Restriction for items from Purchase Order based on Sale Order

    Hi !
           We create PO directly from Sale Order ( by ticking Option under Logistic tab, 'Purchase Order') for customer C01 (for eg).
    From the PO created, we post GRPO.
    Now our need is,
    Assume if 10 Qty is been ordered in such a way and been received (GRPO posted). it 'll add on to the stock account i.e will increase stock qty at our whse.
    is it possible to restrict these 10 qty of item from being sold to any other Customer other than whom hav ordered i.e if we create sale order for C02 the SBO should not take the items received from PO created based on Sales Order created for C01?
    Meera.

    Meera,
    Which version of SBO are you using 2005 or 2007?
    I don't think Serial numbers can help in this scenario.  There is no hard allocation or blocking possible using Serial numbers.
    This is the Work around I am thinking about.
    Set the items to be Batch Managed - On Every Transaction
    When performing Goods Receipt, enter the Sales Order Number as the Batch Number
    When creating the delivery, using SBO_SP_TransactionNotification we can easily check the Batch of the Item being selected and verify it with the BaseRef of Delivery lines to match with Sales Order number.
    If the numbers don't match we can warn user with message, "The items batch reserved for Sales Order xyz"
    Even if you make a mistake when entering the batch number same as Sales Order number when doing a goods receipt. It can still be traced and blocked during delivery.
    Hint: The Batch table records the Goods Receipt transaction along with the BaseDocument number, Base Ref, etc
    If you decide to go this route, I could help you further.
    Let me know
    Suda

  • Can we restrict muliple PO from PR based on quantity

    Hi
    Can we restrict multiple PO based on PR . Suppose we have a PR having quantity 5. Currently we are able to create multiple PO such that the quantity specified in PR which is 5 is exceeding while creating PO. Is this the standard SAP functionality ?.
    If yes, then if we want to restrict it how can it be done.
    Regards,
    Ashish

    You want to restrict PO creation with more than PR Quantity and want to set error message follow path :
    SPRO->Materials Management->Purchasing->Environment Data>Define Attributes of System Messages>system message
    06 076
    Set the message no : 06 076 as Error messages.
    Now, when all the PR quantity already converts to PO, system will not allow to create a another PO from that PR.

  • How to restrict infotype data from SE16 based on country?

    Hello.
    We're a global company and the US organization wants to view infotype data from the PA tables.  At the same time, we are not allowed to view data from other countries from these PA tables.  Is there a way to restrict the output in SE16 by country code?  If not, are there any options we can implement so that we can view the US data from these PA tables?
    Thank you.
    Ashish.

    But SE16 doesn't seem to be doing checks on Personnel Area and Subarea.  Isn't that applied to user roles so that ABAP programs only extract relevant data for that user?  The only authority checks I found for SE16 in the code are:
      authority-check object 'S_TABU_DIS'
               id 'DICBERCLS' field tddat-cclass
        authority-check object 'S_TABU_CLI'
                        id 'CLIIDMAINT' field 'X'.
    So I am not clear how SE16 is restricted by Personnel Area and Subarea.
    Thanks,
    Ashish.

  • Automatic deletion of Items from Customs Declaration

    Hello Experts,
    I will be thankful to anyone could help me with this one : We need to automatically delete line items from declaration based on certain criteria before the first outbound message is sent. For example : The process should be : 4 items in invoice, but only 2 in the declaration (duty unpaid goods). It cannot filter the data in the Feeder system. I was hoping data proposal BADI could be the solution however It does not seem to work...
    Your comments are appreciated,
    Branislav Petricek

    Dear Branko,
    if you want to delete the items before creating the idoc while processing the message, you can use the Badi /SAPSLL/CUS_ECC. There you can modify the data that are sent to customs.
    The items will still be physically available in the document itself but only the ones you do not filter will be sent.
    best regards,
    Christin

  • How to restrict the user from making any changes in Sales order- item level

    Hi to all
    How to restrict the users from making any changes in sales order at item level if the same sales order is released by senior user through status profile.
    Regards
    Anish Parikh
    Edited by: anish parikh on Jan 24, 2008 5:16 AM

    Hi Anish,
    This can be achieved through the roles and authorization.
    This can be done through the basis team. they can create user profiles and roles.
    For the roles they assign some transaction codes so that they can view the only assigned tr. codes.
    Like that ur requirement can be done.
    Also u can prevent the user to change any fields in the sales order screen (VA02). for that please modify the authorisations.
    Hope i answers.
    Reward points if useful.
    Edited by: kaleeswaran bhoopathy on Jan 24, 2008 9:57 AM

  • When using Time Machine, if I delete items from my computer, will they still be backed up to access later on my external hard drive? In other words, when time machine backs up again, will it delete the files from the back up?

    When using Time Machine, if I delete items from my computer, will they still be backed up to access later on my external hard drive? 
    In other words, when time machine backs up again, will it delete the files from the back up that I have deleted from my computer?

    No, I do not believe so. Time Machine would keep all those now-deleted files in previous backups, and as time goes by those backups might be deleted if you needed room, but it would still keep one backup from each day in last month, as well as one from each week forever, as long as you don't start running out of room, then just the oldest would be deleted to make room if needed.
    I use a backup drive about double the size of my drive to be backed up, so I would guess it will never get to the point where deleted files being replaced by new ones being backed fill up that drive to the point where backups actually have to get deleted.

  • Can you eliminate an item from a drop down menu after it is selected once so it isn't selected again

    Can you eliminate an item from a drop down menu after it is selected once so it can't be selected again be someone else?

    I am sorry but Formscentral doesn't support any type of dynamic form content updating.
    Andrew

  • Unrestricted sharing of free* items from iTunes Store

    We are trying to find a legal but convenient way of managing our family iTunes purchases and sharing.
    We are just beginning to use iTunes on a couple of new Macs, three iPads or iPod Touch devices and two old PC's.
    We have a home Wi-Fi network with a network drive, where we can store items to be shared.
    The children in a few years will move out and will take their music, e-books, etc. with them.
    Our Internet connection is slow we would like to avoid downloading the same free item from the iTunes Store to libraries associated with different Apple ID's.
    We want everybody to eventually have his/her own copy of our home videos and voice memos recorded on portable devices, which can be further shared without any restrictions.
    I understand that some of the rules that Apple set for iTunes users are as follows.
    1. Every item purchased from iTunes Store is marked with the ownership information i.e. information about of the account it was purchased from. (The account is identified at any given time by a unique Apple ID.)
    2. The ownership information on an item can not be changed, i.e. I cannot give an item to somebody else, declining to use it any more, and transferring the item to that person's iTunes library associated with that person's iTunes account.
    Question 1: Are the statements 1 and 2 above correct and precise?
    Question 2: Does the same apply to free items (iTunes U, e-books, iPod/iPad apps) from the iTunes store? (it is painful to download the same free item to different accounts over a slow Internet connection.)
    Question 3. Does the same apply to music imported into iTunes from a CD?
    Question 4: Is it true that in order to allow the kids to take their items with them when they move out, one has to make sure that the items
    have been purchased from iTunes accounts associated with their own Apple ID's and placed in their separate iTunes libraries?
    Question 5: If I add our home videos and voice memos to my iTunes Library associated with my iTunes account, and do not retain other copies, will it be possible to copy such items to libraries associated with other Apple ID's without any restrictions? Will it be possible to extract such items from iTunes?
    Question 6: As long as we are using the same Wi-Fi, can we share music, video,  ebooks from libraries associated with different Apple ID's? I believe so, but please confirm. What are the restrictions? Is it helpful to place an iTunes library on a network drive?
    Question 7: I believe the same iTunes library can contain items purchased through different iTunes accounts; also there can be multiple iTunes libraries associated with the same iTunes account. Are such options useful and would they help in managing family purchases and sharing?
    Question 8. I noticed that a portable device can sync (download) items from only one library. Different persons have apps and music from different libraries associated with their own Apple ID's. We would like them to have also on their portable devices the same free e-books and home videos or voice memos. Do we have to copy such free e-books and voice memos to all the different libraries?
    These must be questions many familes ask, but I could not find a precise and comprehensive answer despite browsing the web for several days.
    Could you please help?

    No. It said nothing about authorizing a computer. I only have one I-Pod and one computer with my library on it. I have listened to these 4 songs for over one year on my p/c and I-Pod. This is a new one to me. These 4 songs still show up in my "purchased" section of my I-tunes but I cannot play them and they will not
    copy to my I-Pod. I see where I can repurchase these songs at the I-tunes store, but don't want to pay for them twice. What do you think is going on? Thanks.

  • My hard drive went bad and I lost a lot of purchased items from the iTunes store. I want to re-download them but can not. They still show up on my purchased items. How do I solve this?

    My hard drive went bad and I lost a lot of purchased items from the iTunes store. I want to re-download them but can not. They still show up on my purchased items. How do I solve this?

    Update to iTunes 10.3.1
    After you have finished, you can re download your iTunes purchases without having to re purchase.
    iTunes 10.3.1
    " Download Previous Purchases. Download your past music purchases again at no additional cost. Your purchases are available in the iTunes Store on your Mac or in the iTunes app on your iPhone, iPad, or iPod touch. Previous purchases may be unavailable if they are no longer on the iTunes Store."
    "Available on iTunes in the U.S. and Canada only. Title availability is subject to change."
    From here.  http://www.apple.com/itunes/

  • How to get all checked items from TreeView in VC++ mfc

    void CPDlg::OnTreeClk(NMHDR *pNMHDR, LRESULT *pResult)
    NMTREEVIEW& nm = *(LPNMTREEVIEW)pNMHDR;
    // which item was selected?
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    temp = m_columnTree.GetItemText(hItem, 0);
    MessageBox(temp);
    if (!hItem) return;
    // the rest of processing code..
    I'm new in VC++ .
    this code gives only current selected item . but i need to get all checked items from treeView.
    kindly help me..

    no not unchecked .. the all check box's gone from tree view. which means Treeview without check box.
    finally i tried SetCheck 
    void CPracticesDlg::OnSelchangedTreectrl(NMHDR* pNMHDR, LRESULT* pResult)
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    // TODO: Add your control notification handler code here
    tree_state = 1;//changed
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    BOOL chk = m_columnTree.GetTreeCtrl().GetCheck(hItem);
    if (chk == TRUE)
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Check all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 1);
    hChildItem = hNextItem;
    else
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Uncheck all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 0);
    hChildItem = hNextItem;
    code works good . but here is i think small problem . i cant find it.
    when i click the root node it goes to checked state but not child node. again i click same root node it goes to unchecked state but all child's are goes to checked state.
    help me. here what is the problem?

  • Unable to delete items from recycle bin

    Unable to delete items from my trash, it starts to delete then stops along the way, when i open the trash, its still sat there.

    Relaunch the Finder, then from the Finder menu bar, select
    Finder ▹ Preferences ▹ Advanced
    and uncheck the box marked Empty Trash securely. Hold down the option key and try again to empty the Trash.

  • Restrict excise invoice from proforma invoice after reverse PGI

    Hello experts,
    Our sales flow is stock transfer order-> Fast Delivery-> PGI -> Billing (jex)--> excise invoice
    If we have to reverse the PGI first .System give error (cancel excise invoice first)after cancel excise invoice reverse pgi then cancel proforma invoice (complete).
    But once Again excise invoice  allows me create from cancel billing document.
    My requirement is I want to  restrict excise invoice from billing document which already cancel and reverse post good issue.
    Thanks

    HI G. Lakshmipathi,
    I have checked configuration it same as you suggested.
    I have compared  ABAP code in report MJ1IINI01 with other system ,
    there is code to check the cancellation of proforma invoice
    *Check if proforma is cancelled (Billing type is JEX & VBRK-VBTYP = 'U')
    *For proforma,VBRK-FKSTO is not set as X,but VBRK-RFBSK will be set as E
    IF WA_VBRK-VBTYP = 'U' and WA_VBRK-RFBSK = 'E'.
         MESSAGE e264(8i) WITH j1ii100-vbeln.
       ENDIF.
    But in my system its not shown .
    So how can i activate this message is there any setting in IMG to activate message .

  • Can't remove items from the selectMenu

    I am using selectMenu as:
    <a4j:region selfRendered="true"  id="text">
                <h:selectOneListbox id="symbol" value="#{user.name}">
                  <f:selectItems value="#{user.temp_list}" />
              </h:selectOneListbox>
    <a4j:commandButton action="#{user.getData}" reRender="symbol" value="Get"/>
    </a4j:region>temp_list has following three values when page loads:
    temp_list.add(new SelectItem("Sunday"));
    temp_list.add(new SelectItem("Monday"));
    temp_list.add(new SelectItem("Tuesday"));Now in user.getData i want to remove items one by one based on the selection made by the user. The code is:
    temp_list.remove(0);
    this.setTemp_list(temp_list);But the problem is that if user selects Sunday for example, it remove it from the list but next time when user select Monday it removes monday but BRING BACK SUNDAY AGAIN IN THE LIST. Why is it so?

    BalusC wrote:
    I don´t understand you.Actually i was asking about the code which i mentioned in my last post.
    Okay then what could be the solution? What my thinking is that calling list.remove actually removes the item from the list permenantly, isn't it? If so then why does it showing me again in the selectMenu?

  • How can i remove the menu item from a menu

    how can i remove the JMenuItem from a JMenu at run time.
    thanks in advance

    This is in JMenu from the api
    void remove(JMenuItem item)
    Removes the specified menu item from this menu.
    You must download the api! it helps a lot!
    You can do that or if you need to access it again just set it visible(false);

Maybe you are looking for

  • Inspire T3000 - Speaker Wire Broke

    Ok, you can laugh all you want, but I doubt this is the first time something like this has happened. I bought my Inspire T3000's on 2/7 and I'm very pleased with them. However, my cat chewed through one of the speaker wires and I'm interested in purc

  • Digital Input VI boolean indicator

    I am using the Example VI Digital Input as part of Fieldpoint. It works fine on its own. That is, I can place a voltage across the terminals of the DI module and the respective Boolean LED lights up on the front panel. I'd like to use the VI as a sub

  • Is Compressor For Me?

    I am creating a slideshow in Keynote at 1080 x 1920p and exporting it to a QuickTime movie file. I want to be able to put it on a SD memory card, insert that in an HDTV and play the movie. As far as I can tell, the HDTV supports MPEG2 and AVCHD video

  • How do I restore backed up info

    My husband bought a brand new iphone.  I mistakenly backed up my phone info to his new phone when i was setting it up and now he has all my texts and contacts and his phone shows up under my name on call display.  He has used the phone for about  wee

  • BADI or EXIT for MIRO - propose quantities

    I need a BADI or USER EXIT for TX MIRO so that I could propose the quantities for order posotions before saving (on screen after filling the order). Thanks.