How to get the Next Material Document Number

Hi,
Please let me know How to get the next Material Document Number using Functional Module,
Material Document number are  in MSEG table.
Regards,
Ganesh

Hi Ganesh,
if you want the next matrial number then first of all you have to define it as a number range in transaction snro.After creating the number range you have to define the interval.
now you can use your number range by calling the function module
CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        nr_range_nr             = '01' " here you have to give the number range number which you have defined in number range
        object                  = 'ZPRODLOG' " Number Range
      IMPORTING
        number                  = wa_prod_error_log-seqnr " sequence number generated,in your case material number field
      EXCEPTIONS
        interval_not_found      = 1
        number_range_not_intern = 2
        object_not_found        = 3
        quantity_is_0           = 4
        quantity_is_not_1       = 5
        interval_overflow       = 6
        buffer_overflow         = 7
        OTHERS                  = 8.
each and every time next number will get generated .
i hope this will help you.
Thanks,
Tanmaya

Similar Messages

  • How to get the unoccupied material number in a number range

    How to get the unoccupied material number in a number range.for example, I wang to get a number between 1500000 and 1599990 which is unoccupied as my material number to be created. Is ther any FM or codes?

    Dear,
    You can get this information from Tcode SNUM or you can access database table NRIV.

  • How to get  invoice via material document

    HI,
    How to  get  invoice via material document is there any table or any inderect way?
    thanks
    pandu

    Hi Lakshimipathi,
    thanks for your reply.
    i have checked in vbfa but it's not showing anything.
    my client is providing below information and asking that invoice number.
    material,
    plat,
    material doc,
    movement type,
    posting date.
    i have ran the mb59 by giving material , plant , movement type and Archive info struct as Z_MM_MATBE. here i got the material doc and same doc i have checked at table levle but it's showing.
    and how can i get invoice number by using this information..
    please letme know if you have any idea.
    thanks in advance.
    pandu.

  • Get the next new item number of service contract va43

    Hi Experts,
    I have to get the next new item number of the service contract (va43)
    For example: I have the service contract number like 50100929
    For this existed line items like 10,20,30
    in this case The next new item number is 40.
    How we can get this number .
    Could any one suggest me.
    Thnx,
    Jaya.

    Hi Nitish,
    Thnx for Reply,
    Acually I have to create the new item to the existed service contract , for that I am using the FM 'BAPI_CUSTOMERCONTRACT_CHANGE' .
    1 . Except the Item numebrt,  if I pass the remaing data like (material,plant) I will create the new Item in the service contract.
    2 .But for the same new Item if I pass the condition data with out the Item number it is going to short Dump ( In the short dump it showing Item number is missed )
    I should do the above steps ( 1 & 2)  at a time using the FM 'BAPI_CUSTOMERCONTRACT_CHANGE'  other wise performancely its taking the time.
    Thnx,
    Jaya.

  • How to get the list of documents

    Hi everyone
    Can anyone help me How to get the list of documents residing in a folder of KM repository of SAP Netweaver using a simple java program
    Thanks in ADV.
    Rupesh Khemka

    Hi Rupesh,
    I have written the code for you and it works with WebDynpro, no seperate java program is required.
    Just try to paste it in your application code and run it.
    try{
         // Will check the user athentication for EP
                    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
         IUser sapUser = wdClientUser.getSAPUser(); 
         com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
         ResourceContext context = new ResourceContext(ep5User);
                    // The path in which your folder resides
         RID rid1 =RID.getRID("/documents/Public Documents/SCAP/");
         IResourceFactory factory1 = ResourceFactory.getInstance();
         ICollection icollection = (ICollection)factory1.getResource(rid1, context);
         IResourceList resourcelist = icollection.getChildren();
         int size1 = resourcelist.size();
         for(int s=0; s<listOfDocuments.getLength(); s++){
              IResource resource = resourcelist.get(i);
              InputStream input = new InputStream();
              input = resource.getContent().getInputStream();
    }catch(Exception e){
         e.getMessage();
    Once you get the InputStream everything else is possible....
    This will surely help you in reading the documents from KM.
    Regards,
    Rekha Malavathu

  • How to get the next FACTORYDATE

    Hello all,
    Can somebody show me how to get the next (FACTORYDATE) from SAP in the objective to check and validate the shipto date in the ISA b2b application.
    Thanks in advance.

    Hi Manuel,
    my email: [email protected]
    thank you in advance,
    Djamel.

  • TA48312 i have mac os x version 10.4.11 i have no idea how to get the next update because my computer wont do it on its own.

    i have mac os x version 10.4.11 i have no idea how to get the next update because my computer wont do it on its own.

    10.4.11 is as far as you can go with Tiger.  You have to pay for the next update.  It is not available via Software Update.  Depending on which Mac you have, it can be Leopard, Snow Leopard, or Lion.

  • How to get the Next free Number for External Number Range

    Hi ,
    To get next free number for External Number Range, I have used NUMBER_GET_NEXT Function module.
    It is throws the exception like  NUMBER_RANGE_NOT_INTERN.
    How can i get the next free number for external number range object. And How to update the Current Number for External Number Range Object
    Scenario.
    Call Function module              NUMBER_GET_NEXT
    Import Parameter.
    NR_RANGE_NR : 02
    OBJECT            : RV_BELEG
    QUANTITY         : 00000000000000000001
    I am getting Exception : NUMBER_RANGE_NOT_INTERN
    Thanks in advance.
    Regards
    Ram

    Hi Anand,
    The SAP system issues the numbers for internal number range intervals automatically. This number is between the from-number and the to-number. The last number issued is logged in the current number level.
    You need to enter a number for external number issue. The number you enter needs to be between the from-number and the to-number. For external number ranges, the number number used is not logged. So the next available number is not possible in a straight forward way.
    Only for Internal number ranges, the FM NUMBER_GET_NEXT can get the next available number.
    Hope this helps.
    Thanks,
    Balaji

  • How to Get PO from Material Document by MB1B!

    Hi,
    I created a PO for subcontracting. When I send
    the goods to vendor with trx MB1B and mvt type 541, Material Document Number will be generated (option: to Purchase Order) . When print out this Material Document Number by MB90, I want to get this PO number. Please let me know how to get the relation bw this PO and Material Document.(I have checked in MKPF-XBLNR, but it is blank).
    Thanks in advance.

    there's no relation. the process how you have implemented it leaves no relation between PO and GM except for your doing so 'artificially' by filling field XABLN (for example) or any other.
    if you would adjust the process to use deliveries (tx. ME2O) the prospect would not be much better but there would at least be a chance to find the relation.
    as it is, SAP designed this to be a 'transfer posting' - to do it entering a PO-number is only in order to make typing easier but does not mean, items, quantities or anything else has to be entered as it is in the PO. you can add as many line items as you like ... as long as there's available stock you get your movement.

  • How to get the filename of document that opened my app

    Hope that makes sense. I'm relatively new to OS X programming and have built a small Cocoa app (not a document-based app). I've associated a file type (.myFileType) with my application. If I double-click a file with that file type, it opens my app automatically as expected. From within my app, how do I get the full pathname of the document that opened my app?

    I know what you're saying. IB is made to seem easy, but when you start asking "What's this?", and "What does that do when the nib is loaded??", the pretty pictures suddenly aren't as clear as they seemed. Been there!
    The File's Owner never causes the creation of an object. It's always a "proxy" (a stand-in) for an object that's created elsewhere. The actual object may be defined in another xib, or it may be created in code. In MainMenu.xib. the File's Owner is a proxy for the Application object. The Application object isn't created because of that nib, it's created by the startup code before the nib is loaded. But the "proxy" allows you to make connections to the Application object in the xib.
    I know this is clear as mud so far, but it will start to make sense after you grok a few more pieces of the puzzle. A good place to start might be Anatomy of a Nib File in the +Resource Programming Guide+.
    Nib proxies are actually easier to understand when building an iPhone app. In that case, the SDK makes it much easier to associate proxies with the objects they represent. The concept is still the same, but for example, bridging two iPhone xibs with a proxy only takes a couple mouse clicks in IB.
    Hope that helps!
    \- Ray

  • How to get the web of document from the URL

    Hi All,
    Need small help here,
    I have SharePoint doc URL as below:
    http://sharepoint.com/sub1/sub2/sub3/documents/TestFile.docx
    Here, TestFile existed in document library of Subsite i.e. sub3.
    If I give above URL as input, I should be able to get "sub3" web.
    How can achieve this programmatically. Overall we should get the leaf web from the URL.
    Thanks in advance.
    Krishnasandeep

    Hi Sanny521,
    The SPSite constructor does not care when you pass in the document library and filename as part of the url. you can use the following code:
    string myFileUrl = "http://sharepoint.com/sub1/sub2/sub3/documents/TestFile.docx";
    using (SPSite site = new SPSite(myFileUrl))
    using (SPWeb web = site.OpenWeb())
    SPFile file = web.GetFile(myFileUrl);
    string webUrl = web.ServerRelativeUrl;
    You pass the full url into the SPSIte constructor, it will retrieve the site collection, then the OpenWeb call will retrieve the proper web from the already passed full url, then you can retrieve the file and the url of the SPWeb.
    Mathieu Desmarais http://www.matdesmarais.com/

  • How to get relationship between material document no and accounting documen

    Hi Experts !!
                     I want to create a report displaying accounting document no and GL account no buy providing PO No and material document no (MIGO No).
    I want a database table from where I can get  material document no (MIGO No)(MBLNR/BELNR) and accounting document(BELNR) no both.Currently I am using
    BSEG for getting HKONT,EBELN,BELNR
    MSEG for getting MBLNR by using EBELN (P.O. NO)
    BKPF for getting BUDAT.
    the problem came with EBELN (P.O. NO) as repeated entries are there.
    I am unable to write query for getting MBLNR and  BELNR for same EBELN (P.O. NO).
    Is there any table where MBLNR and  BELNR are related to each other??????
    Thanks in advance !!!!

    Check this thread, if this helps.
    [url] Link between MKPF table and EKKO or RBKP table [url]
    I've done this as well earlier to create a custom document flow for archived documents where from the EBELN i've found all the related documents. Hope this helps.

  • How to get the multidementional hierarchy level number ?

    Dear all,
    Could anyone tell me how to receive the hierarchy level number like the picture below:
    [click here for the Screenshot|http://yaoxin.de/download/level.jpg]
    as you can see, when i mouse hove on a level, it shows the level number.
    but, I want to get the level number 2 (node number 2) in query designer, but i can't find anywhere to show that.
    thank you for your kind help !
    Edited by: Xin Yao on Aug 26, 2011 1:04 PM

    hi Charlie Belt,
    Thank you very much for your answer.
    And yes, I do wish to perform a calculation based (aggregation) on the hierarchy level.
    How can I continue working on that?
    yao
    wish you have a nice weekend!

  • How to get the zero of phone number eg. 0612345678

    Dear Adobe Flex Builder Professionals,
    I've got a problem with getting the zero of a phone number eg. 0612345678
    If I enter the folowing phone number as input:
    0612345678
    I will get the phone number as output:
    612345678
    The application has been written in Adobe Flex Builder 3.
    The code of the MXML file is:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="init()"
    horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:Metadata>
      [Event(name="customerSaveEvent", type="events.CustomerEvent")]
      [Event(name="customerCancelEvent", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
      <![CDATA[
       import util.ComboBoxUtil;
       import mx.controls.Alert;
       import events.CustomerEvent;
       import mx.collections.ArrayCollection;
       import mx.core.Application;
       import valueObject.Customer;
       import mx.validators.Validator;
       import mx.validators.PhoneNumberValidator;
       private var phoneCheck:PhoneNumberValidator;
       [Bindable]
       public var selectedCustomer:Customer;
       private function init():void{
        //this.cretePhoneValidator();
        if(this.selectedCustomer == null){
         this.clearForm(null);
       private function cretePhoneValidator():void{
        phoneCheck = new PhoneNumberValidator();
        phoneCheck.source = phoneNumber;
        phoneCheck.property = "text";
       private function validateForm():void {
        //var validatorList:Array = new Array(emailCheck, phoneCheck);
        //Validator.validateAll(validatorList);
       private function cancelClickHandler():void{
        var cancelManageCustomerObj:Event = new Event("customerCancelEvent");
        dispatchEvent(cancelManageCustomerObj);
       private function saveCustomer():void {
        //validateForm();
         var c:Customer = null;
         var selCust:Customer = Application.application.selectedCustomer;
         if(selCust != null){
          c = selCust;
         } else {
          c = new Customer();          
         c.setLastName(lastName.text);
         c.setFirstName(firstName.text);
         c.setStreet(street.text);
         c.setPostal(postal.text);
         c.setCity(city.text);
         c.setEmail(email.text);
         c.setPhoneNumber(new Number(phoneNumber.text));
         c.setMailing(mailing.selectedItem.data);
         c.setComment(comment.text);
         var modified: Customer = Application.application.customerService.createOrUpdate(c);
        var customerEventObj:CustomerEvent = new CustomerEvent("customerSaveEvent", modified);
        dispatchEvent(customerEventObj);
        this.clearForm(selCust);
        private function clearForm(selCust:Customer):void{
         if(selCust == null){
          this.lastName.text = "";
          this.firstName.text = "";
          this.street.text = "";
          this.postal.text = "";
          this.city.text  = "";
          this.phoneNumber.text = "";
          this.email.text = "";
          this.mailing.selectedIndex = 0;
          this.comment.text  = "";
         focusManager.setFocus(lastName);
      ]]>
    </mx:Script>
    <!--mx:EmailValidator id="emailCheck" source="{email}" property="text"
      trigger="{save}" triggerEvent="click"/-->
    <mx:Form id="manageCustomerForm">
      <mx:FormItem label="Achternaam:">
       <mx:TextInput id="lastName" text="{selectedCustomer.getLastName()}"/>
      </mx:FormItem>
      <mx:FormItem label="Voorletters:">
       <mx:TextInput id="firstName" text="{selectedCustomer.getFirstName()}"/>
      </mx:FormItem>
      <mx:FormItem label="Straat:">
       <mx:TextInput id="street" text="{selectedCustomer.getStreet()}"/>
      </mx:FormItem>
      <mx:FormItem label="Postcode:">
       <mx:TextInput id="postal" text="{selectedCustomer.getPostal()}"/>
      </mx:FormItem>
      <mx:FormItem label="Stad:">
       <mx:TextInput id="city" text="{selectedCustomer.getCity()}"/>
      </mx:FormItem>
      <mx:FormItem label="Telefoonnummer:">
       <mx:TextInput id="phoneNumber" text="{selectedCustomer.getPhoneNumber()}"/>
      </mx:FormItem>
      <mx:FormItem label="E-mail:">
       <mx:TextInput id="email" text="{selectedCustomer.getEmail()}"/>
      </mx:FormItem>
      <mx:FormItem label="Opmerkingen:" >
       <mx:TextArea id="comment" text="{selectedCustomer.getComment()}"
         width="447" height="144"/>
      </mx:FormItem>
      <mx:FormItem label="Mailing:">
       <mx:ComboBox id="mailing" dataProvider="{Application.application.comboBoxUtil.yesNo}"
        selectedIndex="{ComboBoxUtil.getIndex(selectedCustomer.getMailing())}"/>
      </mx:FormItem>
      <mx:HBox id="manageButtonBox">  
       <mx:Button id="save" label="Opslaan" click="saveCustomer()" />  
       <mx:Button id="resetButton" label="Wis" click="clearForm(null)" />  
       <mx:Button id="cancelButton" label="Annuleer" click="cancelClickHandler()" />
      </mx:HBox> 
    </mx:Form>
    </mx:Canvas>
    The code of the SQL file is:
    create table customer (
    id integer not null primary key autoincrement,
    lastName VARCHAR(50),
    firstName VARCHAR(50),
    street VARCHAR(50),
    city VARCHAR(50),
    postal VARCHAR(10),
    phoneNumber INT(10),
    email VARCHAR(50),
    mailing boolean default false,
    comment VARCHAR(255)
    create table treatment (
    id integer not null primary key autoincrement,
    date Date,
    treatment varchar(255),
    customerId integer not null,
    constraint fk_customer foreign key(customerId) references customer(id)
    create table user (
    id integer not null primary key autoincrement,
    loginName varchar(50) not null,
    lastName varchar(50) not null,
    firstName varchar(50) not null,
    password varchar(50) not null,
    active boolean not null default true,
    accessright varchar(10) not null
    create table agenda (
    id integer not null primary key autoincrement,
    userId integer not null,
    date Date,
    hour integer,
    minute integer,
    description varchar(50),
    constraint fk_user foreign key(userId) references user(id)
    create table license (
    id integer not null primary key autoincrement,
    key varchar(50),
    val varchar(50)
    I hope someone can help me with this problem.

    Customer List?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml
    initialize="init()">
    <mx:Metadata>
      [Event(name="selectCustomerEvent", type="events.CustomerEvent")]
    </mx:Metadata>
    <mx:Script>
      <![CDATA[
       import mx.core.Application;
       import service.CustomerService;
       import events.CustomerEvent;
       import valueObject.Customer;
       import mx.events.ListEvent;
       import mx.collections.ArrayCollection;
       [Bindable]
       public var customerData:ArrayCollection;
       private var customerService:CustomerService;
       private function init():void{
        this.customerService = new CustomerService();
        this.customerData = this.customerService.getCustomers();
        if(this.customerData == null){
         this.customerData = new ArrayCollection();
       private function itemClickHandler(event:ListEvent):void {
        if(event.columnIndex != 0){
         var customerData:Customer;
         customerData = event.itemRenderer.data as Customer;
         var customerEventObj:CustomerEvent = new CustomerEvent("selectCustomerEvent", customerData);
         dispatchEvent(customerEventObj);
       public function deleteCustomer(id:int):void{
        var cust:Customer = new Customer();
        cust.setId(id);
        this.customerService.deleteCustomer(cust);
        this.customerData.removeItemAt(customerGrid.selectedIndex);
      ]]>
    </mx:Script>
    <mx:DataGrid id="customerGrid" dataProvider="{customerData}" height="100%"
      itemClick="itemClickHandler(event)" width="340">
      <mx:columns>
       <mx:DataGridColumn deactivate="true" dataField="id" headerText=" " width="15">
              <mx:itemRenderer>
                <mx:Component>
                  <mx:Image source="images/delete.jpg" click="outerDocument.deleteCustomer(data.id)"
                   buttonMode="true" height="15" width="15"/>
                </mx:Component>
              </mx:itemRenderer>
            </mx:DataGridColumn>
       <mx:DataGridColumn dataField="lastName" headerText="Achternaam" />
       <mx:DataGridColumn dataField="firstName" headerText="Voorletters" />
      </mx:columns>
    </mx:DataGrid>
    </mx:Canvas>

  • How to get the next Date

    Hi All,
    I have a date field in which when i enter the date and click on the button I should display the  next day in another inputfield.
    Ex: If i enter 12th Nov 2008 (11/12/2008)i should get 13th Nov 2008 (11/13/2008)
    in the other input field.
    Thank You in Advance.

    Hi,
    Following is the sample code based on todays date
    Date dt = new Date(Calendar.getInstance().getTimeInMillis());
              Calendar calendar = Calendar.getInstance();
              calendar.add(Calendar.DATE, 1);
              System.out.println(calendar.getTime());
    OR
    //Specifically for your sample dates
    Calendar calendar = Calendar.getInstance();
              calendar.set(Calendar.MONTH, 10);
              calendar.set(Calendar.DATE, 12);
              calendar.set(Calendar.YEAR, 2008);
              System.out.println(calendar.getTime());
              calendar.add(Calendar.DATE, 1);
              System.out.println(calendar.getTime());
    Regards
    Ayyapparaj

Maybe you are looking for

  • Fiscal year change in AA

    Dear All, We wanted to run the asset history list report (AR01) as of 31.03.2007. The system is giving an error message saying that "Fiscal Year Change is not done". Please confirm if we can take this report without doing Fiscal year change or is the

  • Receiver Module Configuration Issue

    Hi All, I have done the following Module Configuration in Receiver JMS Adapter, but facing issue in the Length of the Flat File received in JMS. it is having only 512 characters, i got clue that is because of   localejbs/SAP XI JMS Adapter/ConvertMes

  • Display PDF in Portal

    Hi all, I have a problem when I display a PDF in SAP Portal.  This application shows me a form, developed in smartforms, in new windows in SAP Portal. In QA I donu2019t have a problem only in PRD. My problem is that this PDF doesnu2019t open directly

  • How to develop an idoc related lsmw

    hi all,  my name is t.balaji and i belong to sap sd and i dont know how to develop and i doc related lsmw.

  • What good are Master Slides if...

    I can not edit them on the main timeline? I create a captivate template and use master slides with place holders. Then create a new project from the template and I can not edit the master slide with place holders. Right now all I can see using a mast