Skip to Content

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

Table is not Unicode Convertible

hello,

i am getting error the type of tha database table or work area or internal table are not unicode convertible. please help me.

REPORT ZEXCISE_INVOICE_RTNS

LINE-COUNT 100

MESSAGE-ID 8I.

********************************************************************

*INCLUDES

********************************************************************

INCLUDE RVADTABL.

********************************************************************

*TABLES

********************************************************************

TABLES : T001, "Company Codes

T005, "Countries

LFA1, "Vendor Master (General Section)

EKKO, "Purchasing Document Header

EKPO, "Purchasing Document Item

MKPF. "Header: Material Document

*Excise Tables

TABLES : J_1IEXCHDR, "Excise invoice header detail

J_1IEXCDTL, "Excise invoice line item details

J_1IEXCDEF, "Tax default informations

J_1IMOVEND. "Vendor Master Excise Additional Data

********************************************************************

*INTERNAL TABLES AND STRUCTURES

********************************************************************

DATA : BEGIN OF TJ_1IEXCDTL OCCURS 0.

INCLUDE STRUCTURE ZJ1IEXCDTL.

DATA : END OF TJ_1IEXCDTL.

DATA : i_mseg like mseg occurs 0 with header line.

DATA : TJ_1IEXCDTL_Temp like TJ_1IEXCDTL occurs 0 with header line.

DATA : begin of it_ekpo occurs 0,

ebeln like ekko-ebeln, "PO Number

ebelp like ekpo-ebelp, "Line item number

meins like ekpo-meins, "Unit of measurement

mwskz like ekpo-mwskz, "Tax on Sales/Purchases Code

netpr like ekpo-netpr, "unit price

end of it_ekpo.

DATA : begin of it_a003 occurs 0,

knumh like a003-knumh, "Condition record number

kappl like a003-kappl, "Application

kschl like a003-kschl, "Condition type

mwskz like a003-mwskz, "Tax on Sales/Purchases Code

end of it_a003.

DATA : begin of it_konp occurs 0,

knumh like konp-knumh, "Condition record number

kappl like konp-kappl, "Application

kschl like konp-kschl, "Condition type

mwsk1 like konp-mwsk1, "Tax on Sales/Purchases Code

kbetr like konp-kbetr, "Rate/unit

end of it_konp.

DATA : begin of it_konv occurs 0,

knumv like konv-knumv, "Number of the document condition

kposn like konv-kposn, "Condition item number

kschl like konv-kschl, "Condition type

krech like konv-krech, "Calculation type for condition

kbetr like konv-kbetr, "Rate (condition amount or percentage)

kwert like konv-kwert, "Condition value

end of it_konv.

********************************************************************

*VARIABLES

********************************************************************

DATA: RETCODE LIKE SY-SUBRC. "Returncode

DATA: REPEAT(1) TYPE C.

DATA: XSCREEN(1) TYPE C. "Output on printer or screen

DATA: G_FM_NAME TYPE RS38L_FNAM,

V_SUBTOTAL LIKE J_1IEXCDTL-EXBAS.

DATA : V_CHID(45) TYPE C,

V_DESC1(30) TYPE C,

V_DESC2(30) TYPE C,

V_DESC3(30) TYPE C.

DATA : v_document(15) TYPE C.

***********************************************************************

  • SELECTION SCREEN

***********************************************************************

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_mblnr like mkpf-mblnr OBLIGATORY,

P_time like SY-UZEIT.

SELECTION-SCREEN END OF BLOCK b1.

***********************************************************************

  • START-OF-SELECTION

***********************************************************************

start-of-selection.

PERFORM GET_DATA.

CHECK RETCODE = 0.

  • Get the form name

PERFORM GET_FORM_NAME.

  • Call the form

PERFORM CALL_FORM.

***********************************************************************

  • End-Of-Selection

***********************************************************************

end-of-selection.

********************************************************************

*FORM GET DATA

********************************************************************

FORM GET_DATA.

SELECT single * from mkpf where mblnr = P_MBLNR.

IF sy-subrc <> 0.

RETCODE = 4.

message i078(8I).

exit.

ELSE.

PERFORM GET_EXCISE_INVOICE.

if retcode <> 0.

MESSAGE i301(8I).

else.

PERFORM GET_EXCISE_DETAILS.

endif.

ENDIF.

ENDFORM. "GET_DATA

********************************************************************

*FORM GET EXCISE DETAILS

********************************************************************

FORM GET_EXCISE_DETAILS.

DATA: KAWRT LIKE KOMV-KAWRT. "Excise Duty - Base Amount

SELECT * FROM J_1IEXCDTL INTO TABLE <b>TJ_1IEXCDTL</b>

WHERE TRNTYP = J_1IEXCHDR-TRNTYP

AND DOCYR = J_1IEXCHDR-DOCYR

AND DOCNO = J_1IEXCHDR-DOCNO.

SELECT SINGLE * FROM T001 WHERE BUKRS = J_1IEXCHDR-BUKRS.

