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

BAPI for particular application

Former Member
0 Likes
769

Hello Friends,

I want to know how to find appropriate BAPI for particular application. Lets say i want to upload material and i know the transaction for it i.e MM01 . Now I want to upload material using BAPI , what would be my approach toward finding BAPIs?

Please help me out.

Regards,

Parag

1 ACCEPTED SOLUTION
Read only

prasanth_kasturi
Active Contributor
0 Likes
738

hi,

If you mean that you need to know what BAPI's a particular tranx uses, which I can only assume that's what you mean, then you should access the code behind the transaction and search for 'CALL'. That normally is the standard method that think that most people use.

Suppose you want to find the bapi for creating a sales order, you usually use transaction VA01 for this.

1. Find out the package of the transaction.

Start Va01 go to system --> status.

Double click on transaction

Package is VA

Open this package in SE80

Open business engineering-->Business object types

Find the BO which sounds the most appropriate

I would suggest BUS2032 Sales Order

Double click.

Open methods.

Find the released method with from data or something similar in the name

, Createfromdat2

Position the cursor in it and click the program button

Scroll down to find the bapi used in this method

With this way you can also find out programs and FM's

2. Start va01 go to system-->status

Double click transaction VA01

Double click on package

Read the application component. (this is SD-SLS Sales)

Then open the transaction BAPI

Sales and distribution>Sales>sales order

createfromdat2

6 REPLIES 6
Read only

prasanth_kasturi
Active Contributor
0 Likes
739

hi,

If you mean that you need to know what BAPI's a particular tranx uses, which I can only assume that's what you mean, then you should access the code behind the transaction and search for 'CALL'. That normally is the standard method that think that most people use.

Suppose you want to find the bapi for creating a sales order, you usually use transaction VA01 for this.

1. Find out the package of the transaction.

Start Va01 go to system --> status.

Double click on transaction

Package is VA

Open this package in SE80

Open business engineering-->Business object types

Find the BO which sounds the most appropriate

I would suggest BUS2032 Sales Order

Double click.

Open methods.

Find the released method with from data or something similar in the name

, Createfromdat2

Position the cursor in it and click the program button

Scroll down to find the bapi used in this method

With this way you can also find out programs and FM's

2. Start va01 go to system-->status

Double click transaction VA01

Double click on package

Read the application component. (this is SD-SLS Sales)

Then open the transaction BAPI

Sales and distribution>Sales>sales order

createfromdat2

Read only

Former Member
0 Likes
738

Hi,

Type BAPI transaction in the command field,

there u can find the documentation for every object

http://allaboutsap.blogspot.com/2007/09/program-to-create-material-master-data.html

Read only

Former Member
0 Likes
738

/people/kathirvel.balakrishnan2/blog/2006/05/08/data-upload-into-sap-from-microsoft-excel-150-abap-part

Reward points..

Read only

Former Member
0 Likes
738

Reward points..

Read only

Former Member
0 Likes
738

Hi,

Type BAPI transaction in the command field,

there u can find the documentation for every object.

to find the bapi for creating a sales order, you usually use transaction VA01 for this.

1. Find out the package of the transaction.

Start Va01 go to system --> status.

Double click on transaction

Package is VA

Open this package in SE80

Open business engineering-->Business object types

Find the BO which sounds the most appropriate

I would suggest BUS2032 Sales Order

Double click.

Open methods.

Find the released method with from data or something similar in the name

, Createfromdat2

Position the cursor in it and click the program button

Scroll down to find the bapi used in this method

With this way you can also find out programs and FM's

2. Start va01 go to system-->status

Double click transaction VA01

Double click on package

Read the application component. (this is SD-SLS Sales)

Then open the transaction BAPI

Sales and distribution>Sales>sales order

createfromdat2

Read only

GauthamV
Active Contributor
0 Likes
738

hi,

check this program.it will solve ur problem.

*&----


*& Report :

*&----


*& This Program is used to Find BAPI Function Module

*Depending upon Application type and description. *

*&----


*& Description text can be put as per requriment

*&----


REPORT zs_bapi NO STANDARD PAGE HEADING.

TYPES : BEGIN OF ty_tfdir,

funcname TYPE rs38l_fnam,

