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

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

$
0
0

Hi Suneel!

 

Why you are using the field symbol! If you don't know how to use the field symbol don't use it.

 

Make sure that your total program has to work with field symbols or work areas. don't mix up the things.

 

Please change your code as mentioned below! let me know if you have any problem.

 

FORM apserv_itab .

 

   DATA:l_data TYPE string.

 

   p_file = '\\dj56bi00v\migration\migration\CSVManual\suneel.txt'.

 

   OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

 

   IF sy-subrc NE 0.

 

     MESSAGE 'UNABLE TO OPEN THE FILE' TYPE 'I'.

 

   ENDIF.

 

   DO.

 

     READ DATASET p_file INTO l_data.

 

     IF sy-subrc = 0.

 

       SPLIT l_data AT cl_abap_char_utilities=>horizontal_tab  INTO wa_zdsl-mandt

 

                               wa_zdsl-werks

 

                               wa_zdsl-pallet_id

 

                               wa_zdsl-matnr

 

                               wa_zdsl-erfmg

 

                               wa_zdsl-uom

 

                               wa_zdsl-lgort

 

                               wa_zdsl-lot

 

                               wa_zdsl-prod_date

 

                               wa_zdsl-ebeln

 

                               wa_zdsl-erdat

 

                               wa_zdsl-erzet

 

                               wa_zdsl-ernam

 

                               wa_zdsl-aedat

 

                               wa_zdsl-username

 

                               wa_zdsl-floc.

 

move-corresponding wa_zsdl to wa2.

 

move wa_zsdl-erfmg to wa2-erfmg.

 

append wa2 to me_zdsl.

append wa_zdsl to it_zdsl.

clear: wa2,

       wa_zdsl.

 

     ELSE.

 

       EXIT.

 

     ENDIF.

 

   ENDDO.

 

 

 

 

 

ENDFORM.                    " APSERV_ITAB


Viewing all articles
Browse latest Browse all 8497

Trending Articles



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