SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Get pricing accounting values from billing



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD
View previous topic :: View next topic  
Author Message
vga
Мастер
Мастер


Age: 160
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jan 27, 2011 1:01 pm    Post subject: Get pricing accounting values from billing Reply with quote

Code:
FUNCTION zerum_pricing_rv.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_VBELN) TYPE  VBELN
*"     VALUE(I_POSNR) TYPE  POSNR
*"  TABLES
*"      T_OUTPUT STRUCTURE  KOMV
*"  EXCEPTIONS
*"      NOT_FOUND
*"----------------------------------------------------------------------
*  Function name                        : ZERUM_PRICING_RV
*  Development specification ID         :
*  Process team contact person/team name:
*  Date created                         :
*  Service Desk change number           :
*  Transport request number             :
*  Author                               :
*  Description                          : select conditions values
*                                         from RV
*----------------------------------------------------------------------*

  DATA: ls_komk    TYPE komk,
        ls_komp    TYPE komp.

  DATA: vbdkr TYPE vbdkr,
        vbco3 TYPE vbco3.

  DATA: BEGIN OF tvbdpr OCCURS 100.      "Internal table for items
          INCLUDE STRUCTURE vbdpr.
  DATA: END OF tvbdpr.
  DATA: BEGIN OF tkomv OCCURS 50.
          INCLUDE STRUCTURE komv.
  DATA: END OF tkomv.

  DATA: lt_xkomv TYPE TABLE OF komv WITH HEADER LINE.
  DATA: lt_tkomv TYPE TABLE OF komv WITH HEADER LINE.
  DATA: lt_tkomk TYPE TABLE OF komk WITH HEADER LINE.

  REFRESH t_output[].

  CLEAR: ls_komk, ls_komp.

  CALL FUNCTION 'RV_PRICE_PRINT_REFRESH'
    TABLES
      tkomv = tkomv.

  vbco3-mandt = sy-mandt.
  vbco3-spras = sy-langu.
  vbco3-vbeln = i_vbeln.
  vbco3-posnr = i_posnr.

  CALL FUNCTION 'RV_BILLING_PRINT_VIEW'
    EXPORTING
      comwa = vbco3
    IMPORTING
      kopf  = vbdkr
    TABLES
      pos   = tvbdpr.

  MOVE-CORRESPONDING vbdkr TO ls_komk.
  ls_komk-mandt = sy-mandt.
  ls_komk-kappl = 'V'.
  IF NOT vbdkr-kappl IS INITIAL.
    ls_komk-kappl = vbdkr-kappl.
  ENDIF.

  READ TABLE tvbdpr WITH KEY posnr = i_posnr.
  IF sy-subrc IS INITIAL.
    MOVE-CORRESPONDING tvbdpr TO ls_komp.
    ls_komp-kposn     = tvbdpr-posnr.
    ls_komp-taxps     = tvbdpr-posnr.
    ls_komp-mgame     = tvbdpr-fkimg.
    ls_komp-lagme     = tvbdpr-meins.
    ls_komp-mglme     = tvbdpr-fklmg.
    ls_komp-kaend_typ = '*'. "the pricing is NOT changeable.
  ENDIF.

  CALL FUNCTION 'PRICING_SUBSCREEN_PBO'
    EXPORTING
      comm_head_i = ls_komk
      comm_item_i = ls_komp
    IMPORTING
      comm_head_e = ls_komk
      comm_item_e = ls_komp
    TABLES
      tkomv       = lt_tkomv
      ykomv       = lt_xkomv
    EXCEPTIONS
      OTHERS      = 1.

  IF NOT sy-subrc IS INITIAL.
    RAISE not_found.
  ENDIF.

  CALL FUNCTION 'PRICING_REFRESH'
    TABLES
      tkomk  = lt_tkomk
      tkomv  = lt_tkomv
    EXCEPTIONS
      OTHERS = 1.

  t_output[] = lt_xkomv[].

ENDFUNCTION.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
vga
Мастер
Мастер


Age: 160
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jan 27, 2011 1:25 pm    Post subject: Reply with quote

Structures KOMP, KOMK for billing filled in
FM RV_INVOICE_PRICE_PBO
PERFORM preisfindung_vorbereiten USING 'P'.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.