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

form interface using currency fields - smartforms urgent!!!!

Former Member
0 Likes
1,412

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

11 REPLIES 11
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,212

What is the value of FM_NAME which is used in the statement CALL FUNCTION FM_NAME. Is this value the correct value? In SMARTFORMS, check the function module name and make sure that it is the same in the program.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,212

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,

Read only

former_member221770
Contributor
0 Likes
1,212

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.

Read only

0 Likes
1,212

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

Read only

0 Likes
1,212

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.

Read only

0 Likes
1,212

AGINGDATAITAB needs to be of the same structure as ZAGING. You need to define your itab like this.

DATA: AGINGDATAITAB type table of ZSTATMENT_AGING with header line.

Regards,

Rich Heilman

Read only

0 Likes
1,212

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

Read only

0 Likes
1,212

Got it !!! solved it on my own. had to create the table type and got it done.

Santhosh

Read only

0 Likes
1,212

If any of these answers have been helpful, please reward accordingly. Also, please mark this post as "Solved".

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,212

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.

Read only

Former Member
0 Likes
1,212

Yes, That exactly what I mentioned to you on my first post. Please award points and mark this as solved.

Thanks,.