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

How to use BAPI_INTERFACE_GETDOCU correctly?

Former Member
0 Likes
693

Folks,

I need to get the list of parameters and their definitions for a specified BAPI. It appears I need to call BAPI_INTERFACE_GETDOCU to get this information. However, there is not enough information on how to call the function correctly. The following .NET code, for example, returns an error that objname or objtype is not specified.


p.Bapi_Interface_Getdocu(null,   null,   null,  "BAPI_MATERIAL_SAVEDATA",  null, null, null, null, out ret2, ref tbl);

Can someone please help me on calling this function correctly?

Thank you in advance for your help.

Regards,

Peter

3 REPLIES 3
Read only

Former Member
0 Likes
636

i'm afraid that if you don't start with the ABAP side first, it's going to take a long time to figure out the required fields.

you need to manually simulate the BAPI in SAP - meaning, go to the transaction that the BAPI performs and start putting in data on the screen until it's just enough to get your data back. When you figure that out, those will be the fields you need to fill in your call.

Read only

uwe_schieferstein
Active Contributor
0 Likes
636

Hello Peter

The documentation of BAPI_INTERFACE_GETDOCU is quite verbose:



 FU BAPI_INTERFACE_GETDOCU
 ____________________________________________________
 Short Text
     Read BAPI Interface Documentation
 Functionality
     This method reads the interface documentation for a BAPI.
     The method enables you to read out and make available to developers the
     information they need to implement BAPIs correctly.
     The parameters of this method delimit the documentation to be displayed.
     With these parameters you can specify whether you want to display the
     documentation on a business object, method, parameter or field. The BAPI
     interface documentation below can be accessed with this method:
     o   The documentation on the business object, if one of the two
         parameters OBJTYPE or OBJNAME contains a value and the parameters
         METHOD, PARAMETER and FIELD are BLANK.
     o   The documentation on the method, if one of the two parameters
         OBJTYPE or OBJNAME contains a value and the method name is specified
         in the parameter METHOD. The parameters PARAMETER and FIELD must
         also be BLANK.
     o   The docmentation on the parameter, if the parameter name is also
         transferred in the field PARAMETER.
     o   The field name, if the field name is also transferred in the
         parameter FIELD. This is only possible, if a structure has been used
         for the parameter.
 Example
     In this example the documentaion on the BAPI  "Employee.GetList" is
     retrieved without the parameter documentation. It is displayed in
     English (EN) in RTF text format.
     Import Parameter    Value
     OBJTYPE
     OBJNAME             "Employee"
     METHOD              "GetList"
     PARAMETER
     FIELD
     LANGUAGE            "EN"
     TEXTFORMAT          "RTF"
 Notes
     Messages are returned in the parameter RETURN. This parameter
     documentation contains the return codes and their descriptions.
 Parameters
     OBJTYPE
     OBJNAME
     METHOD
     PARAMETER
     FIELD
     LANGUAGE
     TEXTFORMAT
     LINKPATTERN
     RETURN
     TEXT
 Exceptions
 Function Group
     BATG

I did not find the BAPI immediately in the BOR (transaction SWO1) therefore I searched table SWOTLV with VERB = 'SAVEDATA'. And here I found the BAPI belonging to business object BUS1001006.

To retrieve data from BAPI_INTERFACE_GETDOCU use the following IMPORTING parameter:

OBJTYPE = 'BUS1001006'
LANGUAGE = 'EN'
TEXTFORMAT = 'RTF'

I tried to call the BAPI using

OBJNAME = 'StandardMaterial'
OBJTYPE = 'SaveData'

but here I did not retrieve any data.

I just tried another combination of IMPORTING parameter:

OBJNAME = 'StandardMaterial'     " no OBJTYPE !!!

It worked.

Other textformats are:

SCR	SAPscript
ASC	ASCII
RTF	Rich text format
HTM	HTML

Regards

Uwe

Read only

Former Member
0 Likes
636

Uwe,

Thank you for your help.

Regards,

Pradeep