cancel
Showing results for 
Search instead for 
Did you mean: 

TMS_TM_GET_TRLIST and RFC error

Former Member
0 Kudos

Hello,

I am having problem with RFC call to TMS_TM_GET_TRLIST. Since this function is not remote enabled, I copied it and made it remote enabled. Function works well from SAP but when I call it from PHP, I get:

Errors found during saprfc calls:


RFC Error Info :
Key     : 
Status  : EXCEPTION ALERT RAISED
Message : 
Internal: 

How can I debug this exception and what causes it? Can this be resolved?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

have u checked the destination in SM59 transaction

Former Member
0 Kudos

Yes, there is RFC destination defined for target client. For some reason, it seems that function is not getting parameters I pass to it although I define them in php, here is debug info :

Function module: Z_TMS_TM_GET_TRLIST (remote SAP R/3: 620 Unicode)

IMPORT

IV_ALLCLI		C	1	0	offset = 0
IV_DOMAIN /o/		C	10	0	offset = 0
IV_ENDDATE		D	8	0	offset = 0
IV_ENDTIME		T	6	0	offset = 0
IV_EXPORTS /o/		C	1	0	offset = 0
IV_GET_LINENR /o/		C	1	0	offset = 0
IV_IMPORTS /o/		C	1	0	offset = 0
IV_LAST_IMPORT /o/		C	1	0	offset = 0
IV_LATEST /o/		C	1	0	offset = 0
IV_LISTNAME /o/		C	40	0	offset = 0
IV_PROJECT /o/		C	20	0	offset = 0
IV_STARTDATE		D	8	0	offset = 0
IV_STARTTIME		T	6	0	offset = 0
IV_SYSTEM		C	10	0	offset = 0
IV_TPSTAT_KEY /o/		C	20	0	offset = 0
IV_TRCLI /o/		C	3	0	offset = 0
IV_TRFUNCTION /o/		C	1	0	offset = 0
IV_TRSTEPS /o/		C	30	0	offset = 0
EXPORT

ES_EXCEPTION	ID	C	32	0	offset = 0
	DOMNAM	C	10	0	offset = 32
	SYSNAM	C	10	0	offset = 42
	CLIENT	C	3	0	offset = 52
	SERVICE	C	10	0	offset = 55
	FUNCTION	C	30	0	offset = 65
	ERROR	C	30	0	offset = 95
	SEVERITY	C	1	0	offset = 125
	TEXT	C	100	0	offset = 126
	MSGID	C	20	0	offset = 226
	MSGTY	C	1	0	offset = 246
	MSGNO	N	3	0	offset = 247
	MSGV1	C	50	0	offset = 250
	MSGV2	C	50	0	offset = 300
	MSGV3	C	50	0	offset = 350
	MSGV4	C	50	0	offset = 400
	METHODPTR	C	32	0	offset = 450
EV_SERVICE_VERS		C	10	0	offset = 0
TABLE

IRT_REQUESTS	SIGN	C	1	0	offset = 0
	OPTION	C	2	0	offset = 1
	LOW	C	20	0	offset = 3
	HIGH	C	20	0	offset = 23
Value of import (input) parameter IV_ALLCLI (memory = 1):
""
Value of import (input) parameter IV_DOMAIN (optional) (memory = 10):
""
Value of import (input) parameter IV_ENDDATE (memory = 8):
"00000000"
Value of import (input) parameter IV_ENDTIME (memory = 6):
"000000"
Value of import (input) parameter IV_EXPORTS (optional) (memory = 1):
""
Value of import (input) parameter IV_GET_LINENR (optional) (memory = 1):
""
Value of import (input) parameter IV_IMPORTS (optional) (memory = 1):
""
Value of import (input) parameter IV_LAST_IMPORT (optional) (memory = 1):
""
Value of import (input) parameter IV_LATEST (optional) (memory = 1):
""
Value of import (input) parameter IV_LISTNAME (optional) (memory = 40):
""
Value of import (input) parameter IV_PROJECT (optional) (memory = 20):
""
Value of import (input) parameter IV_STARTDATE (memory = 8):
"00000000"
Value of import (input) parameter IV_STARTTIME (memory = 6):
"000000"
Value of import (input) parameter IV_SYSTEM (memory = 10):
""
Value of import (input) parameter IV_TPSTAT_KEY (optional) (memory = 20):
""
Value of import (input) parameter IV_TRCLI (optional) (memory = 3):
""
Value of import (input) parameter IV_TRFUNCTION (optional) (memory = 1):
""
Value of import (input) parameter IV_TRSTEPS (optional) (memory = 30):
""
Value of export (output) parameter ES_EXCEPTION (memory = 488):
ID	DOMNAM	SYSNAM	CLIENT	SERVICE	FUNCTION	ERROR	SEVERITY	TEXT	MSGID	MSGTY	MSGNO	MSGV1	MSGV2	MSGV3	MSGV4	METHODPTR
""	""	""	""	""	""	""	""	""	""	""	"0"	""	""	""	""	""
Value of export (output) parameter EV_SERVICE_VERS (memory = 10):
""
Internal table IRT_REQUESTS (memory = 48):
SIGN	OPTION	LOW	HIGH
0 rows

gregorw
Active Contributor
0 Kudos

Hello Sasha,

the problem is that the current version of SAPRFC for PHP does not support Unicode Backend systems. Here you only have the possibility to use Web Services or help Eduard to develop a Unicode enabled version.

Regards

Gregor

Former Member
0 Kudos

Hello Sasha,

SAPRFC for PHP does support Unicode Backend system. The problem is probably as you wrote in the previous post in the bad parameters when you calling function module (the ALERT exception is raised by standard TMS_TM_GET_TRLIST fm). Try to place saprfc_function_debug_info() before saprfc_call_and_receive(), so you can see as your import parameters are filled (after call are those parameters inicialized).

Regards,

Eduard.

gregorw
Active Contributor
0 Kudos

Hello Eduard,

does this also apply to the avaliable precompiled Windows versions or do I have to get them compiled with the 6.20 Unicode RFC SDK?

Regards

Gregor

Former Member
0 Kudos

Hello Gregor,

yes, this apply to the available precompiled Windows versions. But you must use it with Non-Unicode RFC library. Support for Unicode RFC library and PHP 6 (that support Unicode on the client side) will be available in the next version saprfc 1.5 (currently in the CVS on the sourceforge.net). I want to release beta version of new version saprfc after PHP 6 will be released.

Regards,

Eduard.

Former Member
0 Kudos

Hi everyone,

Eduard,

I tried to do what you suggested. I will include output below. However I think this alert is raised because of missing export parameter which is not found during function discover. The parameter I am talking about is export ET_TMSTPALOG and it has following metadata, which can be checked in SE37:

 ET_TMSTPALOG



            LISTNAME                       CHARACTER       40
            TRTIME                         NUMC            14
            TRKORR                         CHARACTER       20
            TRCLI                          CHARACTER       3
            TRSTEP                         CHARACTER       1
            ALLCLI                         CHARACTER       1
            TRFUNCTION                     CHARACTER       1
            KORRDEV                        CHARACTER       4
            PROJECT                        CHARACTER       20
            TRUSER                         CHARACTER       12
            RETCODE                        CHARACTER       4
            ADMIN                          CHARACTER       12
            AS4TEXT                        CHARACTER       60
            LINENR                         CHARACTER       10

I added this manually with saprfc_function_define but then after a call I get RFC error again.

Debug info before and after call is displayed below:

--- BEFORE CALL ---

