11-15-2006 10:41 AM
Hi
As you probably can see by the question, my ABAP Knowledge isn't exactly overwhelming !
<i>anyway:</i>
I'm trying to create a function module in NW2004s, This functionmodule should take an internal table, based on a structure as (import) parameter.
In the earlier version, I've done this by defining it under the TAB 'Tables' in the function builder - But know its telling me that "<i>Tables Parameters are obsolete</i>", and that I should define it under "Changing" instead.
I have tried that, but I'm only allowed to pass a single line, and if I try to do a Loop, in the function module, it tells me that ity isn't created as an internal table.
So please - what is the "best practice" here ?
Regards
Morten Nielsen
11-15-2006 12:47 PM
Hi Morten,
You should define a table type Standard table in transaction SE11. In transaction SE11 go to field Data Type and insert the name of table, click on button create and select Table Type in the pop up window showed, in the next screen define the Line type of the table, the lyne type can be a structure, then select Standard table in TabStrip Initialización and Access.
Put this new Table Type in the changing parameters of your function Module, and it will work like a standard table.
Regards,
Alejandro.
11-15-2006 12:39 PM
I am still on 47.. but you can try this... create a Table TYPE with in se11 with the desired fields & define a CHANGING parameter of this TYPE in your function module..
~Suresh
11-15-2006 12:45 PM
Hi
U can define you CHANGING parameter as type TABLE, so you'll have a table parameter there.
In this case the problem is this parameter has any reference, so It can be hard to manage it by ABAP.
Another solution is create a type table Z<...> in dictionary and then create the CHANGING parameter in reference to this type.
In both solution you'll have a table without header line.
Max
11-15-2006 12:47 PM
Hi Morten,
You should define a table type Standard table in transaction SE11. In transaction SE11 go to field Data Type and insert the name of table, click on button create and select Table Type in the pop up window showed, in the next screen define the Line type of the table, the lyne type can be a structure, then select Standard table in TabStrip Initialización and Access.
Put this new Table Type in the changing parameters of your function Module, and it will work like a standard table.
Regards,
Alejandro.
11-15-2006 3:33 PM
Hi
Thanks guys !
I have tried to create a table type, but it gives me an internal table without a header line - how do I get the Header line as well ?
Regards
Morten Nielsen
11-15-2006 3:39 PM
11-15-2006 3:49 PM
11-15-2006 3:52 PM
11-15-2006 3:54 PM
1. Create a structure in SE11, this will include all the fields you want.
2. Create a Table type in SE11, referring the above structure as the row type.
3. Now, when you use this table type you would need to have a work area to process the data of the table. So, in the program declare a variable with ref to the structure created in Step 1.
Then you can use
LOOP AT T_ITAB INTO WA_ITAB.
ENDLOOP.
where T_ITAB is referring to table type and WA_ITAB is referring to structure.
Regards,
Ravi
Note - Please mark all the helpful answers
11-15-2006 4:02 PM
01-08-2007 9:51 PM
Hi All,
I followed Steps 1 and 2 but when I use the following select statement I get a dump with the error enclosed.
Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
Step 4. When I use the following select clause I am getting a dump.
DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
SELECT *
FROM dfkkcohi
INTO CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
WHERE cotyp EQ zcotyp
AND gpart EQ zgpart
AND corr_status EQ zcorr_status.
LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
*Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
*Append ZDFKKCOHIOUT.
*Clear IT_ZDFKKCOHI.
ENDLOOP.
What could be wrong?
Thanks for all your help in advance.
Regards,
Divya