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

Problem in SE24 Transaction

Former Member
0 Likes
2,164

Hi,

This is my coding, here after move all the data to internal table(IT_EMP), i should export this internal table, i declared this internal table as export parameter, but error is coming IT_EMP has already been declared, then how i can export this internal table? If any one know explain to me.

method MOVE_FROM_SCREEN.

DATA:IT_EMP TYPE STANDARD TABLE OF ZEMP,

WA_EMP LIKE LINE OF IT_EMP.

READ TABLE IT_EMP INTO WA_EMP TC-CURRENT_LINE..

MOVE-CORRESPONDING ZEMP TO WA_EMP.

MODIFY: IT_EMP FROM WA_EMP.

endmethod.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,948

Hai Matthew,

What is the use of <b>with non-unique key table_line</b>

Hi,

This is my coding, here after move all the data to internal table(IT_EMP), i should export this internal table, i declared this internal table as export parameter, but error is coming IT_EMP has already been declared, then how i can export this internal table? If any one know explain to me.

method MOVE_FROM_SCREEN.

DATA:IT_EMP TYPE STANDARD TABLE OF ZEMP,

WA_EMP LIKE LINE OF IT_EMP.

READ TABLE IT_EMP INTO WA_EMP TC-CURRENT_LINE..

MOVE-CORRESPONDING ZEMP TO WA_EMP.

MODIFY: IT_EMP FROM WA_EMP.

endmethod.

8 REPLIES 8
Read only

matt
Active Contributor
0 Likes
1,948

Did you create an export parameter for the table?

First, you'll need to define a type on the SE24 types tab - something like

emp_table type standard table of zemp with non-unique key table_line.

Then, from the Method tab of SE24, put the cursor on your method, and click on the parameters button.

Here enter IT_EMP as an exporting parameter with the type e.g. emp_table, as defined earlier.

Then your method implementation is:

WA_EMP LIKE LINE OF IT_EMP.

READ TABLE IT_EMP INTO WA_EMP TC-CURRENT_LINE..
MOVE-CORRESPONDING ZEMP TO WA_EMP.
MODIFY TABLE IT_EMP FROM WA_EMP.

matt

Read only

Former Member
0 Likes
1,948

Hai Matthew.

How i can declare <b> emp_table type standard table of zemp with non-unique key table_line.</b> in TYPES tab? Because in TYPES tab only following fields is there TYPES, VISIBILITY, TYPING, ASSOCIATED TYPE, DESCRIPTION.

TYPES - EMP_TABLE.

VISIBILITY- PUBLIC.

TYPING- TYPE.

ASSOCIATED TYPE- emp_table type standard table of zemp with non-unique key table_line.

It's coming error

Read only

matt
Active Contributor
0 Likes
1,948

Go to the Types tab.

Enter the name and visibility of your type. Then click on the arrow button. This takes you into the editor, where you can specify the type as I indicated.

Or, you can from the main SE24 screen, use menu goto->public/protected/private section, and enter your type directly there.

If the type is only going to be used within the class, make it PRIVATE. If it has subclasses that need it, make it PROTECTED. Only if it is to be used outside of the class should you declare it public.

matt

Read only

Former Member
0 Likes
1,949

Hai Matthew,

What is the use of <b>with non-unique key table_line</b>

Read only

matt
Active Contributor
0 Likes
1,948

It's part of the full specification of a table type. If you were to use this type in the definition of another type, you'd be forced to, syntactically, to use the full specification. So I always put it in anyway.

It says that the table being defined as a key that isn't unique (so you can have more than one entry with the same key), and that the key is made up of all the fields (table_line).

matt

Read only

Former Member
0 Likes
1,948

Hai Matthew,

Thanks for your solution it's working fine, but i need some more information please give that solution for that problem also.

How i can Pass <b>TC-CURRENT_LINE</b> value to SE24 transaction through program.

Because i am using <b>TC-CURRENT_LINE</b> variable in the following program.

DATA: WA_EMP LIKE LINE OF IT_EMP.

READ TABLE IT_EMP INTO WA_EMP INDEX <b>TC-CURRENT_LINE</b>

MOVE-CORRESPONDING ZEMP TO WA_EMP.

MODIFY: IT_EMP FROM WA_EMP.

Read only

0 Likes
1,948

Hi Uadaya,

In your method MOVE_FROM_SCREEN, you define an importing parameter line_no of type 'I' and then during call of this method, u pass it in the exporting parameter from your program.

Pls reward if it is useful.

Regards,

Ratheesh V

Read only

matt
Active Contributor
0 Likes
1,948

> Hai Matthew,

> Thanks for your solution it's working fine, but i

> need some more information please give that solution

> for that problem also.

>

> How i can Pass <b>TC-CURRENT_LINE</b> value to

> SE24 transaction through program.

> Because i am using <b>TC-CURRENT_LINE</b> variable in

> the following program.

>

> DATA: WA_EMP LIKE LINE OF IT_EMP.

>

> READ TABLE IT_EMP INTO WA_EMP INDEX

> <b>TC-CURRENT_LINE</b>

> MOVE-CORRESPONDING ZEMP TO WA_EMP.

> MODIFY: IT_EMP FROM WA_EMP.

Well, in the same way you defined an exporting parameter for your method, now you need to define an importing parameter to contain the value of your current line.

If you try and work out how to do this yourself, then you are more likely to remember.

matt