Application Development and Automation 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: 
Read only

Table type & line type, cannot pass values

Former Member
0 Likes
1,647

HI,

I cannot pass from line type to table type...


REPORT  ZTEST_FIRST.

data: itab1 TYPE tdt_docflow,
      wa_itab type tds_docflow.

wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.

export itab1 to MEMORY ID 'ABCDE'.

submit ztest_second and return.

BREAK-POINT.

itab1 is filling with docnum.

in second report when i try to import i am not getting values.


REPORT  ZTEST_SECOND.

data: itab2 TYPE STANDARD TABLE OF tdt_docflow,
      wa_itab2 type tds_docflow.

import itab2 FROM MEMORY ID 'ABCDE'.

BREAK-POINT.

any suggestions?

Giri

15 REPLIES 15
Read only

Former Member
0 Likes
1,434

HI Giri,

REPORT  ZTEST_FIRST.
 
data: itab1 TYPE tdt_docflow,        " This is Like Work Area not Table Type here
      wa_itab type tds_docflow.
 
wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.
 
export itab1 to MEMORY ID 'ABCDE'.
 
submit ztest_second and return.
 
BREAK-POINT.
 


itab1 is filling with docnum.

in second report when i try to import i am not getting values.

REPORT  ZTEST_SECOND.
 
data: itab2 TYPE STANDARD TABLE OF tdt_docflow,       " This is not Work Area type but Internal Table type here
      wa_itab2 type tds_docflow.
 ** 
import itab2 FROM MEMORY ID 'ABCDE'. " Hence you need to Change either one of them according to your requirement
 
BREAK-POINT.

Hope this is clear to you

Cheerz

Ram

Read only

0 Likes
1,434

Hi ram,

i want to use type standard table in second report....

when i change that in first report... its says not compatible....

how to declare in itab1 in first report and how to pass values?

Giri

Read only

0 Likes
1,434

Hi Giri,

Try this,


REPORT  ZTEST_FIRST.
 
data: itab1 TYPE TABLE OF tdt_docflow,
      wa_itab type tds_docflow.
 
wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.
 
export itab1 to MEMORY ID 'ABCDE'.
 
submit ztest_second and return.
 
BREAK-POINT.

in the second report :


REPORT  ZTEST_SECOND.
 
data: itab2 TYPE STANDARD TABLE OF tdt_docflow,
      wa_itab2 type tds_docflow.
 
import itab1 to itab2 FROM MEMORY ID 'ABCDE'.
 
BREAK-POINT.

I tried the above code and it works for me.

Read only

0 Likes
1,434

Hi vasuki,

i tried with both



REPORT  ZTEST_FIRST.
 
data: itab1 TYPE TABLE OF tdt_docflow,
      wa_itab type tds_docflow.
 
wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.
 
export itab1 to MEMORY ID 'ABCDE'.
 
submit ztest_second and return.
 
BREAK-POINT.

and


REPORT  ZTEST_FIRST.
 
data: itab1 TYPE STANDARD TABLE OF tdt_docflow,
      wa_itab type tds_docflow.
 
wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.
 
export itab1 to MEMORY ID 'ABCDE'.
 
submit ztest_second and return.
 
BREAK-POINT.

i am getting same syntax error - *"WA_ITAB" cannot be converted to the line type of "ITAB1". *

Giri

Read only

0 Likes
1,434

Change the declaration as follows:


REPORT  ZTEST_FIRST.

data: itab1 TYPE TABLE OF tdt_docflow,
      wa_itab like line of itab1.                                           "Work area decl changed


REPORT  ZTEST_SECOND.

data: itab2 TYPE TABLE OF tdt_docflow,
      wa_itab like line of itab2.                                           "Work area decl changed

test this

Read only

0 Likes
1,434

Hi vasuki,

getting error "WA_ITAB" is a table without a header line and therefore has no component called "DOCNUM".

Giri

Read only

0 Likes
1,434

can u pls post the code here.

Its working perfectly for me.

Read only

0 Likes
1,434

Hi,

Did you try Vikranth's suggestion?


data: itab1 TYPE  tdt_docflow,
      wa_itab2 type tds_docflow.

import itab1 FROM MEMORY ID 'ABCDE'.

Read only

0 Likes
1,434

HI,

I need to use Type Standard table of in second report, as i am submitting to the standard report..so i cant modify...

i want to export from first report as standard type table .....

vikrant's code is working but i still need this to fix the problem....

Vasuki: code is exactly you pasted....


REPORT  ZTEST_FIRST.

data: itab1 TYPE TABLE OF tdt_docflow,
      wa_itab like LINE OF itab1.

wa_itab-docnum = '12345'.
APPEND wa_itab to itab1.

export itab1 to MEMORY ID 'ABCDE'.

submit ztest_second and return.

BREAK-POINT.

I am expecting like


REPORT  ZTEST_FIRST.

data: itab1 TYPE STANDARD TABLE OF tdt_docflow,
      wa_itab type tds_docflow.

wa_itab-docnum = '12345'. 
APPEND wa_itab to itab1.  " this append need to change

export itab1 to MEMORY ID 'ABCDE'.

submit ztest_second and return.

BREAK-POINT.

Giri

Read only

0 Likes
1,434

sorry Giri, I was trying in my system with a table and not a table type. But in your code tdt_docflow is a table type so it is wrong to declare


 data: itab1 TYPE TABLE OF tdt_docflow,

so you will have to use


data: itab1 TYPE  tdt_docflow,

Read only

0 Likes
1,434

In second report can i use STANDARD table of or only Type?

Giri

Read only

0 Likes
1,434

even in the second you will have to use 'TYPE' and not 'STANDARD TABLE' of .

But why do u want to decalre it as STANDARD TABLE OF ? it will create an internal table, but even its rows would be internal tables. Why would you wnat to do that?

Read only

0 Likes
1,434

the second report has declared as Type standard table of..... which i am not authorized to modify....

so want to make it same in first report.

if it is not possible then i will close the thread... by end of day...

may be some more ideas guys?

Giri

Read only

Former Member
0 Likes
1,434

Hello,

In the second report, declare itab1 and use that in the IMPORT and check.


REPORT  ZTEST_SECOND.
 
data: itab2 TYPE STANDARD TABLE OF tdt_docflow,
        itab1 TYPE STANDARD TABLE OF tdt_docflow,   "Add this
      wa_itab2 type tds_docflow.
 
import itab1 FROM MEMORY ID 'ABCDE'.

append lines of itab1 to itab2.
 
BREAK-POINT.

Vikranth

Read only

nirajgadre
Active Contributor
0 Likes
1,434

HI,

Declare the both the tables as the standard table.

Try to use the statement

Export T_data from lt_tab1[] to MEMORY iID 'ABCDE'.

IMPORT T_DATA TO lt_tab1 FROM MEMORY ID 'ABCDE'.