<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to create invoice using bapi  base on delivery number with example in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853983#M1320178</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Pass the delivery no to the FM to create the invoice
 	 wa_vbsk-smart = u2018Fu2019.
        wa_komfk-vbeln = nast-objky. u201CuF0DF-----delivery number
        APPEND wa_komfk TO it_komfk.
        CLEAR wa_komfk.
*    To fill the message structure
*        l_wa_error-vbeln_vl = nast-objky. " Delivery No.
*        l_wa_error-fkart = wa_ztab-bil_doc_type." Billing Doc type

        CALL FUNCTION 'RV_INVOICE_CREATE'
                EXPORTING
*                 delivery_date             = 0
                 invoice_date              = v_date  u201C&amp;lt;- date
*                 invoice_type              = '    '
*                 pricing_date              = 0
                 vbsk_i                    = wa_vbsk
                 with_posting              = u2018Du2019
*                 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               =
*               DET_REBATE                =
                TABLES
                  xkomfk                    = it_komfk
                  xkomv                     = it_komv
                  xthead                    = it_thead
                  xvbfs                     = it_vbfs
                  xvbpa                     = it_vbpa
                  xvbrk                     = it_xvbrk
                  xvbrp                     = it_vbrp
                  xvbss                     = it_vbss
*               XKOMFKGN                  =
*               XKOMFKKO                  =
                        .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2009 12:24:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-06T12:24:33Z</dc:date>
    <item>
      <title>how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853978#M1320173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl give me one &lt;STRONG&gt;example&lt;/STRONG&gt; to create invoice using bapi base on delivery number (PGI).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 09:20:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853978#M1320173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T09:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853979#M1320174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This BAPI helps to create invoice number,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_BILLINGDOC_CREATE :This will call VF01 tcode where u can pass delivery number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_BILLINGDOC_CREATEFROMDATA:I In this , fill the parameters of BILLING_DATA_IN , in this ther is field ref_doc where u can pass the delivery number,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:wa type BAPIVBRK,&lt;/P&gt;&lt;P&gt;        it type table of BAPIVBRK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-DOC_TYPE = 'ZF2'.&lt;/P&gt;&lt;P&gt;wa-PLANT = '1601'.&lt;/P&gt;&lt;P&gt;wa-REF_DOC = delivery number.&lt;/P&gt;&lt;P&gt;append wa to it.&lt;/P&gt;&lt;P&gt;like this u can pass the fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then call this BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_BILLINGDOC_CREATEMULTIPLE :This will create the mutilple billing documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want more details regarding this got BAPI transaction , u will get all the details or u can view with SE37 also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anagha Deshmukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 09:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853979#M1320174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T09:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853980#M1320175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krupa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have came across the same requirment and i used a bdc program for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-tcode eq 'VF01' and  xvbrk-vkorg eq 'JMG'.

data:
 lw_charg type lips-charg,             " Batch number
 lw_mblnr type mseg-mblnr,             " Number of Material Document
 lw_mjahr type mseg-mjahr,             " Document number
 lw_vbelv type vbfa-vbelv,             " Delivery document
 lw_fkdat type rv60a-fkdat,            " Billing date
 lw_fbuda type rv60a-fbuda,            " Services rendered
 lw_prsdt type rv60a-prsdt,            " Pricing date
  lw_date_format(10) type c.           " System date
DATA:
 t_bdc TYPE TABLE OF bdcdata,          " BDC table
 fs_bdc TYPE bdcdata.                  " BDC workarea

get parameter id: 'FKDAT' field lw_fkdat,
                  'FBUDA' field lw_fbuda,
                  'PRSDT' field lw_prsdt.


 select charg                          " Batch
        from lips
        into lw_charg
        where vbeln eq xkomfk-vbeln.
 endselect.

*if lw_charg is initial.
* exit.
*endif.                                 " If lw_charg is initial

 select mblnr                          " Material document
        mjahr                          " Year
       from mseg
       into (lw_mblnr,lw_mjahr)
       where bwart eq '633'
       and xauto eq space
       and charg eq lw_charg
       and bukrs eq 'VCL'.
 endselect.

* if lw_mblnr is initial or lw_mjahr is initial.
*  exit.
* endif.                                " If lw_mblnr is initial&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 09:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853980#M1320175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T09:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853981#M1320176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Contiuation..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select vbelv                           " Delivery Doc.
       from vbfa
       into lw_vbelv
       where vbeln eq lw_mblnr
       and vbtyp_v eq 'J'
       and MJAHR eq lw_mjahr.
endselect.

*if lw_vbelv is initial.
*exit.
*endif.                                 " If lw_vbelv is initial

  fs_bdc-program  = 'SAPMV60A'.
  fs_bdc-dynpro   = '0102'.
  fs_bdc-dynbegin = 'X'.
  APPEND fs_bdc TO t_bdc.
  CLEAR fs_bdc.

  fs_bdc-fnam     = 'BDC_OKCODE'.
  fs_bdc-fval     = 'SICH'.
  APPEND fs_bdc TO t_bdc.
  CLEAR fs_bdc.

  fs_bdc-fnam     = 'RV60A-FKART'.
  fs_bdc-fval     = 'ZVF2'.
  APPEND fs_bdc TO t_bdc.
  CLEAR fs_bdc.

if not lw_fbuda is initial.
write lw_fbuda to lw_date_format.

  fs_bdc-fnam     = 'RV60A-FBUDA'.
  fs_bdc-fval     = lw_date_format.
  APPEND fs_bdc TO t_bdc.
  CLEAR: fs_bdc,
         lw_date_format.
