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

Perform In function Module

Former Member
0 Likes
2,318

Hi All,

I m using performs in RFC Function module, If i pass single internal table via perform its not giving error through if i pass two internal tables via perform then its giving error as "The Specified type has no structure and therefore no component called VBELN" . But internal table structre is correct

PERFORM Drop_Ship TABLES tt_vbak tt_vbap USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

FORM Drop_Ship TABLES tt_vbak tt_vbap USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

SELECT vbeln auart erdat bstnk bsark FROM vbak

INTO TABLE tt_vbak

FOR ALL ENTRIES IN tt_vbap

WHERE vbeln = tt_vbap-vbeln

AND auart = iv_order_type

AND erdat BETWEEN lv_stdat AND lv_endat.

How to solve this issue.

1 ACCEPTED SOLUTION
Read only

Former Member
1,444

Hello,

When you are using tables you need to specify the structure in the form statement so that it can access the columns of the tables.

Try using the following code. Assuming your tables tt_vbak and tt_vbap are of the type VBAK and VBAP.

PERFORM Drop_Ship TABLES tt_vbak tt_vbap USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

FORM Drop_Ship TABLES tt_vbak structure vbak

tt_vbap structure vbap

USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

Hope it helps.

Anju

10 REPLIES 10
Read only

Former Member
0 Likes
1,444

Hi,

I also got same error while checking the FM.

But when i activated it got activated.

I think you also activate it don't check it.

Regards,

Pravin

Read only

0 Likes
1,444

Hi Pravin,

I tried, it's activated but it gives dump error when call that particular perform, please let me know the solution how to pass two or more internal tables.

Read only

Former Member
0 Likes
1,444

Hi Sentchan ,

It is a good practice to specify the type of data being passed in the interface parameters of the subroutine.

So try explicitly specifying the data type of the parameters passed to the subroutine , i think that should resolve your issue e.g.

FORM Drop_Ship TABLES tt_vbak tt_vbap type ............

USING iv_order_type type i

lv_dat_flag type ........lv_stdat lv_endat lv_drp_ship iv_id.

also try to avoid the use of TABLES , insted use CHANGING .

Regards,

Arun

Read only

Former Member
0 Likes
1,444

HI,

"You not even bothered to Look at my Post, Hmmmmmmmmmmmm Good.........................

data : tt_vbak type standard table of vbak, " Add this and Check again
          tt_vbap type standard table of vbap,


PERFORM Drop_Ship TABLES tt_vbak tt_vbap USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

Check the following

" Also Check whether your Declaraton contains VBELN as one of it Fields

DATA : itab TYPE STANDARD TABLE OF vbak," WITH HEADER LINE,
       jtab TYPE STANDARD TABLE OF vbap." WITH HEADER LINE. " Check your TT_VBAK and TT_VBAP as mentioned here

DATA : ortyp  TYPE vbak-vbtyp,
" Just copy this and Execute this , No Syntax Errors Found for me @ ECC6.0
       erdat TYPE vbak-erdat. 
select * from vbap into TABLE jtab UP TO 100 ROWS.
PERFORM get_data TABLES itab
                        jtab
                 USING  ortyp erdat.

FORM get_data TABLES p_itab " LIKE itab
                     p_jtab "LIKE jtab
              USING  p_ortyp p_erdat.
  select * from vbak
    INTO TABLE itab
    FOR ALL ENTRIES IN jtab
    where vbeln = jtab-vbeln
    and   vbtyp = ortyp
    and   erdat = erdat. 
ENDFORM.                    "get_data

Cheerz

Ram

Read only

umashankar_sahu
Active Participant
0 Likes
1,444

Try something like this.

PERFORM test_11 TABLES TAB1

TAB2

USING PARA1

PARA2

CHANGING FLAG.

FORM test_11 TABLES TAB1 STRUCTURE STAB1

TAB2 STRUCTURE STAB2

USING PARA1

PARA2

CHANGING FLAG.

Read only

Former Member
1,446

Hello,

When you are using tables you need to specify the structure in the form statement so that it can access the columns of the tables.

Try using the following code. Assuming your tables tt_vbak and tt_vbap are of the type VBAK and VBAP.

PERFORM Drop_Ship TABLES tt_vbak tt_vbap USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

FORM Drop_Ship TABLES tt_vbak structure vbak

tt_vbap structure vbap

USING iv_order_type lv_dat_flag lv_stdat lv_endat lv_drp_ship iv_id.

Hope it helps.

Anju

Read only

0 Likes
1,444

I have created type internally.

TYPES : BEGIN OF tv_vbap,

vbeln TYPE vbeln,

END OF tv_vbap.

DATA : tt_vbap TYPE TABLE OF tv_vbap.

ts_vbap LIKE LINE OF tt_vbap.

Like wise i have used tt_vbak also.So if i use as below

FORM Drop_Ship TABLES

tt_vbap STRUCTURE vbap

tt_vbak STRUCTURE vbak

USING

iv_order_type

lv_dat_flag

so if i used structure vbak its giving error such as " In perform or Call Function "Drop_Ship", the actual parameter "tt_vbap" is too short for the formal parameter "tt_vbap". Can we use internal structure as structure in form.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,444

Hello,

Internal tables & structures are different.

You can try something like this:

TYPES : BEGIN OF tv_vbap,
vbeln TYPE vbeln,
END OF tv_vbap,

TYPES: tv_vbap_t TYPE STANDARD TABLE OF tv_vbap. 

FORM Drop_Ship
USING
iv_order_type
lv_dat_flag
CHANGING
tt_vbap TYPE tv_vbap_t
tt_vbak TYPE tv_vbak_t

BR,

Suhas

Read only

0 Likes
1,444

try this code

data: BEGIN OF ty_vbak,

vbeln TYPE vbak-vbeln,

END OF ty_vbak.

DATA: tt_vbak like TABLE OF ty_vbak,

l_cnt TYPE i.

PERFORM test_form TABLES tt_vbak

USING l_cnt.

FORM TEST_FORM TABLES TT_VBAK STRUCTURE ty_vbak

USING L_CNT.

*********ur code here*********

ENDFORM. " TEST_FORM

Hope this helps.

Anju

Read only

0 Likes
1,444

>

> try this code

>

> data: BEGIN OF ty_vbak,

> vbeln TYPE vbak-vbeln,

> END OF ty_vbak.

>

> DATA: tt_vbak like TABLE OF ty_vbak,

> l_cnt TYPE i.

>

> PERFORM test_form TABLES tt_vbak

> USING l_cnt.

>

>

> FORM TEST_FORM TABLES TT_VBAK STRUCTURE ty_vbak

> USING L_CNT.

> *********ur code here*********

> ENDFORM. " TEST_FORM

>

>

> Hope this helps.

>

> Anju

I have created structure in se38 and used it as structure then its working fine.

FORM TEST_FORM TABLES TT_VBAK STRUCTURE ty_vbak