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

Execute T-Code without logging to R/3

Former Member
0 Likes
1,564

Hello All ,

I am using Excel macros to connect to R/3 and retrive information from table.

Now i want to use same code to execute some T-code like SICF ,SE38,etc without logging to R/3.

Any help or suggestion is highly appreciated.

Thanks,

Sudeep

14 REPLIES 14
Read only

Former Member
0 Likes
1,349

I have made changes to Database Tables using Offline Adobe Forms Scenario. This will be interesting to see. As far as I know, you have to login to SAP for executing Transactions. Waiting for more inputs.

Best Regards,

Jagraj Singh.

Read only

Former Member
0 Likes
1,349

Hello Sudeep,

It is possible to execute the T-Code from Excel by adding a function in VBA for the RFC call "RFC_CALL_TRANSACTION".

That should work for you, since you already managed to establish a connection to R/3

Br,

Christian

Read only

0 Likes
1,349

Hello Christian,

Thanks for reply.

I am not able to pass arguments to the transaction.

for e.g if i give SE38 in transaction ,how should i give report name to execute..?

or we have some standard SAP functions  to execute the reports directly.

sample code :

Set RfcCallTransaction = objBAPIControl.Add("RFC_CALL_TRANSACTION_USING")

RfcCallTransaction.exports("tcode") = "SE38"

RfcCallTransaction.exports("mode") = "N"

...........

i dont know next statement....

Thanks

Sudeep

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,349

Use one of the RFC enabled FM that execute transactions with some BDC DATA (e.g. RFC_CALL_TRANSACTION_USING table parameter BT_DATA)

Regards,

Raymond

Read only

0 Likes
1,349

Hello Raymond

i am able to get bt_data table and its parameter.

program name & screen no i can give

but i am not able to find details of the screen like field name & field value (specifed by ? in below e.g) .

add_bdcdata BdcTable, "Program Name", "Screen Number", "X", "???", "???"

any help is appreciated.

Thanks,

Sudeeep

Read only

0 Likes
1,349

Use SHDB to record any transaction, it can generate a snippet that you will copy in your code.

SAPMS38M101
BDC_CURSORRS38M-PROGRAMM
BDC_OKCODE=STRT
RS38M-PROGRAMMname of program

Regards,

Raymond

Read only

0 Likes
1,349

Hello Raymond ,

thanks for the reply..

it was of great help.

i am able to call the RfcTransaction

but how to capture the output of transaction..?

If RfcCallTransaction.Call = True Then

        Set Messages = RfcCallTransaction.imports("MESSG")

        MsgBox Messages.Value("MSGTX")

    Else

        MsgBox " Call Failed! error: " + GetCustomers.Exception

    End If

this is giving error..."Object Variable or With block Variable not set.

Thanks,

Sudeep

Read only

0 Likes
1,349

What do you call the output of transaction, a spool, an ALV grid, if you actually want to get some result back, better look for GET or GET_DETAIL BAPI.

Regards,

Raymond

Read only

0 Likes
1,349

Hello All,

i am able to execute some t-code like SE38(having no sub screens) with  RFC_CALL_TRANSACTION_USING.

but i am unable to call T-codes having inputs from multiple sub screens. i can record the code from SHDB.That code runs fine in R/3 but unable to call the same code remotely.

e.g

add_bdcdata BdcTable, "SAPLSPO1", "0500", "X", "", ""

add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=OPT1"

add_bdcdata BdcTable, "", "", "", "BDC_SUBSCR", "SAPLSPO1                                0502SUBSCREEN"

Can anyone help to handle sub screens...

Thanks,

Sudeep

Read only

0 Likes
1,349

Dear Sudeep,

No need to include the line which is for SUB SCREEN(SUBSCR)

Rest of BDC Data can be as it is. Just exclude the BDC_SUBSCR lines.

I Hope it helps.

Regards,

SG

<text removed>

Message was edited by: Matthew Billingham

Read only

Former Member
0 Likes
1,349

Hi Sudeep,

Could you share with us if you finally make it?

Thank you

Lei

Read only

0 Likes
1,349

This message was moderated.

Read only

0 Likes
1,349

Hello Lei.

I am still struggling with the code.

I am able to login the R/3 and call RFC function but the transaction which i am executing is not giving any output..

I will share techical details once  i am through with the code and i am able to execute t-code successfully.

Read only

0 Likes
1,349

Hello All ,

Calling Transaction from RFC's uses bdc data as input for transaction parameters.

From the information i got from variuos sources BDC is obsolete and BAPI is a better way to  do things.So i am  trying to do the same with BAPI functions.

Thanks for all the help.