% Excise Duty is coming wrong in Report

Hi,
I have a report of Gross Margin (FI)....
My problem is that when i m picking the % Excise Duty from J_1IEXCTAX table against the Chapter ID....it is showing the 4 values against it...means 4 time % Excise Duty....i.e. periodic changed...
like....
8538 90 00................1................08.12.2008................31.12.9999................10.0000
8538 90 00................1................01.03.2008................07.12.2008................14.0000
8538 90 00................1................28.02.2005................29.02.2008................16.0000
8538 90 00................1................01.01.2001................28.02.2005................16.0000
when i m executing my report with period from 01/11/2008 to 15/11/2008..it is showing the 16%...but as per my given period, it must display 14%...
Please tell me that what should the condition there....
I m sending my code...
REPORT  z_fi_gross_margin NO STANDARD PAGE HEADING LINE-SIZE 125  .
TABLES : t179t, tvkbt, mara, vbrp, s501, mbew.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
       vkbur   LIKE s501-vkbur,
       matnr   LIKE s501-matnr,
       prodh   LIKE s501-prodh,
       ummenge LIKE s501-ummenge,
       gumenge LIKE s501-gumenge,
       umnetwr LIKE s501-umnetwr,
       gunetwr LIKE s501-gunetwr,
       sptag   LIKE s501-sptag,
       peinh   LIKE mbew-peinh,
       stprs   LIKE mbew-stprs,
       lplpx   LIKE mbew-lplpx,
       vtext LIKE t179t-vtext,
       mtart LIKE mara-mtart,
       bezei LIKE tvkbt-bezei,
       net_sqty TYPE p DECIMALS 2,
       s_amt TYPE p DECIMALS 2,
       j_1ichid LIKE j_1imtchid-j_1ichid,
       rate LIKE j_1iexctax-rate,
       excise TYPE p DECIMALS 2,
       l_excise TYPE p DECIMALS 2,
       s_unit TYPE p DECIMALS 2,
       m_unit TYPE p DECIMALS 2,
       t_mcost TYPE p DECIMALS 2,
       m_cost% TYPE p DECIMALS 2,
       g_margin TYPE p DECIMALS 2,
       g_marg% TYPE p DECIMALS 2,
       END OF itab.
DATA : v_index TYPE sy-tabix.
DATA : cnt TYPE i.
DATA : w_container TYPE scrfname VALUE 'CL_GRID',
       w_cprog TYPE lvc_s_layo,
       g_repid LIKE sy-repid,
       w_save TYPE c,
       w_exit TYPE c,
       cl_grid TYPE REF TO cl_gui_alv_grid,
       cl_custom_container TYPE REF TO cl_gui_custom_container,
       it_fld_catalog TYPE slis_t_fieldcat_alv,
       wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
       layout TYPE slis_layout_alv,
       col_pos  LIKE sy-cucol ,
       alvfc TYPE slis_t_fieldcat_alv.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS   : vkbur FOR s501-vkbur.
SELECT-OPTIONS   : matnr FOR s501-matnr.
SELECT-OPTIONS   : sptag FOR s501-sptag.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM fill_catalog1 USING:
**'SPTAG'    'ITAB'    'DATE',
**'VKBUR'    'ITAB'    'Sales Office',
'BEZEI'    'ITAB'    'S.Off. Desc.',
'MATNR'    'ITAB'    'Material',
'PRODH'    'ITAB'    'LEVEL',
'VTEXT'    'ITAB'    'Level I',
'MTART'    'ITAB'    'Material Type',
'NET_SQTY' 'ITAB'    'Net Sales Qty.',
'S_AMT'    'ITAB'    'Sales with Ex. Duty',
'EXCISE'   'ITAB'    'Excise Duty',
'RATE'     'ITAB'    '% Excise Duty',
'L_EXCISE' 'ITAB'    'Sales less Ex. Duty',
'S_UNIT'   'ITAB'    'Sales / Unit',
'M_UNIT'   'ITAB'    'Mat / Unit',
'T_MCOST'   'ITAB'    'Total Material Cost',
'M_COST%'  'ITAB'    '% Material Cost',
'G_MARGIN' 'ITAB'    'Gross Margin',
'G_MARG%'  'ITAB'    '% Gross Margin'.
SELECT DISTINCT a~sptag a~vkbur a~matnr a~prodh a~ummenge a~gumenge a~umnetwr a~gunetwr b~vtext c~mtart d~bezei
         INTO CORRESPONDING FIELDS OF TABLE itab
         FROM s501 AS a
         INNER JOIN t179t AS b ON a~prodh = b~prodh
         INNER JOIN mara AS c ON a~matnr = c~matnr
         INNER JOIN tvkbt AS d ON a~vkbur = d~vkbur
         WHERE a~matnr IN matnr
         AND   a~sptag IN sptag
         AND   a~vkbur IN vkbur.
IF sy-subrc <> 0.
  MESSAGE 'DATA NOT FOUND.' TYPE 'I'(001).
