‎2007 Feb 21 4:32 PM
Hello,
I am trying to append a line to a table and pass this tables in the tables parameter to the other function but i am getting a compilation error. Here is what i have.
in the declaration of function f1 in the tables section i have a table called component:
FUNCTION f1.
*" TABLES
*" COMPONENT STRUCTURE SDOKCOMPRP OPTIONAL
Here i write code to append one line to COMPONENT*******
then i want to call function 'SDOK_PHIOS_FILE_PROPERTIES_GET'
and i am calling it this way:
call function 'SDOK_PHIOS_FILE_PROPERTIES_GET'
tables:
component = COMPONENTS
BAD_OBJECTS = BADOBJ.
Now this is giving a compilation error saying that COMPONENTS is unknow,
After modifying the table in function f1 i want to send it to function ''SDOK_PHIOS_FILE_PROPERTIES_GET' which will modify the table again and return it to fucntion f1. Does anyone know how to do this ?
Thank you'
‎2007 Feb 21 4:47 PM
if the table is modied by the function f1 it returns sy-subrc = 0 if it is 0 then pass it to function F2 and here to check the sy-subrc and if it is 0 then pass it again to function F1 by calling it.
‎2007 Feb 21 4:44 PM
Hi,
Is this a typo..
You have given the parameter as COMPONENT ..But you are passing COMPONENTS..
*" TABLES
*" <b>COMPONENT</b> STRUCTURE SDOKCOMPRP OPTIONAL
call function 'SDOK_PHIOS_FILE_PROPERTIES_GET'
tables:
component = <b>COMPONENTS</b>
THanks,
Naren
‎2007 Feb 21 4:49 PM
No it is not a typo,
When i try components = component.
it compiles and works, but this will assign the table components found in function 'SDOK_PHIOS_FILE_PROPERTIES_GET'
to the table component declared in my function f1. But this is not what i want, i want to modify the table component "which is declared in my fucntion and is of the same type of COMPONENTS declared in the second function" after mmodifying it i want to send it to fucntion 'SDOK_PHIOS_FILE_PROPERTIES_GET' to further process it and then i want to send COMPONENTS function from 'SDOK_PHIOS_FILE_PROPERTIES_GET' back to f1 so that i can read the values from it. Any ideas on how to send these tables back and forth ?
thank you
‎2007 Feb 21 4:47 PM
if the table is modied by the function f1 it returns sy-subrc = 0 if it is 0 then pass it to function F2 and here to check the sy-subrc and if it is 0 then pass it again to function F1 by calling it.
‎2007 Feb 21 4:59 PM
i cannot understand it clearly...
but i wht i think is...
component is an internal table
which ur passing it to function module F1 and here the values in the table component changes, noe u want to send the changed component table to function F2 and here too component table get changed and u want this component table to be send back to function F1...
‎2007 Feb 21 5:09 PM
yes,
f1 has a table call it x, f1 modifies x and want to send it to f2 "f2 is an internal sap function, and has an internal tables called y which is the same type as x" f2 also changes table x and now it returns it to f1 which prints its content. this is what i want to do but it is not working. for some reason, this is not taking place, i am not knowing how to send the tables back and forth,
inside f1 i say
call function 'f2'
tables:
y=x.
but when i am debugging, i enter into fucntion f2 and its copy of table y is not equal to the values inside x, so how to send this table x from f1 to f2 ?
Tahnks
‎2007 Feb 21 4:56 PM
Hi,
I still didn't understand your requirement..
You have the tables parameter
*" COMPONENT STRUCTURE SDOKCOMPRP OPTIONAL
If you don't want to modify the COMPONENT parameter..
Then declare a local internal table..
DATA: T_COMPONENT LIKE SDOKCOMPRP OCCURS 0 WITH HEADER LINE.
T_COMPONENT[] = COMPONENT[].
***APPEND THE LINE to the table T_COMPONENT.
pass T_COMPONENT to the FM..
call function 'SDOK_PHIOS_FILE_PROPERTIES_GET'
tables:
component = <b>T_COMPONENT</b>
BAD_OBJECTS = BADOBJ.
If this is not what you want..Please explain your requirement in detail..
Thanks,
Naren