SAP Simulate VF01 – Billing Document with Accounting Document

Bruno Xavier

January 11, 2012 17 minute read

Dashboard

…

ERP SD Billing Troubleshooting Guide

Skip to end of banner

Go to start of banner

Accounting document creation from SD Troubleshooting

Skip to end of metadata

Created by Christian Rosa, last modified by Kelly Ynoue on Oct 04, 2016

Go to start of metadata

FAQ in Accounting document creation from SD (SD-FI Interface)

How to analyze the creation of the accounting document from SD billing

Debugging hints for Error RW022 and F5702

F5 351 Account is blocked for posting

General Information About SD-FI Interface

Dashboard

…

Accounting document creation from SD Troubleshooting

Skip to end of banner

Go to start of banner

How to analyze the creation of the accounting document from SD billing

Skip to end of metadata

Created by Kelly Ynoue, last modified on Oct 04, 2016

Go to start of metadata

To analyze the creation of an accounting document from an SD Billing document, set a breakpoint in function module RV_ACCOUNTING_DOCUMENT_CREATE.

Function module RV_ACCOUNTING_DOCUMENT_CREATE is triggered by:

Function module RV_ACCOUNTING_DOCUMENT_CREATE  is called by function module RV_INVOICE_DOCUMENT_ADD.

If the accounting document is already created, you may use the simulation report SAPFACC0 or SAPFACC1. Both reports provide a list (an overview) about all posted lines and accounts.

To trigger function module RV_ACCOUNTING_DOCUMENT_CREATE of an existing accounting document, follow the steps:

Run SE38 or SA38.

Run report SAPFACC0 or SAPFACC1.

Enter the billing document number. Never select update run, if this option "update run" appears.

The difference between reports SAPFACC0 or SAPFACC1 is the selection of the concerned billing document.

In report SAPFACC0, the selection of the billing document is via a direct SELELCT FROM TABLE, and is therefore limited.

In report SAPFACC1, the selection of the billing document is via function module RV_INVOICE_DOCUMENT_READ. It allows also an investigation in business processes with: costs (condition VPRS), transfer prices, revenue recognition and (partially) down payment.

If you don't know the message ID and number and the billing document was created and released to accounting by collective processing, check the log following these steps:

1. Pick up the billing document number.

2. Run transaction SE16, table VBSS, and enter the billing document number in VBELN. If there is an entry, the billing document was created by a job.

3. Write down the group number (SAMMG).

4. Run transaction V.21 and enter the group number.

You can find further information (specially about debugging) in page: General Information About SD-FI Interface.

Dashboard

…

Accounting document creation from SD Troubleshooting

Skip to end of banner

Go to start of banner

FAQ in Accounting document creation from SD (SD-FI Interface)

Skip to end of metadata

Created by Kelly Ynoue, last modified on Dec 11, 2017

Go to start of metadata

You'll be able to easily find out the answer/solution by yourself for the most frequently asked questions in SD-FI interface on this page.

For an easier search, you can use Ctrl + F to find a specific error message, for example.

If you have issues when creating a billing document, access the FAQ in SD-BIL-IV - Processing of billing documents.

If you have issues when cancelling a billing document, access the FAQ in Billing Cancellation.

Simulate VF01 – Billing Document with Accounting Document

FollowRSS feedLike

1 Like 5,669 Views 0 Comments

This blog is published in the language “Portuguese” permitted by new policies of SDN.

Introduction/Introdução:

Portuguese:

Com esse Blog você vai ver uma maneira que eu desenvolvi para simular o documento contábil de FI antes de gravar a Fatura de SD pela transação VF01.

Esse programa foi útil em cliente onde o índice de estornos VF11 estava muito alto porque os documentos contábeis foram gerados incorretamente e porque não há uma maneira standard para simular o documento contábil pela VF01 até onde eu sei.

Primeiramente irei mostrar três cenários:

1) Simulação do documento contábil da VF01 baseado em remessa VL01N

2) Simulação do documento contábil da VF01 baseado em ordem de venda VA01

3) Simulação de um erro O programa não é perfeito, sinta-se a vontade para adaptar o código fonte.

OBS: os cenários são fictícios e não correspondem os valores da realidade.