ENDIF.
SORT itab BY matnr.
LOOP AT itab .
  cnt = v_index.
  SELECT peinh stprs lplpx FROM mbew INTO (itab-peinh, itab-stprs, itab-lplpx) WHERE matnr = itab-matnr.
    itab-m_unit = itab-stprs - itab-lplpx / itab-peinh.
    v_index = cnt + sy-dbcnt.
    MODIFY itab INDEX v_index TRANSPORTING m_unit.
  ENDSELECT.
  SELECT j_1ichid FROM j_1imtchid INTO itab-j_1ichid WHERE matnr = itab-matnr.
    MODIFY itab INDEX sy-tabix TRANSPORTING j_1ichid .
  ENDSELECT.
  SELECT rate FROM j_1iexctax INTO itab-rate WHERE j_1ichid = itab-j_1ichid AND j_1iexcind = '1'.
    MODIFY itab INDEX sy-tabix TRANSPORTING rate .
  ENDSELECT.
ENDLOOP.
LOOP AT itab .
  itab-net_sqty = itab-ummenge - itab-gumenge .
  MODIFY itab INDEX sy-tabix TRANSPORTING net_sqty.
  itab-s_amt = itab-umnetwr - itab-gunetwr .
  MODIFY itab INDEX sy-tabix TRANSPORTING s_amt.
  itab-excise = itab-s_amt * itab-rate / 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING excise.
  itab-l_excise = itab-s_amt - itab-excise.
  MODIFY itab INDEX sy-tabix TRANSPORTING l_excise.
  itab-s_unit = itab-l_excise / itab-net_sqty.
  MODIFY itab INDEX sy-tabix TRANSPORTING s_unit.
  itab-t_mcost = itab-m_unit * itab-net_sqty.
  MODIFY itab INDEX sy-tabix TRANSPORTING t_mcost.
  itab-m_cost% = itab-t_mcost / itab-s_amt * 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING m_cost%.
  itab-g_margin = itab-l_excise - itab-t_mcost.
  MODIFY itab INDEX sy-tabix TRANSPORTING g_margin.
  itab-g_marg% = itab-g_margin / itab-s_amt * 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING g_marg%.
ENDLOOP.
layout-zebra = 'X' .
layout-colwidth_optimize(1) = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program = 'Z_FI_GROSS_MARGIN'
    is_layout          = layout
    it_fieldcat        = it_fld_catalog
    i_default          = 'X'
    i_save             = 'A'
  TABLES
    t_outtab           = itab
  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.
*&      Form  FILL_CATALOG1
      text
     -->P_FIELDNAME  text
     -->P_REF_TABLE  text
     -->P_SCRTEXT    text
FORM fill_catalog1  USING   p_fieldname TYPE any
                            p_ref_table TYPE any
                            p_scrtext   TYPE any.
  CLEAR : wa_fld_catalog.
  wa_fld_catalog-fieldname  = p_fieldname.
  wa_fld_catalog-tabname    = p_ref_table.
  wa_fld_catalog-seltext_s  = p_scrtext.
  wa_fld_catalog-seltext_m  = p_scrtext.
  wa_fld_catalog-seltext_l  = p_scrtext.
  wa_fld_catalog-outputlen = 15.
  APPEND wa_fld_catalog TO it_fld_catalog.
ENDFORM.                    " fill_catalog1
Please check .....
Thanks...

I think ur code will do the same in my report do...
Please check my code again and modify where as u needed.....
REPORT  z_fi_gross_margin NO STANDARD PAGE HEADING LINE-SIZE 125  .
TABLES : t179t, t179, tvkbt, mara, vbrp, s501, mbew, t134t, v_t179, t023t, t247.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
       vkbur   LIKE s501-vkbur,
       matnr   LIKE s501-matnr,
       prodh   LIKE s501-prodh,
       ummenge LIKE s501-ummenge,
       gumenge LIKE s501-gumenge,
       umnetwr LIKE s501-umnetwr,
       gunetwr LIKE s501-gunetwr,
       sptag   LIKE s501-sptag,
       peinh   LIKE mbew-peinh,
       stprs   LIKE mbew-stprs,
       lplpx   LIKE mbew-lplpx,
       prdha LIKE mara-prdha,       " Product hierarchy
       prdha2 LIKE mara-prdha,       " Product hierarchy
       prdha3 LIKE mara-prdha,       " Product hierarchy
       prodh_text LIKE t179t-vtext, "Product Hierarchy Text
       prodh2_text LIKE t179t-vtext, "Product Hierarchy Text
       prodh3_text LIKE t179t-vtext, "Product Hierarchy Text
       matkl LIKE mara-matkl,
       wgbez LIKE t023t-wgbez,
       fcktx LIKE t247-ktx,
       mtart LIKE mara-mtart,
       bezei LIKE tvkbt-bezei,
       net_sqty TYPE p DECIMALS 2,
       s_amt TYPE p DECIMALS 2,
       mtbez LIKE t134t-mtbez,
       j_1ichid LIKE j_1imtchid-j_1ichid,
       rate LIKE j_1iexctax-rate,
       excise TYPE p DECIMALS 2,
       l_excise TYPE p DECIMALS 2,
       s_unit TYPE p DECIMALS 2,
       m_unit TYPE p DECIMALS 2,
       t_mcost TYPE p DECIMALS 2,
       m_cost% TYPE p DECIMALS 2,
       g_margin TYPE p DECIMALS 2,
       g_marg% TYPE p DECIMALS 2,
       new TYPE i,
       new1(6) TYPE c,
       s_period TYPE i,
       END OF itab.
