‎2005 Aug 17 12:11 AM
hi folks,
I am reading the data into an internal table and the code goes like this..
'zstatment_aging' is a database table where
OPSUM, RAST1,RAST2,RAST3, RAST4 ARE currency fields of the table
ABAP print program ....
types: begin of agingdata,
kunnr type zstatment_aging-kunnr,
PARTNER type zstatment_aging-Partner,
SORTL TYPE zstatment_aging-sortl,
OPSUM type zstatment_aging-OPSUM,
RAST1 type zstatment_aging-RAST1,
RAST2 type zstatment_aging-RAST2,
RAST3 type zstatment_aging-RAST3,
RAST4 type zstatment_aging-RAST4,
end of agingdata.
data: agingdataitab type standard table of agingdata with header line..
select single * from zstatment_aging into corresponding fields of agingdataitab where
kunnr = p_custid and partner = p_advnum.
ERROR********* IS COMING IN THE DECLARATION
FUNCTION MODULE
call function fm_name
exporting
archive_index =
archive_parameters =
control_parameters =
mail_appl_obj =
mail_recipient =
mail_sender =
output_options =
user_settings = 'X'
.
.
.
.
.
TABLES
ZAGING = AGINGDATAITAB
In the smartforms I have declared,
Under
Form Interface - > Tables
ZAGING LIKE ZSTATMENT_AGING (TABLE NAME)
Throwing an error saying that incorrectly called function module.
what is the error here? How can i correct this to display data into the form?
Please help me it is urgent!!!
Thanks
Santhosh
‎2005 Aug 17 12:15 AM
‎2005 Aug 17 12:51 AM
Hi,
Define, ZAGING type internal table of ZSTATMENT_AGING.
Looking at your cirrent declaration it looks like a structure.
Please get back , if this does not work . I would recommend if you can just cut and paste that part of code.
Thanks,
‎2005 Aug 17 12:51 AM
Santhosh,
Is ZSTATEMENT_AGING exactly the same as Type AGINGDATA?
If not then try:
data: agingdataitab type standard table of ZSTATEMENT_AGING with header line.
If ZSTATEMENT_AGING has more fields than type AGINGDATA then the table definition is in conflict which would explain your syntax error.
Cheers,
Pat.
‎2005 Aug 17 3:54 AM
Yes, Patrick is correct, this is obviously a db table and right at the start you know that there not the same because in the internal table, there is no MANDT. You need to be passing a table which is identical to what the function module is expecting, otherwise you will get a runtime error. Do as Patrick suggested, or create a structure in the data dictionary which matches the structure of the internal table, and use this structure in your TABLES parameter of the function module. Also, you will probably want to add the word TABLE to the select statement, otherwise your internal table will not get filled.
select single * from zstatment_aging into corresponding fields of <b>TABLE</b> agingdataitab where
kunnr = p_custid and partner = p_advnum.Regards,
Rich Heilman
‎2005 Aug 17 1:45 PM
The program is giving me a runtime error. The issue is coming while transferring the data from ' agingdataitab' to 'zaging'
' zstatment_aging ' is a db table.
This is the message I am getting.
Error: In the function module interface you can specify only the fields of a specific type and length under 'ZAGING' Although the currently specified field 'AGINGDATAITAB' is the correct type, its length is incorrect.
‎2005 Aug 17 1:50 PM
‎2005 Aug 17 1:50 PM
Hi Santosh,
It seems the total field length of AGINGDATAITAB and ZAGING are not same even if the type is same. Can you check the field length please?
Thanks
Vinod
‎2005 Aug 17 1:57 PM
Got it !!! solved it on my own. had to create the table type and got it done.
Santhosh
‎2005 Aug 17 2:02 PM
‎2005 Aug 17 1:52 PM
Hi Santosh.
The declaration in your Smartform:
ZAGING LIKE ZSTATMENT_AGING
Will declare ZAGING as a structure and not as table, despite the fact that ZSTATMENT_AGING is a DB table. To accomplish the result you want you should declare a table type in de data dictonary (say ZT_AGINGTAB) with line structure ZSTATMENT_AGING.
Then you can declare in your Smartform:
ZAGING LIKE ZT_AGINGTAB.
Regards,
John.
‎2005 Aug 17 10:33 PM
Yes, That exactly what I mentioned to you on my first post. Please award points and mark this as solved.
Thanks,.