Function Module Get Conf by PO number

Dear Expert,
I would like to get Confirmation number by PO Number. Please let me know what the Function module should I use in SRM
example : I have a PO number, I want to know the confirmations number related for these PO number
Many Thanks

Hello,
please find the code below:
DATA : lv_po                  TYPE CRMD_ORDERADM_H-OBJECT_ID,
              lv_conf               TYPE CRMD_ORDERADM_H-OBJECT_ID,
              lt_pdlist               TYPE TABLE OF BBP_PDS_PDLIST,
              ls_pdlist              TYPE BBP_PDS_PDLIST,
              lt_messages       TYPE TABLE OF BBP_PDS_MESSAGES,
lv_po  = po num ber
*Get the confirmation number for given po number
  CALL FUNCTION 'BBP_PD_CONF_GETLIST'
    EXPORTING
      I_FOR_PO_ID = lv_po
    TABLES
      E_PDLIST    = lt_pdlist
      E_MESSAGES  = lt_messages.
LOOP AT lt_pdlist into ls_pdlist WHERE OBJECT_TYPE = 'BUS2203'.
            lv_conf = ls_pdlist-object_id 
ENDLOOP.
Regards,
Neelima

Similar Messages

  • Use SQL function to get the original order number using the invoice number

    Hi All,
    wondering is someone can help me with this challenge I am having?  Often I need to return the original order numbers that created the resulting invoce.  This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement.  the code i currently have is:
    Use SQL function to get the original order number using the invoice number
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    RETURN @OrderList 
    END
    it is run by the following query:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number here'
    The issue is that this returns the order number for all of the lines in the invoice.  Only want to see the summary of the order numbers.  ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
    If this was a simple reporting SELECT query I would use SELECT DISTINCT.  But I can't do that.
    Any ideas?
    Thanks,
    Mike

    Thanks Gordon,
    I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice.  However, I have managed to solve my own problem with a GROUP BY statement!
    Others may be interested so, the code is this:
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    GROUP BY T6.DocNum
    RETURN @OrderList 
    END
    and to call it use this:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number'

  • Is there any function module getting the cpu type?

    Is there any function module getting the cpu type?

    I guess the database server...
    I would like to get the SAP system cpu type as done in transaction st06 under system information.
    Thanks.

  • Function module to retrieve the account number linked to an SD invoice item

    Hi all,
    I should retrieve the gl account number linked to a certain SD invoice item. The
    program starts from VBRK and VBRP data. Is there a function module which
    enables to get it starting from these header lines? I already used the function
    module: RV_INVOICE_ACCOUNT_DETERM ( release: 4.0 ), but in some cases it
    doesn't seem to function properly ( the export table TKOMV doesn't contain a
    value for the SAKN1 field ). For the invoices for which the function isn't able to
    retrieve the account number, the standard accounting analysis functionality returns
    the following message: account determination carried out via KOFI type. So I'm
    searching for a function module that's able to retrieve the account number in these
    cases also.
    Thanks in advance.
    Adriano.

    Dear Adriano,
    Try with Function Module 'SD_DETERMINE_ACCOUNT_INVOICE '.
    Additional Info:
    BAPIs related salesorder:
    BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
    BAPI_SALESORDER_CONFIRMDELVRY Sales Order: Confirmation of Delivery; Document Flow Update
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
    BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
    BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
    FM:
    MB_ADD_PURCHASE_ORDER_QUANTITY (Reading and adding open purchase order quantities)
    SD_SALES_ORDER_STATUS_WWW for complete details including the delivery information.
    Hope this will help.
    Regards,
    Naveen.

  • Request: Function Module - Get PERNR from UserID

    Hi,
    Is a simple Function Module available for getting the PERNR from a UserID?
    For example, I'll send the FM the UserID and will get back the relevant PERNR.
    Please Help.
    Thanks,
    John

    Hi John,
    FM is one way but
    Simple code to Find personnel number for UNAME
      SELECT SINGLE pernr INTO t_pernr
        FROM pa0105
        WHERE subty = '0001' AND
              endda >= sy-datum AND
              begda <= sy-datum AND
              usrid = p_uname.
    Best Regards,
    Aslam

  • Function module to generate a unique number in report based on descrepency

    hi friends,
    i have a object that..
    Every discrepancy Should Have a unique number in the report, which calls based on the discrepancy (dc_qty)-(recd_qty)=shortage
    the shortage value will be always positive,n not <=0..
    is there any function module which should generate a unque no
    based on passing MBLNR..
    or any other way...
    Thanks n regards
    harish

    use following funtion module
    call function 'NUMBER_GET_NEXT'
            exporting
              nr_range_nr             = '01'
              object                  = 'ZBDCMSC2N'
            importing
              number                  = file_no
            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.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
    in This
    Creat a number Range object(ZBDCMSC2N') using transction SNRO.
    for any problem revert back.
    regards
    Rajesh

  • Does Update function module gets executed after Commit Work?

    Hi Gurus,
    I have a BAPI with a Commit work. Does update function module V1 , V2 - i need mainly about the sequence of V2, gets executed after Commit work or before Commit work.
    Thanks

    Pl refer to SAP help on the same as follows.
    https://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/content.htm
    Regards,
    Naveen Vishal

  • Any function module to update Manufacturer serial number in tcode IE02

    Hi Friends,
    I need function module or bapi to update
    Manufacturer serial number in tcode IE02 .
    Please ........
    Thank you.
    Karthik.

    Hi,
    You may use the exit
    IEQM0007
    or
    BADI:
    EQUI_SERLV_CHECK
    hope this helps.
    Regards,
    Renjith Michael.

  • Function module get tables from view

    Hello,
    I am looking for a function module or something alike where I can find the tables used in a specific view.
    I know how to get the data from the view, but I only want the table names.
    Can anyone help?

    Hi,
    Please try with the Function Module "VIEW_GET_TABLES" by passing the name of the View to the Importing Paramater "VIEWNAME" and tables parameter "VIEW_TABLES" will list the tables used in the VIEW.
    Regards,
    Srinivas

  • What is function module get previous date by enteing no of days

    FM should take : 7 days
    and should return : 4.12.2007
    as output.
    Thanx,
    Naveen

    Hi,
    Apart from function module, you can write as follows.
    data : date1 type datum,
           date2 type datum.
    date1 = sy-datum.
    date2 = date1 - 7 .
    write date2.

  • Function Module to find Reference Employee Number (PERNR)

    Hi All,
    Is there a FM to get employee's reference PERNR (employee number) in case employee was assigned a new employee number due to inter-company transfer or anyother reason.
    Thanks

    Class :CL_HRCCE_PERSON_READER
    You can also see the method ...
        METHOD get_other_pernr.                                                                               
    DATA l_personid TYPE personid.                                                                               
    CALL METHOD me->get_personid              
            EXPORTING                               
              p_pernr    = p_pernr                  
            RECEIVING                               
              p_personid = l_personid.              
          CALL METHOD me->get_pernr                 
            EXPORTING                               
              p_personid = l_personid               
            IMPORTING                               
              p_pernr    = p_rpernr.                
    ENDMETHOD.

  • Function module in SRM for adding number to date excluding weekends

    Hi Experts,
    Please help to get the standard FM in SRM for adding number to date and getting next date excluding weekends.
    Thanks in Advance.
    Thanks,
    Sahil

    This kind of custom FM can be created easily.
    But if you want to use standard FM then "DATE_CONVERT_TO_FACTORYDATE" FM is good but you need a factory calendar id which has all working days and weekend days specified (also public holidays if required). Then call this FM in loop for a count of days and it will give working day after "entered date + number of days"
    So if calendar has only weekdays and weekends specified, it will add number of days in specified date excluding weekends.
    Thanks,
    Murtuza

  • Function Module for getting Number ranges between two number

    Hi guys,
    Is there any Function module which provide us the number range between two numbers?
    For Ex:If i give 1 and 10 to FM it must give me 1
    2
    3
    4.....upto 10.
    is there any FM for doing this,but i'm not able to find exact Fm for same.
    I can write small piece of code for getting number ranges, but if i get FM it could save little work.

    Hi
    But why do u need a fm, can't you do it by yourself?
    DATA: FROM_NUMBER TYPE I VALUE 1,
          TO_NUMBER   TYPE I VALUE 15.
    DATA: NUMBER            TYPE I.
    DATA: BEGIN OF T_NUMBER OCCURS 0,
                  NR TYPE I,
              END    OF T_NUMBER.
    NUMBER = FROM_NUMBER.
    DO.
      IF NUMBER <= TO_NUMBER.
        T_NUMBER-NR = NUMBER.
        APPEND T_NUMBER.
      ELSE.
        EXIT.
      ENDIF.
      NUMBER = NUMBER + 1.
    ENDDO.
    LOOP AT T_NUMBER.
      WRITE: / T_NUMBER-NR.
    ENDLOOP.
    Max

  • Request number of a function module.

    Hi Experts,
    Can anybody plz send me the table where the request number of a function module get stored.
    (Function groups are stored in E071,But i need the request number for function module.)
    If any function module for the same plz send it
    Regards,
    Anoop Chandran

    Hi Martin,
    My scenario  is ;
    i have 2 fn modules
    Fn mod1 and Fn mod2 in fn group A
    and i transported this to another server.
    now i changed fn mod1 and transported.
    so the request number of fn mod 1 get changed.
    So my req is to not based on fn group.
    And it depends on fn modules.
    Can u plz gv me some idea to get the request number (tables or fn mods) of fn module??
    Regards,
    Anoop Chandran

  • Function module to find the external reference number in CRM?

    hi all,
          Is there any function module available to find the process_types for a given external reference number?

    Hello,
    I don't know a function module. The external reference number you can find in CRM in the table BUT0ID (IDTYPE = CRM001 as external identfier). Then you can read BUT000 to get the info with the partner number given in BUT0ID.
    Rgds,
    JP

Maybe you are looking for

  • New 27" thunderbolt flicking to black

    Hi all. I just dropped $1199 on a new 27" TB cinema display to pair with my MBP. Unfortunately, i'm having the same issues I had with an older 30" cinema display on the same lapto: when using Photoshop (cs6, in this case), and zoomed in, the screen f

  • Run time error in org sructure report

    Hi All, I am trying to execute org structure report s_ahr_6106493 with evaluation path BOSS_OE (Standard SAP evaluation path). The report fails on run time error. It looks like there is e recursion that causes that but I checked the data carefully &

  • Cisco 4500X VSS & MEC Cisco 2960X

    Hi I have Cisco 4500x VSS  connect to  MEC Cisco 2960X using LACP. I encountered a problem about C2960X Integration reason 1.C2960X Ten 1/0/2 link flapping interface error-disable .  I am  disable interface then  enable interface , switch show SFP no

  • LabView 5.1 and Database Connectivity Toolkit Compatibility?

    I am looking to serve some data from a LabView 5.1 application up to an Oracle 8i database. I have looked at the current Database Connectivity Toolkit (which uses ADO technology), but am not sure if this will be compatible with LabView 5.1... is it?

  • Query: Source of partner function

    Dear All, I have a basic question in partner determination. I have configured partner determination such that all the required partner functions appear when the customer master is created. But how does the system know the source? I mean, how does the