DATA : BEGIN OF itab3 OCCURS 0.
        INCLUDE STRUCTURE itab.
DATA : END OF itab3.
DATA : v_index TYPE sy-tabix.
DATA : cnt TYPE i.
DATA : w_container TYPE scrfname VALUE 'CL_GRID',
       w_cprog TYPE lvc_s_layo,
       g_repid LIKE sy-repid,
       w_save TYPE c,
       w_exit TYPE c,
       cl_grid TYPE REF TO cl_gui_alv_grid,
       cl_custom_container TYPE REF TO cl_gui_custom_container,
       it_fld_catalog TYPE slis_t_fieldcat_alv,
       wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
       layout TYPE slis_layout_alv,
       col_pos  LIKE sy-cucol ,
       alvfc TYPE slis_t_fieldcat_alv.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS   : vkbur FOR s501-vkbur.
SELECT-OPTIONS   : matnr FOR s501-matnr.
SELECT-OPTIONS   : sptag FOR s501-sptag.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM fill_catalog1 USING:
'SPTAG'    'ITAB'    'DATE',
'VKBUR'    'ITAB'    'Sales Office',
'BEZEI'    'ITAB'    'S.Off. Desc.',
'MATNR'    'ITAB'    'Material',
*'PRODH'    'ITAB'    'LEVEL',
'PRODH_TEXT'    'ITAB'    'Level I',
'PRODH2_TEXT'   'ITAB'    'Level II',
'PRODH3_TEXT'   'ITAB'    'Level III',
'WGBEZ'    'ITAB'    'Level IV',
'MTBEZ'    'ITAB'    'Material Type',
'NET_SQTY' 'ITAB'    'Net Sales Qty.',
'S_AMT'    'ITAB'    'Sales with Ex. Duty',
'EXCISE'   'ITAB'    'Excise Duty',
'RATE'     'ITAB'    '% Excise Duty',
'L_EXCISE' 'ITAB'    'Sales less Ex. Duty',
'S_UNIT'   'ITAB'    'Sales / Unit',
'M_UNIT'   'ITAB'    'Mat / Unit',
'T_MCOST'   'ITAB'    'Total Material Cost',
'M_COST%'  'ITAB'    '% Material Cost',
'G_MARGIN' 'ITAB'    'Gross Margin',
'G_MARG%'  'ITAB'    '% Gross Margin',
'NEW1'      'ITAB'    'Month'.
SELECT DISTINCT asptag avkbur amatnr aprodh aummenge agumenge aumnetwr agunetwr cmtart cmatkl dbezei emtbez
         INTO CORRESPONDING FIELDS OF TABLE itab
         FROM s501 AS a
         INNER JOIN mara AS c ON amatnr = cmatnr
         INNER JOIN tvkbt AS d ON avkbur = dvkbur
         INNER JOIN t134t AS e ON cmtart = emtart
         WHERE a~matnr IN matnr
         AND   a~sptag IN sptag
         AND   a~vkbur IN vkbur
         AND   e~spras EQ 'EN'.
IF sy-subrc <> 0.
  MESSAGE 'DATA NOT FOUND.' TYPE 'I'(001).
ENDIF.
SORT itab BY matnr.
LOOP AT itab .
  cnt = v_index.
  SELECT SINGLE peinh stprs lplpx FROM mbew INTO (itab-peinh, itab-stprs, itab-lplpx) WHERE matnr = itab-matnr.
  itab-m_unit = itab-stprs - itab-lplpx / itab-peinh.
  v_index = cnt + sy-dbcnt.
  MODIFY itab INDEX v_index TRANSPORTING m_unit.
  SELECT SINGLE j_1ichid FROM j_1imtchid INTO itab-j_1ichid WHERE matnr = itab-matnr.
  MODIFY itab INDEX sy-tabix TRANSPORTING j_1ichid .
  SELECT SINGLE rate FROM j_1iexctax INTO itab-rate WHERE j_1ichid = itab-j_1ichid AND j_1iexcind = '1' AND validfrom GE sptag-low AND validto LE sptag-high.
  MODIFY itab INDEX sy-tabix TRANSPORTING rate .
  SELECT SINGLE prdha FROM mara INTO (itab-prdha) WHERE matnr = itab-matnr .
  MODIFY itab INDEX sy-tabix TRANSPORTING prdha .
  SELECT SINGLE wgbez FROM t023t INTO itab-wgbez WHERE matkl = itab-matkl .
  MODIFY itab INDEX sy-tabix TRANSPORTING wgbez .
