‎2008 Aug 21 1:12 PM
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.
‎2008 Aug 21 1:15 PM
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
‎2008 Aug 21 1:27 PM
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.