2021年6月8日星期二

Tax classification of Billing Determination

 LV60AA95 

Form VBRK_VBRP_DATENTRANSPORT

TVKOのXSTCEG(Tax Number)

A:From Sold To

B:From Payer

C: Destination Country of Ship-to

1.Get Tax classification from Sold-to ,payer or ship-to

 if vbrk-vbtyp na vbtyp_fkiv and
      vbrp-vgtyp ca vbtyp_lief and   "! delivery relevant
          lips-fkrel charj and         "! plant abroad / EU-TAX
          lips-vgtyp ne charv or       "! consignment fill-up, pickup
        not xvbpa_we-stceg is initial or "! manual value from order
        not vbrk-stceg_l is initial )"!
    perform vbrk-stceg_fuellen.
  else.
* control determination of the VAT registration
    if kurgv-stceg ne space and kurgv-kunnr ne kuagv-kunnr and
       tvko-xstceg is initial or tvko-xstceg flg_stceg_std or
       tvko-xstceg flg_stceg_rg.
* from payer

    vbrk-stceg  =  kurgv-stceg.
      vbrk-stceg_h 'B'.
      vbrk-stceg_l kurgv-land1.
      if kurgv-stceg_l ne space.
        vbrk-stceg_l kurgv-stceg_l.
        vbrk-stceg_h 'D'.
      endif.
      vbrk-taxk1  =  kurgv-taxk1.
      vbrk-taxk2  =  kurgv-taxk2.
      vbrk-taxk3  =  kurgv-taxk3.
      vbrk-taxk4  =  kurgv-taxk4.
      vbrk-taxk5  =  kurgv-taxk5.
      vbrk-taxk6  =  kurgv-taxk6.
      vbrk-taxk7  =  kurgv-taxk7.
      vbrk-taxk8  =  kurgv-taxk8.
      vbrk-taxk9  =  kurgv-taxk9.
    elseif kuwev-stceg ne space or kuagv-stceg space and
      tvko-xstceg is initial or tvko-xstceg flg_stceg_std ).
      vbrk-stceg  =  kuwev-stceg.
      vbrk-stceg_h 'A'.
      vbrk-stceg_l kuwev-land1.
      vbrk-taxk1  =  kuwev-taxk1.
      vbrk-taxk2  =  kuwev-taxk2.
      vbrk-taxk3  =  kuwev-taxk3.
      vbrk-taxk4  =  kuwev-taxk4.
      vbrk-taxk5  =  kuwev-taxk5.
      vbrk-taxk6  =  kuwev-taxk6.
      vbrk-taxk7  =  kuwev-taxk7.
      vbrk-taxk8  =  kuwev-taxk8.
      vbrk-taxk9  =  kuwev-taxk9.
    elseif tvko-xstceg is initial or
      tvko-xstceg flg_stceg_ag  or
      tvko-xstceg flg_stceg_std.
      vbrk-stceg  =  kuagv-stceg.
      vbrk-stceg_h 'C'.
      vbrk-stceg_l kuagv-land1.
      if kuagv-stceg_l ne space.
        vbrk-stceg_l kuagv-stceg_l.
        vbrk-stceg_h 'J'.
      endif.

* from Sold to

      vbrk-taxk1  =  kuagv-taxk1.
      vbrk-taxk2  =  kuagv-taxk2.
      vbrk-taxk3  =  kuagv-taxk3.
      vbrk-taxk4  =  kuagv-taxk4.
      vbrk-taxk5  =  kuagv-taxk5.
      vbrk-taxk6  =  kuagv-taxk6.
      vbrk-taxk7  =  kuagv-taxk7.
      vbrk-taxk8  =  kuagv-taxk8.
      vbrk-taxk9  =  kuagv-taxk9.
    endif.
  endif.                               "WIA / EU-TAX

2.IF tax classification of VBAK is not initial,vbrk will use the tax classification of vbak.

Function VIEW_KUAG2 (get Sold-to view)
LV60AA45  FORM KUAGV_FUELLEN


 CLEAR vtcom.
  vtcom-kunnr xvbpa-kunnr.
  vtcom-vkorg vbrk-vkorg.
  vtcom-vtweg vbrk-vtweg.
  vtcom-aland vbrp-aland.
  IF vbrk-landtx NE space.
    vtcom-aland vbrk-landtx.
  ENDIF.
 



CALL FUNCTION 'VIEW_KUAG2'
    EXPORTING
      comwa         vtcom
      init_kuagv    lvf_clear_kuagv
    IMPORTING
      agwa          kuagv
    EXCEPTIONS
      no_kna1       1
      no_knvv       2
      error_message 8
      OTHERS        7.

  IF sy-subrc <> AND sy-msgty 'A'.
    MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.



LV05EF1I  FORM READ_KNVI_KNVI_DD_01   Line  15

  CLEAR LKNVI.
  REFRESH LKNVI.
  CALL FUNCTION 'KNVI_GENERIC_READ_LAND'
       EXPORTING
            I_KUNNR   LVF_KUNNR
            I_ALAND   VTCOM-ALAND
       TABLES
            O_KNVI    LKNVI
       EXCEPTIONS
            NOT_FOUND 1
            OTHERS    2.



Defining the Tax Category by Departure Country (SD)

Use

A tax category must be defined by departure country. Allowable departure country is the plant’s country and/or the company code’s country.

The tax category allows entry of the tax classification indicator in the customer master data and material master data .

The tax category displayed in the customer master record depends on:

  • Customer sales organization’s company code country

  • Country of each plant assigned to that sales organization

The tax category displayed in the material master record depends on:

  • Material sales organization’s company code country

  • Country of each plant assigned to that sales organization

Procedure