ENDLOOP.
LOOP AT itab .
  itab-net_sqty = itab-ummenge - itab-gumenge .
  MODIFY itab INDEX sy-tabix TRANSPORTING net_sqty.
  itab-s_amt = itab-umnetwr - itab-gunetwr .
  MODIFY itab INDEX sy-tabix TRANSPORTING s_amt.
  itab-excise = itab-s_amt * itab-rate / 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING excise.
  itab-l_excise = itab-s_amt - itab-excise.
  MODIFY itab INDEX sy-tabix TRANSPORTING l_excise.
  IF itab-net_sqty NE '0'.
    itab-s_unit = itab-l_excise / itab-net_sqty.
    MODIFY itab INDEX sy-tabix TRANSPORTING s_unit.
  ENDIF.
  itab-t_mcost = itab-m_unit * itab-net_sqty.
  MODIFY itab INDEX sy-tabix TRANSPORTING t_mcost.
  itab-m_cost% = itab-t_mcost / itab-s_amt * 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING m_cost%.
  itab-g_margin = itab-l_excise - itab-t_mcost.
  MODIFY itab INDEX sy-tabix TRANSPORTING g_margin.
  itab-new = itab-sptag+4(2).
  SELECT SINGLE ktx FROM t247 INTO itab-new1 WHERE mnr = itab-new AND spras EQ 'EN' .
  CONCATENATE itab-new1 itab-sptag+2(2) INTO itab-new1 SEPARATED BY '-'.
  itab-g_marg% = itab-g_margin / itab-s_amt * 100.
  MODIFY itab INDEX sy-tabix TRANSPORTING g_marg% new1.
ENDLOOP.
LOOP AT itab.
  SELECT SINGLE vtext INTO itab-prodh3_text FROM t179t WHERE prodh = itab-prdha.
  itab-prdha2 = itab-prdha+0(5).
  SELECT SINGLE vtext INTO itab-prodh_text FROM t179t WHERE prodh = itab-prdha2.
  itab-prdha3 = itab-prdha+0(10).
  SELECT SINGLE vtext INTO itab-prodh2_text FROM t179t WHERE prodh = itab-prdha3.
  MODIFY itab INDEX sy-tabix TRANSPORTING prodh3_text prodh_text prodh2_text prdha3.
ENDLOOP.
layout-zebra = 'X' .
layout-colwidth_optimize(1) = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program = 'Z_FI_GROSS_MARGIN'
    is_layout          = layout
    it_fieldcat        = it_fld_catalog
    i_default          = 'X'
    i_save             = 'A'
  TABLES
    t_outtab           = itab
  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.
*&      Form  FILL_CATALOG1
      text
     -->P_FIELDNAME  text
     -->P_REF_TABLE  text
     -->P_SCRTEXT    text
FORM fill_catalog1  USING   p_fieldname TYPE any
                            p_ref_table TYPE any
                            p_scrtext   TYPE any.
  CLEAR : wa_fld_catalog.
  wa_fld_catalog-fieldname  = p_fieldname.
  wa_fld_catalog-tabname    = p_ref_table.
  wa_fld_catalog-seltext_s  = p_scrtext.
  wa_fld_catalog-seltext_m  = p_scrtext.
  wa_fld_catalog-seltext_l  = p_scrtext.
  wa_fld_catalog-outputlen = 15.
  APPEND wa_fld_catalog TO it_fld_catalog.
ENDFORM.                    " fill_catalog1
please tell....

