‎2009 Aug 17 8:37 AM
Hello,
We use the call transaction to CN22 ( with MESSAGES into itab option...) to close networks.
Sometimes we have messages in a popup window which indicate that the closing action is not possible.
Unfortunately, those kind of messages are not returned by the call transaction and sy-subrc statement = 0.
Is it possible to read these messages with the call transaction statement ?
Thanks in advance for your answer
Jocelyne
‎2009 Aug 17 1:35 PM
Hi Guinamant,
you can collect al lthe error messages into bdcmsgcoll structure.
you follow the codes:
CALL TRANSACTION c_cn22 USING i_bdcdata
OPTIONS FROM wa_opt
MESSAGES INTO i_msgcoll.
note: i_msgcoll type standard table of bdcmsgcoll,
wa_msgcoll type bdcmsgcoll.
after bdc execution , all the error messages will be colllected in to i_msgcoll.
then if you want to get the text messages, then pass it through FM:
WRF_MESSAGE_TEXT_BUILD, OR USE FORMAT_MESSAGE
READ TABLE i_msgcoll INTO wa_msgcoll
WITH KEY msgtyp = c_e.
CALL FUNCTION 'WRF_MESSAGE_TEXT_BUILD'
EXPORTING
p_msgid = wa_msgcoll-msgid
p_msgno = l_msgno
p_msgv1 = wa_msgcoll-msgv1
p_msgv2 = wa_msgcoll-msgv2
p_msgv3 = wa_msgcoll-msgv3
p_msgv4 = wa_msgcoll-msgv4
IMPORTING
es_return = lwa_bapireturn1.
Hope this can solve your problems.
Regards,
Tutun
‎2009 Aug 17 11:29 AM
we can't read the system messages to call transaction method...
you can try with this BAPI BAPI_BUS2002_CREATE
‎2009 Aug 17 1:35 PM
Hi Guinamant,
you can collect al lthe error messages into bdcmsgcoll structure.
you follow the codes:
CALL TRANSACTION c_cn22 USING i_bdcdata
OPTIONS FROM wa_opt
MESSAGES INTO i_msgcoll.
note: i_msgcoll type standard table of bdcmsgcoll,
wa_msgcoll type bdcmsgcoll.
after bdc execution , all the error messages will be colllected in to i_msgcoll.
then if you want to get the text messages, then pass it through FM:
WRF_MESSAGE_TEXT_BUILD, OR USE FORMAT_MESSAGE
READ TABLE i_msgcoll INTO wa_msgcoll
WITH KEY msgtyp = c_e.
CALL FUNCTION 'WRF_MESSAGE_TEXT_BUILD'
EXPORTING
p_msgid = wa_msgcoll-msgid
p_msgno = l_msgno
p_msgv1 = wa_msgcoll-msgv1
p_msgv2 = wa_msgcoll-msgv2
p_msgv3 = wa_msgcoll-msgv3
p_msgv4 = wa_msgcoll-msgv4
IMPORTING
es_return = lwa_bapireturn1.
Hope this can solve your problems.
Regards,
Tutun
‎2009 Aug 18 2:46 PM
Hi,
Unfortunately, I have only a message which indicate that the network was modified. I expected to receive an error message.
We use CN22 => when we try to close a specific network, it's not possible because of standard rules (Balance of NWA is not zero).
This message appears in the entitled popup window "Error log from status check:displayed message". It explains why the user can't closed the network.
When we use the ''call transaction CN22" this kind of messages is not returned => no error detected.
Thanks for your answer
Jo
‎2009 Aug 18 3:03 PM
hii,
BEGIN OF METHOD ZNET CHANGING CONTAINER.
DATA: net TYPE aufnr.
swc_get_property self 'NET' net.
REFRESH bdcdata.
PERFORM bdc_fill USING :
***
'X' 'SAPLCOKO' '2000',
' ' 'BDC_CURSOR' 'CAUFVD-AUFNR',
' ' 'CAUFVD-AUFNR' net,
' ' 'BDC_OKCODE' '=LIST',
Next Screen
'X' 'SAPLCOVG' '2000',
' ' 'BDC_CURSOR' 'AFVGD-VORNR(01)',
' ' 'RC27X-FLG_SEL(01)' 'X',
' ' 'BDC_OKCODE' '=INFV',
Next Screen to AOd User Fields
'X' 'SAPLCONW' '2700'.
****
REFRESH messtab.
CALL TRANSACTION 'CN22' USING bdcdata
MODE 'E'
UPDATE 'S'
MESSAGES INTO messtab.
END_METHOD.
FORM bdc_fill USING var1
var2
var3
CLEAR bdcdata.
IF var1 IS NOT INITIAL.
bdcdata-program = var2.
bdcdata-dynbegin = var1.
bdcdata-dynpro = var3.
ELSE.
bdcdata-fnam = var2.
bdcdata-fval = var3.
ENDIF.
APPEND bdcdata.
ENDFORM.
regards,
Shweta
‎2009 Aug 18 3:22 PM
‎2009 Aug 20 10:04 AM
Hi,
Unfortunately, the evoked Bapis don't exist in our system.
With the call transaction function, it seems that we can't access to the following screens (example for CN22)=>
SAPLCO01 0400 X
BDC_CURSOR SPOP-TEXTLINE1
BDC_OKCODE =OPT1
SAPMSSY0 0120 X
BDC_OKCODE =&ONT
SAPLCO01 0400 X
BDC_CURSOR SPOP-TEXTLINE1
BDC_OKCODE =OPT2
(these lines are displayed only in 'not batch input mode' in SM35).
and so, no messages are returned with the 'MESSAGES into ..." option ....