Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SD Invoice Price Conditions (Simulations)

Hi all

I would like to simulate pricing conditions on SD invoice (already registered in FI). A bapi doing this particoular process would be great... but I cannot find nothing. Also a FM or BAPI to simulate/create without posting an invocice SD that return price conditions could be good: I tried  BAPI_BILLINGDOC_CREATEMULTIPLE and  BAPI_BILLINGDOC_SIMULATE, but KOMK is only in input and not in output. Does anybody have some hints ?

Thanks and regards

Gabriele

Tags:
Former Member
Former Member replied

Solved. Here's the solution I found DIGGING in the standard program for bonus, processing and re-evaluating invoice (already in accounting). Hope this help who will have the same problem

PARAMETER vbeln TYPE vbrk-vbeln.

START-OF-SELECTION.

   DATA wa_vbrk TYPE vbrk.

   DATA  xkomv   TYPE TABLE OF  komv.

   DATA  xvbpa   TYPE TABLE OF  vbpavb.

   DATA  xvbrk   TYPE TABLE OF  vbrkvb.

   DATA  xvbrp   TYPE TABLE OF  vbrpvb.

   DATA  xkomfk  TYPE TABLE OF  komfk .

   DATA  xvbfs   TYPE TABLE OF  vbfs .

   DATA  xvbss   TYPE TABLE OF  vbss .

   SELECT SINGLE *

     FROM vbrk

     INTO wa_vbrk

     WHERE vbeln EQ vbeln.

   CALL FUNCTION 'RV_INVOICE_DOCUMENT_READ'

     EXPORTING

       activity             = '02'      

       konv_read            = 'X'

       no_nast              = 'X'

       vbrk_i               = wa_vbrk

       i_no_authority_check = 'X'

     TABLES

       xkomv                = xkomv

       xvbpa                = xvbpa

       xvbrk                = xvbrk

       xvbrp                = xvbrp

       xkomfk               = xkomfk

     EXCEPTIONS

       error_message        = 4

       OTHERS               = 4.

   DATA vbsk_i TYPE vbsk.

   DATA vbsk_e TYPE vbsk.

   DATA xkomk  TYPE TABLE OF  komk.

   DATA xkomp  TYPE TABLE OF komp.

   DATA xthead TYPE TABLE OF theadvb.

   CALL FUNCTION 'RV_INVOICE_DOCUMENT_UPDATE'

     EXPORTING

       vbsk_i       = vbsk_i

       pricing_type = 'B'

     IMPORTING

       vbsk_e       = vbsk_e

     TABLES

       xkomfk       = xkomfk

       xkomk        = xkomk

       xkomp        = xkomp

       xkomv        = xkomv " <====== NEW CONDITION HERE !!

       xthead       = xthead

       xvbfs        = xvbfs

       xvbpa        = xvbpa

       xvbrk        = xvbrk

       xvbrp        = xvbrp

       xvbss        = xvbss

     EXCEPTIONS

       OTHERS       = 1.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question