Similar Messages

  • Excise Duty not coming during sales order creation

    Hi Experts ,
    Sub:Excise is not calculaing on sales oder for a perticular  plant 
    We have configure a new manufacturing plant .in this the system not performing calcualtion on the base amount and no tax duty is coming .but for one plant its coming properly .
    Vk11
    J1id  is maitain properly
    Regards
    Sachin g

    Sorry, no idea what product you are using. Likely a classic SAP product of some sort. If it's Crystal Reports then you are using someones created report so check with that person or try the B1 forum possibly.

  • Debit memo excise duty calculation is wrong

    Hi,
    Basic excise duty is wrongly picked in to debit memo as explained below
    1) Depot sales order: creted for qty 1
       Basic excise duty 80
    2) delivery created:
    3)depot excise invoice creted: Adjusted depot stock aganist plant excise invoice 123 and basic excise duty is 100
    4) created depot invoice; CAPTURED BASIC EXCISE DUTY IS 100 which is correct (356 movement type assigned to basic ex duty in pricing procedure)
    Depot returns:
    1)returns sales order created with referance to depot invoice
       copied basic excise duty as 1000 (which is correct)
    2) cretaed credit memo request: Here basic excise duty is 80 wronly copied from depot sales order instead of 100
    Please provide the solution
    Regards,
    ramesh

    Dear Lakshimipathy,
    Thanks for your response
    The excise duty combination is same in both returns order and credit memo as mentioned below
    Variable key
    country
    plant
    control code
    valid from 2010/02/27   valid to 2010/02/27
    condition supplements
    Country         name                                amount        unit       delition  id
    JEXP     IN: A/R BED %     10.000      %     flaged 
    And in pricing procedur6e of the returns order is neccessay 356 alternative calculation type
    as i mentioned above valid date has been expired and marked for delition how system is determinng excise duty for retuns order. please suggest
    Best regards,
    ramesh

  • Rate (% Excise Duty) in picking wrong...

    Hi,
    I have a report of Gross Margin (FI)....
    My problem is that when i m picking the % Excise Duty from J_1IEXCTAX table against the Chapter ID....it is showing the 4 values against it...means 4 time % Excise Duty....i.e. periodic changed...
    like....
    8538 90 00................1................01.03.2008................31.12.9999................14.0000
    8538 90 00................1................28.02.2005................29.02.2008................16.0000
    8538 90 00................1................01.01.2001................28.02.2005................16.0000
    when i m executing my report with period from 01/07/2007 to 15/07/2007..it is showing the 14%...but as per my given period, it must display 16%...
    Please tell me that what should the condition there....
    Plz. check my code---
    REPORT  z_fi_gross_margin NO STANDARD PAGE HEADING LINE-SIZE 125  .
    TABLES : t179t, t179, tvkbt, mara, vbrp, s501, mbew, t134t, v_t179, t023t, t247.
    TYPE-POOLS : slis.
    DATA : BEGIN OF itab OCCURS 0,
           vkbur   LIKE s501-vkbur,
           matnr   LIKE s501-matnr,
           prodh   LIKE s501-prodh,
           ummenge LIKE s501-ummenge,
           gumenge LIKE s501-gumenge,
           umnetwr LIKE s501-umnetwr,
           gunetwr LIKE s501-gunetwr,
           sptag   LIKE s501-sptag,
           peinh   LIKE mbew-peinh,
           stprs   LIKE mbew-stprs,
           lplpx   LIKE mbew-lplpx,
           prdha LIKE mara-prdha,       " Product hierarchy
           prdha2 LIKE mara-prdha,       " Product hierarchy
           prdha3 LIKE mara-prdha,       " Product hierarchy
           prodh_text LIKE t179t-vtext, "Product Hierarchy Text
           prodh2_text LIKE t179t-vtext, "Product Hierarchy Text
           prodh3_text LIKE t179t-vtext, "Product Hierarchy Text
           matkl LIKE mara-matkl,
           wgbez LIKE t023t-wgbez,
           fcktx LIKE t247-ktx,
           mtart LIKE mara-mtart,
           bezei LIKE tvkbt-bezei,
           net_sqty TYPE p DECIMALS 2,
           s_amt TYPE p DECIMALS 2,
           mtbez LIKE t134t-mtbez,
           j_1ichid LIKE j_1imtchid-j_1ichid,
           rate LIKE j_1iexctax-rate,
           excise TYPE p DECIMALS 2,
           l_excise TYPE p DECIMALS 2,
           s_unit TYPE p DECIMALS 2,
           m_unit TYPE p DECIMALS 2,
           t_mcost TYPE p DECIMALS 2,
           m_cost% TYPE p DECIMALS 2,
           g_margin TYPE p DECIMALS 2,
           g_marg% TYPE p DECIMALS 2,
           new TYPE i,
           new1(6) TYPE c,
           s_period TYPE i,
           END OF itab.
    DATA : BEGIN OF itab3 OCCURS 0.
            INCLUDE STRUCTURE itab.
    DATA : END OF itab3.
    DATA : v_index TYPE sy-tabix.
    DATA : cnt TYPE i.
    DATA : v_currdate TYPE i.
    DATA : w_container TYPE scrfname VALUE 'CL_GRID',
           w_cprog TYPE lvc_s_layo,
           g_repid LIKE sy-repid,
           w_save TYPE c,
           w_exit TYPE c,
           cl_grid TYPE REF TO cl_gui_alv_grid,
           cl_custom_container TYPE REF TO cl_gui_custom_container,
           it_fld_catalog TYPE slis_t_fieldcat_alv,
           wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
           layout TYPE slis_layout_alv,
           col_pos  LIKE sy-cucol ,
           alvfc TYPE slis_t_fieldcat_alv.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS   : vkbur FOR s501-vkbur.
    SELECT-OPTIONS   : matnr FOR s501-matnr.
    SELECT-OPTIONS   : sptag FOR s501-sptag.
    SELECTION-SCREEN : END OF BLOCK b1.
    PERFORM fill_catalog1 USING:
    'SPTAG'    'ITAB'    'DATE',
    'VKBUR'    'ITAB'    'Sales Office',
    'BEZEI'    'ITAB'    'S.Off. Desc.',
    'MATNR'    'ITAB'    'Material',
    *'PRODH'    'ITAB'    'LEVEL',
    'PRODH_TEXT'    'ITAB'    'Level I',
    'PRODH2_TEXT'   'ITAB'    'Level II',
    'PRODH3_TEXT'   'ITAB'    'Level III',
    'WGBEZ'    'ITAB'    'Level IV',
    'MTBEZ'    'ITAB'    'Material Type',
    'NET_SQTY' 'ITAB'    'Net Sales Qty.',
    'S_AMT'    'ITAB'    'Sales with Ex. Duty',
    'EXCISE'   'ITAB'    'Excise Duty',
    'RATE'     'ITAB'    '% Excise Duty',
    'L_EXCISE' 'ITAB'    'Sales less Ex. Duty',
    'S_UNIT'   'ITAB'    'Sales / Unit',
    'M_UNIT'   'ITAB'    'Mat / Unit',
    'T_MCOST'   'ITAB'    'Total Material Cost',
    'M_COST%'  'ITAB'    '% Material Cost',
    'G_MARGIN' 'ITAB'    'Gross Margin',
    'G_MARG%'  'ITAB'    '% Gross Margin',
    'NEW1'      'ITAB'    'Month'.
    SELECT DISTINCT asptag avkbur amatnr aprodh aummenge agumenge aumnetwr agunetwr cmtart cmatkl dbezei emtbez
             INTO CORRESPONDING FIELDS OF TABLE itab
             FROM s501 AS a
             INNER JOIN mara AS c ON amatnr = cmatnr
             INNER JOIN tvkbt AS d ON avkbur = dvkbur
             INNER JOIN t134t AS e ON cmtart = emtart
             WHERE a~matnr IN matnr
             AND   a~sptag IN sptag
             AND   a~vkbur IN vkbur
             AND   e~spras EQ 'EN'.
    IF sy-subrc <> 0.
      MESSAGE 'DATA NOT FOUND.' TYPE 'I'(001).
    ENDIF.
    SORT itab BY matnr.
    LOOP AT itab .
      cnt = v_index.
      SELECT SINGLE peinh stprs lplpx FROM mbew INTO (itab-peinh, itab-stprs, itab-lplpx) WHERE matnr = itab-matnr.
      itab-m_unit = itab-stprs - itab-lplpx / itab-peinh.
      v_index = cnt + sy-dbcnt.
      MODIFY itab INDEX v_index TRANSPORTING m_unit.
      SELECT SINGLE j_1ichid FROM j_1imtchid INTO itab-j_1ichid WHERE matnr = itab-matnr.
      MODIFY itab INDEX sy-tabix TRANSPORTING j_1ichid .
      SELECT SINGLE rate FROM j_1iexctax INTO itab-rate WHERE j_1ichid = itab-j_1ichid AND j_1iexcind = '1' . "AND validfrom GE sptag-low AND validto LE sptag-high.
      MODIFY itab INDEX sy-tabix TRANSPORTING rate .
      SELECT SINGLE prdha FROM mara INTO (itab-prdha) WHERE matnr = itab-matnr .
      MODIFY itab INDEX sy-tabix TRANSPORTING prdha .
      SELECT SINGLE wgbez FROM t023t INTO itab-wgbez WHERE matkl = itab-matkl .
      MODIFY itab INDEX sy-tabix TRANSPORTING wgbez .
    ENDLOOP.
    LOOP AT itab .
      itab-net_sqty = itab-ummenge - itab-gumenge .
      MODIFY itab INDEX sy-tabix TRANSPORTING net_sqty.
      itab-s_amt = itab-umnetwr - itab-gunetwr .
      MODIFY itab INDEX sy-tabix TRANSPORTING s_amt.
      itab-excise = itab-s_amt * itab-rate / 100.
      MODIFY itab INDEX sy-tabix TRANSPORTING excise.
      itab-l_excise = itab-s_amt - itab-excise.
      MODIFY itab INDEX sy-tabix TRANSPORTING l_excise.
      IF itab-net_sqty NE '0'.
        itab-s_unit = itab-l_excise / itab-net_sqty.
        MODIFY itab INDEX sy-tabix TRANSPORTING s_unit.
      ENDIF.
      itab-t_mcost = itab-m_unit * itab-net_sqty.
      MODIFY itab INDEX sy-tabix TRANSPORTING t_mcost.
      itab-m_cost% = itab-t_mcost / itab-s_amt * 100.
      MODIFY itab INDEX sy-tabix TRANSPORTING m_cost%.
      itab-g_margin = itab-l_excise - itab-t_mcost.
      MODIFY itab INDEX sy-tabix TRANSPORTING g_margin.
      itab-new = itab-sptag+4(2).
      SELECT SINGLE ktx FROM t247 INTO itab-new1 WHERE mnr = itab-new AND spras EQ 'EN' .
      CONCATENATE itab-new1 itab-sptag+2(2) INTO itab-new1 SEPARATED BY '-'.
      itab-g_marg% = itab-g_margin / itab-s_amt * 100.
      MODIFY itab INDEX sy-tabix TRANSPORTING g_marg% new1.
    ENDLOOP.
    LOOP AT itab.
      SELECT SINGLE vtext INTO itab-prodh3_text FROM t179t WHERE prodh = itab-prdha.
      itab-prdha2 = itab-prdha+0(5).
      SELECT SINGLE vtext INTO itab-prodh_text FROM t179t WHERE prodh = itab-prdha2.
      itab-prdha3 = itab-prdha+0(10).
      SELECT SINGLE vtext INTO itab-prodh2_text FROM t179t WHERE prodh = itab-prdha3.
      MODIFY itab INDEX sy-tabix TRANSPORTING prodh3_text prodh_text prodh2_text prdha3.
    ENDLOOP.
    layout-zebra = 'X' .
    layout-colwidth_optimize(1) = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = 'Z_FI_GROSS_MARGIN'
        is_layout          = layout
        it_fieldcat        = it_fld_catalog
        i_default          = 'X'
        i_save             = 'A'
      TABLES
        t_outtab           = itab
      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.
    *&      Form  FILL_CATALOG1
          text
         -->P_FIELDNAME  text
         -->P_REF_TABLE  text
         -->P_SCRTEXT    text
    FORM fill_catalog1  USING   p_fieldname TYPE any
                                p_ref_table TYPE any
                                p_scrtext   TYPE any.
      CLEAR : wa_fld_catalog.
      wa_fld_catalog-fieldname  = p_fieldname.
      wa_fld_catalog-tabname    = p_ref_table.
      wa_fld_catalog-seltext_s  = p_scrtext.
      wa_fld_catalog-seltext_m  = p_scrtext.
      wa_fld_catalog-seltext_l  = p_scrtext.
      wa_fld_catalog-outputlen = 15.
      APPEND wa_fld_catalog TO it_fld_catalog.
    ENDFORM.                    " fill_catalog1
    please let me know...

    Hi,
    when  i m using this query...
    SELECT SINGLE rate FROM j_1iexctax INTO itab-rate WHERE j_1ichid = itab-j_1ichid AND j_1iexcind = '1'  AND validfrom  LE sptag-high AND validto     GE sptag-low.          
    MODIFY itab INDEX sy-tabix TRANSPORTING rate .
    it is picking the another value.....like... (picking BOLD VALUE), means 0.00
    8538 10 10................0................28.02.2005................31.12.9999................0.0000
    8538 10 10................1................01.03.2008................31.12.9999................14.0000
    8538 10 10................1................28.02.2005................29.02.2008................16.0000
    8538 10 10................1................01.01.2001................28.02.2005................16.0000
    also Excise tax indicator, not reflect anything here....
    Plz let me know......

  • No base value or Excise duty calculation coming at J1IS

    I am trying to create excise invoice by T code - J1IS with Ref. doc type - OTHR,
    but the system is not calculating the base value and excise duty
    Please help
    Regards,
    Pranav

    Hi,
    Please maintain the Assessable Value in J1ID for the material and also maintain the condition records for your excise conditions such as BED, ECS & SHECess in FV11 and try.
    Thanks & Regards,

  • Total Excise Duty not coming in MIGO

    Hi All,
    For a PO in MIGO am getting Total Excise tab in header level(in Excise invoice tab) but the same is not coming in item details.Please let me know what is wrong?
    Thanks,
    Rakesh.

    Hai,
    In std sap u will not get the total excise in either header r item, in ur client it might have delveloped.

  • Excise duty is not coming at the time of J1IIN in stock transfer

    The value of BED, CESS is coming Zero while creating Excise Invoice for Stock Transfer. I have maintained all the default condition types. I am using STO Proforma Invocie, Excise duty is coming in STO Proforma Invoice.
    I am using TAXINN.
    Regards
    Gaurav

    Maintain pricing (TVAP-PRSFD) as X in VOV7 for your STO item category.
    Regards,
    GSL.

  • Problem in excise duty

    Hi Guru if i am creating sales order system giving below warning.i checked in chapter id this material is maintained for chapter id.
    Maintain the chapter ID for material 17207081 J_1IMTCHID.how can i correct this errror due to this error excise duty not coming in sales order.
    regards
    ajit

    that is also not maintained.so for that i have to maintain 1 for exc indicator.
    Yes certainly.  If the excise value to flow in sale order, billing and excise invoice, then maintain 1 as I stated above.  Create a new sale order and check
    thanks
    G. Lakshmipathi

  • In import GRN - excise duty is wrongly updating..

    hi frnds..
    In import GRN - excise duty is wrongly updating.. How to resolve this...
    Regards
    Raghav.KH

    Hi,
    After Bill of Entry(MIRO), when u do MIGO, pop up will appear, where ur BOE number will reflect, make sure that u r putting year as 2009.
    Regards,
    Piyush

  • Purchase order report with basic price and Excise duty values

    Hi All,
    Is there any standard report in SAP to get the Purchase order basic price / qty and its Excise duty values ? Since we are including Excise duties for non - codified items (w/o material master and with cost center 'K') Purchase order and the ed values are added to the cost and the requirement is to see the split up (Basic priceEdEcs+Hcs)for these Purchase orders for the vendors. If there is no std report then please let me know how to link Purchase order table with this Condition value table in query to get the desired report.
    Thanks in advance
    Benny

    Hi,
    there is no standert report to fullfill this requierment
    you have to create this report with the help of abaer
    for that which tax code you are using its importnat thing
    for po table EKPO
    1. A524 (Normal supply point / Material) it will return condition record number for condition type.
    2. KONP (Conditions (Item)) .
    3. J_1IMTCHID (Combination of Material Number and Chapter ID).
    4. J_1IEXCTAX (Tax calc. - Excise tax rates
    5 get the IR no. from RBKP and RSEG, and get the relevant FI doc no. and goto BSET table
    for IR number  to get from table apply logic for doc type RE ,you will get fi number nad in refernce field you will get invoice number + fiscal year
    Map this by refernig on po for which grn and invoice happen
    Regards
    Kailas Ugale

  • Excise Duty Paid and Excise Duty Payable Report

    Hi
    Is there any standard report through which we can check the Excise Duty which is already paid and Excise duty which is payable for a posting period. If not any report then is there some table through which we can check this for a plant  for specific posting period.
    Thanks in advance
    regards
    Amitesh Anand

    Dear Amitesh
    The difference could be due to
    a)  different G/L Account assigned to the excise condition type / account key in OB40 settings
    b)  opening balance carried forward in J2IUN
    Nevertheless you can also check in j2i9  which I forget to mention earlier.
    thanks
    G. Lakshmipathi

  • Excise duty movement report (BEV2/EDSL)

    Hi Guys,
    Can only could he me why i cannot generate he report for excise duty movement or Tcode BEV2/EDSL. it always prompt no data selection.

    Hi,
    You can get with t.code: J2I9
    also can try with t.code: J1I2
    Regards,
    Biju K

  • Monthly VAT and Excise duty Report in SAP

    Hi Experts,
      My Client need monthly VAT and Excise duty report from through SAP solution.
      Please Help
    Thanks,
    Amit

    Hi Amitgiri,
    Please check the following SAP standard report. May be it suits your requirement.
    T-Code - S_ALR_87012357
    Thanks,
    Umesh    

  • Reg Excise Duty is not coming in the Excise invoice

    Hi all,
          We are doing STO senerio between two plants while doing commercial invoice the EXcise Duty ZMOD and ZCES is determining in the commercial invoice but when we do the Excise invoice in J1IIN the ZMOD and ZCES values are not comming.
    So can you please assist to over come this issue
    Please give replay ASAP,
    Regards,
    Murali.

    Hi Alpesh,
            Thank you for your replay I already checked that the A/R BED,SED CESS condition types are maintaining to that Tax procedure.
    Can you please assist
    Regards,
    Murali.

  • Excise Duty wrongly capture in J1iex

    Hi Exports , I am doing STO from Manufacturing Plant to Packing Plant
    1) I created STO for 100 Qty 2) Delivery-qty 100 3) Jex- proforma invoice-qty-100-excise value Rs 100, 4) Excise invoice -J1iin- Qty-100 qty.- excise duty Rs 100
    But in MIGO I am doing 90 qty after that in excise capture Ji1ex- the excise duty value showing only 90 qty. Rs 80 it means the excise duty 2 time diduction. on remaing Qty.
    but if i did not change qty in MIGO it is working fine.

    The Note -1349626, SAP_APPL realase 604 and pakage is SAPKH60406
    But, My Client is Using ECC 6.0 and in that the pakage is SAP_APPL realase 604 and pakage is SAPKH60408,
    so i am unaible to use this SAP NOTE.