END OF ty_tfdir.

TYPES : BEGIN OF ty_tftit,

funcname TYPE rs38l_fnam,

stext TYPE rs38l_ftxt,

END OF ty_tftit.

DATA : it_tfdir TYPE STANDARD TABLE OF ty_tfdir,

wa_tfdir TYPE ty_tfdir,

it_tftit TYPE STANDARD TABLE OF ty_tftit,

wa_tftit TYPE ty_tftit.

DATA : ws_bapi TYPE char4,

chk TYPE char1,

field1(30).

DATA : ws_lines TYPE i.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: appl_typ TYPE rs38l_appl,

fmode TYPE fmode default 'R',

desc_txt TYPE char10 OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

PERFORM select_fmname.

PERFORM process_table.

PERFORM no_of_records.

PERFORM top_of_page.

PERFORM write_fname.

AT LINE-SELECTION.

PERFORM call_function_module.

*&----


*& Form SELECT_FMNAME

*&----


*----


FORM select_fmname .

SELECT funcname

FROM tfdir INTO TABLE it_tfdir

WHERE ( appl = appl_typ

OR fmode = fmode ).

IF sy-subrc = 0.

SELECT funcname stext

FROM tftit INTO TABLE it_tftit

FOR ALL ENTRIES IN it_tfdir

WHERE funcname = it_tfdir-funcname

AND spras = sy-langu.

ENDIF.

ENDFORM. " SELECT_FMNAME

*&----


*& Form process_table

*&----


*----


FORM process_table .

LOOP AT it_tftit INTO wa_tftit.

ws_bapi = wa_tftit-funcname+0(4).

IF ws_bapi NE 'BAPI'.

DELETE TABLE it_tftit FROM wa_tftit.

CLEAR wa_tftit.

CLEAR ws_bapi.

CONTINUE.

ENDIF.

IF desc_txt IS NOT INITIAL.

SEARCH wa_tftit-stext FOR desc_txt.

IF sy-subrc NE 0.

DELETE TABLE it_tftit FROM wa_tftit.

CLEAR : wa_tftit.

CONTINUE.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " process_table

*&----


*& Form NO_OF_RECORDS

*&----


*----


FORM no_of_records .

DESCRIBE TABLE it_tftit LINES ws_lines.

FORMAT COLOR COL_POSITIVE INTENSIFIED ON.

WRITE :/5 'No of BAPI Selected for Given Application type is-',ws_lines.

ENDFORM. " NO_OF_RECORDS

*&----


*& Form top_of_page

*&----


*----


FORM top_of_page .

WRITE :/1(125) sy-uline.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 '|', 2(3) 'SNO',

6 '|' , 7(35) 'BAPI FUNCTION MODULE',

43 '|', 44(80) 'FUNCTION MODULE DESCRIPTION',

125 '|'.

WRITE :/1(125) sy-uline.

ENDFORM. " top_of_page

*

*& Form WRITE_FNAME

*&----


*----


FORM write_fname .

DATA: loc_sl TYPE i VALUE '0'.

LOOP AT it_tftit INTO wa_tftit.

loc_sl = loc_sl + 1.

FORMAT COLOR COL_GROUP INTENSIFIED OFF.

WRITE :/1(125) sy-uline.

WRITE:/1 '|', 2(3) loc_sl, "CHK AS CHECKBOX,

6 '|' , 7(35) wa_tftit-funcname HOTSPOT ON,

43 '|', 44(80) wa_tftit-stext,

125 '|'.

ENDLOOP.

ENDFORM. " WRITE_FNAME

*&----


*& Form call_function_module

*----


FORM call_function_module .

DATA: ws_fname TYPE tfdir-funcname.

GET CURSOR FIELD field1.

CHECK field1(17) EQ 'WA_TFTIT-FUNCNAME'.

READ TABLE it_tftit INTO wa_tftit WITH KEY funcname = sy-lisel+6(30).

MOVE wa_tftit-funcname TO ws_fname.

SET PARAMETER ID 'LIB' FIELD ws_fname.

CALL TRANSACTION 'SE37' AND SKIP FIRST SCREEN.

ENDFORM. " call_function_module

***********************END*****************************************************