Application Development 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: 

Identifying Programs using BDC.

Former Member
0 Kudos

Hi Experts,

I have a peculiar requirement. i have a list of programs. I have to develop a logic which will help me identify those programs using BDC (using batch input session or Call transaction). I also have to identify the transactions called using the batch input session or Call transaction.

For example:

1) I have a program using CALL TRANSACTION 'abc' USING BDCDATA

MODE CTUMODE

UPDATE CUPDATE

MESSAGES INTO MESSTAB.

I have to extract the program name and 'abc' in a file.

kindly provide solutions.

Thanks

Edited by: Sadhna Achhra on Dec 22, 2008 7:58 AM

10 REPLIES 10

Former Member
0 Kudos

Hi use SHDB transactiob for recording program. In that program you give your transaction.

In recording program you will get all the Transactions and tables .

Thanks & regards

Nagamani Challa

0 Kudos

Hi..

Problem is we have list of prgorams in a table. We have to identify program type as BDC and from the same program we need to extract the transaction code used in that recording.

The solution you have proposed, in that TCODE can be found in TSTC table. But it is not possible to extract the relative data from it.

0 Kudos

hi sadhna,

I am not able to understand your issue exactly , but if u r looking for a source scan then there is a standard report RS_ABAP_SOURCE_SCAN u can use to scan for a particular string u can give the string as ' call transaction ...." and give a set of programs.

Hope this helps u

Regards,

Sumanjeet

0 Kudos

Sadhna,

Go to the table APQI,give BDC as DATA TYPE,you will get the list of all BDC Programs in your syste.Check if this info as well as the other fields in table APQI, can give you some lead.

K.Kiran.

0 Kudos

Hi Kiran,

We are looking for the similar kind of solution. The solution you have provided is working for the programs present in queue. None of our programs is there in queue. Please give us some table name which provide the similar info but not related to queue.

0 Kudos

Try this:

1. If you don't have list of programs then get it from the table REPOSRC or TRDIR

2. Read the contents of the program into an internal table: 'READ REPORT prog INTO itab [MAXIMUM WIDTH INTO wid]'.

3. Search for 'call transaction' in the internal table 'itab', if found get the tcode.

0 Kudos

Hi Vijay,

We have done this for the programs which is having name of TCODE available in Call Transaction statement.

For example: CALL TRANSACTION 'SE38' ...

Problem is coming where the TCODE is provided in some perform statement.

For example: perform bdc_transaction using 'SE38'.

FORM BDC_TRANSACTION.....

.....

.....

CALL TRANSACTION TCODE....

We need solution for this case.

I hope you are understanding my problem.

0 Kudos

For this particular case:

1. Search for Call transaction. if found traverse back in the internal table until you find the FORM statement, get the formname.

2. Search for perform formname in the internal table & get the TCODE.

Any this solution is not generic, won't work for all the cases.

0 Kudos

Hi Sadhna,

I just written a small program (with reference to standard progs) that u might use. please see if you can use the following codes and adapt it for your purpose:

logic:

- i have retrieved all includes associated to the program in selection screen

- scan each program where call transaction has been used

- get the transaction being called and display it on screen

PARAMETERS:p_prog TYPE trdir-name.

DATA: BEGIN OF i_int_abap OCCURS 0, " Internal table for storing ABAP

line(256) TYPE c,

END OF i_int_abap.

DATA: BEGIN OF i_int_inc OCCURS 0, " Table to Store Includes Name

include LIKE sy-repid,

END OF i_int_inc.

DATA:v_prog TYPE trdir-name ,

v_tcode TYPE sy-tcode,

v_dummmy TYPE c.

CONSTANTS:c_true TYPE c VALUE 'X'.

CLEAR v_prog.

v_prog = p_prog.

CALL FUNCTION 'RS_GET_ALL_INCLUDES' "This will get all includes related to the program

EXPORTING

program = v_prog

with_inactive_incls = c_true

TABLES

includetab = i_int_inc

EXCEPTIONS

not_existent = 1

no_program = 2

OTHERS = 3.

IF sy-subrc = 0.

CLEAR i_int_inc.

i_int_inc-include = p_prog.

INSERT i_int_inc INDEX 1.

CLEAR i_int_inc.

LOOP AT i_int_inc. " loop at all programs/include and check for call transaction

CLEAR v_prog.

v_prog = i_int_inc-include.

READ REPORT v_prog INTO i_int_abap.

LOOP AT i_int_abap WHERE line(1) <> '*'

AND LINE CS 'CALL TRANSACTION '.

SPLIT i_int_abap-line AT text-001 INTO v_dummmy v_tcode. "text-001 stores '

SPLIT v_tcode AT text-001 INTO v_tcode v_dummmy. "text-001 stores '

WRITE : / 'Call transaction to :' , v_tcode.

ENDLOOP.

REFRESH i_int_abap .

ENDLOOP.

ENDIF.

Regards,

Dev.

Former Member
0 Kudos

It is done using the back track method. It takes lot of effort to go and track.

Anyway thanks to all of you for your timely reply.