2006 Mar 10 10:01 AM
Hi Everyone,
I'm trying to use this BAPI and it's web service to pass confirmations from an outside system. When I run the BAPI in test, I get the following error:
E RU 510 "Confirmation functions can only be executed in dialog mode"
Yet, there are posts on this forum that make it sound like you can do it as part of a program that doesn't require user action.
Has anyone out there used this BAPI to create a confirmation? Has anyone used the SAP-supplied web service?
I even wrote a wrapper function ... here's the code ...
FUNCTION Z_IMPORT_EM_CONF_A.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(Z_ORDERID) LIKE AFRUD-AUFNR
*" VALUE(Z_OPERATION) LIKE AFRUD-VORNR
*" VALUE(Z_SEQUENCE) LIKE AFRUD-APLFL
*" VALUE(Z_FIN_CONF) LIKE AFRUD-AUERU
*" VALUE(Z_YIELD) LIKE AFRUD-LMNGA
*" VALUE(Z_YIELD_UNIT) LIKE AFRUD-MEINH
*" EXPORTING
*" VALUE(Y_RETURN_CODE) LIKE BAPIRET1 STRUCTURE BAPIRET1
*" TABLES
*" Z_TIMETICKETS STRUCTURE BAPI_PP_TIMETICKET
*" Z_DETAIL_RETURN STRUCTURE BAPI_CORU_RETURN
*"----
----
data definition
----
Batchinputdata of single transaction
data: s_BAPIRET1 like BAPIRET1,
s_timetkt type BAPI_PP_TIMETICKET,
t_timetkt type table of BAPI_PP_TIMETICKET,
t_goodmvt type table of BAPI2017_GM_ITEM_CREATE,
t_link_conf type table of BAPI_LINK_CONF_GOODSMOV,
s_dtl_rtn type BAPI_CORU_RETURN,
t_dtl_rtn type table of BAPI_CORU_RETURN.
refresh: t_timetkt,
t_goodmvt,
t_link_conf,
t_dtl_rtn.
.
IF Z_FIN_CONF = 'Y'.
Z_FIN_CONF = ''.
ENDIF.
s_timetkt-ORDERID = Z_ORDERID.
s_timetkt-OPERATION = Z_OPERATION.
s_timetkt-SEQUENCE = Z_SEQUENCE.
s_timetkt-FIN_CONF = Z_FIN_CONF.
s_timetkt-YIELD = Z_YIELD.
s_timetkt-CONF_QUAN_UNIT = Z_YIELD_UNIT.
append s_timetkt to Z_TIMETICKETS.
CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
EXPORTING
POST_WRONG_ENTRIES = '2'
TESTRUN = ' '
IMPORTING
RETURN = Y_RETURN_CODE
TABLES
timetickets = Z_TIMETICKETS
GOODSMOVEMENTS = t_goodmvt
LINK_CONF_GOODSMOV = t_link_conf
DETAIL_RETURN = Z_DETAIL_RETURN.
IF SY-SUBRC <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET1'
EXPORTING
TYPE = SY-MSGTY
CL = SY-MSGID
NUMBER = SY-MSGNO
PAR1 = SY-MSGV1
PAR2 = SY-MSGV2
PAR3 = SY-MSGV3
PAR4 = SY-MSGV4
LOG_NO = ' '
LOG_MSG_NO = ' '
IMPORTING
BAPIRETURN = Y_RETURN_CODE.
EXIT.
ENDIF.
*loop at t_dtl_rtn into s_dtl_rtn.
reference field s_dtl_rtn-CONF_NO.
*endloop.
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*EXPORTING
*WAIT = 'W'.
if sy-subrc = 0.
COMMIT WORK.
Else.
ROLLBACK WORK.
ENDIF.
ENDFUNCTION.
I've tried commenting out the goods movements since there are some associated.
Also, when you run CO11N, to perform this same action, a dialog box pops up asking about a trigger function. Could this be the cause of the problem?
Thanks for any help.
Rod Wagoner
Tucson, AZ
Hi Everyone,
I'm trying to use this BAPI and it's web service to pass confirmations from an outside system. When I run the BAPI in test, I get the following error:
E RU 510 "Confirmation functions can only be executed in dialog mode"
Yet, there are posts on this forum that make it sound like you can do it as part of a program that doesn't require user action.
Has anyone out there used this BAPI to create a confirmation? Has anyone used the SAP-supplied web service?
I even wrote a wrapper function ... here's the code ...
FUNCTION Z_IMPORT_EM_CONF_A.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(Z_ORDERID) LIKE AFRUD-AUFNR
*" VALUE(Z_OPERATION) LIKE AFRUD-VORNR
*" VALUE(Z_SEQUENCE) LIKE AFRUD-APLFL
*" VALUE(Z_FIN_CONF) LIKE AFRUD-AUERU
*" VALUE(Z_YIELD) LIKE AFRUD-LMNGA
*" VALUE(Z_YIELD_UNIT) LIKE AFRUD-MEINH
*" EXPORTING
*" VALUE(Y_RETURN_CODE) LIKE BAPIRET1 STRUCTURE BAPIRET1
*" TABLES
*" Z_TIMETICKETS STRUCTURE BAPI_PP_TIMETICKET
*" Z_DETAIL_RETURN STRUCTURE BAPI_CORU_RETURN
*"----
----
data definition
----
Batchinputdata of single transaction
data: s_BAPIRET1 like BAPIRET1,
s_timetkt type BAPI_PP_TIMETICKET,
t_timetkt type table of BAPI_PP_TIMETICKET,
t_goodmvt type table of BAPI2017_GM_ITEM_CREATE,
t_link_conf type table of BAPI_LINK_CONF_GOODSMOV,
s_dtl_rtn type BAPI_CORU_RETURN,
t_dtl_rtn type table of BAPI_CORU_RETURN.
refresh: t_timetkt,
t_goodmvt,
t_link_conf,
t_dtl_rtn.
.
IF Z_FIN_CONF = 'Y'.
Z_FIN_CONF = ''.
ENDIF.
s_timetkt-ORDERID = Z_ORDERID.
s_timetkt-OPERATION = Z_OPERATION.
s_timetkt-SEQUENCE = Z_SEQUENCE.
s_timetkt-FIN_CONF = Z_FIN_CONF.
s_timetkt-YIELD = Z_YIELD.
s_timetkt-CONF_QUAN_UNIT = Z_YIELD_UNIT.
append s_timetkt to Z_TIMETICKETS.
CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
EXPORTING
POST_WRONG_ENTRIES = '2'
TESTRUN = ' '
IMPORTING
RETURN = Y_RETURN_CODE
TABLES
timetickets = Z_TIMETICKETS
GOODSMOVEMENTS = t_goodmvt
LINK_CONF_GOODSMOV = t_link_conf
DETAIL_RETURN = Z_DETAIL_RETURN.
IF SY-SUBRC <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET1'
EXPORTING
TYPE = SY-MSGTY
CL = SY-MSGID
NUMBER = SY-MSGNO
PAR1 = SY-MSGV1
PAR2 = SY-MSGV2
PAR3 = SY-MSGV3
PAR4 = SY-MSGV4
LOG_NO = ' '
LOG_MSG_NO = ' '
IMPORTING
BAPIRETURN = Y_RETURN_CODE.
EXIT.
ENDIF.
*loop at t_dtl_rtn into s_dtl_rtn.
reference field s_dtl_rtn-CONF_NO.
*endloop.
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*EXPORTING
*WAIT = 'W'.
if sy-subrc = 0.
COMMIT WORK.
Else.
ROLLBACK WORK.
ENDIF.
ENDFUNCTION.
I've tried commenting out the goods movements since there are some associated.
Also, when you run CO11N, to perform this same action, a dialog box pops up asking about a trigger function. Could this be the cause of the problem?
Thanks for any help.
Rod Wagoner
Tucson, AZ
2006 Mar 10 10:32 AM
Hi Roderic,
the BAPI just explain that you could not use it in background mode or in RFC. So try another one.
Rgd
Frédéric
2006 Mar 10 11:01 AM
Hi Frederic,
I'm new to this ... aren't BAPIs like APIs in the MS world?
I appreciate your response.
Rod
2012 Aug 21 6:48 PM
The original poster probably found his answer by now! I was looking for an answer to the same issue and found several notes that address this problem including Note 648292. The error is caused by a flaw in SAP that expects milestones to be confirmed even when none are present in the operatoin.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |