Regarding RV_INVOICE_CREATE

Hi Experts
i am using RV_INVOICE_CREATE fm to create billing document i am just passing my delivery number and some values like this
CALL FUNCTION 'RV_INVOICE_CREATE'
    EXPORTING
      VBSK_I       = VBSK_I
      WITH_POSTING = WITH_POSTING
    TABLES
      XKOMFK       = P_XKOMFK.
and its working fine and is creating billind document.
But my problem is this that i have delivery number of which i have to create a billing document plus i have to assign a pricing condition type to table XKOMV for a particular item number.
again its creating a billing document but its not adding the condition type to that particular item.
IS THERE ANYWAY YOU GUYS HELP ME OUT WITH THAT.
Thanks in advance

Hi Jawad,
How did you with RV_INVOICE_CREATE? I am having problem creating invoice with RV_INVOICE_CREATE. My code below:
    LOOP AT t_ord.
      t_komfk-vbeln = t_ord-vbeln.
      APPEND t_komfk.
      AT LAST.
        gs_vbsk-smart = 'F'.
        gs_vbsk-ernam = sy-uname.
        gs_vbsk-erdat = sy-datum.
        gs_vbsk-uzeit = sy-uzeit.
        CALL FUNCTION 'RV_INVOICE_CREATE'
          EXPORTING
            vbsk_i                    = gs_vbsk
            with_posting              = 'X'
          IMPORTING
            vbsk_e                    = gs_vbsk_e
            od_bad_data               = g_bad
          TABLES
            xkomfk                    = t_komfk
            xkomv                     = t_komv
            xthead                    = t_head
            xvbfs                     = t_vbfs
            xvbpa                     = t_vbpa
            xvbrk                     = t_vbrk
            xvbrp                     = t_vbrp
            xvbss                     = t_vbss
    COMMIT WORK.
    BREAK-POINT ID z_chkpt_grp.
  ENDAT.
ENDLOOP.

