How to fetch billing number using delivery number

Hi Experts,
Based on delivery number(LIPS-VBELN) i need to get the data from billing table(VBRK and VBRP).
Is there any function module to get the same. Pls anyone help on this.
Thanks
Ramesh Manoharan
Moderator message: please do some research before asking.
Edited by: Thomas Zloch on Mar 2, 2011 9:16 AM

Hi ,
My requirement is to fetch the check number from payr table using CHECT field .
but relation ship i taken from bseg table.
i am giving query as follows
select single chect from payr into a_chect where vblnr = bseg-belnr.
above query is not giving solution.
is there any other relation ship for getting check number.
i  written  subroutine program for calling into form .
form  check_get tables in_tab structure itcsy
                      out_tab structure itcsy.
tables: payr.
data:  a_chect type payr-chect,
       b_belnr type bseg-belnr.
read table in_tab INDEX 1.   "with key NAME = 'BSIK-BELNR'.
       check sy-subrc = 0.
b_belnr   =    in_tab-value.
break-point.
select single CHECT from PAYR into A_CHECT where vblnr = b_belnr.
if sy-subrc = 0.
read table out_tab index 1. "with key 'CHECT'.
check sy-subrc = 0.
out_tab-value = a_chect.
modify out_tab index 1.
endif.
endform.