Maybe you are looking for

  • Error while running SDK application in XIR2 server machine

    Hi all, Thanks for your support provided so far. I have developed a .NET sdk application to extract the metadata from the XI-R2 universe and report files. I'm able to run the application in my machine. But when I run my tool in the server machine whi

  • Visual Studio 6.0 SP5 setup on Vista Beta 2 (5384)?

    Does anyone know how to get around the MDAC check in the Service Pack 5 setup of Visual Studio 6.0?  For some reason it doesn't detect MDAC 2.5 or higher which it requires (even though Vista obviously has a later version - 6.0)  and the setup will no

  • Error When Changing Modules

    Hey, all. I just got Lightroom 5.3 for my Macbook Pro and have been attempting to use it for the past several days, but regardless of what I try nothing works -- I have spent several hours on the Adobe troubleshooting website going through every proc

  • New Apple College Computer Offer

    I received a brand new Apple MacBook Air for graduation and then two weeks later I see an advertisement saying anyone who buys a new computer for college gets $100 for the App Store! I feel like I should be able to receive that $100. How would I go a

  • Yearly Calender (12 month view)

    Hi, I want to create a yearly calender view in apex is this possible? maybe it is using the Sql calender. The wizard only has weekly, monthly and daily calenders. I'm running Apex Version 2.0.0.00.49 Thanks in advance, Huw.