Application Development 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: 

Problem with adding field to fieldcatlalog

former_member670836
Participant
0 Kudos

Hi experts,

Actually i am adding a field to field catalog by using

PERFORM FILL_FIELD_CAT USING '9' TEXT-CU1 TEXT-AM2 ' ' TEXT-CU2 '' '' '' '' '' ''. "land1( Text-CU1 = Land1 and Text-cu2 = Customer Country code)

Form is

FORM FILL_FIELD_CAT USING P_COLPOS TYPE SYCUCOL

P_FLDNAM TYPE FIELDNAME

P_TABNAM TYPE TABNAME

P_JUSTIF TYPE CHAR1

P_SELTEXT TYPE DD03P-SCRTEXT_L

P_OUT TYPE CHAR1

P_TECH TYPE CHAR1

P_QFIELD TYPE SLIS_FIELDNAME

P_QTAB TYPE SLIS_TABNAME

P_HOTSPOT TYPE CHAR1

P_DOSUM TYPE CHAR1.

GS_FIELDCAT-COL_POS = P_COLPOS. "Column

GS_FIELDCAT-FIELDNAME = P_FLDNAM. "Field Name

APPEND GS_FIELDCAT TO GT_FIELDCAT.

Problem is i am getting DUMP while executing the program

" The reason for the exception is:*

Call to FORM "FILL_FIELD_CAT" is incorrect:

The actual parameter no. 2 has a different data type in the

PERFORM than requested for the FORM "FILL_FIELD_CAT" in program

"ZFIGL_REP_IGRECONCILIATION".

Can anybody plz help me what i have to do.

Thanks & Regards,

Praveena.

7 REPLIES 7

Former Member
0 Kudos

Hi,

PERFORM FILL_FIELD_CAT USING '9'

TEXT-CU1

TEXT-AM2

' '

TEXT-CU2

'' '' '' '' '' ''.

Just try it this way

FORM FILL_FIELD_CAT USING P_COLPOS 
P_FLDNAM 
P_TABNAM 
P_JUSTIF 
P_SELTEXT 
P_OUT 
P_TECH 
P_QFIELD 
P_QTAB 
P_HOTSPOT 
P_DOSUM .

There is the type difference

Regards,

Madhukar Shetty

0 Kudos

Hi madhu..

Thanks for giving reply...

But actuall code is this one...

FORM FILL_FIELD_CAT USING P_COLPOS TYPE SYCUCOL

P_FLDNAM TYPE FIELDNAME

P_TABNAM TYPE TABNAME

P_JUSTIF TYPE CHAR1

P_SELTEXT TYPE DD03P-SCRTEXT_L

P_OUT TYPE CHAR1

P_TECH TYPE CHAR1

P_QFIELD TYPE SLIS_FIELDNAME

P_QTAB TYPE SLIS_TABNAME

P_HOTSPOT TYPE CHAR1

P_DOSUM TYPE CHAR1.

GS_FIELDCAT-COL_POS = P_COLPOS. "Column

GS_FIELDCAT-FIELDNAME = P_FLDNAM. "Field Name

GS_FIELDCAT-TABNAME = P_TABNAM. "Internal Table Name

GS_FIELDCAT-JUST = P_JUSTIF. "Screen Justified

GS_FIELDCAT-SELTEXT_L = P_SELTEXT. "Field Text

GS_FIELDCAT-NO_OUT = P_OUT. "No output

GS_FIELDCAT-TECH = P_TECH. "Technical field

GS_FIELDCAT-QFIELDNAME = P_QFIELD. "Quantity unit

GS_FIELDCAT-QTABNAME = P_QTAB . "Quantity table

GS_FIELDCAT-HOTSPOT = P_HOTSPOT. "Hot Spot

GS_FIELDCAT-DO_SUM = P_DOSUM. "Do Sum

APPEND GS_FIELDCAT TO GT_FIELDCAT.

Plz tell me..now i need to remove types...

0 Kudos