--- saprfc_function_debug_info(Resource id #8) --->
Function module: Z_TMS_TM_GET_TRLIST (remote SAP R/3: 40B)

IMPORT

IV_ALLCLI		C	1	0	offset = 0
IV_DOMAIN		C	10	0	offset = 0
IV_ENDDATE		D	8	0	offset = 0
IV_ENDTIME		T	6	0	offset = 0
IV_EXPORTS		C	1	0	offset = 0
IV_GET_LINENR		C	1	0	offset = 0
IV_IMPORTS		C	1	0	offset = 0
IV_LAST_IMPORT		C	1	0	offset = 0
IV_LATEST		C	1	0	offset = 0
IV_LISTNAME		C	40	0	offset = 0
IV_PROJECT		C	20	0	offset = 0
IV_STARTDATE		D	8	0	offset = 0
IV_STARTTIME		T	6	0	offset = 0
IV_SYSTEM		C	10	0	offset = 0
IV_TPSTAT_KEY		C	20	0	offset = 0
IV_TRCLI		C	3	0	offset = 0
IV_TRFUNCTION		C	1	0	offset = 0
IV_TRSTEPS		C	30	0	offset = 0
EXPORT

ES_EXCEPTION	ID	C	32	0	offset = 0
	DOMNAM	C	10	0	offset = 32
	SYSNAM	C	10	0	offset = 42
	CLIENT	C	3	0	offset = 52
	SERVICE	C	10	0	offset = 55
	FUNCTION	C	30	0	offset = 65
	ERROR	C	30	0	offset = 95
	SEVERITY	C	1	0	offset = 125
	TEXT	C	100	0	offset = 126
	MSGID	C	20	0	offset = 226
	MSGTY	C	1	0	offset = 246
	MSGNO	N	3	0	offset = 247
	MSGV1	C	50	0	offset = 250
	MSGV2	C	50	0	offset = 300
	MSGV3	C	50	0	offset = 350
	MSGV4	C	50	0	offset = 400
	METHODPTR	C	32	0	offset = 450
ET_TMSTPALOG	LISTNAME	C	40	0	offset = 0
	TRTIME	N	14	0	offset = 40
	TRKORR	C	20	0	offset = 54
	TRCLI	C	3	0	offset = 74
	TRSTEP	C	1	0	offset = 77
	ALLCLI	C	1	0	offset = 78
	TRFUNCTION	C	1	0	offset = 79
	KORRDEV	C	4	0	offset = 80
	PROJECT	C	20	0	offset = 84
	TRUSER	C	12	0	offset = 104
	RETCODE	C	4	0	offset = 116
	ADMIN	C	12	0	offset = 120
	AS4TEXT	C	60	0	offset = 132
	LINENR	C	10	0	offset = 192
EV_SERVICE_VERS		C	10	0	offset = 0
TABLE

IRT_REQUESTS	SIGN	C	1	0	offset = 0
	OPTION	C	2	0	offset = 1
	LOW	C	20	0	offset = 3
	HIGH	C	20	0	offset = 23
Value of import (input) parameter IV_ALLCLI (memory = 1):
"X"
Value of import (input) parameter IV_DOMAIN (memory = 10):
""
Value of import (input) parameter IV_ENDDATE (memory = 8):
"31012007"
Value of import (input) parameter IV_ENDTIME (memory = 6):
"000000"
Value of import (input) parameter IV_EXPORTS (memory = 1):
""
Value of import (input) parameter IV_GET_LINENR (memory = 1):
""
Value of import (input) parameter IV_IMPORTS (memory = 1):
"X"
Value of import (input) parameter IV_LAST_IMPORT (memory = 1):
""
Value of import (input) parameter IV_LATEST (memory = 1):
""
Value of import (input) parameter IV_LISTNAME (memory = 40):
""
Value of import (input) parameter IV_PROJECT (memory = 20):
""
Value of import (input) parameter IV_STARTDATE (memory = 8):
"01012007"
Value of import (input) parameter IV_STARTTIME (memory = 6):
"000000"
Value of import (input) parameter IV_SYSTEM (memory = 10):
"B10"
Value of import (input) parameter IV_TPSTAT_KEY (memory = 20):
""
Value of import (input) parameter IV_TRCLI (memory = 3):
""
Value of import (input) parameter IV_TRFUNCTION (memory = 1):
""
Value of import (input) parameter IV_TRSTEPS (memory = 30):
""
Value of export (output) parameter ES_EXCEPTION (memory = 488):
ID	DOMNAM	SYSNAM	CLIENT	SERVICE	FUNCTION	ERROR	SEVERITY	TEXT	MSGID	MSGTY	MSGNO	MSGV1	MSGV2	MSGV3	MSGV4	METHODPTR
""	""	""	""	""	""	""	""	""	""	""	"0"	""	""	""	""	""
Value of export (output) parameter ET_TMSTPALOG (memory = 208):
LISTNAME	TRTIME	TRKORR	TRCLI	TRSTEP	ALLCLI	TRFUNCTION	KORRDEV	PROJECT	TRUSER	RETCODE	ADMIN	AS4TEXT	LINENR
""	"0"	""	""	""	""	""	""	""	""	""	""	""	""
Value of export (output) parameter EV_SERVICE_VERS (memory = 10):
""
Internal table IRT_REQUESTS (memory = 48):
SIGN	OPTION	LOW	HIGH

0 rows 

--- AFTER CALL --- 
RFC Error Info : 
Key : 
Status : EXCEPTION SYSTEM_FAILURE RAISED 
Message : 
Internal: 

--- saprfc_function_debug_info(Resource id #8) --->

Function module: Z_TMS_TM_GET_TRLIST (remote SAP R/3: 40B)

IMPORT

IV_ALLCLI		C	1	0	offset = 0
IV_DOMAIN		C	10	0	offset = 0
IV_ENDDATE		D	8	0	offset = 0
IV_ENDTIME		T	6	0	offset = 0
IV_EXPORTS		C	1	0	offset = 0
IV_GET_LINENR		C	1	0	offset = 0
IV_IMPORTS		C	1	0	offset = 0
IV_LAST_IMPORT		C	1	0	offset = 0
IV_LATEST		C	1	0	offset = 0
IV_LISTNAME		C	40	0	offset = 0
IV_PROJECT		C	20	0	offset = 0
IV_STARTDATE		D	8	0	offset = 0
IV_STARTTIME		T	6	0	offset = 0
IV_SYSTEM		C	10	0	offset = 0
IV_TPSTAT_KEY		C	20	0	offset = 0
IV_TRCLI		C	3	0	offset = 0
IV_TRFUNCTION		C	1	0	offset = 0
IV_TRSTEPS		C	30	0	offset = 0
EXPORT

ES_EXCEPTION	ID	C	32	0	offset = 0
	DOMNAM	C	10	0	offset = 32
	SYSNAM	C	10	0	offset = 42
	CLIENT	C	3	0	offset = 52
	SERVICE	C	10	0	offset = 55
	FUNCTION	C	30	0	offset = 65
	ERROR	C	30	0	offset = 95
	SEVERITY	C	1	0	offset = 125
	TEXT	C	100	0	offset = 126
	MSGID	C	20	0	offset = 226
	MSGTY	C	1	0	offset = 246
	MSGNO	N	3	0	offset = 247
	MSGV1	C	50	0	offset = 250
	MSGV2	C	50	0	offset = 300
	MSGV3	C	50	0	offset = 350
	MSGV4	C	50	0	offset = 400
	METHODPTR	C	32	0	offset = 450
ET_TMSTPALOG	LISTNAME	C	40	0	offset = 0
	TRTIME	N	14	0	offset = 40
	TRKORR	C	20	0	offset = 54
	TRCLI	C	3	0	offset = 74
	TRSTEP	C	1	0	offset = 77
	ALLCLI	C	1	0	offset = 78
	TRFUNCTION	C	1	0	offset = 79
	KORRDEV	C	4	0	offset = 80
	PROJECT	C	20	0	offset = 84
	TRUSER	C	12	0	offset = 104
	RETCODE	C	4	0	offset = 116
	ADMIN	C	12	0	offset = 120
	AS4TEXT	C	60	0	offset = 132
	LINENR	C	10	0	offset = 192
EV_SERVICE_VERS		C	10	0	offset = 0
TABLE

IRT_REQUESTS	SIGN	C	1	0	offset = 0
	OPTION	C	2	0	offset = 1
	LOW	C	20	0	offset = 3
	HIGH	C	20	0	offset = 23
Value of import (input) parameter IV_ALLCLI (memory = 1):
""
Value of import (input) parameter IV_DOMAIN (memory = 10):
""
Value of import (input) parameter IV_ENDDATE (memory = 8):
"00000000"
Value of import (input) parameter IV_ENDTIME (memory = 6):
"000000"
Value of import (input) parameter IV_EXPORTS (memory = 1):
""
Value of import (input) parameter IV_GET_LINENR (memory = 1):
""
Value of import (input) parameter IV_IMPORTS (memory = 1):
""
Value of import (input) parameter IV_LAST_IMPORT (memory = 1):
""
Value of import (input) parameter IV_LATEST (memory = 1):
""
Value of import (input) parameter IV_LISTNAME (memory = 40):
""
Value of import (input) parameter IV_PROJECT (memory = 20):
""
Value of import (input) parameter IV_STARTDATE (memory = 8):
"00000000"
Value of import (input) parameter IV_STARTTIME (memory = 6):
"000000"
Value of import (input) parameter IV_SYSTEM (memory = 10):
""
Value of import (input) parameter IV_TPSTAT_KEY (memory = 20):
""
Value of import (input) parameter IV_TRCLI (memory = 3):
""
Value of import (input) parameter IV_TRFUNCTION (memory = 1):
""
Value of import (input) parameter IV_TRSTEPS (memory = 30):
""
Value of export (output) parameter ES_EXCEPTION (memory = 488):
ID	DOMNAM	SYSNAM	CLIENT	SERVICE	FUNCTION	ERROR	SEVERITY	TEXT	MSGID	MSGTY	MSGNO	MSGV1	MSGV2	MSGV3	MSGV4	METHODPTR
""	""	""	""	""	""	"OK"	""	""	""	""	"0"	""	""	""	""	""
Value of export (output) parameter ET_TMSTPALOG (memory = 208):
LISTNAME	TRTIME	TRKORR	TRCLI	TRSTEP	ALLCLI	TRFUNCTION	KORRDEV	PROJECT	TRUSER	RETCODE	ADMIN	AS4TEXT	LINENR
""	"0"	""	""	""	""	""	""	""	""	""	""	""	""
Value of export (output) parameter EV_SERVICE_VERS (memory = 10):
""
Internal table IRT_REQUESTS (memory = 48):
SIGN	OPTION	LOW	HIGH

0 rows 

Former Member
0 Kudos

Hi Sasha,

you are right. The current version of saprfc doesn't support IMPORT or EXPORT parameter type of table. You must do workaround and change interface of your Z_TMS_TM_GET_TRLIST to ET_TMSTPALOG as TABLE (not EXPORT).

Regards,

Eduard.

Former Member
0 Kudos

I will have to learn a bit of ABAP for that, but it seems like final hour for it has come.

Thanks a lot!