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

smartforms

Former Member
0 Likes
664

Hi Group,

I have designed a layout using smartforms and also written a driver program for that.

select EBELN

LIFNR

ZTERM

BEDAT

INCO1

from EKKO

INTO TABLE IT_EKKO WHERE EBELN = P_EBELN.

IF IT_EKKO IS NOT INITIAL.

SELECT EBELN

EBELP

MATNR

WERKS

MENGE

MEINS

PEINH

NETPR

FROM EKPO INTO TABLE IT_EKPO

FOR ALL ENTRIES IN IT_EKKO WHERE EBELN = IT_EKKO-EBELN.

SELECT LIFNR

ADRNR

FROM LFA1 INTO TABLE IT_LFA1

FOR ALL ENTRIES IN IT_EKKO WHERE LIFNR = IT_EKKO-LIFNR.

SELECT KUNNR

ADRNR

FROM KNA1

INTO TABLE IT_KNA1

FOR ALL ENTRIES IN IT_EKKO WHERE KUNNR = IT_EKKO-KUNNR.

SELECT WERKS

NAME1

STRAS

PSTLZ

ORT01

LAND1

REGIO

FROM T001W INTO TABLE IT_T001W

FOR ALL ENTRIES IN IT_EKPO WHERE WERKS = IT_EKPO-WERKS.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZTEST1'

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION FM_NAME

TABLES

IT_EKKO = IT_EKKO

IT_EKPO = IT_EKPO

IT_ADRC = IT_ADRC

IT_LFA1 = IT_LFA1

IT_KNA1 = IT_KNA1

IT_T001W = IT_T001W

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " TEST_SMARTFORMS

this is my source code. i have designed the layout

in which i have declared

form interface

tables

it_ekko like ekko,

it_ekpo like ekpo

etc.,

in global data

wa_ekko type ekko,

wa_ekpo type ekpo,

etc.,

i am getting an error as

Type conflict when calling a function module (field length).

i am getting thsi error at call function fm_name.

i am getting the data perfectly in the report but its not getting populated in the smartform.

Regards

Jackson

can somebody tell me where i m wrong ..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
640

Have you declared your fm_name as follows:

data: fm_name TYPE rs38l_fnam

Check if you are getting any data in your internal tables.

Have you declared your internal table as follows:

for.e.g:

DATA: gt_receipts TYPE STANDARD TABLE OF bapitrvreo

INITIAL SIZE 0 WITH HEADER LINE.

Also, have you declared the internal tables in smartforms in global interface, tables tab?

It should be of same type.

For e.g.: The above is declared in smartforms as follows:

gs_receipts type bapitrvreo

Check this link for sample smartforms. You will get better idea.

http://www.erpgenie.com/abap/smartforms.htm

Thanks,

Santosh

Message was edited by:

SKJ

Message was edited by:

SKJ

7 REPLIES 7
Read only

Former Member
0 Likes
641

Have you declared your fm_name as follows:

data: fm_name TYPE rs38l_fnam

Check if you are getting any data in your internal tables.

Have you declared your internal table as follows:

for.e.g:

DATA: gt_receipts TYPE STANDARD TABLE OF bapitrvreo

INITIAL SIZE 0 WITH HEADER LINE.

Also, have you declared the internal tables in smartforms in global interface, tables tab?

It should be of same type.

For e.g.: The above is declared in smartforms as follows:

gs_receipts type bapitrvreo

Check this link for sample smartforms. You will get better idea.

http://www.erpgenie.com/abap/smartforms.htm

Thanks,

Santosh

Message was edited by:

SKJ

Message was edited by:

SKJ

Read only

0 Likes
640

hi santosh,

i did that but still the smartform returns empty.

regards

jackson

Read only

0 Likes
640

hi santosh,

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught in

procedure "TEST_SMARTFORMS" "(FORM)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The call to the function module "/1BCDWB/SF00000002" is incorrect:

In the function module interface, you can specify only

fields of a specific type and length under "IT_ADRC".

Although the currently specified field

" " is the correct type, its length is incorrect.

this is the exact errr message

Read only

0 Likes
640

I dont see IT_ADRC table used in your program and still you are trying to pass this internal table to function module.

Is this IT_ADRC empty?

Thanks,

Santosh

Read only

0 Likes
640

Hi santosh,

Now when i remove IT_ADRC i am getting the same error for IT_EKKO. i donno where am i going wrong .. could you rectify me.

Regards

Jackson

Read only

0 Likes
640

hi santosh,

could you give me a sample code so that i can understand . I would really appreciate that.

regards

jackson

Read only

0 Likes
640

Hi santosh,

I am getting the data into the internal tables but its not getting into the smartforms.

Regards

Jackson