Similar Messages

  • RV_INVOICE_CREATE for this FM what are the mandatory fields

    Hi guru,
            in my process development, first i am creating the sales order using the BAPI FM SD_SALESDOCUMENT_CREATE, From this FM i get the sales order no, after that i use this fm RV_INVOICE_CREATE , then i pass the VBELN (sales order no), but it is not created the invoice no,
    what are the fields i have to pass for this FM.
    What is the use of this FM : RV_INVOICE_DOCUMENT_ADD, is it useful in my scenario.
    plz give the details briefly
    thanks & regards
         raj.

    HI ,
    call function 'RV_INVOICE_CREATE'
        exporting
          with_posting = 'B'
          vbsk_i       = i_xvbsk
        importing
          vbsk_e       = i_xvbsk
        tables
          xkomv        = xkomv
          xvbpa        = xvbpa
          xvbrp        = xvbrp
          xvbrk        = xvbrk
          xkomfk       = i_komfk
          xthead       = xthead
          xvbfs        = i_vbfs
          xvbss        = i_vbss.
    These table are not optional , these all are mand...
    Reagrds,
    Bharani

  • Need sample code with RV_INVOICE_CREATE used

    Hi everybody!
    I need sample code with RV_INVOICE_CREATE or similar FMs used.
    The thing is that I do not know how to populate parametres of this and other invoicing FMs....
    For example, there are some tables to be passed to RV_INVOICE_CREATE
         TABLES
              XKOMFK     = XKOMFK
              XKOMV       = XKOMV
              XTHEAD      = XTHEAD
              XVBFS        = XVBFS
              XVBPA        = XVBPA
              XVBRK        = XVBRK
              XVBRP        = XVBRP
              XVBSS        = XVBSS
    How to populate them? I mean how to fill them with needed values?
    Useful answers will be awarded.
    Kind regards, M.

    RV_INVOICE_CREATE is the function module to create invoice based on delivery .
    when you pass delivery number ,it will create invoice ,see the invoice number in vf02,vf03 transaction. and also see the data vbrk,vbrp tables
    I have done this development and i have cancelled invoice,reverse goods issue,updated the delivery and again i am createing invoice..see the below progrm to get better understanding.
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Reward Points if it is helpful
    Thanks
    Seshu

  • Help on RV_INVOICE_CREATE

    Hi,
    I want to create an billing document of type F1(FKART).
    I must use the function module RV_INVOICE_CREATE to generate billing document.
    Here in my program am passing..... exporting parameter WITH_POSTING = 'B' & filling table parameter XKOMFK(MANDT VBELN POSNR VBTYP ELDAT FKART FKIMG VRKME) and executing it.
    I should get some value in my importing parameter VBSK_E & table parameter XVBFS... but here am getting space.
    1) Is there any parameter which am missing to pass to this FM?
    2) Are any of the above table parameters not needed for creating this F1 type billing document?
    Thanks & regards,
    Adithya M.

    Hi,
    Good for you to find the solution yourself. Please kindly mark the question as answered.
    Regards,
    Teddy

  • Urgent: RV_INVOICE_CREATE - With Posting significance

    Hi everyone.
    I am trying to use the RV_INVOICE_CREATE and RV_INVOICE_DOCUMENT_ADD to create a billing doc. Both these function modules have a parameter WITH_POSTING.
    1. Can anyone tell me what is the significance of this parameter.
    2. What are the possible values to this parameter.
    3. How to determine what value is to be passed.
    Thanks in advance. Please help me on this  ... answers will be rewarded with points.

    Hi,
    Here you go....
    ' '  =  do not update directly (this is done separately using the  function module RV_INVOICE_DOCUMENT_ADD)
    'A'  =  update directly without error log (VBSK,VBFS) - asynchronous
    'B'  =  update directly with error log (VBSK,VBFS)  - asynchronous
    'C'  =  update directly without error log (VBSK,VBFS) - synchronous
    'D'  =  update directly with error log (VBSK,VBFS)  - synchronous
    'E'  =  update directly without error log (VBSK,VBFS) - without commit
    'F'  =  update directly without error log (VBSK,VBFS)  - without commit
    'G'  =  only for internal use by the POS interface         no billing document update, accounting and info system is         updated.
    'H'  =  do not update directly, simulation of billing doc creation and         transfer to FI, no final data initialization.
    Let me know if this doesnt help you...
    Regards,
    Venky

  • Create Invoice with RV_INVOICE_CREATE

    hi buddies, I want to create invoice with reference to sales orders and delivery notes, Can I use FM:RV_INVOICE_CREATE for both?
    I have tested this FM, and seems no errors, but  no documents created when check the invoice table vbrk...
    thanks!

    Hi,
    you can use RV_INVOICE_CREATE, you can do commit only after checking the XVBFS internal table , and look for Success message then only you need to use COMMIT.
    Note: XVBFS is the log internal table, here you can see success and error log.
    check this internal table after execution of the FM for log details(success/error).
    Regards
    vijay

  • RV_INVOICE_CREATE u0096 Incorrect Invoice Quantity

    Hi All,
    I am creating invoice document using “<b>RV_INVOICE_CREATE</b>” for sales document. Creation part works fine. I got small issue I am passing sales order details in table ‘xkomfk’ with correct billing quantity. For some reason it is ignoring <b>‘Actual Invoiced Quantity’</b> passed in table ‘xkomfk’ and picking up quantity from original sales order.
    Quantity should allow to change, because it’s partial billing. I debug VF01, it calls same FM, all passing parameters are same compare that in my program. VF01 it creates what ever <b>quantity specified</b>. Have any one come across such issue. Any clue is much appreciated and thanks in advance.
    Regards,
    Tim

    Hi,
    if you have a userexit include, this must be active.
    in SE80, select inactive objects, and see...
    Regards,
    Clemens

  • Flow of operations in using RV_INVOICE_CREATE for credit / debit memos

    Hi everyone,
    my Z program is reading Excel file with such information like customer nr, invoice nr, material nr, quantity of materials,  invoiced price. My purpose is to create credit / debit memos using RV_INVOICE_CREATE.
    To achieve this I have to retrieve delivery number(vbeln?) and to pass it to FM (thanks Seshu)
    Here are my questions:
    1. what information I must have in order to retrieve vbeln? And how to do it.
    2. how to pass adjusted price to RV_INVOICE_CREATE? I need credit / debit price on memo.
    3. what more basic information I should pass to RV_INVOICE_CREATE?
    Usefull answers will be rewarded.
    Kind regards, Mindaugas

    CALL FUNCTION 'RV_INVOICE_CREATE'
      EXPORTING
      DELIVERY_DATE             = 0
      INVOICE_DATE              = 0
      <b>INVOICE_TYPE              =</b> '    '
      PRICING_DATE              = 0
        VBSK_I                    =
      WITH_POSTING              = ' '
      SELECT_DATE               = 0
      I_NO_VBLOG                = ' '
      I_ANALYZE_MODE            = ' '
      ID_UTASY                  = ' '
      ID_UTSWL                  = ' '
      ID_UTSNL                  = ' '
      ID_NO_ENQUEUE             = ' '
      ID_NEW_CANCELLATION       = ' '
    IMPORTING
      VBSK_E                    =
      OD_BAD_DATA               =
      TABLES
        XKOMFK                    =
        XKOMV                     =
        XTHEAD                    =
        XVBFS                     =
        XVBPA                     =
        XVBRK                     =
        XVBRP                     =
        XVBSS                     =
      XKOMFKGN                  =
      XKOMFKKO                  =
    bold one is invoice type - if you pass G2 - Credit memo
    if you pass L2 is debit memo
    So this function module should work for all invoice types.

  • RV_INVOICE_CREATE u0096 Issue creating more then one invoice

    Hi All,
    I am creating Billing document using “<b>RV_INVOICE_CREATE</b>”. For single sales record it creates fine, but when I pass multiple sales order to create invoice, it only creates billing document for first sales order rest ignored. I am using “<b>RV_INVOICE_REFRESH</b>” after each create, still it doesn’t work. Am I missing any thing here? Thanks in advance. Please check code for further details.
    Regards,
    Tim
    CODE ....
    loop at GT_INIT_ITAB2 into GS_INIT_ITAB2.
        concatenate GS_INIT_ITAB2-afdat6(4) GS_INIT_ITAB2-afdat3(2) GS_INIT_ITAB2-afdat+0(2)
                    into gl_date.
        condense gl_date.
        MOVE-CORRESPONDING GS_INIT_ITAB2 to gt_xkomfk.
        gt_xkomfk-fkimg = GS_INIT_ITAB2-KWMENG.
        gt_xkomfk-SELDAT = gl_date.
        append gt_xkomfk.
    Create Billing document at end of each Sales Document
        AT END OF VBELN.
          gs_vbsk-mandt = sy-mandt.
          gs_vbsk-smart = 'F'.
          gs_vbsk-ernam = sy-uname.
          gs_vbsk-erdat = sy-datum.
          gs_vbsk-uzeit = sy-uzeit.
    Call function module to create Invoice
          CALL FUNCTION <b>'RV_INVOICE_CREATE'</b>
            EXPORTING
            DELIVERY_DATE   = sy-datum
            INVOICE_DATE    = gl_date
              INVOICE_TYPE    = p_fkart
              PRICING_DATE    = sy-datum
            ID_NO_ENQUEUE   = 'X'
              vbsk_i          = gs_vbsk
              with_posting    = 'B'
            IMPORTING
              vbsk_e       = gs_vbsk
            TABLES
              xkomfk       = gt_xkomfk
              xkomv        = gt_xkomv
              xthead       = gt_xthead
              xvbfs        = gt_xvbfs
              xvbpa        = gt_xvbpa
              xvbrk        = gt_xvbrk
              xvbrp        = gt_xvbrp
              xvbss        = gt_xvbss.
          loop at gt_xvbfs.
            append gt_xvbfs-vbeln to gt_vbeln.
          endloop.
         CALL FUNCTION 'DEQUEUE_EVVBAKE'
           EXPORTING
             VBELN = GS_INIT_ITAB2-vbeln.
         DESCRIBE TABLE gt_xvbrk LINES SY-SUBRC.
         IF SY-SUBRC = 0.
          DELETE GT_INIT_ITAB2.
           REFRESH GT_XKOMFK.
         ELSE.
            CALL FUNCTION <b>'RV_INVOICE_REFRESH'</b>
              EXPORTING
                WITH_POSTING = ' '
              TABLES
                XKOMFK       = GT_XKOMFK
                XKOMV        = GT_XKOMV
                XTHEAD       = GT_XTHEAD
                XVBFS        = GT_XVBFS
                XVBSS        = GT_XVBSS
                XVBPA        = GT_XVBPA
                XVBRK        = GT_XVBRK
                XVBRP        = GT_XVBRP.
        ENDIF.
          REFRESH: gt_xkomfk,    gt_xkomv,gt_xthead,gt_xvbfs,gt_xvbpa,
                   gt_xvbrk,gt_xvbrp,gt_xvbss .
        ENDAT.
      endloop.

    Hi Narendarn,
    Thanks for your feed back. I am calling “RV_INVOICE_REFRESH” before looping thru internal table. So first one created fine. I am calling “RV_INVOICE_REFRESH” again once I process “RV_INVOICE_CREATE”. But there onwards billing document not created but I do get billing document number. But when I check in VF03 that billing document no doesn’t exist at all in system. I don’t know what wrong?
    here is the code
    Call function module to create Invoice
      CALL FUNCTION 'RV_INVOICE_REFRESH'
        EXPORTING
          WITH_POSTING = 'B'
        TABLES
          XKOMFK       = GT_XKOMFK
          XKOMV        = GT_XKOMV
          XTHEAD       = GT_XTHEAD
          XVBFS        = GT_XVBFS
          XVBSS        = GT_XVBSS
          XVBPA        = GT_XVBPA
          XVBRK        = GT_XVBRK
          XVBRP        = GT_XVBRP.
    This value will be imported back in Billing document routine(VOFM)
    Routine number 906 - For consolidation logic
      EXPORT P_CONSOL TO MEMORY ID 'ZSD_OPWS_PRE_INVOICE'.
      if gv_lock  is initial and
         gv_block is initial.
        loop at GT_INIT_ITAB2 into GS_INIT_ITAB2.
          clear: gt_xvbfs.
          refresh: gt_xvbfs.
          CALL FUNCTION 'DEQUEUE_EVVBAKE'
            EXPORTING
              MANDT = SY-MANDT
              VBELN = GS_INIT_ITAB2-VBELN.
          concatenate GS_INIT_ITAB2-afdat6(4) GS_INIT_ITAB2-afdat3(2) GS_INIT_ITAB2-afdat+0(2)
                      into gl_date.
          condense gl_date.
          MOVE-CORRESPONDING GS_INIT_ITAB2 to gt_xkomfk.
          gt_xkomfk-fkimg = GS_INIT_ITAB2-KWMENG.
          gt_xkomfk-SELDAT = gl_date.
      gt_xkomfk-SELDAT = GS_INIT_ITAB2-afdat.
          append gt_xkomfk.
          CASE P_CONSOL.
            WHEN 'N'.
    Create Billing document at end of each Sales Document
              AT END OF VBELN.
                gs_vbsk-mandt = sy-mandt.
                gs_vbsk-smart = 'F'.
                gs_vbsk-ernam = sy-uname.
                gs_vbsk-erdat = sy-datum.
                gs_vbsk-uzeit = sy-uzeit.
                CALL FUNCTION 'RV_INVOICE_CREATE'
                  EXPORTING
                DELIVERY_DATE   = sy-datum
                    INVOICE_DATE    = sy-datum
                    INVOICE_TYPE    = p_fkart
                    PRICING_DATE    = sy-datum
                    vbsk_i          = gs_vbsk
                    with_posting    = 'B'
                    id_no_enqueue   = 'X'
                  IMPORTING
                    vbsk_e       = gs_vbsk
                  TABLES
                    xkomfk       = gt_xkomfk
                    xkomv        = gt_xkomv
                    xthead       = gt_xthead
                    xvbfs        = gt_xvbfs
                    xvbpa        = gt_xvbpa
                    xvbrk        = gt_xvbrk
                    xvbrp        = gt_xvbrp
                    xvbss        = gt_xvbss.
                CLEAR:   gt_xkomfk.
                REFRESH: gt_xkomfk.
              ENDAT.
              loop at gt_xvbfs.
                gs_vbeln-vbeln    = gt_xvbfs-vbeln.
                gs_vbeln-vbeln_so = GS_INIT_ITAB2-vbeln.
                append gs_vbeln to gt_vbeln.
              endloop.
    Call function module to create Invoice
              CALL FUNCTION 'RV_INVOICE_REFRESH'
                EXPORTING
                  WITH_POSTING = 'B'
                TABLES
                  XKOMFK       = GT_XKOMFK
                  XKOMV        = GT_XKOMV
                  XTHEAD       = GT_XTHEAD
                  XVBFS        = GT_XVBFS
                  XVBSS        = GT_XVBSS
                  XVBPA        = GT_XVBPA
                  XVBRK        = GT_XVBRK
                  XVBRP        = GT_XVBRP.
            WHEN 'Y1'.
    Create Billing document at end internal table all togather in one Billing document
              AT LAST.
                gs_vbsk-mandt = sy-mandt.
                gs_vbsk-smart = 'F'.
                gs_vbsk-ernam = sy-uname.
                gs_vbsk-erdat = sy-datum.
                gs_vbsk-uzeit = sy-uzeit.
                CALL FUNCTION 'RV_INVOICE_CREATE'
                  EXPORTING
                DELIVERY_DATE   = sy-datum
                    INVOICE_DATE    = sy-datum
                    INVOICE_TYPE    = p_fkart
                    PRICING_DATE    = sy-datum
                    vbsk_i          = gs_vbsk
                    with_posting    = 'B'
                    id_no_enqueue   = 'X'
                  IMPORTING
                    vbsk_e       = gs_vbsk
                  TABLES
                    xkomfk       = gt_xkomfk
                    xkomv        = gt_xkomv
                    xthead       = gt_xthead
                    xvbfs        = gt_xvbfs
                    xvbpa        = gt_xvbpa
                    xvbrk        = gt_xvbrk
                    xvbrp        = gt_xvbrp
                    xvbss        = gt_xvbss.
                CLEAR:   gt_xkomfk.
                REFRESH: gt_xkomfk.
              ENDAT.
              loop at gt_xvbfs.
                gs_vbeln-vbeln    = gt_xvbfs-vbeln.
                gs_vbeln-vbeln_so = GS_INIT_ITAB2-vbeln.
                append gs_vbeln to gt_vbeln.
              endloop.
          ENDCASE.
        endloop.
        commit work.
    Regards,
    Tim

  • RV_INVOICE_CREATE  - enqueue not required

    Hi pals,
      I am using RV_INVOICE_CREATE to simulate billing.
      But the documents delivery documents are gettting locked. How do I use the FM without locking the documents?
    thanks
    Krishnan

    Hi,
    Please try to fill I_ANALYZE_MODE parameter in FM RV_INVOICE_CREATE  perhaps it may help.
    Regards,
    Ferry Lianto

  • Regarding sy-index and sy-tabix

    Hi,
    What is the major difference between sy-index and sy-tabix ,
      can you give me one good example with code..
    Regards,
    Reddy.

    Hi,
    SY-TABIX - Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY_INDEX - In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
    sy-tabix is the tab index - the index of the record in the internal table you are accessing,
    sy-index is the loop counter.
    If you use a condition in LOOP the sy-index will go from 1 to n, but sy-tabix will refer to the line in the internal table.
    Hope this helps u.
    Thanks,
    Ruthra

  • Regarding Field Missing in Dso Transformation

    Hi
    Folks
    I am facing the issue like
    In Datasouce to DSO transformation i can see the 55 objects in DSO table, and in DSO to Cube Transformation i can see 54 fields in DSO table, one field is missing , the object  0TXTSH(short discription) is mapped to field 0TXZ01in DS to DSO transformation.
    so How can i get the field in DSO to Cube transformation.??
    any settings have to be change???
    waiting for yours Valuable answers
    Regards
    Anand

    Hi,
    Please identify the object and check it whether it is an attribute or a characteristic, if it is attribute only disable that option then check it.
    Regards,
    Srinivas

  • I am having an issue regarding a placed order via customer service department

    I recently relocated to Anchorage Alaska as part of a permanent change of station per the United States Air Force. I was initially located on the East Coast in the lower 48 and at the time of activating my contract I had purchased two separate Iphone 4 devices. I also recently went in to a store in February to purchase a Nexus 7 as well.
    Upon arrival in Anchorage I had multiple issues regarding the Iphone 4 devices including being unable to send and receive text messages & imessages, unable to make phone calls, dropped phone calls, unable to utilize GPS, as well as not being able to access general account information and use anything related to web browsing or data usage. It was determined that because the Iphone 4 operates on the 3g network and Verizon does not have a 3g network in Alaska, as a result I was utilizing an extended service network from another carrier. As a result of this I am only able to use my Iphone 4 devices while connected to my wi-fi network while within my home, which is totally unacceptable.
    I was not made aware that I would be dealing with this when I moved to Alaska and inquired as the the use of the devices I currently owned prior to purchasing the tablet. I was assured by three separate store employees one of which being a manager that all devices would function at 100% efficiency including the Iphone 4s. In fact I was recently billed 350$ for roaming charges last month, which prompted me to speak with a representative via the online chat regarding the significant increase she said that she was unable to process any sort of credit to the account regardless of what I had been told at a local Verizon store where I purchased the tablet.
    As a result of all of these mishaps since arriving here in Alaska I determined I was in need of newer devices that utilize the 4G LTE network currently provided by Verizon in Alaska. I know for a fact that the 4G LTE works great up here because my Nexus 7 tablet runs flawlessly and does not incur roaming charges when utilizing the 4G LTE network.
    Yesterday I attempted to contact Verizon through the live chat feature regarding upgrading two of the devices on my account. The live chat representative immediately asked me when my upgrade date was. Upon telling her my upgrade date 9/29/2014 she told me I should contact the customer service department as I might be eligible for an early upgrade. I then proceeded to contact the customer service department using my Iphone 4.
    My attempt to speak to anyone in the customer service department resulted in a merry-go-round of being put on hold 6 separate times by two different employees, both of which had me wait for more than an hour while they attempted to speak to a manager to gain approval for an early upgrade. The first rep seemed almost sure she would be able to have my devices upgraded early especially considering the issues I was having regarding service.
    The second rep seemed newer and was very dodgy about my questions and was very unwilling to help at first. He even mentioned that I had been a Verizon customer for almost two years, had never missed a single payment and had outstanding account history which should have garnered some sort of importance to the level of my request. But I digress, during this time I was disconnected from the call twice from each separate representative.
    Both reps assured me they would call me back, I never did get a call back from either one of those reps and I was becoming very frustrated having waited four hours trying to find some sort of solution to my current predicament.
    After waiting an hour for the second representative to call back I grew impatient and contacted the customer service department, was put on hold again, and finally reached a third customer service representative who was able to provide a solution for me.
    I explained everything I had been dealing with to Cory ID #  V0PAC61, both regarding the phones, the issue of the level of service I was receiving, the dire need for working devices and the multiple times I had been disconnected. I explained to him as a result of these issues I was certainly considering switching to a different provider, a local provider even who could provide me the adequate service that I require for my mobile devices.
    I explained to Cory that I had been with Verizon for almost two years, and I had been on a relatives account prior to owning my own Verizon account and had never received this kind of treatment when trying to work towards a simple solution. Cory proceeded to tell me he needed to put me on hold to see if there was anything that could be done regarding the upgrades of the device considering all of the trouble I had been dealing with.
    After Cory reconnected with me in the phone call he was able to successfully reach a solution by allowing me to upgrade my devices. We conversed about the options available and I eventually decided to upgrade both Iphone 4 devices to Moto X devices as we determined those would be sufficient for my needs while in Alaska. I also proceeded to add two Otter Box Defender cases to the order so that the devices would have sufficient protection. Cory inquired as to whether or not I would like to purchase insurance for the phones as well and I opted for the $5.00 monthly insurance which including damage and water protection.
    Cory explained to me the grand total for the devices which included an activation fee of $35.00 for each device, $49.99 for each Otter Box case, and an additional $50.00 for each device which would be refunded as a rebate upon receipt of the devices and activation, a rebate that I would be required to submit. Cory explained to me that the devices would most likely arrive Tuesday of 6/17 and no later than Wednesday 6/18.
    Cory took my shipping information and told me everything was all set and the only thing left to do was to transfer me to the automated service so that I could accept the 2 year agreement for both devices. I thanked him very much, took his name and ID# so that I might leave positive feedback about his exemplary customer service and was then transferred to the automated service.
    Once transferred to the automated service I was then prompted to enter both telephone numbers for the devices that would be upgraded, I was then required to accept the new 2 year agreement for both devices and after doing so I was required to end the call. I did so in an orderly fashion and expected a confirmation # to arrive in my email regarding the placed order.
    I have never received a confirmation email. I decided to sleep on it and assumed a confirmation email would be sent sometime tomorrow. Nothing has since been received however. I woke up early this morning around 6AM Alaska time to speak to another live chat representative, Bryan, in the billing department who assured me the order was currently processing and verified the order #. I asked him whether or not it was typical for a customer to not receive a confirmation email for an order placed and he said it can sometimes take up to 2-3 business days. He then stated that he had taken note of the issues I was experiencing and told me he would transfer me to the sales department as they would be able to provide more information regarding the shipment of both devices and a confirmation email, as he stated he did not want me to have to wait any longer than necessary to receive said devices.
    I was then transferred to Devon in the sales department via the live chat service where I was then required to repeat everything I had said to both Bryan and the other representatives I had spoken too. After a lengthy discussion and repeating everything I have just wrote he told me the order was indeed processing and that he would send a confirmation email in the next 30 minutes.
    That was 2 hours ago. It is now 8am Alaska time and I still have not received a confirmation email regarding my order. I was sent an email by Verizon an hour ago stating I had a device to "discover". The email contained no information regarding the shipment of my device, the order confirmation number, or anything regarding my account. The email I received was a typical spam email asking an individual to check out the current available phones and sign up for a new contract.
    All I want is a confirmation email to assure that the devices are being sent. I need my phone for work and to communicate with my family in the lower 48. I desperately need to make sure that the device is in fact being sent to the proper address, this is why a confirmation email of the order is so important. I do not care about the shipping speed I just want what I ask to be taken care of for a change. I would hate to sit here unable to determine what the status of my devices are only for the order to be stuck in "processing" limbo and be unable to receive the devices when I was told they would be sent.
    I feel I have been given the run around treatment way more than is typically given with any company when an individual is trying to work towards a solution. I have been patient and cordial with everyone I have spoken with, I have not raised my voice or shown stress or anger towards the situation I have only tried my best to work towards a solution with anyone I have spoken too but I am becoming increasingly frustrated with this situation.
    Any help regarding this matter would be greatly appreciated. This situation has left a sour taste in my mouth and if the devices were indeed not actually processed in an order, or they were not shipped correctly, or in fact if the order had never existed at all it will only deter me from keeping my Verizon account active and affect my decision to switch to another provider.

        Hello APVzW, we absolutely want the best path to resolution. My apologies for multiple attempts of replacing the device. We'd like to verify the order information and see if we can locate the tracking number. Please send a direct message with the order number so we can dive deeper. Here's steps to send a direct message: http://vz.to/1b8XnPy We look forward to hearing from you soon.
    WiltonA_VZW
    VZW Support
    Follow us on twitter @VZWSupport

  • Vendor Line item with Opening and Closing Balances report regarding

    Dear All,
    I need a report for vendor line items with Opening and Closing balances.
    Thanks in advance
    Sateesh

    Hi
    Try S_ALR_87012082 - Vendor Balances in Local Currency
    Regards
    Sanil Bhandari

  • Regarding training and event management queries

    hi experts,
    in my company we have ess in which training and event management module is working fine.i need to develop a report in which training booked against employee through tc-psv1 means in sap-r/3 and through ess means tc-pv8i will come.means saggregation for sap r/3 and ess will come.
    please help me regarding this.
    how will i identifie that training has been booked against employees  through sap r/3 or ess on what paramenet we will identifie.
    plz help me....
    is there any function module;....

    solved by own

Maybe you are looking for