Similar Messages

  • In order confirmation i need invoice number and delivery number.

    Dear Experts,
    I need invoice number and delivery number in order confirmation.
    how can i get the delivery number an invoice number.
    Program name: RVADOR01
    Regards
    Ahmed

    Hi
    In the Order confirmation Only sales order details will be there
    You better write a PERFORM  statement in Script and in the subroutine fetch the Delivery number and Invoice number with the following links and display them in script
    LIPS-VGBEL = VBAK-VBELN
    LIPS-VGPOS = VBAP-POSNR
    VBRP-AUBEL = VBAK-VBELN
    VBRP-AUPOS = VBAP-POSNR
    You can also can use the VBFA table
    using Prev doc type = C (order) and Subsequent doc type = J to get the Delivery
    and Sunsequent type = M for getting the Invoice Number
    see the sample code for subroutine
    REPORT ZMPO1 .
    form get_freight tables in_par structure itcsy out_par structure itcsy.
    tables: ekko,konv,t685t.
    data: begin of itab occurs 0,
             ebeln like ekko-ebeln,
             knumv like ekko-knumv,
           end of itab.
    data: begin of itab1 occurs 0,
             knumv like konv-knumv,
             kposn like konv-kposn,
             kschl like konv-kschl,
             kbetr like konv-kbetr,
             waers like konv-waers,
             kwert like konv-kwert,
           end of itab1.
    data: begin of iout occurs 0,
             kschl like konv-kschl,
             vtext like t685t-vtext,
             kbetr like konv-kbetr,
             kwert like konv-kwert,
           end of iout.
    data v_po like ekko-ebeln.
    read table in_par with key 'EKKO-EBELN'.
    if sy-subrc = 0.
       v_po = in_par-value.
       select
         ebeln
         knumv
      from ekko
      into table itab
      where ebeln = v_po.
      if sy-subrc = 0.
        loop at itab.
          select
            knumv
            kposn
            kschl
            kbetr
            waers
            kwert
          into table itab1
          from konv
          where knumv = itab-knumv and
                kappl = 'M'.
        endloop.
        loop at itab1.
          if itab1-kposn <> 0.
            select single * from t685t
                              where kschl = itab1-kschl
                                and kappl = 'M'
                                and spras = 'EN'.
            iout-vtext = t685t-vtext.
            iout-kschl = itab1-kschl.
            iout-kbetr = itab1-kbetr.
            iout-kwert = itab1-kwert.
            append iout.
            clear iout.
          endif.
        endloop.
        sort itab1 by kposn.
        loop at iout.
          sort iout by kschl.
          if ( iout-kschl eq 'GSDC' OR
               iout-kschl eq 'GSFR' OR
               iout-kschl eq 'GSIR' ).
            at end of kschl.
              read table iout index sy-tabix.
              sum.
             write:/ iout-kschl,iout-vtext,iout-kwert.
          out_par-name = 'A1'.
          out_par-value = iout-vtext.
          append out_par.
          out_par-name = 'A2'.
          out_par-value = iout-kwert.
          append out_par.
              endat.
            endif.
          endloop.
        endif.
      endif.
    endform.
    IN THE FORM I AM WRITING THIS CODE.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:ENDPERFORM
    &A1&
    &A2&
    This Code is to be written in the PO form under ADDRESS window.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:DEFINE &A3& = ' '
    /:DEFINE &A4& = ' '
    /:DEFINE &A5& = ' '
    /:DEFINE &A6& = ' '
    /:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:CHANGING &A3&
    /:CHANGING &A4&
    /:CHANGING &A5&
    /:CHANGING &A6&
    /:ENDPERFORM
    &A1&
    &A2&
    &A3&
    &A4&
    &A5&
    &A6&
    Regards
    Anji

  • Reg: How to create shipment by using delivery...

    HI all,
    How to create shipment by using delivery...
    Thanks

    Hi Jamie:
    Thank you for your help.
    Could you please tell me what is "SQL*Plus session"?
    I modified the code into:
    Statement Stmt = Conn.createStatement();
    Stmt.executeUpdate("CREATE VIEW csclass AS SELECT * FROM CSGRADE10");
    The error message is the same:
    SQLException: Error during query: Unexpected Exception: java.sql.SQLException message given: Syntax error or access violation: You have an error in your SQL syntax near 'VIEW csclass AS SELECT * FROM CSGRADE10' at line 1
    SQLState: S1000
    VendorError: 0
    I am using MySQL.
    Jack

  • How to update Z table with delivery number using MV50AFZ1

    Hi Friends,
    I am working with user exit MV50AFZ1/ USEREXIT_SAVE_DOCUMENT.
    My requirement is I have a Ztable with delivery number field (initially blank). If I create a delivery thru sales order VA02 , my created delivery number should get populated/updated in my Ztable.
    I would appreciate if someone could help me on this.
    Thanks.

    Hi
    First of all, read SAP Note 415716 - User exits in delivery processing, as for instance, avoid your own COMMIT WORK.
    For instance, as the sample code suggests, the better is encapsulate your ABAP coding in a function module with the option IN UPDATE TASK. Define the interface with the data that you need (XLIKP, XLIPS, XVBUK, and so on), after in your own coding (for instance)
    FUNCTION Z_SAVE_DELIVERY
         IMPORTING
           VALUE(IM_LIKP) TYPE SHP_LIKP_T.
       DATA: w_zeta LIKE z_table.
       DATA: ty_likp TYPE likp.
      LOOP AT im_likp INTO ty_likp.
         MOVE-CORRESPONDING ty_likp TO w_zeta.
         MODIFY z_table FROM w_zeta.            "or your own algorithm, searching records and modify them.
      ENDLOOP.
    In the userexit you can do this coding:
      CALL FUNCTION 'Z_SAVE_DELIVERY' IN UPDATE TASK
          EXPORTING
                im_likp = xlikp.
    I hope this helps you
    Regards
    Eduardo
    Edited by: E_Hinojosa on Jun 21, 2011 5:49 PM

  • How to trace sales order number from delivery number, when batch is split

    Hi All,
    I have created a Sales Order and a Outbound Delivery against the sales order.
    While creating the Outbound delivery, I have split the qty in two batches.
    Now when I go in table LIPS, and search on the basis of the Delivery number, I get two rows, one for each batch. But here the sales order LIPS-VGBEL, and Sales order item no (LIPS-VGPOS) is updated only for the 1st batch line item, but is not updated for the second batch line item.
    Please help me so that on the basis of the delivery number, i will be able to find record from tables for sales order for both the line items (i.e. for each batch).
    Immediate help would be appreciated.
    Thanks in Advance.
    Ankush

    Hi,
    I have created delivery against sales order.
    While picking (during delivery PGI), I selected two batches to suffice the delivery qty. Please refer the example quoted below.
    Sales order (SO1) - Material (Mat1) - qty (15 ea)
    Delivery against sales order (Del1) - batch split: batch1 - 10 ea
                                                                         batch2 - 5 ea
    In table LIPS: when I enter delivery number as "Del1" and execute, I get 2 records:
       del no.     Item No.      Material   Qty       Batch no       Sales Order no     Sales Order Item no
    1. DEL1       10              Mat1        10 ea    batch1          SO1                    10
    2. DEL1       20              Mat1         5 ea     batch2         ______                 ____
    Thus in the 2nd record, the Sales order no.(LIPS-VGBEL) and sales order item no. (LIPS-VGPOS) does not get updated.
    I have to develop a report to display the Sales Order number and sales order line item number for each batch of the Delivery for the same item number. Please guide me to know how I can get the same.
    Hope this clarifies the issue faced.
    Regards,
    Ankush

  • HT4759 i lost my iphone how i can find it using IMEI number

    hi how i  can find my iphone using IMEI number please help

    That will only allow your carrier to blacklist the phone so it cannot be used or reactivated on their network.  It won't allow you to find it.

  • How to find out the Group Delivery Number from STO

    User performed WA08 to create Vendor PO and STO for stores.
    When GR was carried out on the Vendor PO, multiple Delivery Order were auto-generated.
    Now, is there a place whereby User could identified the Group Delivery Number which
    links all the DOs generated based on either
    a. The STO number  OR
    b. The vendor PO number OR
    c. the allocation table.
    Can some assist?

    Hi,
    Please check these tables
    LIPS...
    VBELN: for Delivery Number
    VGBEL: for STO Number
    with the above chk this.
    VBSS...
    SAMMG: Group Number
    VBELN: Sales and Distribution Document Number
    Regards
    GK.

  • How to get master sales order number from delivery number

    Hi All,
    I need logic for getting master sales order number from available Delivery number.
    Note: There can be many SO's in diffrent levels.
    Finally i need to pick up master sales order no.
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    I have a outbound delivery[VL03N] 'X' in my system .
    Then for getting sales order no i am writing below code:
      SELECT single vbelv vbeln
             from vbfa
             INTO (vbelv, vbeln)
             where vbeln   EQ p_vbeln AND
                   vbtyp_n EQ 'J'.
    Then vbelv i need to pick up master sales order no.
        SELECT vbelv vbeln
               from vbfa
               INTO TABLE i_so
               where vbeln   EQ l_vbelv AND
                     vbtyp_n EQ 'C'.
    If i write code as above it is giving four sales orders which one of them is master sales order no!
    Thanks,
    Deep.

  • How to create invoice by passing delivery number..?

    Plz suggest any method or code to create automatic invoice by passing delivery number...

    Through BDC we have done it .
    we are passing delivery number as well text field also.
    Thanks

  • Report ( invoice number and delivery number)

    Hi
    Is there any report in SAP, which can show invoice number and delivery document number, I know the SAP table, but is SAP standard report available?
    Example:PO: 5500075241, plant abraod delivery number 3510000174 and plant abroad Invoice number 3550000019, we need report which gives Delivery and Invoice no.
    thanks

    No standard reports shows both delivery and billing references in a single report.  You can develop a query in SQVI by table joining VBFA, LIKP and VBRK.
    thanks
    G. Lakshmipathi

  • How to fetch message comments using JMA API?

    Hi All,
    From telnet <host> 143, and tring get comments associated with a message works well as shown below.
    2 fetch 8 COMMENT ("/message/vendor/ms/follow-up-flag-status" ("value.shared"))
    * 8 FETCH (COMMENT ("/message/vendor/ms/follow-up-flag-status" ("value.shared" "completed")))
    How to fetch the same details using Java Mail API. I couldn't get any of these flags when added to FetchProfile before fetching. The last option is using IMAPFolder.ProtocolCommand.
    Please suggest if there is a better way to fetch message meta data as "comment" using JMA
    Regards,
    Venkat

    I don't know what JMA is. I assume you meant JavaMail.
    Sorry, there's no direct support for fetching that data.
    You might be able to get this to work using IMAPFolder.ProtocolCommand.

  • HT1918 How to delete billing information using iOS

    How do I delete billing information using iOS device

    you can't, you should use iTunes on a computer for this. log in, select 'account' and 'payment method/info'
    then you can select 'none' and save settings

  • How to change Billing status of delivery-related billing documents?

    Hi Experts,
    Now I meet with the problem with the billing status.
    I want to create a billing reference delivery notes, but the billing staus of delivery-related billing docuemnts is  blank, I want to chage it to 'A' so as to create a billing refer to it.
    Can anyone give me some hint to make it true?
    Thanks a lot.
    Best regards,
    Chris Gu

    Hi,
    Billing status blank means, delivery is not relevent for billing. Check the deliver document, whether it has billing relevant items in it or not. To know the billing relevence, please check your item category definition.
    For delivery relevant billing, billing relevance in item category definition (VOV7 transaction) should be 'A'.
    A: Delivery-related billing document
    Billing is based on the outbound delivery. Billing status is only updated in the outbound delivery.
    Regards,
    Satya.

  • How to simulate bill cancellation using ISU_SIMULATION_PERIOD_BILL ?

    Hi all !
    I would like to simulate bill cancellation using the Function Module ISU_SIMULATION_PERIOD_BILL.
    Does anyone have an idea ?
    Thanks
    Regards
    Loïc
    Edited by: Loïc  Legrand on Jan 20, 2009 10:11 PM

    Have a look at note 561759.
    Rob

  • How to fetch Billing Document Number

    Hi All,
    i have Sold to party (kunnr), from this i need to find Billing document number and the corresponding Ship to party.
    i have used
          SELECT vbeln FROM vbpa INTO TABLE gt_vbeln
                                  WHERE PARVW = 'WE' AND
                                        kunnr = p_kunnr.
          if gt_vbeln is NOT INITIAL.
            SELECT KUNNR FROM vbpa
                                 INTO TABLE gt_kunnr
                                 FOR ALL ENTRIES IN gt_vbeln
                                 WHERE vbeln = gt_vbeln-vbeln AND
                                       PARVW = 'AG'.
            DELETE ADJACENT DUPLICATES FROM gt_kunnr COMPARING ALL FIELDS.
          ENDIF.
    the first select query is taking long time n it is going for dump, please suggest me the solution.
    Regards,
    Kumar

    Hi Kumar,
    I will recommend with the below solution:
    1. Select vbeln from vbrk...gt_vbeln
           where kunag = sold-to-party.
    2. if gt_vbeln[] is not initial.
       Select from vbpa...
           for all entries in gt_vbeln
           where vbeln = gt_vbeln-vbeln
                and parvw = 'WE'.  "Ship to party
        endif.
    If you have any qn / concern on the above soln, please let me know.
    Regards,
    Selva K.
    Edited by: Selvakumar Krishnan on Jul 20, 2010 9:21 PM