Praveena,

Yes remove those type defination as i specified earlier or else define them of same type

Regards,

Madhukar Shetty

Former Member
0 Kudos

hello praveena,

actual parameters and formal parameters you entered are not matching.

system is considering TEXT-CU1 as 2nd actual paramter and TYPE as 2nd formal paramter. both are not matching and hence the error is. u should enter equal num of formal and actual parameters.

Thanks,

Indra sena chowdary

0 Kudos

Hi Indra...

PERFORM FILL_FIELD_CAT USING '9' TEXT-CU1 TEXT-AM2 ' ' TEXT-CU2 '' '' '' '' '' ''.....here 9 parameters are there with spaces..

actal parameters also same as per my understanding...can you plz check...

FORM FILL_FIELD_CAT USING P_COLPOS TYPE SYCUCOL

P_FLDNAM TYPE FIELDNAME

P_TABNAM TYPE TABNAME

P_JUSTIF TYPE CHAR1

P_SELTEXT TYPE DD03P-SCRTEXT_L

P_OUT TYPE CHAR1

P_TECH TYPE CHAR1

P_QFIELD TYPE SLIS_FIELDNAME

P_QTAB TYPE SLIS_TABNAME

P_HOTSPOT TYPE CHAR1

P_DOSUM TYPE CHAR1.

GS_FIELDCAT-COL_POS = P_COLPOS. "Column

GS_FIELDCAT-FIELDNAME = P_FLDNAM. "Field Name

GS_FIELDCAT-TABNAME = P_TABNAM. "Internal Table Name

GS_FIELDCAT-JUST = P_JUSTIF. "Screen Justified

GS_FIELDCAT-SELTEXT_L = P_SELTEXT. "Field Text

GS_FIELDCAT-NO_OUT = P_OUT. "No output

GS_FIELDCAT-TECH = P_TECH. "Technical field

GS_FIELDCAT-QFIELDNAME = P_QFIELD. "Quantity unit

GS_FIELDCAT-QTABNAME = P_QTAB . "Quantity table

GS_FIELDCAT-HOTSPOT = P_HOTSPOT. "Hot Spot

GS_FIELDCAT-DO_SUM = P_DOSUM. "Do Sum

APPEND GS_FIELDCAT TO GT_FIELDCAT.

0 Kudos

Hi Praveena,

remove type from the subroutine definition, its not required for single variable. if you are passing structure or table then only you need to specify the type. PFB the example

FORM FILL_FIELD_CAT USING P_COLPOS

P_FLDNAM

P_TABNAM

P_JUSTIF

P_SELTEXT

P_OUT

P_TECH

P_QFIELD

P_QTAB

P_HOTSPOT

P_DOSUM.

Example:

                                • Calling subroutine ************************

PERFORM build_field_cat USING :

'1' 'MATNR' text-014 '16' 'T_BAPI_ERROR',

'2' 'WERKS' text-015 '5' 'T_BAPI_ERROR',

'3' 'TYPE' text-018 '14' 'T_BAPI_ERROR',

'4' 'MESSAGE' text-017 '220' 'T_BAPI_ERROR'.

                                  • Subroutine definition********************

FORM build_field_cat USING p_col

p_field

p_text

p_oplen

p_tabnam.

DATA : wl_fieldcat TYPE slis_fieldcat_alv .

wl_fieldcat-col_pos = p_col .

wl_fieldcat-tabname = p_tabnam .

wl_fieldcat-fieldname = p_field .

wl_fieldcat-seltext_l = p_text .

wl_fieldcat-outputlen = p_oplen .

APPEND wl_fieldcat TO t_fieldcat.

CLEAR wl_fieldcat .

ENDFORM. " BUILD_FIELD_CAT

Regards,

Vijeta

Edited by: Vijyeta Aharwar on Oct 28, 2010 10:54 AM

0 Kudos

How about taking a course, reading some books, check the SAP help on FORM?

This is not an online syntax checking tool.