English:

With this blog you will see a way that I developed of simulate FI accounting document before saving the SD Billing Document for the transaction VF01.

This program was useful in client where the rate of reversals VF11 was very high because the accounting documents were generated incorrectly and because there is no standard way to simulate the accounting document by VF01 as far as I know.

First I will show three scenarios:

1) Simulation accounting document with the VF01 based document delivery VL01N

2) Simulation accounting document with VF01 based sales order VA01

3) Simulation of an error The program is not perfect, feel free to adapt the source code.

NOTE: The scenarios are fictitious and do not match reality values

1) Simulação do documento contábil da VF01 baseado em remessa VL01N

No programa Z, informe a remessa e execute F8

O programa Z irá mostrar como deve ficar o documento contábil:

Criando o documento real de faturamento na transação VF01 com a mesma remessa:

Documento que foi gerado:

Conferindo o fluxo de documentos na transação VF03 para ter a certeza dos documentos gerados:

Conferindo o documento contábil ainda na transação VF03:

Resultado final: Documento real ficou igual ao simulado.

2) Simulação do documento contábil da VF01 baseado em ordem de venda VA01

No programa Z, informe a ordem de venda/item e execute F8

O programa Z irá mostrar como deve ficar o documento contábil:

Criando o documento real de faturamento na transação VF01 com a mesma ordem de venda:

Documento que foi gerado:

Conferindo o fluxo de documentos na transação VF03 para ter a certeza dos documentos gerados:

Conferindo o documento contábil ainda na transação VF03:

Resultado final: Documento real ficou igual ao simulado.

3) Simulação de um erro

Nesse exemplo tenho uma remessa com problema na determinação de conta. O programa irá mostrar os erros em um pop-up.

Código Fonte:

Customer-Exit: EXIT_SAPLV60B_008

Ampliação: SDVFX008