endif.

if not lw_fkdat is initial.
write lw_fkdat to lw_date_format.
  fs_bdc-fnam     = 'RV60A-FKDAT'.
  fs_bdc-fval     = lw_date_format.
  APPEND fs_bdc TO t_bdc.
  CLEAR: fs_bdc,
         lw_date_format.
endif.

if not lw_prsdt is initial.
write lw_prsdt to lw_date_format.

  fs_bdc-fnam     = 'RV60A-PRSDT'.
  fs_bdc-fval     = lw_date_format.
  APPEND fs_bdc TO t_bdc.
   CLEAR: fs_bdc,
         lw_date_format.
endif.

  fs_bdc-fnam     = 'KOMFK-VBELN(01)'.
  fs_bdc-fval     = lw_vbelv.
  APPEND fs_bdc TO t_bdc.
  CLEAR fs_bdc.
 CALL TRANSACTION 'VF01' USING t_bdc mode 'P' update 'A'.
 endif.                                " IF SY-TCODE EQ 'VF01'
ENDENHANCEMENT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Hareesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 09:56:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853981#M1320176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T09:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853982#M1320177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi hareesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from where u fetch xkomfk-vbeln?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 11:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853982#M1320177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T11:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853983#M1320178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Pass the delivery no to the FM to create the invoice
 	 wa_vbsk-smart = u2018Fu2019.
        wa_komfk-vbeln = nast-objky. u201CuF0DF-----delivery number
        APPEND wa_komfk TO it_komfk.
        CLEAR wa_komfk.
*    To fill the message structure
*        l_wa_error-vbeln_vl = nast-objky. " Delivery No.
*        l_wa_error-fkart = wa_ztab-bil_doc_type." Billing Doc type

        CALL FUNCTION 'RV_INVOICE_CREATE'
                EXPORTING
*                 delivery_date             = 0
                 invoice_date              = v_date  u201C&amp;lt;- date
*                 invoice_type              = '    '
*                 pricing_date              = 0
                 vbsk_i                    = wa_vbsk
                 with_posting              = u2018Du2019
*                 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               =
*               DET_REBATE                =
                TABLES
                  xkomfk                    = it_komfk
                  xkomv                     = it_komv
                  xthead                    = it_thead
                  xvbfs                     = it_vbfs
                  xvbpa                     = it_vbpa
                  xvbrk                     = it_xvbrk
                  xvbrp                     = it_vbrp
                  xvbss                     = it_vbss
*               XKOMFKGN                  =
*               XKOMFKKO                  =
                        .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 12:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853983#M1320178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T12:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853984#M1320179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kartik,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;as  u told i write but not working so please tell where is my mistake?&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lt_vbsk LIKE vbsk,
lt_xkomfk LIKE komfk OCCURS 0 WITH HEADER LINE,
lt_xvbfs LIKE vbfs OCCURS 0 WITH HEADER LINE,
lt_xkomv LIKE komv OCCURS 0 WITH HEADER LINE,
lt_xthead LIKE theadvb OCCURS 0 WITH HEADER LINE,
lt_xvbpa LIKE vbpavb OCCURS 0 WITH HEADER LINE,
lt_xvbrk LIKE vbrkvb OCCURS 0 WITH HEADER LINE,
lt_xvbrp LIKE vbrpvb OCCURS 0 WITH HEADER LINE,
lt_xvbss LIKE vbss OCCURS 0 WITH HEADER LINE.

REFRESH lt_xkomfk.
lt_xkomfk-VBELN = '4888073'.
lt_xkomfk-VBTYP = 'J'.
append lt_xkomfk.

lt_vbsk-smart = 'F'.
lt_vbsk-ernam = sy-uname.
BREAK DEVELOPER.
CALL FUNCTION 'RV_INVOICE_CREATE'
EXPORTING
* DELIVERY_DATE = 0
* INVOICE_DATE = 0
* INVOICE_TYPE = ' '
* PRICING_DATE = 0
vbsk_i = lt_vbsk
*WITH_POSTING = 'B'
WITH_POSTING = 'D'
* SELECT_DATE = 0
* I_NO_VBLOG = ' '
* I_ANALYZE_MODE = ' '
* ID_UTASY = ' '
* ID_UTSWL = ' '
* ID_UTSNL = ' '
* ID_NO_ENQUEUE = ' '
* ID_NEW_CANCELLATION = ' '
* I_BLART = ' '
IMPORTING
VBSK_E = lt_vbsk
* OD_BAD_DATA =
* DET_REBATE =
tables
xkomfk = lt_xkomfk
xkomv = lt_xkomv
xthead = lt_xthead
xvbfs = lt_xvbfs
xvbpa = lt_xvbpa
xvbrk = lt_xvbrk
xvbrp = lt_xvbrp
xvbss = lt_xvbss.
* XKOMFKGN =
* XKOMFKKO =
BREAK DEVELOPER.
if sy-subrc eq 0.
commit work.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 12:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853984#M1320179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T12:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853985#M1320180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 12:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853985#M1320180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T12:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853986#M1320181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krupa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How did u solved the issue ?  I am facing the similar kind of problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 09:58:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853986#M1320181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-05T09:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to create invoice using bapi  base on delivery number with example</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853987#M1320182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read my above thread which i past code through this i solve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 10:30:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-invoice-using-bapi-base-on-delivery-number-with-example/m-p/5853987#M1320182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-05T10:30:40Z</dc:date>
    </item>
  </channel>
</rss>