Maybe you are looking for

  • How do I reinstall Adobe Acrobat XI Pro?

    I unistalled Adobe Acrobat XI Pro.  I am a Creative Cloud member.  I want to reinstall Adobe Acrobat XI Pro.  HOWEVER, my Creative Cloud app manager shows that I already have it and I can't reinstall it.  I've signed out of the CC desktop app, and si

  • Relation between RV_DELIVERY_CREATE and WS_DELIVERY_UPDATE

    Hi! RV_DELIVERY_CREATE creates a delivery... how to pos goods issue (PGI) I know that I need to pass Delivery nr to WS_DELIVERY_UPDATE, but how to retrieve this nr? Is it a result of RV_DELIVERY_CREATE? CALL FUNCTION 'RV_DELIVERY_CREATE'       EXPORT

  • Deleting contacts from Favourites list?

    It sounds so easy to do, but for some reason I can't do it! How do I delete a contact from my favourites list yet keep it in my address book? Thanks in advance. f

  • Connect to internet Error

    I am using my N82 and ovi suite v3.1.1.65 (BETA) doesnot connect my cellphone to internet over bluetooth.Does anyone face a similar problem ? I think this is a bug and needs to be fixed. Pervious versions had no such problems . In other words :  CONN

  • HT1414 Good morning, I have an issue with my Iphone 4s, could you please help me?

    My IPhone 4s is losing battery at an alarming rate, now it is getting very HOT while it is turned on and even shuts itself off because it is getting too hot?