Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10519

How to convert one data type to another data type ?

$
0
0

Hi ,

 

        While inserting records from internal table to table I am getting problem because of the field ERFMG. The data type of table was declared in table as  'QUAN' data type. While checking the program, it's showing error the field ERFMG must be C, I, N or string type. If i declared the data type as char while inserting records into ztable I am getting unicode convertible error(i.e the database  table and internal table are not having same structure.)

 

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

PARAMETERS     : aps_ztab RADIOBUTTON GROUP abc.

PARAMETERS     : prs_ztab RADIOBUTTON GROUP abc  MODIF ID fda.

SELECTION-SCREEN:END OF BLOCK b1.

 

TYPES: BEGIN OF ty_zdsl,

* mandt TYPE zdsl-mandt,

*       werks TYPE zdsl-werks,

*       pallet_id TYPE zdsl-pallet_id,

*       matnr TYPE zdsl-matnr,

*       erfmg(20) TYPE c,

*       uom TYPE zdsl-uom,

*       lgort TYPE zdsl-lgort,

*       lot TYPE zdsl-lot,

*       prod_date TYPE zdsl-prod_date,

*       ebeln TYPE zdsl-ebeln,

*       erdat TYPE zdsl-erdat,

*       erzet TYPE zdsl-erdat,

*       ernam TYPE zdsl-ernam,

*       aedat TYPE zdsl-aedat,

*       username TYPE zdsl-username,

*       floc TYPE zdsl-floc,

*  END OF ty_zdsl.


DATA:p_file TYPE rlgrap-filename,

      s_file TYPE rlgrap-filename,

      t_file TYPE string.

 

IF aps_ztab  = 'X'.

   PERFORM read_file.      " read file from application server to internal table"

   PERFORM update_file.  "  insert data from internal table to ztable".

ENDIF.

 

IF prs_ztab = 'X'.

   PERFORM upload_file.      " File uploaded from presentation server to internal table".

   PERFORM update_data.     "insert data fron internal table to ztable".

ENDIF.

 

      If I need to change the data type please suggest me how to do it.

 

 

Note: I am getting the error of ERFMG is should be of data type c,n or string in the line of split command in Form routine "read_file" ( while downloading from application server) if i declared it as it is in the form of ztabl

 

regards,

suneel.


Viewing all articles
Browse latest Browse all 10519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>