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 PO



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


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

PostPosted: Thu Jan 27, 2011 1:09 pm    Post subject: get pricing accounting values from PO Reply with quote

Code:
FUNCTION zerum_pricing_po.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_EBELN) TYPE  EBELN
*"     VALUE(I_EBELP) TYPE  EBELP
*"  TABLES
*"      T_OUTPUT STRUCTURE  KOMV
*"  EXCEPTIONS
*"      NOT_FOUND
*"----------------------------------------------------------------------
*  Function name                        :
*  Development specification ID         :
*  Process team contact person/team name:
*  Date created                         :
*  Service Desk change number           :
*  Transport request number             :
*  Author                               :
*  Description                          : select conditions values
*                                         from PO
*----------------------------------------------------------------------*

  DATA: ls_komk    TYPE komk,
        ls_komp    TYPE komp,
        ls_t001    TYPE t001,
        ls_t001w   TYPE t001w,
        ls_ekko    TYPE ekko,
        ls_ekpo    TYPE ekpo.

  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.

  CALL FUNCTION 'ME_EKKO_SINGLE_READ'
    EXPORTING
      pi_ebeln          = i_ebeln
      pi_refresh_buffer = 'X'
    IMPORTING
      po_ekko           = ls_ekko
    EXCEPTIONS
      no_records_found  = 1
      OTHERS            = 2.

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

  SELECT SINGLE * FROM ekpo INTO ls_ekpo
    WHERE ebeln = i_ebeln
      AND ebelp = i_ebelp.

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

  CALL FUNCTION 'K_READ_T001'
    EXPORTING
      i_bukrs   = ls_ekko-bukrs
    IMPORTING
      e_t001    = ls_t001
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.

  CHECK sy-subrc IS INITIAL.

  CALL FUNCTION 'MM_REFRESH_PARTNERS'. "memory free
  CALL FUNCTION 'ME_FILL_KOMK_PO'
    EXPORTING
      i_ekko = ls_ekko
      i_ekpo = ls_ekpo
      i_t001 = ls_t001
    IMPORTING
      e_komk = ls_komk.

  CHECK sy-subrc IS INITIAL.

  CALL FUNCTION 'T001W_SINGLE_READ'
    EXPORTING
      t001w_werks = ls_ekpo-werks
    IMPORTING
      wt001w      = ls_t001w
    EXCEPTIONS
      not_found   = 1
      OTHERS      = 2.

  CALL FUNCTION 'ME_FILL_KOMP_PO'
    EXPORTING
      i_ekpo  = ls_ekpo
      i_t001w = ls_t001w
      i_ekko  = ls_ekko
      i_komk  = ls_komk
    IMPORTING
      e_komp  = ls_komp.

  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.

  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
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ММ 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.