Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with conversion of Data Types

Former Member
0 Kudos
65

Hi,

In my program I need to consider a internal in the follwoing fashion. But

actually LABST is "Valuated stock with unrestricted use"

with DATA TYPE : QUAN and length 13 with decimal length 3.

How to do conversion with out any error.

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

data: begin of i_mard occurs 0,

matnr like mard-matnr,

labst(17) type <b>N</b>, "otherwise what I have to change

end of i_mard,

select matnr labst from mard into table i_mard.

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

I dont want to use labst like mard-labst.If its necessary to declare like that I use this .So I think I need to create one more internal table and I have to pass this internal table to it again I think

Please help me in this regard.

This is going to Short dump

3 REPLIES 3

Former Member
0 Kudos
42

Hi,

Better, You can declare LABST like MARD-LABST in the Itab.

But what are you going to do with this int table?

Regards,

Anji

0 Kudos
42

Hi Anji Reddy

In order to make heading in Excel Sheet .Its not accepting String heading for the numberical Fields .So I was forced to declare variables not as table fields.

report y_test.

data: begin of i_mard occurs 0,

matnr like mard-matnr,

labst(17) type n, "<b> I have written this instead of labst like mard-labst.</b>

end of i_mard,

begin of it_fnames occurs 0,

reptext like dfies-reptext,

end of it_fnames.

select matnr LABST from mard into table i_mard.

it_fnames-reptext = 'MATERIAL'.

Append it_fnames.

*it_fnames-reptext = <b>'Valued Stock'</b>.

*Append it_fnames.

CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME = 'C:\T001'

DATA_SHEET_NAME = 'Companies'

TABLES

DATA_TAB = i_MARD

FIELDNAMES = <b>it_fnames</b>

EXCEPTIONS

FILE_NOT_EXIST = 1

FILENAME_EXPECTED = 2

COMMUNICATION_ERROR = 3

OLE_OBJECT_METHOD_ERROR = 4

OLE_OBJECT_PROPERTY_ERROR = 5

INVALID_FILENAME = 6

INVALID_PIVOT_FIELDS = 7

DOWNLOAD_PROBLEM = 8

OTHERS = 9

.

Former Member
0 Kudos
42

hi Satya,

declare in this way then

data: begin of i_mard occurs 0,
matnr like mard-matnr,
*labst(17) type N, "otherwise what I have to change
 labst(13) type P decimals 3,
end of i_mard,