Restricting Duplication in Item Code Field

Dear Experts,
           I am designing an FMS on sale order Item Code Field. When it will executed on first line it will show all the sale items but as it will be executed on 2nd line it will show sale items excluding the item which has been entered at first line and same scenario will occur at 3rd line means it shows Sale Items excluding Items entered on line 1 & 2 and same for other lines. So the user will not be able to enter a single item twice not even by mistake.
Please tell me what would be the FMS query for this.

Hi Muhammad,
Executing a stored procedure will not solve your problem.
Stored procedure can only evaluate when your records is written in table.
In your case, when user enter an item code, it is not yet committed to database.
Thus your stored procedure will never know what items have been entered.
Your current requirement cannot be addressed by FMS.
You have 2 choices.
1. If you insists on validating live as when the user enter the items, you need an UI API addon.
2. If you can live with validating when the user click the add/update the document, you can use Transaction Notification.
Regards
Edy

Similar Messages

  • Item Code Field size

    Hi!
    Is there a way to increase the Item Code field size? I believe it is 20 characters. Can it be increased to a higher size, say, 35 characters?
    Prajwal

    Hi Prajwal Kashyap,
    The length of item code is designed in background as 20 characters and cannot be changed from front end, even with add-on/SDK.
    If it is really necessary for your customer to change the definition, please kindly refer to Note 1028874 regarding missing functionality for datails and log a message providing Business Impact.
    Regards,
    Varun
    SAP Business One Forum Team

  • Move to next field after typing item code in a document

    Hello experts,
    In a marketing document we type 1000 in item code field and press tab.
    we would like the cursor to move to next field but instead a list of items is being opened.
    in the list there are two items 1000 and 10001
    in another company we can do it but we couldnt find what is the difference between the two companies setup definitions.
    Thank you,
    Rinat

    Hi,
    Please make sure item number fully entered at item code. If not complete, then list of items window will open.
    If possible please post screen shot above window
    Thanks & Regards,
    Nagarajan

  • Item Codes-Automatic(urgent)

    Hi All,
    I want to define Item Code as Default i.e In SAP How we are getting the Default numbering for eg.1,2,3,4.........I want in the same way for the Item Code.IS IT POSSIBLE through Query based FMS or any other way??
    Thanks in Advance.
    mona

    Dear Mona,
    In order to resolve the issue, please do the following steps :-
    1. Create a Initial Item code I0000 manually in the application.
    2. Save the following query :-
    Select max(Itemtype)
    + cast(substring( max(Itemcode), 2, len(max(Itemcode)))
    + 1 as nvarchar(10)) from OITM                                              
    Where Itemtype = $[OITM.Itemtype]
    3. Create a formatted search based on the above query and assign it to the itemcode field. (Open Item master in add mode )
    4. Then select refresh the formatted search regularly with the Item description change.
    5. Then Go to item master data in add mode put something in item code field and then type the correct item description and click tab.
        Now your Itemcode field will display as "I0001".
    Regards,
    Rakesh Pati
    SAP Business One Forum Team

  • Item Code Auto generation in item master UDF field

    Dear Expert,
    I want to Generate automatic item code in the item master U_STY UDF field . the number start with 'SL' prefix 
    like this  'SL000001' and continue when i generate next item master.
    for example 'SL000001' for X item . when add next item Y  then item nuber will be 'SL000002'.  kindly help me.
    thanks.
    sridharan
    Edited by: Sridharan.R on Oct 28, 2011 10:02 AM

    Hi!
    Try this
    declare @temp as char(15)
    IF (Select max(Itemcode) from OITM ) IS Null
    BEGIN
    set @temp = 'SL000001'
    select cast(@temp as char(15))
    END
    set @temp=(select max(right(ItemCode,6)) + 1 from OITM )
    set @temp='SL'+isnull(replicate(0,6-len(@temp)),'')+@temp
    select cast(@temp as char(15))
    END
    Regards,
    [Thanga Raj K|Q3 Wrap-Up: What happened in the third quarter of 2009 in the SAP Business One Community]

  • In order level no duplication of material code

    Hai Guru's
    Client requirement: In order level he is entering minimum 100 line items per order.Any duplication of material code came in same order on that time system has to taken to  that line iteam and changed the quantity .
    01    x      100 quantity
    02     y       50   quantity
    03     z       80  quantity
    when ever the  X  material come next time in same order i dont want one more line item. If I enter X material code in same order automatically  01 line item has to come .here i will change the quantity as a 150
    01    x      150  quantity.
    why because  its very difficult to find X material in 100 line items.Client strictly telling he dont want second line item as same material X.
    This is Standard SAP not possible if anybody face this type of situation before give me the solution how to face it . If any Development requires please tell me the logic.
    Thank u
    Regards
    Sree Sree

    Dear Sree
    My suggestion is specific to your comments
    when ever the X material come next time in same order i dont want one more line item.
    If I enter X material code in same order automatically 01 line item has to come .
    here i will change the quantity as a 150"
      whereby, if you follow the first suggestion, definitely it will work.  The end user has just to input the material code and execute.  System will automatically go to first line item of that material code.
    For example, you have maintained a material ABC in line items 50, 70 & 100 and in VA02, if you follow the suggestion what I have proposed, system will by default, go to line item 50 only, where you can make changes as per your requirement.
    On the second suggestion, as you said a sale order contains some 100 line items in which the material ABC is flowing in line item 20, 60 & 90.  What the end user have to do as a one time job is that based on material code, they have to sort the data in excel format so that in the excel sheet, you can see for material code with preceding tabs line items 20, 60 & 90 continuously. 
    Your job is to develop a BDC with just three fields of course, the input data has to be sale order reference.  The format can be
    Line Item:::::Item Code::::::Quantity
    If the end user would like to change the quantity of ABC for line item 60 instead of 20, in the BDC template, they have to maintain the line item as 60, material code ABC and quantity xxx.
    Why dont you make a try with the option cited first ?? 
    thanks
    G. Lakshmipathi

  • Tax Code field in Cash journal

    Dear All,
    Can Tax Code field be activated in Cash Journal . If yes how? Useful answers will be rewarded with points.
    Regards
    Milind Nair

    Hi
    Goto FBCJ, it will have two segments, one is the header data and other is the line item data.
    In the Line item segment where you enter the line item details, go to the right hand side corner of the Table. You will see a small icon with colours. This icon is present at the Top right hand corner of the line item entry table in FBCJ.
    Click on this ICON, this is the administrator icon. Then click on administrator, then you can see list of field names, there will be a check box called invisible. For the fields TAx code and juristiction it will be marked as invisibel. remove this tick and activate and save the parameter.
    Afterwards you will get the required fields in FBCJ.
    If you have problem when you click on the icon, then it is a authorisation problem so contact your Basis resourse for necessary action then do the changes as required.
    Cheers
    V.Krishnan
    (Assign Points if Useful)

  • WebPart is raising the following error "Invalid data has been used to update the list item.The field you are trying to update may be read only"

    I have created a farm solution and then i deploy it to SharePoint server, the code looks as follow, and i use it to update a page info values (as the current page values represents old info):-
    [ToolboxItemAttribute(false)]
    public partial class VisualWebPart1 : WebPart
    // Uncomment the following SecurityPermission attribute only when doing Performance Profiling using
    // the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
    // for production. Because the SecurityPermission attribute bypasses the security check for callers of
    // your constructor, it's not recommended for production purposes.
    // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
    public VisualWebPart1()
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    InitializeControl();
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["Pages"];
    web.AllowUnsafeUpdates = true;
    foreach (SPListItem items in list.Items)
    items["Author"] = "SharePoint";
    items["Created"] = "01/08/2014 01:44 PM";
    items.Update();
    list.Update();
    web.AllowUnsafeUpdates = false;
    protected void Page_Load(object sender, EventArgs e)
    but when i try adding this web part to a page i got the following error:-
    Invalid data has been used to update the list item.The field you are trying to update may be read only
    so can anyone advice?

    i only changed lines bitween 
    web.AllowUnsafeUpdates = true;
    and
    web.AllowUnsafeUpdates = false;
    and other parts of code remains without change
    so it will updates all pages in current web
    yaşamak bir eylemdir

  • Make Item level field Non-Editable in VA01

    Dear Experts,
            I have a requirment to make ITEM Category field in item level of VA01
            make Non-editable based on the value of Sale order Type in the main screen
      i am using Program MV45AFZZ to make necessary changes i am able change any thing on the header level but i am not geting the control of item level Please suggest me how to change or make fields non-editable in Item level.

    Hi,
    Try writing code in FORM userexit_field_modification.
    *** Lock field pricing date in SO if delivery occured
      IF   screen-name = 'VBAP-PSTYV'  AND
           sy-tcode NE 'VA01' AND l VBAK-AUART EQ 'your document type'.
          screen-input = 0.
      ENDIF.
    ENDFORM.                    "USEREXIT_FIELD_MODIFICATION
    KR Jaideep,

  • How to restrict AS02 access to certain fields only

    How to restrict AS02 (Asset Master Record) access to certain fields only. Currently when you assigned AS02 to a certain user, this will enable the user to change all the fields in the asset master record. Suppose i want only the user to restrict the access to certain field eg.NDJAR (Life in Yrs).
    Thanks for your inputs.
    Regards,
    Robert

    hello,
    basis has to assign the proper activity with object A_S_ANLKL. in this case they have to allow activity 03 only with combination of Cocode,asset class. see some more details below.
    This authorization object is the first part of the object "asset master record."
    The definition at this level determines whether the user is authorized to process data in a given company code. The activity type for the transaction is also defined here. This authorization object is used for master data transactions, for the display of value fields, and for reporting.
    Defined Fields
    The following fields are assigned to the authorization object
    Asset class (specified by entering a value in the pop-up window)
    Company code (specified by entering a value in the pop-up window)
    Activity type - there are three different activity types:
    01 = Create
    02 = Change (including blocking and deleting)
    03 = Display

  • HOW TO RESTRICT DUPLICATION OF ITEMCODE IN PURCHASE ORDER

    Hi to all,
    In PO, we can select same item for a single document.
    Is there any work around solution to restrict the duplication of item in PO.
    Thanks in Advance,
    Sagar

    hi Istvan Koros,
    Thanks for ur reply.
    Can u explain me what is "23" (line 6).
    line 1 IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'22')
    line 2 BEGIN
    line 3 declare  @line int
    line 4 set @line=-1
    line 5 set @line=(SELECT T0.LineNum+1 FROM POR1 T0
    line 6  WHERE T0.DocEntry =23
    line 7   and exists(select linenum from por1
    line 8            where docentry=T0.DocEntry and itemcode=T0.Itemcode
    line 9                and linenum<T0.LineNum) )
    line 10 If @line<>-1
    line 11 begin
    line 12 SET @error = 10
    line 13 SET @error_message = N'Duplicate item: line '+
    line 14  CONVERT(nvarchar(4),@line) + '!'
    line 15 end
    line 16 END
    Which parameter i should pass it the SP.
    SAGAR

  • Fill BSEG-LIFNR and LFA1-NAME1 in line item text field of Bank GL line item

    Hi all,
    I need to develop a program to populate the Vendor Number (BSEG-LIFNR) and Vendor Name (LFA1-NAME1) in the line item text field of Bank GL line item.
    The UI design will have the input data as:
       - Company Code
       - Posting Dates (both from and to date)
       - Execute Icon
    Please let me know how to proceed on this.
    Thanks and regards,
    Anishur

    program a bdc to tcode fb09
    A.

  • Contract item customer fields not getting saved from ITS side??

    Hi there,
    I have had to add "account assignment" details to a contract item (3 fields: account assignment, G/L account and cost center)...
    All is going fine....in fact the 3 fields have been added on the contract item level in function group BBP_CTR_UI_ITS screen 4100. I followed the instructions in SAP note number 458591 "user defined fields: preparation and use"...
    The 3 fields I added where "generated" down to SAP table level and now appear in table BBP_PDIGP...
    Also when I create a contract from transaction BBP_CTR_MAIN and fill my 3 new fields in on the item level all works fine when I release the contract...the contract item gets created and the 3 new fields appear nicely in table BBP_PDIGP....so from the GUI side all is PERFECT...
    I have worked on the ITS side of things quite a bit but now I clearly don't understand something...
    I go to "internet service" BBP_CTR_MAIN - template SAPLBBP_CTR_UI_ITS 4100.....I have added my code and my 3 fields display perfectly on the web page....for each contract item.....
    As I said I can make the contract with the 3 new fields filled perfectly via the GUI (transaction BBP_CTR_MAIN)....and if I VIEW that contract on the web it also displays perfect with the 3 filled in fields....
    If I COPY that contract.....and save the new one, the 3 fields are still fine, all saved.
    NOW COMES THE PROBLEM:-)
    If I create a new contract from the web, fill in my 3 fields on the contract item level THE 3 FIELD VALUES SEEM TO NOT GET POSTED BACK AND SAVED IN THE SRM DATABASE...
    I have tried everything from using FIELD-GET, FIELD-SET...the note I mentioned above mentions some BADI's that I could possibly use:
    BBP_CUF_BADI_2 (modify screen methods etc)
    BBP_DOC_SAVE_BADI
    All I really want to try understand is how interaction between the user clicking on the web page and the SAP GUI screen flow is really happening.....I mean I see in function group BBP_CTR_UI_ITS there are a number of function modules with ITS in them, are those function modules just called when the user is clicking on the web (via ITS etc) - I would assume so...
    Bottomline is I need what is happening in the SAP GUI to happen on the web as well.....it is almost there, I just need a push in the right direction so that I can grab the fields from the web page, in the most standard way possible.
    Thanks for the help, I am very curious to see how this sort of solved.
    Regards
    Lynton

    He Yann,
    We are running SRM 3.0, EBP 4.0 - support pack 8
    Thanks for the help
    Lynton

  • SBO 2007 PLD AR invoice item code not printing

    Hi,
    We have a problem which just started yesterday on an installation that has been running fine for a long time.   The PLD format for the AR Invoice usually prints the row ItemCode no problem.  Since yesterday it started printing the item's manufactirers number instead.   If we changed the default layout to the SAP supplied layout the problem was the same.   Went in to the customised PLD and amended it to one field and then back to the ItemCode now it does not print anything in that field, and nor do the system provided PLDs either, although they have/can not be amended.
    Any ideas?
    Thanks
    Simon

    Hi Thanks for the replies,
    The system is on SP00 PL49.    There are no add-ons, and certainly no add-on have been removed or added recently.  The AR invoice PLD has been in use for at least six months without modification.   The field for item code in the PLD looks fine, if I amend it to show, say, the INV1 warehouse code instead, it works fine.  If I switch it back to Itemcode it print nothing.   If I check the table it looks fine also.  It is very strange that the same symptom is experienced in the customer modified PLD and system default PLDs
    Any ideas?
    Simon

  • SAPscript - output of delivery item text field

    Hello,
    I would like to show an item text field of a delivery (VL02n) on one of the output script forms.
    I've used the function read_text in my print program for the output type:
    DATA: BEGIN OF TEXT_CARTONQUAN OCCURS 20.    
          INCLUDE STRUCTURE TLINE.
    DATA: END OF TEXT_CARTONQUAN.
    CALL FUNCTION 'READ_TEXT'
                 EXPORTING
                   ID        = 'Z005'
                   LANGUAGE  = SY-LANGU
                   NAME      = VBDPL-TDNAME
                   OBJECT    = 'VBBP'
                IMPORTING
                   HEADER    = THEAD
                TABLES
                   LINES     = TEXT_CARTONQUAN
                EXCEPTIONS
                   NOT_FOUND = 1.
            READ TABLE TEXT_CARTONQUAN INDEX 1.
            MOVE TEXT_CARTONQUAN-TDLINE TO VBDPL-USR01_VBLB.
    Now I put this code into my sapscript:
    IL    &VBDPL-USR01_VBLB&
    For some reasons, it does not come up on the form, but I know it should have a value.
    Am I missing something?
    Thanks,
    Anne
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 7, 2009 11:25 AM

    Hello,
    thanks for the answers!
    @Ramiro Escamilla  
    I've tried that already, but for some reasons, the break point doesn't work, it is not stopping during the print out. I've tested if it is using that print program and uncommented the entry subroutine and I got an error message then, so it's the correct print program. Any suggestions why break point is not working?
    @Pawan Kesari  
    I did that and this is working. But the problem is, I need this value within an IF statement, because I only want to give this and some text out, if  INCLUDE &VBDPL-TDNAME& OBJECT 'VBBP' ID 'Z005' has a value. Unfortunately I cannot use the Include statement within an IF statement.
    Thanks
    Anne

Maybe you are looking for