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

Function module import parameter

Former Member
0 Likes
1,873

I had used a bapi in the program and i got a dump.

then i recetified the dump. But kindly tell me the

reason .

My program is like this..

Report xyz.

DATA wa_bapireturn TYPE bapireturn.

DATA it_bapireturn LIKE TABLE OF wa_bapireturn.

DATA wa_bapisdstat TYPE bapisdstat.

DATA it_bapisdstat LIKE TABLE OF wa_bapisdstat.

PARAMETERS p_vbeln LIKE vbap-vbeln.

START-OF-SELECTION.

CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'

EXPORTING

salesdocument = so_vbeln

IMPORTING

return = it_bapireturn

TABLES

statusinfo = it_bapisdstat.

now i got the dump because i have used

it_bapireturn for importing.

then i modified the program like..

CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'

EXPORTING

salesdocument = so_vbeln

IMPORTING

return = wa_bapireturn

TABLES

statusinfo = it_bapisdstat.

Now the program working fine because i passed

wa_bapireturn. please tell me why it happened like

this. How to know when to pass internal table and when to

pass just a structure.

And also tell me the difference bet type and type ref to.

2 REPLIES 2
Read only

Former Member
0 Likes
863

As per the interface definition of the BAPI, it expects one workarea in the RETURN parameter.

but it_bapireturn was an internal table so was the dump

but wa_bapireturn is a work area so it worked.

You can check the interface of the Function Module to know what to be used. Usually work areas are passed in IMPORT AND EXPORT parameters and internal tables in TABLES parameters.

by using TYPE , we create a variable of a pre difined TYPE.

by using TYPE REF we create object of a particual class

Edited by: Swastik Bharati on Aug 21, 2008 2:16 PM

Read only

former_member217544
Active Contributor
0 Likes
863

Hi Shiva,

Exporting and Importing tabs will take single field or work area as parameters. If you want to pass the tables then you need to declare them in the Tables section.

Here there is a mismatch between the parameters which resulted in dump. Return parameter is like workarea which can hold only one record but it_bapireturn is a table.

Hope thsi will clear your doubts.

Regards,

Swarna Munukoti.