SELECT SINGLE * FROM T005 WHERE LAND1 = T001-LAND1.

SELECT SINGLE * FROM J_1IEXCDEF WHERE J_1ITAXCAL = T005-KALSM.

LOOP AT TJ_1IEXCDTL INTO TJ_1IEXCDTL.

IF TJ_1IEXCDTL-EXBED IS INITIAL AND J_1IEXCHDR-EXPIND = 'D'.

KAWRT = TJ_1IEXCDTL-EXBAS.

CALL FUNCTION 'J_1I6_DETERMINE_EXCISE_RATE'

EXPORTING

BUKRS = J_1IEXCHDR-BUKRS

WERKS = J_1IEXCHDR-WERKS

MATNR = TJ_1IEXCDTL-MATNR

VENDOR = J_1IEXCHDR-KUNAG

KALSM = T005-KALSM

MWSKZ = J_1IEXCDEF-J_1ITXCODE

TAX_DATE = SY-DATUM

MENGE = TJ_1IEXCDTL-MENGE

KAWRT = KAWRT "Excise Duty - Base Amount

UNIT = TJ_1IEXCDTL-MEINS

IMPORTING

EXC_AMOUNT = TJ_1IEXCDTL-EXBED "Basic Excise Duty

EXC_PERC = TJ_1IEXCDTL-BEDRATE "Basic Excise Duty rate

ADD_AMOUNT = TJ_1IEXCDTL-EXAED "Additional Excise Duty

ADD_PERC = TJ_1IEXCDTL-AEDRATE "Additional Excise Duty rate

SED_AMOUNT = TJ_1IEXCDTL-EXSED "Special Excise Duty

SED_PERC = TJ_1IEXCDTL-SEDRATE "Special Excise Duty rate

EXCEPTIONS

CHAPTER_ID_MISSING = 1

COMPANY_DATA_NOT_SETUP = 2

TAX_PROC_INVALID = 3

EXCIND_MISSING = 4

VENDOR_MISSING = 5

TAXCODE_INVALID = 6

EXCISE_RATE_MISSING = 7

OTHERS = 8.

ENDIF.

  • Get Tax and Excise Details.

PERFORM get_tax_details.

MODIFY TJ_1IEXCDTL.

CLEAR TJ_1IEXCDTL.

ENDLOOP.

  • Get the Chapter Details

PERFORM CHID.

ENDFORM. " GET_EXCISE_DETAILS

********************************************************************

*FORM GET EXCISE INVOICE

********************************************************************

FORM GET_EXCISE_INVOICE.

  • get the excise invoice for the refrence document

SELECT SINGLE * FROM J_1IEXCHDR

WHERE TRNTYP = 'OTHR'

AND RDOC = P_MBLNR

AND RIND = 'I'.

IF SY-SUBRC <> 0.

  • excise invoice not found

RETCODE = 4.

exit.

ENDIF.

  • Gwt the vendor details

SELECT SINGLE * FROM J_1IMOVEND

WHERE LIFNR = J_1IEXCHDR-LIFNR.

SELECT SINGLE * FROM LFA1

WHERE LIFNR = J_1IEXCHDR-LIFNR.

  • Get GI details

select * from mseg into corresponding fields of

table i_mseg where mblnr = P_MBLNR.

ENDFORM. " GET_EXCISE_INVOICE

********************************************************************

*FORM GET FORM NAME

********************************************************************

FORM get_form_name .

DATA : l_form(30) type c.

l_form = 'ZEXCISE_INV_RTNS'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = l_form

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = G_FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " get_form_name

********************************************************************

*FORM CALL FORM

********************************************************************

FORM call_form.

CALL FUNCTION G_FM_NAME

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

W_J_1IEXCHDR = J_1IEXCHDR

W_LIFNR = J_1IMOVEND

W_LFA1 = LFA1

W_MKPF = MKPF

CHID = V_CHID

DESC1 = V_DESC1

DESC2 = V_DESC2

DESC3 = V_DESC3

REM_TIME = p_time

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

TJ_1IEXCDTL = TJ_1IEXCDTL

I_MSEG = I_MSEG

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " call_form

********************************************************************

*FORM FOR CHAPTER ID DETERMINATION

********************************************************************

FORM CHID .

move TJ_1IEXCDTL[] to TJ_1IEXCDTL_Temp[].

sort TJ_1IEXCDTL_Temp by chapid descending.

delete adjacent duplicates from TJ_1IEXCDTL_Temp comparing chapid.

loop at TJ_1IEXCDTL_Temp.

if sy-tabix > 2.

delete TJ_1IEXCDTL_Temp.

clear TJ_1IEXCDTL_Temp.

else.

if not TJ_1IEXCDTL_temp-chapid is initial.

condense v_chid.

if sy-tabix = 1.

concatenate v_chid TJ_1IEXCDTL_temp-chapid into v_chid.

else.

concatenate v_chid '/' TJ_1IEXCDTL_temp-chapid

into v_chid separated by space.

endif.

endif.

endif.

endloop.

data : begin of i_chid occurs 0,

