2007 Dec 11 8:16 AM
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.
2007 Dec 11 9:55 AM
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.
2007 Dec 11 8:22 AM
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
2007 Dec 11 9:39 AM
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
2007 Dec 11 9:47 AM
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
2007 Dec 11 9:55 AM
Hai Matthew,
What is the use of <b>with non-unique key table_line</b>
2007 Dec 11 10:03 AM
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
2007 Dec 11 10:25 AM
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.
2007 Dec 11 10:41 AM
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
2007 Dec 11 11:15 AM
> 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