RFC_CALL_TRANSACTION
Hello all,
Good Day.
I am using Macro to updated data in to SAP.
Using "RFC_CALL_TRANSACTION"
Previous i am using the Below code to Get the SAP MSG.
If RfcCallTransaction.Call = True Then
Set Messages = RfcCallTransaction.imports("MESSG")
Cells(i1, 21) = Messages.Value("MSGTX")
Now I am using the "ABAP4_CALL_TRANSACTION" Code to updated data in sap
I am not sure what code i want to use to get the Message.
Please Help Me...
I find the Solution...
Set Messages = RfcCallTransaction.Tables("MESS_TAB")
Cells(i1, 21) = Messages.Value(Messages.ROWCOUNT, "MSGV2") & Messages.Value(Messages.ROWCOUNT, "MSGV3") & Messages.Value(Messages.ROWCOUNT, "MSGV4")
Cells(i1, 21).Select
Sources : http://www.facebook.com/topic.php?uid=105737996136882&topic=62
Similar Messages
-
RFC_CALL_TRANSACTION in 4.6c serching for an alternative in ECC6.0
Hi there,
in release 4.6c i use the function RFC_CALL_TRANSACTION in some of my programs.
In ECC6.0 it seems that this RFC is not there any more.
Any ideas what RFC i can use instead ?
Greetings
H.P:Hi,
Alternate function module RFC_CALL_TRANSACTION_USING
Satya -
Rfc_Call_Transaction parameters
Hi:
I'm trying to perform a transaction with the RFC function Rfc_Call_Transaction, I put all the parameters: Transaction, Screen, dynpro, etc. But I'm missing something, I'm reciving 'Start screen does not exist in batch input data'
¿Can anyone help me?
Thanks.Yes, it's solved (i can´t mark it, don't know why)
Ok, I made a funtion to create a record on the DBCDATA structure, simple:
private BDCDATA FillBDCDATA(string Program,
string Dynbegin,
string Dynpro,
string Fnam,
string Fval)
BDCDATA st_DATA = new BDCDATA();
st_DATA.Program = Program;
st_DATA.Dynbegin = Dynbegin;
st_DATA.Dynpro = Dynpro;
st_DATA.Fnam = Fnam;
st_DATA.Fval = Fval;
return st_DATA;
This result will be added in the tblBDCDATA table (this can be done in .NET based languages, thanks to the garbage collector, in other languages something like this could be very dangerous)
The calling funtion works like this, take special attention on the sequence sended to the above function, this order is exactly the same of a transaction register generated inside SAP, hope is usefull.
private void button3_Click(object sender, System.EventArgs e)
SAPProxy proxy = null;
txtMsg.Text = "";
try
proxy = new SAPProxy("ASHOST=" + txtHost.Text +
" SYSNR=" + txtSysnr.Text +
" CLIENT=" + txtMand.Text +
" LANG=" + txtLang.Text +
" USER=" + txtUser.Text +
" PASSWD=" + txtPass.Text);
catch(Exception excpt)
txtMsg.Text = excpt.Message;
if (proxy == null)
return;
BDCDATATable tblBDCDATA = new BDCDATATable();
MESSAGEINF infMessage = new MESSAGEINF();
// call to FillBDCDATA( Program, Dynbegin, Dynpro, Fnam, Fval)
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "X", "0111", null, null));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BDC_OKCODE", "/00"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPDY-BLDAT", "30.12.2004"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPDY-VERSN", "0"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "FMPS-FIKRS", "ente"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPDY-JAHR", "2005"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "X", "0320", null, null));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BDC_OKCODE", "=PERI"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "ERFA_ZEILE_IN", "1"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPFMPS-FISTL(01)", "GRCOMW"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPFMPS-FIPOS(01)", "G90230615"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPAK-WERT(01)", "2"));
tblBDCDATA.Add(FillBDCDATA("SAPLKBPP", "X", "0600", null, null));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BDC_OKCODE", "=CLOS"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPDY-PERI1(01)", "350953.44"));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BPDY-PERI1(02)", "350953.44"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "X", "0320", null, null));
tblBDCDATA.Add(FillBDCDATA( null, null, null, "BDC_OKCODE", "=BUCH"));
try
proxy.Rfc_Call_Transaction("FR33" /"FM9J"/,"", out infMessage, ref tblBDCDATA);
catch(Exception excpt)
txtMsg.Text = excpt.Message;
/Document 0500106943 posted/
txtMsg.Text = infMessage.Msgtx; -
RFC_CALL_TRANSACTION missing after upgrade
Hello,
we had used to remote call the transaction RFC_CALL_TRANSACTION 9SAP R/3 4.4C).
Aftre upgrade to ECC 6.0 the transaction RFC_CALL_TRANSACTION does not exist.
Which one can we use instead of it?
Regards
ZenoHi Zeno,
The function group ATSV no more exists in the ECC 6 version of SAP, instead you could use the FM RFC_CALL_TRANSACTION_USING of the function group MRFC.
Let me know if you need any further information.
Regards
Yugandhar -
RFC_CALL_TRANSACTION missing
Hello,
we had used to remote call the transaction RFC_CALL_TRANSACTION 9SAP R/3 4.4C).
Aftre upgrade to ECC 6.0 the transaction RFC_CALL_TRANSACTION does not exist.
Which one can we use instead of it?
Regards
Zeno
Edited by: zeno novak on Jun 18, 2008 1:43 PMHi Zeno,
The function group ATSV no more exists in the ECC 6 version of SAP, instead you could use the FM RFC_CALL_TRANSACTION_USING of the function group MRFC.
Let me know if you need any further information.
Regards
Yugandhar -
Rfc_Call_Transaction, AL08
Hi,
In SAP I can see a list of logged on users with transaction AL08.
What I want to do is access this data in a .NET application. I think that the way to do this is by using Rfc_Call_Transaction?
Unfortuanately I haven't been able to find much information on Rfc_Call_Transaction - can anyone advise me on how to do this?
Many thanks,
ColinCould you elaborate? I still have no idea how to use Rfc_Call_Transaction with AL08? (It is not an issue if I need to use it in conjunction with the GUI)
Or is there a better way to obtain data from AL08 in a .nET application?
Many thanks,
Colin -
Function Module RFC_CALL_TRANSACTION not exist in ERP6??
Hi,
Does anyone know if this function module has been replaced in ERP6?? We are still running code that calls this Funciton Module, but we get the following error:
Executing postCommandError with type 'action_log', attribute '10001' and command 'Function module "RFC_CALL_TRANSACTION" not found.'
tks
Christiaan
POINTS WILL BE REWARDEDHi Christiaan,
Check RFC FM ABAP4_CALL_TRANSACTION
Thanks
Lakshman -
Hello, I'm using .net connector and I need to read the output of a report from it.
The .net connector only could access to a RFC, there's any way to read the data of a report? without changing de ABAP of the report?
I got the same problem reading the output of a SAP transaction, I'm trying to use the RFC_CALL_Transaction, is this correct?
Thanks a lot!Hi Magesh,
Enabling the output of R/3 report in a web page is possible through internet. You should be able to enable it by means of writing a BAPI with correct export and import parameters. If you spell out your exact requirement to a developer, he can develop this easily.
You can even enable the user to run this report from portal itself. You can create selection screens in webpage similar to the ones in SAP. You can specifiy the import parameters for each screen. Based on teh selection criteria in the webpage, the details are passed on to SAP and the result of the report can again be passed to the web page using the BAPI with proper export parameter.
As I already told you, please consult the technical consultant. He will enable it easily.
We have done lot of such reports for a custom made portal.
Hope this helps.
You can reward if this helps. -
RFC & Excel VBA with ECC 6.0
I use a routine like this to post movements in R/3 (This is an example for MB1A Transaction) based on information posted on a excel spreadsheet + VBA and seudo-code created with SM35 transaction
Public Sub updateRFC_BDC()
'Set sheet specific variables / constants
j = 0
startRow = 3
colStatus = 1
colMsg = 1
' Cell information on the excel spreadsheet
colMKPF_BLDAT = 2
colMKPF_BUDAT = 3
colMKPF_OIB_BLTIME = 4
colRM07M_BWARTWA = 5
colRM07M_WERKS = 6
colRM07M_LGORT = 7
colXFULL = 8
colRM07M_WVERS3 = 9
colMSEG_MATNR = 10
colMSEG_ERFMG = 11
colMSEG_ERFME = 12
colMSEG_WERKS = 13
colMSEG_LGORT = 14
colMSEG_CHARG = 15
colMSEG_OIHANTYP = 16
colOIB_A08_TDICH = 17
colOIB_A08_TDICHEH = 18
colOIB_A08_MTTMP = 19
colOIB_A08_MTTEH = 20
colOIB_A08_TSTMP = 21
colOIB_A08_TSTEH = 22
colOIB_A08_MCF = 23
colDKACB_FMORE = 24
colCOBL_PRCTR = 25
i = 0
'Set debug mode
If CheckBox1.Value = True Then
DEBUG_MODE = True
Else
DEBUG_MODE = False
End If
'Reset status column
Range(Cells(startRow, colMsg), Cells(60000, colMsg)).Value = ""
'Login to SAP, if it fails, notify user and exit sub
updateStatus "Logging into SAP...", colStatus, 1
If Not login2SAP Then
MsgBox "Login to SAP failed. Remote Function Call NOT performed.", vbInformation, "Login Failed"
updateStatus "", colStatus, 1
Exit Sub
End If
'While the next row is not empty loop through BDC
While Trim(Cells(startRow + i, 2).Value) <> ""
firstTime = True
updateStatus "Processing Row " & (startRow + i), colStatus, 1
' Retrieve the Function object (the Connection object must be set up before Function objects can be created):
Set RfcCallTransaction = Functions.Add("RFC_CALL_TRANSACTION")
'Set the export parameters
RfcCallTransaction.exports("TRANCODE") = "MB1A "
RfcCallTransaction.exports("UPDMODE") = "S"
Set BdcTable = RfcCallTransaction.Tables("BDCTABLE")
'Highlight current row so user knows what is happening
Cells(startRow + i, 2).Select
'Screen SAPMM07M BDC code
add_BDCData BdcTable, "SAPMM07M", "0400", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "RM07M-LGORT"
testForBlank_AddToBDC "MKPF-BLDAT", Cells(startRow + i, colMKPF_BLDAT).Value
testForBlank_AddToBDC "MKPF-BUDAT", Cells(startRow + i, colMKPF_BUDAT).Value
testForBlank_AddToBDC "MKPF-OIB_BLTIME", Cells(startRow + i, colMKPF_OIB_BLTIME).Value
testForBlank_AddToBDC "RM07M-BWARTWA", Cells(startRow + i, colRM07M_BWARTWA).Value
testForBlank_AddToBDC "RM07M-WERKS", Cells(startRow + i, colRM07M_WERKS).Value
testForBlank_AddToBDC "RM07M-LGORT", Cells(startRow + i, colRM07M_LGORT).Value
testForBlank_AddToBDC "XFULL", Cells(startRow + i, colXFULL).Value
testForBlank_AddToBDC "RM07M-WVERS3", Cells(startRow + i, colRM07M_WVERS3).Value
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "=NPE"
'Screen SAPMM07M BDC code
add_BDCData BdcTable, "SAPMM07M", "0410", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "MSEG-OIHANTYP"
testForBlank_AddToBDC "MSEG-MATNR", Cells(startRow + i, colMSEG_MATNR).Value
testForBlank_AddToBDC "MSEG-ERFMG", Cells(startRow + i, colMSEG_ERFMG).Value
testForBlank_AddToBDC "MSEG-ERFME", Cells(startRow + i, colMSEG_ERFME).Value
testForBlank_AddToBDC "MSEG-WERKS", Cells(startRow + i, colMSEG_WERKS).Value
testForBlank_AddToBDC "MSEG-LGORT", Cells(startRow + i, colMSEG_LGORT).Value
testForBlank_AddToBDC "MSEG-CHARG", Cells(startRow + i, colMSEG_CHARG).Value
testForBlank_AddToBDC "MSEG-OIHANTYP", Cells(startRow + i, colMSEG_OIHANTYP).Value
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPMM07M 2400BLOCK1"
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPMM07M 2400BLOCK2"
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "/00"
'Screen SAPLOIB_QCI BDC code
add_BDCData BdcTable, "SAPLOIB_QCI", "0500", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "OIB_A08-TDICH"
testForBlank_AddToBDC "OIB_A08-TDICH", Cells(startRow + i, colOIB_A08_TDICH).Value
testForBlank_AddToBDC "OIB_A08-TDICHEH", Cells(startRow + i, colOIB_A08_TDICHEH).Value
testForBlank_AddToBDC "OIB_A08-MTTMP", Cells(startRow + i, colOIB_A08_MTTMP).Value
testForBlank_AddToBDC "OIB_A08-MTTEH", Cells(startRow + i, colOIB_A08_MTTEH).Value
testForBlank_AddToBDC "OIB_A08-TSTMP", Cells(startRow + i, colOIB_A08_TSTMP).Value
testForBlank_AddToBDC "OIB_A08-TSTEH", Cells(startRow + i, colOIB_A08_TSTEH).Value
testForBlank_AddToBDC "OIB_A08-MCF", Cells(startRow + i, colOIB_A08_MCF).Value
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "=CONT"
'Screen SAPMM07M BDC code
add_BDCData BdcTable, "SAPMM07M", "0410", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPLKACB 0001BLOCK"
testForBlank_AddToBDC "DKACB-FMORE", Cells(startRow + i, colDKACB_FMORE).Value
'Screen SAPLKACB BDC code
add_BDCData BdcTable, "SAPLKACB", "0002", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "COBL-AUFNR"
testForBlank_AddToBDC "COBL-PRCTR", Cells(startRow + i, colCOBL_PRCTR).Value
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPLKACB 9999BLOCK1"
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "=ENTE"
'Screen SAPMM07M BDC code
add_BDCData BdcTable, "SAPMM07M", "0410", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "MSEG-ERFMG"
testForBlank_AddToBDC "MSEG-ERFMG", Cells(startRow + i, colMSEG_ERFMG).Value
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPMM07M 2400BLOCK1"
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPMM07M 2400BLOCK2"
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPLKACB 0001BLOCK"
testForBlank_AddToBDC "DKACB-FMORE", Cells(startRow + i, colDKACB_FMORE).Value
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "=BU"
'Screen SAPLKACB BDC code
add_BDCData BdcTable, "SAPLKACB", "0002", "X", "", ""
add_BDCData BdcTable, "", "", "", "BDC_CURSOR", "COBL-AUFNR"
testForBlank_AddToBDC "COBL-PRCTR", Cells(startRow + i, colCOBL_PRCTR).Value
add_BDCData BdcTable, "", "", "", "BDC_SUBSCR", "SAPLKACB 9999BLOCK1"
add_BDCData BdcTable, "", "", "", "BDC_OKCODE", "=ENTE"
add_BDCData BdcTable, "TCDEMB1A ", "", "", "", ""
firstTime = False
' Call the function (if the result is false, then display a message):
If RfcCallTransaction.CALL = True Then
Set Messages = RfcCallTransaction.imports("MESSG")
If DEBUG_MODE Then
printBDCTable (startRow + i)
End If
Cells(startRow + i, colMsg).Value = Messages.Value("MSGTX")
Else
MsgBox " Call Failed! error: " + RfcCallTransaction.Exception
updateStatus "Error!", colStatus, 1
End If
i = i + 1
j = 0
Messages.Value("MSGTX") = ""
Wend
logOffSAP
If DEBUG_MODE Then
MsgBox "BDC file written to : " & DEBUG_FILE
End If
updateStatus "Processing Done. Logged off of SAP", colStatus, 1
End Sub
Now I'm trying to use this routine for ECC 6.0, but it looks like the export parameter changed and it is not working.
Could you please help me to debug this routine to make it work with ECC 6.0
ThanksDear Javier Cantini,
Welcome to SCN.
Post your queries in relevant forum. Your query is technical in nature and should be posted in ABAP forums. Moving your thread to ABAP, General forum.
Regards,
Naveen -
RFC with VBA Help Needed.
Hi.
I'm preety new to RFCand but I have to challenge following topic:
I need to call SAP transaction MF42N from RFC. I want to pass the parametres from Excel spreadsheet or externat .csv or .txt file. Can you please provide some example code. I know how to retrive data from SAP tables with RFC but call tcode is new for me. I know I need to use RFC_CALL_TRANSACTION. But I need more code.
Thanks in advance.hi
you r doin r3 to xi
follow these steps
SAP R/3
1) RFC Destination (SM59)
a) Choose create.
b) Specify the name of the RFC destination
c) Select connection type as 3 and save
d) In the technical settings tab enter the details SAP SID/URL and system number#.
e) Enter the Gateway host as same details above SID/URL.
f) Gateway service is 3300+system number#.
g) In the Logon /Security tab, enter the client user & Password details of Destination system.
h) Test the connection and remote logon.
2) Create Port (We21)
a) First Select Transactional RFC and then click create button
b) Enter the destination port name as SAP+SID (The starting char should be SAP)
c) Enter the destination client.
d) Enter the RFC Destination created in SAP R/3 towards other system.
e) Save
3) Create Partner Profile (WE20)
a) Create New
b) Create the Partner no. name as same the logical system name of the destination system.
c) Select Partner type LS
d) Enter details for Type: US/USER, Agent, and Lang.
e) Click on the + button to select the message type.
f) Select Partner no. and LS which ever create above.
g) Select Message type
h) Select Process code related to the Message type.
I) save.
In SLD System Landscape Directory
TS for R/3 (Logical system):-Assign the client name created in R/3 as Logical system Name.
Ts for Third Party (Logical system):-
BS for SAP R/3 (Logical system):- Assign the client name created in R/3 as Logical system Name.
BS for Third Party (Logical system):-Enter the XI logical system name.
cheers
kish
<b>reward points if useful</b> -
MAKE AN ENTRY IN ALL REQUIRED FIELDS
HI,
I AM USING THE FOLLOWING EXCEL VBA CODE TO TRY AND CALL A TRANSACTION LX02 DIRECT INTO EXCEL.
Public Sub add_bdcdata(BdcTable As Object, program As String, dynpro As String, dynbegin As String, fnam As String, fval As String)
Dim vField As Variant
j = j + 1
BdcTable.Rows.Add
BdcTable.Value(BdcTable.Rows.Count, "PROGRAM") = "RLS10020"
BdcTable.Value(BdcTable.Rows.Count, "DYNPRO") = "1000"
BdcTable.Value(BdcTable.Rows.Count, "DYNBEGIN") = "X"
BdcTable.Value(BdcTable.Rows.Count, "FNAM") = "BDC_OKCODE"
BdcTable.Value(BdcTable.Rows.Count, "FVAL") = "NEXT"
Debug.Print BdcTable.Value(j, "FVAL")
End Sub
Public Sub rfc_call_transaction()
Dim Functions As Object
Dim RfcCallTransaction As Object
Dim Messages As Object
Dim BdcTable As Object
' Create the Function control (that is, the high-level Functions collection):
Set Functions = CreateObject("SAP.Functions")
' Set the rest of Connection object values:
Functions.Connection.System = "QA2"
Functions.Connection.client = "900"
Functions.Connection.user = "mbrough"
Functions.Connection.Password = "st34lhv3"
Functions.Connection.Language = "EN"
If Functions.Connection.Logon(0, False) <> True Then
Exit Sub
End If
Dim iBOB As Integer
iBOB = Range("A1")
Do
' Retrieve the Function object (the Connection object must be set up before Function objects can be created):
Set RfcCallTransaction = Functions.Add("RFC_CALL_TRANSACTION")
' Set the export parameters
RfcCallTransaction.exports("TRANCODE") = "LX02"
RfcCallTransaction.exports("UPDMODE") = "S"
Set BdcTable = RfcCallTransaction.Tables("BDCTABLE")
' Set the tables parameter and add the data for the call transaction
add_bdcdata BdcTable, "RLS10020", "1000", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "S1_LGNUM"
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "=ONLI"
add_bdcdata BdcTable, "", "", "", "S1_LGNUM", "900"
add_bdcdata BdcTable, "", "", "", "S1_LGNUM", "ActiveCell"
add_bdcdata BdcTable, "", "", "", "S1_LGTYP-LOW", "K01"
add_bdcdata BdcTable, "", "", "", "BDC_SUBSCR", "SAPLSSEL"
add_bdcdata BdcTable, "", "", "", "BDC_SUBSCR", "SAPLSSEL"
add_bdcdata BdcTable, "SAPMSSYO", "0120", "X", "", ""
add_bdcdata BdcTable, "", "0", "", "BDC_OKCODE", "=BACK"
add_bdcdata BdcTable, "RLS10020", "1000", "X", "", ""
add_bdcdata BdcTable, "", "", "", "BDC_OKCODE", "/EE"
add_bdcdata BdcTable, "", "", "", "BDC_CURSOR", "S1_LGNUM"
add_bdcdata BdcTable, "", "", "", "S1_LGNUM", ActiveCell.Value
'End SubCall the function (if the result is false, then display a message):
If RfcCallTransaction.Call = True Then
Set Messages = RfcCallTransaction.imports("MESSG")
MsgBox Messages.Value("MSGTX")
Else
MsgBox " Call Failed! error: " + GetCustomers.Exception
End If
iBOB = iBOB + 1
Loop Until IsEmpty(ActiveCell.Offset(iBOB, 0))
Functions.Connection.Logoff
End Sub
I KEEP GETTING AN ERROR MESSAGE SAYING 'MAKE AN ENTRY IN ALL REQUIRED FIELDS' AND THEN NOTHING DOWNLOADS INTO EXCEL.
CAN ANYONE HELP PLEASE?
THANKSWhen I run this transaction through SAPgui I only have to fill out the field S1_LGNUM, and I have specified this in my code.
Is my code below correct?
Public Sub add_bdcdata(BdcTable As Object, program As String, dynpro As String, dynbegin As String, fnam As String, fval As String)
Dim vField As Variant
Static j As Integer
j = j + 1
BdcTable.Rows.Add
BdcTable.Value(j, "PROGRAM") = "RLS10020" ' Program Name
BdcTable.Value(j, "DYNPRO") = "1000" ' Dynpro Number
BdcTable.Value(j, "DYNBEGIN") = "X" ' X if a screen
BdcTable.Value(j, "FNAM") = "BDC_OKCODE" ' Field Name
BdcTable.Value(j, "FVAL") = "NEXT" ' Field Value
End Sub
As i have seen this in examples where it looks like below.
Public Sub add_bdcdata(BdcTable As Object, program As String, dynpro As String, dynbegin As String, fnam As String, fval As String)
Dim vField As Variant
Static j As Integer
j = j + 1
BdcTable.Rows.Add
BdcTable.Value(j, "PROGRAM") = program ' Program Name
BdcTable.Value(j, "DYNPRO") = dynpro ' Dynpro Number
BdcTable.Value(j, "DYNBEGIN") = dynbegin ' X if a screen
BdcTable.Value(j, "FNAM") = fnam ' Field Name
BdcTable.Value(j, "FVAL") = fval ' Field Value
End Sub
Thanks -
Starting transaction in SAPGUI via JCo
Hello,
I'm trying to start SAPGUI for Windows using parameter
setSapGui(1), but the GUI Window does not show. When I'm using setAbapDebug(true)than the GUI window starts in debug mode.
What can be wrong? Does anyone have any ideas?
I'm trying to start transaction se11 using BAPI RFC_CALL_TRANSACTION.
Code looks like this:
// Obtain parameter list for function
JCO.ParameterList input = function.getImportParameterList();
// Obtain table for function
JCO.Table BDCtable = function.getTableParameterList().getTable("BDCTABLE");
//BDCtable.setRow(0);
BDCtable.appendRows(4);
BDCtable.setValue("SAPMSRD0", "PROGRAM");
BDCtable.setValue("0102", "DYNPRO");
BDCtable.setValue("X", "DYNBEGIN");
BDCtable.nextRow();
BDCtable.setValue("BDC_CURSOR", "FNAM");
BDCtable.setValue("RSRD1-TBMA_VAL", "FVAL");
BDCtable.nextRow();
BDCtable.setValue("BDC_OKCODE", "FNAM");
BDCtable.setValue("=SHOW", "FVAL");
BDCtable.nextRow();
BDCtable.setValue("RSRD1-TBMA", "FNAM");
BDCtable.setValue("X", "FVAL");
BDCtable.nextRow();
BDCtable.setValue("RSRD1-TBMA_VAL", "FNAM");
BDCtable.setValue("BUKRS", "FVAL");
BDCtable.nextRow();
BDCtable.setValue("SAPMSRD0", "PROGRAM");
BDCtable.setValue("0102", "DYNPRO");
BDCtable.setValue("X", "DYNBEGIN");
// Pass function parameters
input.setValue(transactionName, "TRANCODE");
//input.setValue(daneKlienta, "DANE_KLIENTA");
conn.execute(function, conn.createTID());
Regards Artur
Message was edited by: Artur WelkeHi Artur,
This answer is in relation to BSP but i think concept is same, it will give you an idea. This answer is taken from
Brain's <a href="/people/brian.mckellar/blog/2003/10/23/bsp-trouble-shooting-frequently-asked-short-questions weblog.
<i>Typical question: "We have developed a BSP application and we're trying to call some function. It doesn't work. However, if we execute the BSP application in debug mode, everything works fine. Why?"
When you log onto a WebAS system the Dynpro engine is started that contains all the logic to handle interaction with the SAPGUI. For example, things such as rendering controls and doing file upload/download are all available.
When you run an HTTP request into Web AS, a very special "dark" (or background) Dynpro is started. A minimal Dynpro is required to get ABAP up and running. But now there is no SAPGUI available, so no SAPGUI-based service will work. Also little things such as popup windows do not work.
So why does the code work in the debugger? Because, once the debugger is triggered,it realizes that a normal Dynpro is required for the debugger and not the "dark" one. So the full-blown Dynpro engine is started, making all SAPGUI services available.
You can consider finding the code that causes the error and bracket it with IF-statements in this function, so that no SAPGUI interaction is required in the context of a HTTP call.</i>
Also visit this <a href="https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D35880%26tstart%3D60">thread</a>, this will certainly help you.
Regards,
Narinder Hartala -
I want to display a transaction such as MM01 in SAP gui from Visual Basic. I tried to use function RFC_DISPLAY_MATERIAL_MASTER (without any parameters), but it works only in ABAP debugger. Without debugger, it returns SYSTEM_FAILURE.
Here is the code:
theFunc = functionCtrl.Add("RFC_DISPLAY_MATERIAL_MASTER")
returnFunc = theFunc.Call
If returnFunc = True Then
Return 0
Else
callException = theFunc.Exception
Return -1
End If
How about transaction such as SD62(change order bom)? I couldn't find RFC-function to display it. Is there a general function to display a transaction in SAPgui? RFC_CALL_TRANSACTION seems to do it only in backround.Thanks for your help Sanjeev,
I tried to use ABAP4_CALL_TRANSACTION, but it works only if I run it in ABAP debugger. Do I have to call some other functions before it to open SAPgui? I only call
functionCtrl = CreateObject("SAP.Functions")
sapConnection = functionCtrl.Connection
before function ABAP4_CALL_TRANSACTION. -
Start screen does not exist in batch input data
I'm using .NET Connector calling Rfc_Call_Transaction funtion throught a proxy, i stablished all the params as you can see in the code below, but i get the message cited in the subject 'Start screen does not exist in batch input data'.
What do you think is happening? or Where can i get the samples needed for perform this type of request?
private BDCDATA FillBDCDATA(string Program,
string Dynbegin,
string Dynpro,
string Fnam,
string Fval)
BDCDATA st_DATA = new BDCDATA();
st_DATA.Program = Program;
st_DATA.Dynbegin = Dynbegin;
st_DATA.Dynpro = Dynpro;
st_DATA.Fnam = Fnam;
st_DATA.Fval = Fval;
return st_DATA;
private void button3_Click(object sender, System.EventArgs e)
SAPProxy proxy = null;
try
proxy = new SAPProxy("ASHOST=" + txtHost.Text +
" SYSNR=" + txtSysnr.Text +
" CLIENT=" + txtMand.Text +
" LANG=" + txtLang.Text +
" USER=" + txtUser.Text +
" PASSWD=" + txtPass.Text);
catch(Exception excpt)
txtMsg.Text = excpt.Message;
if (proxy == null)
return;
BDCDATATable tblBDCDATA = new BDCDATATable();
MESSAGEINF infMessage = new MESSAGEINF();
//BDCDATA st_DATA = new BDCDATA();
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "0111", "0111", "BDC_OKCODE", "/00"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "0111", "0111", "BPDY-BLDAT", "30.12.2004"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "0111", "0111", "BPDY-VERSN", "0"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "0111", "0111", "FMPS-FIKRS", "ente"));
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "0111", "0111", "BPDY-JAHR", "2005"));
proxy.Rfc_Call_Transaction("FM9J","", out infMessage, ref tblBDCDATA);
txtMsg.Text = infMessage.Msgtx;Jose,
I imagine you are passing, for the Dynbegin parameter of the private method FillBDCDATA, invalid values.
Why don't you try this way:
tblBDCDATA.Add(FillBDCDATA("SAPMKBUA", "X", "0111", " "," "));
tblBDCDATA.Add(FillBDCDATA(" ", " ", " ", "BDC_OKCODE", "/00"));
tblBDCDATA.Add(FillBDCDATA(" ", " ", " ", "BPDY-BLDAT", "30.12.2004"));
tblBDCDATA.Add(FillBDCDATA(" ", " ", " ", "BPDY-VERSN", "0"));
tblBDCDATA.Add(FillBDCDATA(" ", " ", " ", "FMPS-FIKRS", "ente"));
tblBDCDATA.Add(FillBDCDATA(" ", " ", " ", "BPDY-JAHR", "2005"));
I hope I could help you.
Regards,
Daniel Carvalho -
Function module SYSTEM_ATTACH_GUI
Hallo,
has someone worked with the function module SYSTEM_ATTACH_GUI ?
If you connect with RFC to a SAP-System you can use this function module to open a SAP-GUI. But this does not work in my environment. In my case only the SAP-Logon screen with all my defined systems opens.
Has anyone a code example ?
ThanksCALL FUNCTION 'SYSTEM_ATTACH_GUI'
EXCEPTIONS
OTHERS = 1.
Check FM <b>RFC_CALL_TRANSACTIONS</b> for demonstartion ..
regards,
Santosh
Maybe you are looking for
-
How to make video screensaver for iPad?
Dear all, does any one know how to make a video screensaver for iPad? We plan to use iPad's (with iOs7) in our retail shops and we want them to role video screensavers (while iPad is locked). I know that Apple Demo has it. And did I miss something bu
-
Where can I download the CC desktop app?
I am just setting up my secondary installation of CC on my new laptop. Where can I find CC desktop app installer?
-
Hello, Can somebody help me with a manual for repairing my notebook? HP Pavillion dv9202ea p/n: RY689EA Kind regards. This question was solved. View Solution.
-
Iphone frozen - need help!
Hi, My Iphone has recently frozen was fine one minute then when i looked back a while later the screen was blank and will not turn on. Didnt think the battery was dead but nevertheless I have had it on charge all day but my pc, laptop and dock wont p
-
Outbound Asynchronous communication Using Proxy
Hello, I am trying to send an outbound communication from an R/3 system using a abap proxy. The method execute_asynchronous completes without any bad return code (sy-subrc is 0). But the message does not go to the Integration server. Is there somethi