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

subroutines

Former Member
0 Likes
1,576

Hi All,

i'm using a function module where in table parameter i defined

FIELDS like RFC_DB_FLD. and pass this table through this subroutine

PERFORM Y_WS3 TABLES OPTIONS FIELDS DATA DATA1 DATA2 USING QSELECT

QUSER .

after getting these values in this form parameters

FORM Y_WS3 TABLES OPTIONS FIELDS DATA DATA1 DATA2

USING QSELECT QUSER.

now i'm facing this error in one of my loop

*The data object "FIELDS" has no structure and therefore no component *

*called "FIELDNAME". *

pls suggest me possible solution.

regards

13 REPLIES 13
Read only

former_member217544
Active Contributor
0 Likes
1,524

Hi Anuj,

While writing the form statement you need to declare the type of that parameters.

For Instance:


data : options type table of it_table1,
         fields type RFC_DB_FLD,
         qseelct type wa_tab.

PERFORM Y_WS3 TABLES OPTIONS FIELDS 
                             USING QSELECT.

Now the form statemnt should be written in this form:


FORM Y_WS3 TABLES OPTIONS LIKE IT_TABLE1
                                   FIELDS LIKE RFC_DB_FLD
                             USING QSELECT LIKE WA_TAB.
ENDFORM.

Hope this will be helpful.

Regards,

Swarna Munukoti.

Read only

naveen_inuganti2
Active Contributor
0 Likes
1,524

Hi.....

Change your code like this...

PERFORM Y_WS3 TABLES OPTIONS 
                                           FIELDS 
                                           DATA 
                                           DATA1 
                                           DATA2
                                USING QSELECT
                                           QUSER .

FORM Y_WS3 TABLES OPTIONS type standard table 
                                     FIELDS type standard table
                                     DATA type standard table
                                     DATA1 type standard table
                                     DATA2 type standard table
                          USING QSELECT 
                                     QUSER.

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,524

Hi swarna,

thanks for reply but when i declaring like

FORM Y_WS3 TABLES OPTIONS FIELDS like RFC_DB_FLD DATA DATA1 DATA2

USING QSELECT QUSER.

then i'm getting error.

For typing of TABLES parameters, only table types should be used. -

if i using

FORM Y_WS3 TABLES OPTIONS FIELDS structure RFC_DB_FLD DATA DATA1 DATA2

USING QSELECT QUSER.

then i got processor error

*Different number of parameters in FORM and PERFORM (routine: Y_WS3, *

*number of formal parameters: 0, number of actual parameters: 7). *

regards,

anuj

Read only

0 Likes
1,524

Hi Anuj,

I have just taken 2 parameters and explained with them..

If there are 7 parameters in form then in form statement also you need to declare the corresponding types for all the 7 parameters.

That is:

if the declarations are in this way:

data: OPTIONS type table of it_tab1

FIELDS type table of RFC_DB_FLD

DATA type table of it_tab2

DATA1 type table of it_tab3

DATA2 type table of it_tab4,

qselect type wa_tab1,

qyser type wa_tab2.

Then form should be written in the following way:

FORM Y_WS3 TABLES OPTIONS structure it_tab1

FIELDS structure RFC_DB_FLD

DATA structure it_tab2

DATA1 structure it_tab3

DATA2 structure it_tab4

USING QSELECT type wa_tab1

QUSER type wa_tab2.

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
1,524

Hi awarna, thanks for reply ,

i know u r taking abt all fields it's nt a matter of problem.

k , now i defined

form as a

FORM Y_WS3 TABLES OPTIONS structure RFC_DB_OPT FIELDS structure RFC_DB_FLD DATA structure ZTAB_4000 DATA1 structure ZTAB_4000 DATA2 structure ZTAB_4000

USING QSELECT QUSER.

where as pls note i'm using function module.

in table parameters

OPTIONS like RFC_DB_OPT,

FIELDS like RFC_DB_FLD,

same as others with their respective structure

so my perform is PERFORM Y_WS3 TABLES OPTIONS FIELDS DATA DATA1 DATA2 USING QSELECT

QUSER .

but now i'm getting error

Different number of parameters in FORM and PERFORM (routine: Y_WS3,

number of formal parameters: 0, number of actual parameters: 7).

and previouslly before defining form with structure i'm getting this error n both wkg fine with same no's of parameters.

regards,

Read only

0 Likes
1,524

Hi...

What is the error you got with following declaration of formal parameters...

FORM Y_WS3 TABLES OPTIONS type standard table 
                                     FIELDS type standard table
                                     DATA type standard table
                                     DATA1 type standard table
                                     DATA2 type standard table
                          USING QSELECT 
                                     QUSER.

---Naveen.I

Read only

0 Likes
1,524

FORM Y_WS3 TABLES OPTIONS like RFC_DB_OPT FIELDS like RFC_DB_FLD DATA....................

Regards

Sathar

Read only

Former Member
0 Likes
1,524

Hi naveen

if i'm using ur method then i;m getting error that table type should use so i created respective table types n used all ,

now perform is

PERFORM Y_WS3 TABLES OPTIONS FIELDS DATA DATA1 DATA2 USING QSELECT

QUSER .

and form is

FORM Y_WS3 TABLES OPTIONS type YAJ FIELDS type yaj1 DATA TYPE YAJ2 DATA1 TYPE YAJ2 DATA2 TYPE YAJ2

USING QSELECT QUSER.

but now i'm getting error

Different number of parameters in FORM and PERFORM (routine: Y_WS3,

number of formal parameters: 0, number of actual parameters: 7).

and previouslly before defining form with type i'm getting this error n both wkg fine with same no's of parameters.

regards,

Read only

0 Likes
1,524

Hi Anuj...

Not...

> OPTIONS type YAJ

no need to mention that YAJ...

You can try the syntax...

> OPTINS TYPE STANDARD TABLE.

here "Stadard table" is the key word.

Plz get back with result again.

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,524

Thanx naveen it's help me but in form inside a loop it's throw a error that

*The data object "FIELDS" has no structure and therefore no component called "FIELDNAME". *

here is code also

DATA NUMBER_OF_FIELDS TYPE I.

DESCRIBE TABLE FIELDS LINES NUMBER_OF_FIELDS.

IF NUMBER_OF_FIELDS = 0.

LOOP AT TABLE_STRUCTURE.

MOVE TABLE_STRUCTURE-FIELDNAME TO FIELDS-FIELDNAME.----


> error

APPEND FIELDS.

ENDLOOP.

ENDIF.

regards,

anuj

Read only

0 Likes
1,524

Hi....

Define one local itab for FILEDS with structure and internal table...

Append that itab with entries...

After the loop..

write this syntax...

FILEDS() = ITAB()

Here finally FIELDS table carrie out the entries from subroutine.

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,524

Hi Anuj,

The following syntax working fine.

FUNCTION ZEXFM.

*"----------------------------------------------------------------------
*"*"Local interface:
*"  TABLES
*"      FIELDS STRUCTURE  RFC_DB_FLD
*"      OPTIONS STRUCTURE  RFC_DB_OPT
*"----------------------------------------------------------------------
perform exfm TABLES OPTIONS FIELDS.



ENDFUNCTION.


*&---------------------------------------------------------------------*
*&  Include           LZ701715F01                                      *
*&---------------------------------------------------------------------*
FORM exfm TABLES OPTIONS structure RFC_DB_OPT FIELDS structure RFC_DB_FLD.

endform.

Read only

Former Member
0 Likes
1,524

thanks all.