J_1ICHT1 like J_1ICHIDTX-J_1ICHT1,

end of i_chid.

loop at TJ_1IEXCDTL_Temp.

select single J_1ICHT1 into i_chid-J_1ICHT1 from J_1ICHIDTX where

J_1ICHID = TJ_1IEXCDTL_Temp-CHAPID AND LANGU = SY-LANGU.

IF SY-TABIX > 1.

MOVE I_CHID-J_1ICHT1 TO V_DESC2.

else.

MOVE I_CHID-J_1ICHT1 TO V_DESC1.

ENDIF.

APPEND I_CHID.

CLEAR I_CHID.

ENDLOOP.

ENDFORM. " CHID

********************************************************************

*FORM FOR GETTING TAX DETAILS

********************************************************************

FORM GET_TAX_DETAILS.

refresh : it_ekpo,it_a003,it_konp,it_konv.

clear : it_ekpo,it_a003,it_konp,it_konv.

  • Fetching data Tax Indicator

select single * from ekko

where ebeln = TJ_1IEXCDTL-RDOC1.

select single * from ekpo

where ebeln = TJ_1IEXCDTL-RDOC1

and ebelp = TJ_1IEXCDTL-RITEM1

and matnr = TJ_1IEXCDTL-MATNR.

select kappl kschl knumh

into corresponding fields of table it_a003

from A003

where mwskz = ekpo-mwskz.

sort it_a003 by kappl kschl knumh.

  • Fetching data Conditions (Item)

select knumh kschl mwsk1 kbetr

from konp

into corresponding fields of table it_konp

for all entries in it_a003

where knumh = it_a003-knumh

and kappl = it_a003-kappl

and kschl = it_a003-kschl.

select knumv kposn kschl krech kbetr kwert

from konv

into corresponding fields of table it_konv

where knumv = ekko-knumv

and kposn = TJ_1IEXCDTL-RITEM1.

sort it_konp by kschl.

sort it_konv by knumv kposn.

loop at it_konp where mwsk1 = ekpo-mwskz.

if ( it_konp-kschl = 'JEC1' or

it_konp-kschl = 'JEC2' or

it_konp-kschl = 'ZSEC' or

it_konp-kschl = 'JNAC' or

it_konp-kschl = 'JCES' or

it_konp-kschl = 'JECS' ).

it_konp-kbetr = it_konp-kbetr / 10.

TJ_1IEXCDTL-CESS = TJ_1IEXCDTL-CESS + ( TJ_1IEXCDTL-EXBED * it_konp-kbetr ) / 100.

TJ_1IEXCDTL-CESSRATE = it_konp-kbetr.

endif.

endloop.

V_SUBTOTAL = TJ_1IEXCDTL-EXBAS + TJ_1IEXCDTL-EXBED + TJ_1IEXCDTL-CESS.

loop at it_konp where mwsk1 = ekpo-mwskz.

if ( it_konp-kschl = 'JIP1' or

it_konp-kschl = 'JIP2' or

it_konp-kschl = 'JIP3' or

it_konp-kschl = 'JIP4' or

it_konp-kschl = 'JIP5' or

it_konp-kschl = 'JIP6' or

it_konp-kschl = 'JIP7' or

it_konp-kschl = 'JIP8' or

it_konp-kschl = 'JIP9' ).

it_konp-kbetr = it_konp-kbetr / 10.

TJ_1IEXCDTL-TAX = TJ_1IEXCDTL-TAX + ( V_SUBTOTAL * it_konp-kbetr ) / 100.

TJ_1IEXCDTL-TAXRATE = it_konp-kbetr.

endif.

endloop.

loop at it_konp where mwsk1 = ekpo-mwskz.

if ( it_konp-kschl = 'ZRMD' or

it_konp-kschl = 'ZRMN' or

it_konp-kschl = 'ZCPD' or

it_konp-kschl = 'ZCPN' or

it_konp-kschl = 'ZFGD' or

it_konp-kschl = 'ZFGN').

it_konp-kbetr = it_konp-kbetr / 10.

TJ_1IEXCDTL-INDTAX = TJ_1IEXCDTL-INDTAX + ( TJ_1IEXCDTL-TAX * it_konp-kbetr ) / 100.

endif.

endloop.

loop at it_konv.

if ( it_konv-kschl = 'FRA1' or

it_konv-kschl = 'FRB1' or

it_konv-kschl = 'FRC1' or

it_konv-kschl = 'FRA2' or

it_konv-kschl = 'FRB2' or

it_konv-kschl = 'FRC2' or

it_konv-kschl = 'ZPAF' or

it_konv-kschl = 'ZPFA').

TJ_1IEXCDTL-FREIGHT = TJ_1IEXCDTL-FREIGHT + it_konv-kwert.

if it_konv-krech = 'A'.

TJ_1IEXCDTL-FRTRATE = it_konv-kbetr / 1000.

endif.

endif.

endloop.

ENDFORM.

Regards,

Former Member
Not what you were looking for? View more on this topic or Ask a question