In Customizing for Sales and Distribution, choose  Basic functions  Taxes    Define Tax Determination Rules.  You can also use transaction OVK1 (Table TSTL).

Tax category UTXJ must be maintained using a sequence of 1 for the US.

Tax category CTXJ must be maintained using a sequence of 1 for Canada.






2021年6月4日星期五

IDOC TABLE

 

EDID4: IDoc  data contents table
SRRELROLES:
IDOCREL:
SRRELROLES 

2021年5月31日星期一

Steps change batch management flag of material master

 1. change batch management flag from space to X.

 1) It should have no stock in MMBE.

 2) It should have no stock in storage loction history data (MARDH)

     In order to delete material storage location data just run report  RM07KOHDEL.

 ※Restrictions when run report RM07KOHDEL.

  1)  Never delete material history records for the current

      period (based on lookup for material in MARV table using BUKR).

  2)  Never delete material history records from the previous period

      (again based on lookup for material in MARV table using BUKR).

  3)  Never delete material history record for two periods before

      the current period based on MARV table lookup.

  4)  Never delete material history records for the last month

      of the previous year (based on MARV table lookup for material).

  5)  Never delete the last material history record for a given

      material under any circumstances.

 2. change batch management flag from  X to space.

 1) It should have no stock in MMBE.

 2) It should have no stock in storage loction history data (MARDH)

 3) It should have no batch data. (MCHA and MCHB)

   In order to delete material batch data, first run MSC2N to set delete flag = X

   then ran transaction SARA (MM74) to achive batch data.


Below is from the article of link

Enter Title Here: Do not exceed space provided - Title automatically appears in page header (sap.com)


If we want to activate/ de-activate then we need to perform below steps. 

 • Check the Status of material in MMBE ( stock overview company code/plant/storage location /batch ) ;

 ideally stock should not be present for material at any levels 

 • There should not be any open purchase order for material; we can check entries in table EKPO. 

 • There should not be any open production order. we can check entries in table AFPO.

 • There should not be any sales order. We can check entries in table VBAP.

 • There should not be any purchase requisition. we can check entries in table EBAN.  

 • There should not be any stock in transit. we can check MB5T ( display of stock in transit ) 

 • There should not be any Plant availability Stock, use MB53 to validate. 

 • There should not be any reservation for material. we can check in MB25

(reservation list ) .

 • Stock requirement should be zero we can check in MD04 (stock requirement list).

 • There should not be any open delivery we can check entries in table LIPS.


• There should not be any open warehouse Transfer Requirement. We can check entries in table LTBP and LTAP; 

• There should not be any open Warehouse transfer orders. We can check 

entries in table LTAK. 

• The Batch Corresponding to the plant has to be set for deletion indicator in MSC2N, 

if previous period stocks exist, we can make a withdrawal posting also.

After cross checking all above steps we can activate / de-activate batch management in material master. 

But in most of the cases, number of material master date is huge and 

it is not possible to follow above steps for all material.


To solve this issues SAP have provided standard programs. 

Solution 

 Now SAP provided two reports which can update or remove BATCH MANAGEMENT

 INDICATOR and BATCHES without removing the material stocks and documents. 

We need to close only open physical inventory documents. 

 The below reports update, all relevant documents based on batch activation/de-activation: 

 • RVBCONVMAT2BM - Sets the batch management requirement indicator. 

 • RVBREVMATBM - Removes the batch management requirement indicator.


Useful sap note

These programs should be applied with in preview of the following SAP notes 

 • Note 533276 - Setting the batch management requirement indicator

 • Note 533383- Deselecting the batch management requirement indicato

 

2021年5月25日星期二

Information structures in SAP

https://blogs.sap.com/2013/05/31/information-structures-in-sap/


1.  Go to IMG : Logistics General à LIS àLogistics Data Warehouse à Data basis àInformation Structures à Maintain self-defined information structures OR
Use T-Code – MC21, Enter number & description for your information structure, choose application 01, type as standard, enable planning and continue.
2. Choose characteristics from given field catalogs. Choose Sales Org, Distribution Channel, Division, Sold-to-party, Material and/or as required. Copy & Close.

Similarly, choose key figures like order quantity, confirmed quantity, gross weight, Net Weight, Volume, Billed Quantity, Open Orders Quantity etc. as required.

3. Save your information structure.

4. Go to MC24 to create updating for your information structure. Choose update group 1 (SIS: sales document, delivery, billing document) or as required.

5. Create update rules. Double-click on key figures and specify event, update type, source table source field. Choose table and date field for period determination or click on suggest rules. Copy.
Click on rules for characteristics to create update rules of characteristics for each key figure. Specify source tables and fields for each characteristic. Copy.

6. After creating rules for all your key figures, go to Environment in the menu bar and choose activate updating. Double-click your info structure to select                parameters as shown below. Set period split as required and asynchronous updating. Save.

7. Use T-Code LBW0 to connect your info-structure to SAP BW. Input your info-structure, choose set-up LIS environment and execute.
-Next Choose generate data source and execute.
-For Delta updating in LIS choose generate updating and execute.

8. Display your info-structure in MC23. Go to Environment in menu bar and choose update definitions. Status of info-structure is Active.

mcvr:  update diagnosis for sales order
mcvv:  update diagnosis  for Billing
mcvt:   update diagnosis for delivery 
mcvw:  update diagnosis for material

2021年5月23日星期日

2020年11月21日星期六

价格差异

 标准价格(S)

采购订单价值和标准价格产生的价格差异计入:材料成本差异。

生产成本和完工产品的标准价格产生的差异计入:生产成本差异。


移动平均法:原材料,包材,辅材,低值易耗品 产成品(商贸企业)

半成品:自主制造 标准价格

            外部采购 移动平均

标准成本法:产成品

Customer Characteristic

  Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...