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

Re: How to convert one data type to another data type ?

$
0
0

Hi Suneel,

 

When you are reading the flat file it should be fields as character data type only!

 

Read the file with all character type fields only ( even your ERFMG).

 

Store the file contents in one internal table and  declared one more internal table type of your Z table.

 

Move the entries to Z internal table and insert the entries.

 

 

* Make it the internal table file read as below!

 

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.


* declare the one more internal table with reference of your Z table

TYPES: BEGIN OF ty_zdsl_update,

* mandt TYPE zdsl-mandt,

*       werks TYPE zdsl-werks,

*       pallet_id TYPE zdsl-pallet_id,

*       matnr TYPE zdsl-matnr,

*       erfmg type ztable-erfmg,

*       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_update.



it_zdsl_update[] = it_zdsl[].


modify Ztable from it_zdsl_update





Viewing all articles
Browse latest Browse all 9146

Trending Articles



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