Hi all,
It is told that we have to create a structure in order to pass input values to a BAPI, whether it is via import paramter or tables parameter.
When i tried to declare a import parameter with TYPE declaration also BAPI was generated and worked fine.
<b>Why is it necessary to create a structure to import/export values?</b>
Please throw light on the concept behind declaring the structures
Request clarification before answering.
HI Lakshmi,
Whoever told you that you have to create a struture for import /export/tables parameters might have meant that if you are <b>creating</b> a bapi/fm, then you need to create a structure.
When you <b>USE</b> a bapi, you need not create a structure but can declare a internal table/internal structure withing the program which refers to the bapi parameters' structure.
If your question is about creation of bapis, then we can explain like this.
To tell the system that the bapi accepts the parameters in a specific format we should tell the system that the parameter X is of type so and so.
This type must be defined at a global level so that it is visible to the bapi.
And moreover the tpes that are available may not be exactly what we want.
So It is always advisable to create a structure in se11 .
The concept of reusablility can be stated as another reason.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suma,
Yes.
You can convert a FM to BAPI, provided:
1. It is Remotely enabled (Attributes: Remote-enabled)
2. You cannot have exceptions being returned by FM
3. any Errors/Success messages are to be returned using BAPI Return Structure (BAPIRET1/2..)
4. It is advisable to create separate structures for import and export parameters whose names start with BAPI
(although this is not compulsory but advisable)
5. Then write your code for FM
Once you are ready with FM which is remotely enabled, now
1. Goto SWO1 (business object creation) give business object name and desc, program name (a prog will be generated by SAP under this name)and application. click on next.
2. Save it under a package.(it is must else u cannot transport it)
3. Goto UTILITIES-API METHODS - ADD METHOD
4. Give the FM (remotely enabled) which u have created, click on next
5. Select the method, goto EDIT - Change release status- object type component - to be implemented
6. Select the object type, goto EDIT - Change release status- object type component - to be implemented
7. Goto SE37, give FM name select RELEASE under Functionmodule menu.
8. Again comeback to SWO1, Select the object type, goto EDIT - Change release status- object type component - to be release
9. Select the method, goto EDIT - Change release status- object type component - to be released
10. Select the object type,click on GENERATE button to generate the business object.
NOW Goto BAPI Explorer using TCODE: BAPI, goto tab alphabetical and checkout for the business object created by with given name.
Hope this will help you.
still got any doubts please refer to online documentation on HELP.SAP.COM
with regards,
Lakshmi
| User | Count |
|---|---|
| 14 | |
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.