Func Mod to get next number for purchase order

Hi all,
  Does any know what the function module or bapi to get the next purchase order number ?
what would be the object number ?
thanks
Joyce
Edited by: Joyce Chan on May 14, 2010 4:11 PM

See if this helps..
Get an accounting document number:
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = r_blart "type of Document
object = 'RF_BELEG'
SUBOBJECT = p_bukrs "Company
IMPORTING
number = d_belnr "Returned belnr
document number
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
OTHERS = 7

Similar Messages

  • Can SAP get material number in Purchase order in external processing?

    I have a question that:
    As I know, Exeternal processing is a service, so that Material number can not be shown in purchase order converted from PR for external processing. Here, PR can be automately generated from transaction CO01 to create an external processing production order. Meanwhile, for external processing, purchase info record is created without material number only with material group.
    So, I want to know that if there any solutions to show material number in purchase order generated for external processing?
    thanks,
    best regards,

    If therer are no production order, How can I get finished products from internal activity and external processing?
    Now, external processing in our company like this:
    1.create an purchase info record. (type:subcontracting, with material group, but not material ID)
    2.Maintan external processing data in external operation where external processing happens.(control key: pp02, external processing data: info record, purchase org. net price, cost element etc.)
    3.create a production order for the material.(one of the operations is an external processing operation described like step 2)
    4.Purchase requstion is changed into Purchase order. (Purchase requestion is automately created with the production order)
    5.MIGO to receive goods from the purchase order.
    6.finished the production order and delivery goods.then the production order is DLV.
    In step 4, purchase order can only get the production order ID, but there are no material ID shown in it. Only method to show material is that maintaining a description text in the external operation, then, purchase order item could show material in material text(but, here, there is no material ID derectly from info record or production order).
    this is the big problem now for our company. No material ID can be automately carried into the purchase order.
    Hope you help..
    thanks...

  • How to get Line Number in Purchase Order

    Hi Experts
    I want to get Line Number of Matrix of Purchase Order. How I get it ?
    I want to compare Matrix Line Number with Line Number of POR1 in DB.
    Please Help me.
    Hepil Doshi

    Hi Hepil,
    Linenum in Matrix "38" is Columns.Item("110").Value
    SBO application doesnot show it, but you can get the linenum from that column.
    You can test by getting the column title. omatrix.columns.item("110").Title
    Hope it helps.
    Regards
    Edy

  • BI : Invoice number in Purchase Order

    Hi Experts,
    I am doing Standard extraction for having purchase order related data in BI. we are using the below data sources :
    2LIS_02_itm, 2lis_02_cgr,2lis_02_scn & 2lis_02_sgr. Our requirement is we want to have the invoice number(XBLNR,REBZG)  in the extraction but none of the standard PO related Datasource has these fields. Kindly advise how can we bring the invoice number for purchase order extraction.
    thanks & regards,
    M.S

    Hi,
    You ERP system should be upgraded to Enhancement pack 3 to avail this datasource. Could you confirm the patch level of your ECC system. Or you can use 2lis_06_inv datasource to get the PO Number and accounting information.
    Thanks,
    RRR.
    Edited by: Rammi on Feb 18, 2010 10:11 AM
    Edited by: Rammi on Feb 18, 2010 10:12 AM
    Edited by: Rammi on Feb 18, 2010 10:12 AM

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

  • No goods receipt possible for purchase order Number and Item number.

    Hello experts,
    When I create a Goods Reciept with reference to Purchase Order using BAPI_GOODSMVT_CREATE, the following error message appears.
    No goods receipt possible for purchase order <PO number> <line item number>.
    But the GR is getting created manually using Transaction MIGO for the same PO number.
    I found some blogs to check for deletion indicator and Movement type and quantity, when I searched SDN for the same Issue.
    In my case 
    1.deletion indicator is not set for the Purchase order line items
    2.And Movement type is 101
    3.And gm_code is 01.
    Could anyone please suggest me, what else could be the reason for this error?

    Here is the code what i have written.
      f_gmvt_header-pstng_date = sy-datum.
      f_gmvt_header-doc_date   = sy-datum.
      f_gmvt_header-pr_uname   = sy-uname.
      f_gmvt_header-ref_doc_no = p_ebeln.
      f_goodsmvt_code_tmp        = '01'.
    * Looping the PO details.
      CLEAR: gf_item,f_gmvt_item.
      LOOP AT gt_item INTO gf_item.
    * fill the bapi item structure details
        f_gmvt_item-material   = gf_item-material.
        f_gmvt_item-plant      = gf_sbms-werks.
        f_gmvt_item-stge_loc   = '0001'.
        f_gmvt_item-move_type  = '101'.
        f_gmvt_item-po_number  = p_ebeln.
        f_gmvt_item-po_item    = gf_item-po_item.
        f_gmvt_item-entry_qnt  = gf_item-quantity.
        f_gmvt_item-entry_uom  = 'PC'.
        f_gmvt_item-entry_uom_iso = 'PCE'.
        f_gmvt_item-po_pr_qnt = gf_item-quantity.
        f_gmvt_item-orderpr_un = 'PC'.
        f_gmvt_item-orderpr_un_iso = 'PCE'.
        f_gmvt_item-no_more_gr = 'X'.
        f_gmvt_item-ref_doc    = p_ebeln.
        f_gmvt_item-prod_date  = sy-datum.
        f_gmvt_item-mvt_ind    = 'B'.
        f_gmvt_item-move_reas  = '101'.
        f_gmvt_item-vendor      = gf_lfm1-lifnr.
        APPEND f_gmvt_item TO t_gmvt_item.
        CLEAR f_gmvt_item.
      ENDLOOP.
    * cALL THE bapi fm FOR gr POSTING
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header               = f_gmvt_header
          goodsmvt_code                 = f_goodsmvt_code_tmp
    *     TESTRUN                       = ' '
    *     GOODSMVT_REF_EWM              =
       IMPORTING
         goodsmvt_headret              = f_gmvt_headret
    *     MATERIALDOCUMENT              =
    *     MATDOCUMENTYEAR               =
        TABLES
          goodsmvt_item                 = t_gmvt_item
    *     GOODSMVT_SERIALNUMBER         =
          return                        = t_return
    *     GOODSMVT_SERV_PART_DATA       =
    *     EXTENSIONIN                   =
      IF sy-subrc = 0.
    * For commit the changes use BAPI_TRANSACTION_COMMIT FM.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
    *      MOVE: f_GMVT_HEADRET-MAT_DOC   TO WA_DET-MBLNR,
    *            f_GMVT_HEADRET-DOC_YEAR  TO WA_DET-MJAHR,
    *            f_GMVT_HEADER-REF_DOC_NO TO WA_DET-EBELN.
    *      APPEND WA_DET TO IT_DET.
    *      CLEAR WA_DET.
      ENDIF.

  • Where can I get serial number for Lightroom to start using it?

    Hello. I have just created Adobe CC account and purchased a Photography membership plan for Individuals. The price is 9,99 per month and this sum has already been taken from my card. On this page (https://accounts.adobe.com/plans) I can see the confirmation that I have obtained this plan.
    Now I want to use Lightroom but it asks me for serial number. After reading some help I found that I should get serial number from here - https://www.adobe.com/account.html. But on this page it says that "You have no registered products.". So I see no serial number.
    So there's a simple question - where can I get serial number for Lightroom to start using it?

    Jeff, thanks for your answer but it doesn't help. I've successfully passed all checks on page Sign in, activation, or connection errors | CS5.5 and later . My internet connection is ok, hosts file ok, certificates ok, etc. It's not a source of the problem.
    I've found that on page Adobe ID it says that I have free membership. Somehow it turns that my purchased Photography membership plan is not there at all. in order to proof that I really purchased it please see screen from my internet-banking page below:
    Why it is displayed only free membership in my account page and not Photography subscription which was already paid?

  • Getting errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation

    Hi sap Gurus,
      I am getting Errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation that Material (144) does not exist but it is alreardy maintained in MM01.
    I dont get how it is coming.and what are the mandatory fields in bapi BAPI_PO_CREATE1 in item level .that is too material only.
    pls let me know .
    thanks in advance.

    Hi,
    Check the sample code..
    report  zpo_test             .
    *DATA DECLARATION
    constants : c_x value 'X'.
    *Structures to hold PO header data
    data : header like bapimepoheader ,
    headerx like bapimepoheaderx .
    *Structures to hold PO account data
    data : account like bapimepoaccount occurs 0 with header line ,
    accountx like bapimepoaccountx occurs 0 with header line .
    *Internal Tables to hold PO ITEM DATA
    data : item like bapimepoitem occurs 0 with header line,
    itemx like bapimepoitemx occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    return like bapiret2 occurs 0 with header line,
    *Internal table to hold messages from BAPI call
    pocontractlimits like bapiesucc occurs 0 with header line.
    data : w_header(40) value 'PO Header',
    purchaseorder like bapimepoheader-po_number,
    delivery_date like bapimeposchedule-delivery_date.
    data : ws_langu like sy-langu.
    *text-001 = 'PO Header' - define as text element
    selection-screen begin of block b1 with frame title text-001.
    parameters : company like header-comp_code default '122' ,
    doctyp like header-doc_type default 'NB' ,
    cdate like header-creat_date default sy-datum ,
    vendor like header-vendor default '2000000012' ,
    pur_org like header-purch_org default 'PU01' ,
    pur_grp like header-pur_group default '005' .
    *sociedad like HEADER-COMP_CODE default '122' ,
    *vendedor like HEADER-SALES_PERS default 'sale person'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameters : item_num like item-po_item default '00010',
    material like item-material default '12000000' ,
    tipo_imp like item-acctasscat default 'K' ,
    *pos_doc like ITEM-ITEM_CAT default 'F' ,
    shorttxt like item-short_text default 'PRUEBA BAPI' ,
    grup_art like item-matl_group default '817230000' ,
    plant like item-plant default '3001' ,
    mpe like item-trackingno default '9999' ,
    *contrato like ITEM-AGREEMENT default '4904000003' ,
    *quantity like ITEM-QUANTITY default 1 .
    po_unit like item-po_unit default 'EA'.
    selection-screen end of block b2.
    Par?mnetros de imputaci?n
    selection-screen begin of block b3 with frame title text-004.
    parameters : centro like account-costcenter default '1220813150',
    cuenta like account-gl_account default '6631400' ,
    num_pos like account-po_item default '10' ,
    serial like account-serial_no default '01' ,
    ind_imp like account-tax_code default 'I2' .
    selection-screen end of block b3.
    start-of-selection.
    *DATA POPULATION
      ws_langu = sy-langu. "Language variable
    *POPULATE HEADER DATA FOR PO
    *HEADER-COMP_CODE = sociedad .
      header-doc_type = doctyp .
      header-vendor = vendor .
      header-creat_date = cdate .
      header-created_by = 'TD17191' .
      header-purch_org = pur_org .
      header-pur_group = pur_grp .
      header-comp_code = company .
      header-langu = ws_langu .
    *HEADER-SALES_PERS = vendedor .
    *HEADER-CURRENCY = 'DOP' .
    *HEADER-ITEM_INTVL = 10 .
    *HEADER-PMNTTRMS = 'N30' .
    *HEADER-EXCH_RATE = 1 .
    *POPULATE HEADER FLAG.
      headerx-comp_code = c_x.
      headerx-doc_type = c_x.
      headerx-vendor = c_x.
      headerx-creat_date = c_x.
      headerx-created_by = c_x.
      headerx-purch_org = c_x.
      headerx-pur_group = c_x.
      headerx-langu = c_x.
    *HEADERX-sales_pers = c_x.
    *HEADERX-CURRENCY = c_x.
    *HEADER-ITEM_INTVL = c_x.
    *HEADER-PMNTTRMS = c_x.
    *HEADER-EXCH_RATE = c_x.
    *HEADER-EXCH_RATE = c_x.
    *POPULATE ITEM DATA.
      item-po_item = item_num.
      item-quantity = '1'.
    *ITEM-MATERIAL = material .
      item-short_text = 'prueba bapi_po_create1'.
    *ITEM-TAX_CODE = ''.
      item-acctasscat = 'K' .
    *ITEM-ITEM_CAT = 'D' .
      item-matl_group = '817230000' .
      item-plant = '3001' .
      item-trackingno = '99999'.
      item-preq_name = 'test'.
    *ITEM-AGREEMENT = '' .
    *ITEM-AGMT_ITEM = ''.
      item-quantity = '1' .
      item-po_unit = 'EA'.
    *ITEM-ORDERPR_UN = 'EA'.
      item-conv_num1 = '1'.
      item-conv_den1 = '1'.
      item-net_price = '1000000' .
      item-price_unit = '1'.
      item-gr_pr_time = '0'.
      item-prnt_price = 'X'.
      item-unlimited_dlv = 'X'.
      item-gr_ind = 'X' .
      item-ir_ind = 'X' .
      item-gr_basediv = 'X'.
    *ITEM-PCKG_NO = '' .
      append item. clear item.
    *POPULATE ITEM FLAG TABLE
      itemx-po_item = item_num.
      itemx-po_itemx = c_x.
    *ITEMX-MATERIAL = C_X.
      itemx-short_text = c_x.
      itemx-quantity = c_x.
    *ITEMX-TAX_CODE = C_X.
      itemx-acctasscat = c_x.
    *ITEMX-ITEM_CAT = c_x.
      itemx-matl_group = c_x.
      itemx-plant = c_x.
      itemx-trackingno = c_x.
      itemx-preq_name = c_x.
    *ITEMX-AGREEMENT = C_X.
    *ITEMX-AGMT_ITEM = c_x.
      itemx-stge_loc = c_x.
      itemx-quantity = c_x.
      itemx-po_unit = c_x.
    *ITEMX-ORDERPR_UN = C_X.
      itemx-conv_num1 = c_x.
      itemx-conv_den1 = c_x.
      itemx-net_price = c_x.
      itemx-price_unit = c_x.
      itemx-gr_pr_time = c_x.
      itemx-prnt_price = c_x.
      itemx-unlimited_dlv = c_x.
      itemx-gr_ind = c_x .
      itemx-ir_ind = c_x .
      itemx-gr_basediv = c_x .
      append itemx. clear itemx.
    *POPULATE ACCOUNT DATA.
      account-po_item = item_num.
      account-serial_no = serial .
      account-creat_date = sy-datum .
      account-costcenter = centro .
      account-gl_account = cuenta .
      account-gr_rcpt = 'tester'.
      append account. clear account.
    *POPULATE ACCOUNT FLAG TABLE.
      accountx-po_item = item_num .
      accountx-po_itemx = c_x .
      accountx-serial_no = serial .
      accountx-serial_nox = c_x .
      accountx-creat_date = c_x .
      accountx-costcenter = c_x .
      accountx-gl_account = c_x .
      account-gr_rcpt = c_x.
      append accountx. clear accountx.
    *BAPI CALL
      call function 'DIALOG_SET_NO_DIALOG'.
      call function 'BAPI_PO_CREATE1'
        exporting
          poheader         = header
          poheaderx        = headerx
        importing
          exppurchaseorder = purchaseorder
        tables
          return           = return
          poitem           = item
          poitemx          = itemx
          poaccount        = account
          poaccountx       = accountx.
    *Confirm the document creation by calling database COMMIT
      call function 'BAPI_TRANSACTION_COMMIT'
      exporting
      wait = 'X'
    IMPORTING
    RETURN =
    end-of-selection.
    *Output the messages returned from BAPI call
      loop at return.
        write / return-message.
      endloop.
    Regards
    Sudheer

  • No goods receipt possible for purchase order message number# M7036

    Hello,
    We are working in 4.7C , Created the scheduling agreements, with Shipping notification(Inbound delivery)   .
    Created the Scheduling agreement on 25.09.2009 and created the schedule line one same day with date 25.09.2009, (time column Blank).
    So in Practice for Goods receipt we are using MB0A t code for GR,(not using MIGO)..while MB0A..iam going to make GR with ref to Shipping notification then system will through below given message.
    No goods receipt possible for purchase order
    5500001447 0001
    Message no. M7036
    tried every thing but unable get. shar your views
    Regards
    Sapman man

    Hi
    If you use Shipping notification then you have to create inbound delivery VL31n and do the PGR in inbound delivery  VL32N itself.
    Incase of scheduling agreement schedule lines you have to make sure the following
    1) Schedule line delivery date shoud be todays date or in the past
    2) Schedule must be released by using message type based on the type of schedule ( Normal, JIT or forecast)
    Hope it helps
    Thanks/Karthik

  • How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_0

    How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_001 using Functional Module NUMBER_GET_NEXT explain me ?

    Hi,
    First go thourh the FM import export parameters list.
    Try to create an internal table of type INRI-NRRANGENR for number ranges.
    We can provide the lower and higher values for this table so that what ever PO is created will be with that range.
    Try to create the ncessary ones using this FM.
    In the Exit, EXIT_SAPMM06E_001,
    the Export parameters are-
    EKKO-EBELN- the PO ios created with in that specified range
    Range as INRI-NRRANGENR - Here try to assign the Internal table that was populated in the FM.
    Try to code this in the Include provded and keep Breakpint and check the PO number generated.
    Reply if u need more help on this.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • Workflow for PO-Event Linkage get unchecked after making Purchase Order

    Hi,
    I have a client reqiirement for setting Workflow for Purchase Order.
    I have done all the settings for PO Workflow. I am getting the mail for the first time but from the second PO onwards I am not getting the mail.
    When I checked the settings, the Event linkage in SWETYPV gets unchecked for BUS2012 Object Type automatically after making the first PO.
    Again when I activate that, I am able to get mail for the first PO only. From the second onwards, no mail is triggered.
    Could anyone suggest?
    Thanks,
    S.Raghavan
    Hi,
    I now have changed the "Behavior Upon Error Feedback" to "Mark Linkage as having Errors" in SWETYPV
    After this change if I make a PO, the link doesn't get break but "Receiver Status" shows "Errors".
    I could also see the overview of errors in Transaction code  SWEQADM. It shows 3event with Errors and 1 linkage with errors.
    I do not know in which event error is there and in which linkage error is there?
    Can anyone help to see the events and linkage where error persists?
    Edited by: S.Raghavan on Aug 30, 2011 6:22 PM
    Hi all,
    Any suggestion for the issue posted?

    In SWDD select WS 20000075 in the first task assign agents(users, ie create u r own users),
    without user IDs(as u r step 2).if u design "organization plan" then userID's r assigned (like manager,supervisor, clerk etc.,)
    try it

  • Where to get serial number for photoshop cs2?

    Hi! where do i get serial number for photoshop cs2 free dl? Thanks

    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    CS2 is not free. The download is for existing owners of CS or CS2.

  • How do i get serial number for my element12 i have the redemption code

    how do i get serial number for my element12 i have the redemption code

    Hi ylee0y0te,
    Please follow the steps here.
    1. http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    2.http://helpx.adobe.com/x-productkb/global/find-serial-number-student-teacher.html
    3.http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Hope it helps you.
    Regards,
    Rajshree

  • Number ranges for purchase order in SUS- why?

    Dear Gurus,
    In SPRO settings, I have seen the option for defining the number range for purchase order in supplier self service system. similarly, there is an option for defining the number range for purchase order response.
    Why do we need to define the number range for purchase order and its response in SUS system? In SUS system, the purchasing documents from SRM and MM system create corresponding Sales Order and its follow-on document. So, we need to define the number range for sales order not purchase order.
    In spro documents, it says you need to define the number range only if you create purchase order locally in SUS.
    What does it mean?
    regards,
    Ranjan

    Hi Ranjan,
    Unfortunately in SUS, Sales orders are referred to as Purchase orders only. Hence any PO with a number say 450000000 that comes into SUS will have a corresponding number in SUS as 19000000.
    Sam has already explained the PO response part.
    Regards,
    Nikhil

  • I cant get a number for my ipod on iMessage?

    I'm having troubles, I can't get a number for my ipod on iMessage. Like I send &amp; receive texts from my email but I cant get a phone number. If I try to add it on the field it wont let me put it in. So what do I do?

    An iPod (and iPad) will only have a phone number for Messages (and FaceTime) if the same ID is used on an iPhone with iOS 6
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage

Maybe you are looking for