Transaction Button
VF01 Save
VF02 Release to accounting  (if posting block is set in billing type customizing VOFA)
VFX3 Release to accounting  (if posting block is set in billing type customizing VOFA)
VF11 Save
Error messages
Questions you may have SAP Notes/KBAs/Wikis that you should check
How can I solve error message F5702 or RW022 "Balance in Transaction Currency"? 1459805 - Error F5702 or RW022 Balance in Transaction Currency when releasing SD invoice to accounting 160211 - Using USER_EXIT creates data inconsistency 662011 - VF02 Error Message: Balance in Transaction Currency 2088382 - RW 022 when cancellation billing document posted
How can I solve the error message VF072 "Document has been saved (foreign trade data incomplete)"? 1459330 - Error Message: VF072 Foreign Trade Data Incomplete 1711342 - VF072 Due to missing export data billing document can not be released to accounting
How to solve error message F5727 "Maximum number of items in FI reached"? 2078335 - FAQ: Error F5 727 when posting via Accounting Interface 1675235 - Error message F5727 "Maximum number of items in FI reached" when release SD billing document to accounting 511873 - Invoice lists with more than 999 FI items
How to solve error message F5 350 "Account type/account for invoice reference does not match item" while releasing credit or debit memo to accounting? 1669117 - Error message F5350 while release credit or debit memo to accounting.
How to solve error message F5A005 "Reversal of document &v1 &v2 &v3 not possible in FI" when trying to release the cancelation invoice to accounting? 1938325 - Error F5A005 when releasing cancelation billing document to accounting Wiki page: Error message F5A005 during release of a cancelation invoice to accounting
How to solve error message RW030 "Incorrect call up of function module AC_DOCUMENT_CVTYP_GET"? Wiki page: RW030 Incorrect call up of function module AC_DOCUMENT_CVTYP_GET
How to solve error message F5A 190 "Enter a business place under Basic data"? Wiki page: F5A 190: Enter a business place under Basic data
How to solve error message F5 351 "Account is blocked for posting"? 1592428 - Account is blocked for posting - error message F5 351 - During invoice releasing Wiki page: F5 351 Account is blocked for posting
How to solve error message FF 848 "Entry of tax for &1 &2 is not possible because of tax base 0"? Blog: SD-FI: Error FF848 when releasing billing document to accounting
How to solve error message F5 788 "Reconciliation account & or short key & is not permitted"? 409824 - F5788 if releasing a billing document
How can I solve error message F5 151: "Incorrect doc.no.: &. Select document number between & and &" during invoicing simulation? 321410 - Error message F5 151 during invoicing simulation
When I transfer billing documents using the "Release Billing Documents for Accounting" transaction or the SDBLBDDL report, the system issues an error  (VR123, VR124) due to missing authorization despite the fact that you have all the authorization required. How to solve this issue? 1242755 - VFX3: Authorization check "several sales organizations"
How to solve error message KI 235 "Account <(>&<)> requires an assignment to a CO object"? 898356 - Cost center is not copied to the billing document
How to solve error message FF 759 "Cannot post document: tax base in local currency is zero"? 1988553 - Cannot post document: tax base in local currency is zero - Message no. FF759 - Release to Accounting
How to solve error message F5 808 "Field Bus. Area is a required field for G/L account &."? 1952409 - VF02 - Field Business Area is a required field for G/L account - F5808 Wiki page: Missing Business Area (GSBER) in the customer line item
How to solve error message F5 808 "Field Cost Center is a required field for G/L account"? 1898299 - Not able to create accounting documents - Message no. F5808
How to solve error message F5 808 when transfering the fields State Central Bank Indicator (LZBKZ) or Supplying country (LANDL)? 27067 - Transfer of LZBKZ and LANDL from SD to FI
How to solve error message F5 670: "No account is specified in item 'nnnnnnnn'"? 146879 - G/L account missing when billing doc released
How to solve error message "Customer must be created in the company code"? 33533 - Billing release for sold-to party w/o accounting
How to solve ABAP runtime error "SYSTEM_IMODE_TOO_LARGE" during the cancellation of a billing document? 639138 - VF11: Cancellation of billing documents with many line items
How to solve error message VF 156 "Error & while substituting WBS element &"? 672929 - No billing due to error VF156
Exchange rate
Questions you may have SAP Notes/KBAs/Wikis that you should check
How is the exchange rate transferred from SD to accounting? 1481238 - How are different exchange rates (Price, FI postings and Conditions) determined in billing documents
How can I change the system behavior regarding the exchange rate transferred from SD to accounting? 36070 - Fixed foreign currency rate for Accounting document
How can I change the system behavior regarding the exchange rate type? 22781 - Foreign currency rate for accounting, exchange rate type
Why is there currency translation difference for the cost (condition VPRS)? 136078 - Currency translation difference for the cost
Posting Period
Questions you may have SAP Notes/KBAs/Wikis that you should check
I can create a billing document although the billing date lies within a closed posting period. How to prevent this? 180756 - Billing during closed posting period
I can post a billing document to accounting despite of closed posting period. I expect error message F5201: "Posting period & & is not open". How to solve this issue? 145468 - Missing check for closed posting period
Fields
Questions you may have SAP Notes/KBAs/Wikis that you should check
Why is the quantity field (BSEG-MENGE) initial / blank / not filled? 2123259 - Quantity in subsequent FI accounting document of SD billing
Why is the Business Area (BSEG-GSBER) initial / blank / not filled? 1952409 - VF02 - Field Business Area is a required field for G/L account - F5808 Wiki page: Missing Business Area (GSBER) in the customer line item
Why is the field 'Company ID of the trading partner' (BSEG-VBUND) initial / blank / not filled? 1712305 - Field BSEG-VBUND is not filled when FI document is created from SD
The field  "Number of the Invoice the Transaction Belongs to" (BSEG-REBZG) is wrong or missing. How to solve this issue? 2009346 - Number of the Invoice value unexpected
How to transfer the payment reference of the invoice list into the respective individual invoices? 364671 - Payment reference in invoice lists
How can I transfer the fields reference number (XBLNR) and assignment number (ZUONR) without the leading zeros? 72692 - SD-FI reference number without leading zeros
A billing document contains a term of payment for which a payment block is defined in Customizing. However, the payment block is not transferred during the release of this billing document to accounting. How to solve this issue? 132701 - Payment block not transferred to FI
When I release a billing document, the quantities are updated twice in the cost accounting. How to solve this issue? 762216 - Double quantities in cost accounting
In a billing document, I can create or display the profit center document although I do not have the authorization. How to solve this issue? 724778 - Missing check for profit center document
Profitability Analysis uses characteristics which are available in the billing document but are not passed on to the Profitability Analysis (CO-PA). For example: the promotion ID (VBRP-KNUMA_PI), the sales deal (VBRP-KNUMA_AG),  the valuation type (VBRP-BWTAR), the batch (VBRP-CHARG). 70231 - Characteristics not forwarded to CO-PA
In credit memo cancellation, why does the system uses the terms of payment of the customer during the determination of the due date for net payment? 375363 - Incorrect due date for net payment if cancelling credit memo
Why does the accounting document display a cash discount base of zero? 108774 - Cash discount for billing docs w/ negative final amount
Userexits / Customer functions
Questions you may have SAP Notes/KBAs/Wikis that you should check
Which userexits are available for the transfer to accounting? 301077 - User exits for the interface for accounting 39503 - User exits in accounting interface
I want to implement userexit EXIT_SAPLV60B_010 or EXIT_SAPLV60B_011. What should I bear in mind? 160211 - Using USER_EXIT creates data inconsistency
How to solve ABAP runtime error PERFORM_NOT_FOUND in the function module SD_COND_DETERMINATION? 160211 - Using USER_EXIT creates data inconsistency
How to solve ABAP runtime error "T681Z_MISSING" occurs in the include LV61ZF0T? 160211 - Using USER_EXIT creates data inconsistency
Why is userexit EXIT_SAPLV60B_008 not executed? 515459 - EXIT_SAPLV60B_008 will not run
Performance
Questions you may have SAP Notes/KBAs/Wikis that you should check
How can I improve the performance during the transfer of billing documents to financial accounting when using the transaction 'Blocked Billing Document'? 315925 - Performance during release of bill doc or rebate settlement
I'm facing poor performance in billing document creation (VF01, VF04). How can I solve it? 841758 - Procedure when you experience performance problems
I'm facing poor performance in billing document creation (VF01, VF04) due to locks in table NRIV. During an analysis on general system performance you see many locks on table NRIV, traces bring up report SAPLSNR3being responsible for long runtime. 1524325 - Poor performance due to locks on table NRIV - Buffering of billing documents
Is there any other recommendation or note to improve the performance in billing creation? 1934946 - Performance Issue When Creating Billing Documents 23154 - VF04 SAPMV60S: Tuning --> Checklist + Notes 118743 - Collective note performance in SD 16430 - SD Customizing and performance/tuning 103212 - Bad performance during SD document update 1524325 - Poor performance due to locks on table NRIV - Buffering of billing documents 1524347 - Buffering of billing documents - invoice creation
Inconsistency
Questions you may have SAP Notes/KBAs/Wikis that you should check
I have a gap in billing numbering. How to proceed? 1695132 - Gap in billing document number 1575749 - SD billing and Italian legal requirement
The billing document has posting status (VBRK-RFBSK) = 'C' - completed, but the accounting document does not exists. How to correct the posting status? 571073 - Billing documents with status 'C' but w/o accounting docs
I have FI documents created from missing billing documents, or duplicate accounting documents. How to proceed? 1579523 - Billing document is missing eventhough accounting document is available - SD Billing
After a client copy, the accounting document is not visible in VF03 nor in the document flow. What is the reason? 1472346 - Accounting document not visible in VF03
Functionality
Questions you may have SAP Notes/KBAs/Wikis that you should check
In VFX3, I want the option of selecting via several sales organizations. How can I change the system behavior? 539615 - VFX3: Selection via several sales organizations
I can cancel a billing document, regardless of whether or not this billing document has already been cleared in accounting. How to prevent this? 1495733 - Cleared billing documents can be cancelled 1870023 - Cleared billing documents can be canceled (mod)
If the group valuation or profit center valuation is active, the summarization in the SD/FI interface is not carried out. How to solve this issue? 1443088 - Transfer prices: Tax code prevents summarization 141899 - Transfer price: lines with zero posting in FI document
Where can I find more information about cash discount or condition types SKTO and SKTV? Wiki page: Cash discount in SD
Where do I find further information about Accounting document creation from SD (SD-FI interface)? Troubleshooting guide: Accounting document creation from SD
Report: zsd_simula_vf01
REPORT zsd_simula_vf01 . TYPE-POOLS: slis. TYPES: BEGIN OF ty_bseg.         INCLUDE STRUCTURE bseg. TYPES:  ktext TYPE rfpsd-ktext,         kursf type acccr-KURSF,         END   OF ty_bseg,         ty_t_bseg TYPE TABLE OF ty_bseg. CONSTANTS: c_c(1)  TYPE c VALUE ‘C’,            c_j(1)  TYPE c VALUE ‘J’,            c_pcmt  TYPE skat-ktopl VALUE ‘PCMT’,            c_brl   type acccr-WAERS value ‘BRL’. PARAMETERS: p_vbeln TYPE likp-vbeln. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. PARAMETERS:             p_vbelnv type vbap-vbeln,             p_posnr  type vbap-posnr. SELECTION-SCREEN END OF BLOCK b1. DATA:       t_billing_data_in    TYPE TABLE OF    bapivbrk,       w_billind_data_in     LIKE LINE OF t_billing_data_in,       t_condition_data_in    TYPE TABLE OF bapikomv,       t_returnlog_out    TYPE TABLE OF bapireturn1,       t_success_doc_out    TYPE TABLE OF bapisucc,       t_xaccit         TYPE TABLE OF accit,       t_xacccr         TYPE TABLE OF acccr,       lv_simulate(1)        TYPE c,       xbseg                 TYPE ty_t_bseg,       w_bseg                LIKE LINE OF xbseg. DATA:       w_layout      TYPE slis_layout_alv,       w_gs_print    TYPE slis_print_alv,       t_fieldcat    TYPE slis_t_fieldcat_alv,       w_fieldcat    LIKE LINE OF t_fieldcat. START-OF-SELECTION.   if p_vbeln  is initial and      p_vbelnv is initial and      p_posnr  is initial. *Preencha Fornecedimento ou  OV/item.      message i208(00) with text-e03.      exit.   endif.   if not p_vbeln is initial and      ( not p_vbelnv is initial or        not p_posnr  is initial ). *Somente pode ser preenchido Fornecimento ou OV.      message i208(00) with text-e01.      exit.   endif. *Se fornecimento não for preenchido ordem e item são obrigatorios.   if p_vbeln is initial.      if p_vbelnv is initial or         p_posnr  is initial. *Documento ou  Item de venda não foi preenchido.        message i208(00) with text-e02.        exit.      endif.   endif. *Fornecimento/Picking   if not p_vbeln is initial.     CLEAR w_billind_data_in.     w_billind_data_in-ref_doc    = p_vbeln.     w_billind_data_in-ref_doc_ca = c_j.     APPEND w_billind_data_in TO t_billing_data_in.   else.     CLEAR w_billind_data_in.     w_billind_data_in-ref_doc    = p_vbelnv.     w_billind_data_in-ref_item   = p_posnr.     w_billind_data_in-ref_doc_ca = c_c.     APPEND w_billind_data_in TO t_billing_data_in.   endif. *Exporta para EXIT_SAPLV60B_008   lv_simulate = ‘X’.   EXPORT p1 = lv_simulate   TO MEMORY ID ‘ZBILLINGDOC_SIMULATE’.   CALL FUNCTION ‘BAPI_BILLINGDOC_SIMULATE’        TABLES             billing_data_in   = t_billing_data_in             condition_data_in = t_condition_data_in             returnlog_out     = t_returnlog_out             success_doc_out   = t_success_doc_out        EXCEPTIONS             error_message     = 1             OTHERS            = 2.   IF sy-subrc <> 0.     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.   ENDIF.   IMPORT p1 = t_xaccit[]          p2 = t_xacccr[]   FROM MEMORY ID ‘ZBILLINGDOC_SIMULATE_TAB’.   PERFORM f_preenche_alv.   PERFORM f_alv. *&———————————————————————* *&      Form  f_alv *&———————————————————————* *       text *———————————————————————-* *  –>  p1        text *  <–  p2        text *———————————————————————-* FORM f_alv. *Lista ALV igual a FB03 *Layout   w_layout-zebra = ‘X’.   w_layout-min_linesize = 100. *Print   w_gs_print-no_print_listinfos = ‘X’. *Fielcat   PERFORM f_fieldcat. *Libera o documento   ROLLBACK WORK.   CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’    EXPORTING         i_interface_check        = ‘ ‘ *     i_buffer_active             = ‘X’                      “ALRK241034         i_callback_program       = ‘ZSD_SIMULA_VF01’ *          i_callback_pf_status_set = ‘PF_STATUS_SET’ *          i_callback_user_command  = ‘HANDLE_USER_COMMAND’ *          I_STRUCTURE_NAME         = ‘BSEG’         is_layout                = w_layout         it_fieldcat              = t_fieldcat         i_default                = ‘X’         i_save                   = ‘A’                 “Note 319936         is_print                 = w_gs_print      TABLES           t_outtab                 = xbseg      EXCEPTIONS           program_error            = 1           OTHERS                   = 2.   IF sy-subrc <> 0.     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.   ENDIF. ENDFORM.                    ” f_alv *&———————————————————————* *&      Form  f_fieldcat *&———————————————————————* *       text *———————————————————————-* *  –>  p1        text *  <–  p2        text *———————————————————————-* FORM f_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘BUZEI’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘BUZEI’.   w_fieldcat-ref_tabname    = ‘BSEG’.   w_fieldcat-key            = ‘X’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘BSCHL’.   w_fieldcat-emphasize      = ‘$’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘BSCHL’.   w_fieldcat-ref_tabname    = ‘BSEG’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘HKONT’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘KONTO’.   w_fieldcat-ref_tabname  = ‘RFPSD’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘KTEXT’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘KTEXT’.   w_fieldcat-ref_tabname    = ‘RFPSD’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘ZUONR’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘ZUONR’.   w_fieldcat-ref_tabname    = ‘BSEG’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘MWSKZ’.   w_fieldcat-emphasize      = ‘$’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘MWSKZ’.   w_fieldcat-ref_tabname    = ‘BSEG’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘WRBTR’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_tabname    = ‘BSEG’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘DMBTR’.   w_fieldcat-tabname         = ‘XBSEG’.   APPEND w_fieldcat TO t_fieldcat.   CLEAR w_fieldcat.   w_fieldcat-fieldname      = ‘KURSF’.   w_fieldcat-tabname         = ‘XBSEG’.   w_fieldcat-ref_fieldname  = ‘KURSF’.   w_fieldcat-ref_tabname    = ‘ACCCR’.   APPEND w_fieldcat TO t_fieldcat. ENDFORM.                    ” f_fieldcat *&———————————————————————* *&      Form  f_preenche_alv *&———————————————————————* *       text *———————————————————————-* *  –>  p1        text *  <–  p2        text *———————————————————————-* FORM f_preenche_alv.   FIELD-SYMBOLS: <lf_xaccit> LIKE LINE OF t_xaccit,                  <lf_xacccr> LIKE LINE OF t_xacccr,                  <lf_bseg>   LIKE LINE OF xbseg.   DATA: lv_buzei TYPE bseg-buzei. *Primeiro acha o clientes   LOOP AT t_xaccit ASSIGNING <lf_xaccit>   WHERE kunnr <> space.     CLEAR w_bseg.     w_bseg-bschl = <lf_xaccit>-bschl.     w_bseg-hkont = <lf_xaccit>-kunnr.     w_bseg-zuonr = <lf_xaccit>-zuonr.     w_bseg-mwskz = <lf_xaccit>-mwskz.     SELECT SINGLE name1 INTO w_bseg-ktext     FROM kna1     WHERE kunnr = <lf_xaccit>-kunnr.     READ TABLE t_xacccr ASSIGNING <lf_xacccr>      WITH KEY posnr = <lf_xaccit>-posnr.     IF sy-subrc = 0.       w_bseg-wrbtr = <lf_xacccr>-wrbtr.       w_bseg-kursf = <lf_xacccr>-kursf. *Verifica se é diferente de BRL       if <lf_xacccr>-WAERS <> c_brl.           unassign <lf_xacccr>.           READ TABLE t_xacccr ASSIGNING <lf_xacccr>            WITH KEY posnr = <lf_xaccit>-posnr                     waers = c_brl.           if sy-subrc = 0.             w_bseg-dmbtr = <lf_xacccr>-wrbtr.           endif.       endif.     ENDIF.     IF NOT w_bseg-wrbtr IS INITIAL.       COLLECT w_bseg INTO xbseg.     ENDIF.   ENDLOOP. *Contas somente sem cliente   LOOP AT t_xaccit ASSIGNING <lf_xaccit>       WHERE hkont <> space AND             kunnr = space. *Somente pode entrar     CLEAR w_bseg.     w_bseg-bschl = <lf_xaccit>-bschl.     w_bseg-hkont = <lf_xaccit>-hkont.     w_bseg-zuonr = <lf_xaccit>-bldat.     w_bseg-mwskz = <lf_xaccit>-mwskz.     READ TABLE t_xacccr ASSIGNING <lf_xacccr>      WITH KEY posnr = <lf_xaccit>-posnr.     IF sy-subrc = 0.       w_bseg-wrbtr = <lf_xacccr>-wrbtr.       w_bseg-kursf = <lf_xacccr>-kursf. *Verifica se é diferente de BRL       if <lf_xacccr>-WAERS <> c_brl.           unassign <lf_xacccr>.           READ TABLE t_xacccr ASSIGNING <lf_xacccr>            WITH KEY posnr = <lf_xaccit>-posnr                     waers = c_brl.           if sy-subrc = 0.             w_bseg-dmbtr = <lf_xacccr>-wrbtr.           endif.       endif.     ENDIF. *TABLE BUFFER!!!     SELECT SINGLE txt50 INTO w_bseg-ktext     FROM skat     WHERE spras = sy-langu     AND   ktopl = c_pcmt     AND   saknr = <lf_xaccit>-hkont.     IF NOT w_bseg-wrbtr IS INITIAL.       COLLECT w_bseg INTO xbseg.     ENDIF.   ENDLOOP. *Arruma numeracao dos itens   LOOP AT xbseg ASSIGNING <lf_bseg>.     ADD 1 TO lv_buzei.     <lf_bseg>-buzei = lv_buzei.   ENDLOOP. ENDFORM.                    ” f_preenche_alv
INCLUDE ZXVVFU08
*———————————————————————-* *   INCLUDE ZXVVFU08                                                   * *———————————————————————-* CONSTANTS:       lc_xacchd(18) TYPE c VALUE ‘(SAPLV60B)xacchd[]’. DATA:       lv_simulate(1) TYPE c. FIELD-SYMBOLS: <lf_t_xacchd> TYPE STANDARD TABLE. IMPORT p1 = lv_simulate FROM MEMORY ID ‘ZBILLINGDOC_SIMULATE’. IF sy-subrc = 0 AND lv_simulate = ‘X’.   FREE MEMORY ID ‘ZBILLINGDOC_SIMULATE’.   ASSIGN (lc_xacchd) TO <lf_t_xacchd>.   IF <lf_t_xacchd> IS ASSIGNED.     CALL FUNCTION ‘AC_DOCUMENT_CREATE’          EXPORTING               i_free_table  = ‘ ‘          TABLES               t_acchd       = <lf_t_xacchd>               t_accit       = xaccit               t_acccr       = xacccr               t_accfi       = xaccfi          EXCEPTIONS               error_message = 01.     FREE MEMORY ID ‘ZBILLINGDOC_SIMULATE_TAB’.     EXPORT p1 = xaccit[]            p2 = xacccr[]     TO MEMORY ID ‘ZBILLINGDOC_SIMULATE_TAB’.   ENDIF. ENDIF.
Textos de Seleção e Símbolos de Texto
P_POSNR    Item Documento de Venda P_VBELN    Fornecimento/Picking P_VBELNV    Documento de vendas 001    OV Serviço E01    Somente pode ser preenchido Fornecimento ou OV. E02    Documento ou  Item de venda não foi preenchido. E03    Preencha Fornecedimento ou  OV/item.
返回FICO参考资料列表