on 06-14-2006 11:00 AM
Hi,
i´m developing a Z transaction in SAPCONSOLE.
if i click on the corresponding button of the Z transaction it leads me to the screen with it´s input fields.
Well if then i process the Z transaction and an error occurs the flow of the program leads me to the error screen. If then i click on OK push button then i go to the initial screen of the z transaction.
The question is that when i click on the OK pushbutton of the error message i´d like to return to the screen with the input fields of the Z transaction and not to the button of the Z transaction.
is this possible?
if so, how can i do it?
for the error screen i use:
CALL FUNCTION 'CALL_MESSAGE_SCREEN'
EXPORTING
I_MSGID = MESSAGE_ID
I_LANG = SY-LANGU
I_MSGNO = L_MSGNB
I_MSGV1 = MESSAGE_V1
I_MSGV2 = MESSAGE_V2
I_MSGV3 = MESSAGE_V3
I_MSGV4 = MESSAGE_V4
I_CONDENSE = 'X'
EXCEPTIONS
INVALID_MESSAGE1 = 1
OTHERS = 2.
Best regards.
Hi,
i´ve already tried with CLEAR OK_CODE but with no avail.
Within FM CALL_MESSAGE_SCREEN there is another FM:
CALL FUNCTION 'LAST_STEP'
EXPORTING
I_MENU = SY-TCODE
I_MENU_TYPE = '2'
I_LRF_WKQU = LRF_WKQU
IMPORTING
O_MENU = MENU_ID
O_MENU_TYPE = PRO_TYP.
the values i´m passig are:
sy-tcode = ZENTRADA
and i´m getting:
MENU_ID = INB00
PRO_TYP = 1
whereas i should be receiving:
MENU_ID = ZENTRADA
PRO_TYP = 2
can it be a question of incorrect parametrization in SPRO?
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Calsadillo,
I am not sure why you are using Submit? I think you have too much code.Clear of the unwanted source code and use this.
Just use this and let me know.This will get you to the same screen from where the Error Screen was called after clicking the OK button.
IF <CONDITION IS FALSE>.
*********************************************************
PERFORM error_message_screen USING '0999'.
LEAVE TO SCREEN sy-dynnr.
*********************************************************
ENDIF.
*********************************************************
FORM error_message_screen USING p_screen.
Calls the standard SAP error message screen 0999
or calls the user decision screeen 0998.
CLEAR v_answer.
IF v_msgno IS INITIAL.
v_msgno = '000'.
v_msgid = 'OO'.
ENDIF.
CALL FUNCTION 'CALL_MESSAGE_SCREEN'
EXPORTING
i_msgid = v_msgid
i_lang = sy-langu
i_msgno = v_msgno
i_msgv1 = v_msgv1
i_msgv2 = v_msgv2
i_msgv3 = v_msgv3
i_msgv4 = v_msgv4
i_message_screen = p_screen
i_line_size = 0
i_lines = 0
i_non_lmob_envt = 'X'
IMPORTING
o_answer = v_answer
EXCEPTIONS
invalid_message1 = 1
OTHERS = 2.
IF sy-subrc <> 0. "A major error occurred.
LEAVE TO SCREEN 0.
ENDIF.
CLEAR : v_msgv1, v_msgv2, v_msgv3, v_msgv4, v_msgid, v_msgno.
CLEAR : sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4, sy-msgid, sy-msgno.
ENDFORM. " error_Message_screen
*********************************************************
-Gisk
i_non_lmob_envt = 'X' <- ftw
nothing else needed to solve this problem imo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
sure. here it is:
PROGRAM zrep_error_handle.
*----
D E C L A R A T I O N S
*----
Includes
*----
INCLUDE z_mb1c_501top.
*----
Initialization
*----
*----
Top-of-page
*----
*TOP-OF-PAGE.
*----
Start-of-selection
*----
START-OF-SELECTION.
CLEAR: MESSAGE_ID, MESSAGE_NUMBER, MESSAGE_V1,
MESSAGE_V2, MESSAGE_V3, MESSAGE_V4.
GET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
GET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
GET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
GET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
GET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
GET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
DATA: L_MSGNB(3) TYPE c.
CLEAR L_MSGNB.
L_MSGNB = MESSAGE_NUMBER.
CALL FUNCTION 'CALL_MESSAGE_SCREEN'
EXPORTING
I_MSGID = MESSAGE_ID
I_LANG = SY-LANGU
I_MSGNO = L_MSGNB
I_MSGV1 = MESSAGE_V1
I_MSGV2 = MESSAGE_V2
I_MSGV3 = MESSAGE_V3
I_MSGV4 = MESSAGE_V4
I_CONDENSE = 'X'
EXCEPTIONS
INVALID_MESSAGE1 = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*----
End-of-selection
*----
END-OF-SELECTION.
*----
FORM's
*----
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rich,
i´ve commented the EXIT statement so that the code looks like:
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
leave to screen 100.
the flow of the program goes through the SUBMIT statement but it doesn´t return.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
for dynpro 100 i´ve got:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE INITIALIZE_DATA.
*
PROCESS AFTER INPUT.
CHAIN.
FIELD: mseg-matnr MODULE CHECK_MATNR,
mseg-erfmg MODULE CHECK_ERFMG,
mseg-charg MODULE CHECK_CHARG.
ENDCHAIN.
MODULE USER_COMMAND_0100.
and for PAI i´ve got:
*&----
*
*& Module CHECK_MATNR INPUT
*&----
*
text
*----
*
MODULE CHECK_MATNR INPUT.
CLEAR: MESSAGE_ID,
MESSAGE_NUMBER,
MESSAGE_V1,
MESSAGE_V2,
MESSAGE_V3,
MESSAGE_V4.
IF mseg-matnr IS INITIAL.
MESSAGE_ID = '00'.
MESSAGE_NUMBER = '6055'.
MESSAGE_V1 = sy-msgv1.
MESSAGE_V2 = sy-msgv2.
MESSAGE_V3 = sy-msgv3.
MESSAGE_V4 = sy-msgv4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
ELSE.
CLEAR: l_matnr, l_mtart.
SELECT SINGLE matnr mtart
FROM mara INTO (l_matnr, l_mtart)
WHERE matnr = mseg-matnr.
IF sy-subrc <> 0.
MESSAGE_ID = '6R'.
MESSAGE_NUMBER = '068'.
MESSAGE_V1 = mseg-matnr.
MESSAGE_V2 = sy-msgv2.
MESSAGE_V3 = sy-msgv3.
MESSAGE_V4 = sy-msgv4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
ENDIF.
ENDIF.
ENDMODULE. " CHECK_MATNR INPUT
*&----
*
*& Module CHECK_ERFMG INPUT
*&----
*
text
*----
*
MODULE CHECK_ERFMG INPUT.
CLEAR: MESSAGE_ID,
MESSAGE_NUMBER,
MESSAGE_V1,
MESSAGE_V2,
MESSAGE_V3,
MESSAGE_V4.
IF mseg-erfmg IS INITIAL.
MESSAGE_ID = '00'.
MESSAGE_NUMBER = '6055'.
MESSAGE_V1 = sy-msgv1.
MESSAGE_V2 = sy-msgv2.
MESSAGE_V3 = sy-msgv3.
MESSAGE_V4 = sy-msgv4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
ELSE.
ENDIF.
ENDMODULE. " CHECK_ERFMG INPUT
*&----
*
*& Module CHECK_CHARG INPUT
*&----
*
text
*----
*
MODULE CHECK_CHARG INPUT.
CLEAR: MESSAGE_ID,
MESSAGE_NUMBER,
MESSAGE_V1,
MESSAGE_V2,
MESSAGE_V3,
MESSAGE_V4.
IF mseg-charg IS INITIAL.
MESSAGE_ID = '00'.
MESSAGE_NUMBER = '6055'.
MESSAGE_V1 = sy-msgv1.
MESSAGE_V2 = sy-msgv2.
MESSAGE_V3 = sy-msgv3.
MESSAGE_V4 = sy-msgv4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
ELSE.
ENDIF.
ENDMODULE. " CHECK_CHARG INPUT
*&----
*
*& Module USER_COMMAND_0100 INPUT
*&----
*
text
*----
*
MODULE USER_COMMAND_0100 INPUT.
Each function key on the screen holds a function code
CASE OK_CODE.
WHEN FCODE_SAVE.
Transacción MB1C con movimiento 501
CLEAR: tblgoodsmvt_item, tblreturn.
REFRESH: tblgoodsmvt_item, tblreturn.
Añado fechas de cabecera
strgoodsmvt_header-pstng_date = mkpf-budat.
strgoodsmvt_header-doc_date = mkpf-bldat.
material
tblgoodsmvt_item-material = mseg-matnr.
centro
tblgoodsmvt_item-plant = rm07m-werks.
almacén
tblgoodsmvt_item-stge_loc = rm07m-lgort.
Lote
tblgoodsmvt_item-batch = mseg-charg.
clase de movimiento
tblgoodsmvt_item-move_type = '501'.
cantidad
tblgoodsmvt_item-entry_qnt = mseg-erfmg.
APPEND tblgoodsmvt_item.
CLEAR tblgoodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = strgoodsmvt_header
goodsmvt_code = '05'
testrun = ' '
IMPORTING
goodsmvt_headret = strgoodsmvt_headret
materialdocument = strmaterialdocument
matdocumentyear = strmatdocumentyear
TABLES
goodsmvt_item = tblgoodsmvt_item
goodsmvt_serialnumber =
return = tblreturn.
IF NOT strmaterialdocument IS INITIAL.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
CLEAR OK_CODE.
CALL SCREEN '0200'.
ELSE.
ROLLBACK WORK.
READ TABLE tblreturn WITH KEY TYPE = 'E' INTO message.
MESSAGE_ID = tblreturn-id.
MESSAGE_NUMBER = tblreturn-number.
MESSAGE_V1 = tblreturn-message_v1.
MESSAGE_V2 = tblreturn-message_v2.
MESSAGE_V3 = tblreturn-message_v3.
MESSAGE_V4 = tblreturn-message_v4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
ENDIF.
WHEN FCODE_BACK.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rich,
the basis i´m working with is the example proposed in "Programming Guideline: Radio Frequency Applications.doc".
in fact i have 2 reports:
1.- Z_MB1C_501 (contains dynpro 100)
2.- ZREP_ERROR_HANDLE
in the 1st one whenever there is an error i do:
MESSAGE_ID = '00'.
MESSAGE_NUMBER = '6055'.
MESSAGE_V1 = sy-msgv1.
MESSAGE_V2 = sy-msgv2.
MESSAGE_V3 = sy-msgv3.
MESSAGE_V4 = sy-msgv4.
SET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
SET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
SET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
SET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
SET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
SET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
SUBMIT ZREP_ERROR_HANDLE AND RETURN.
EXIT.
and in the 2nd one i do:
GET PARAMETER ID 'CONSOLEID' FIELD MESSAGE_ID.
GET PARAMETER ID 'CONSOLENUMBER' FIELD MESSAGE_NUMBER.
GET PARAMETER ID 'CONSOLEV1' FIELD MESSAGE_V1.
GET PARAMETER ID 'CONSOLEV2' FIELD MESSAGE_V2.
GET PARAMETER ID 'CONSOLEV3' FIELD MESSAGE_V3.
GET PARAMETER ID 'CONSOLEV4' FIELD MESSAGE_V4.
DATA: L_MSGNB(3) TYPE c.
CLEAR L_MSGNB.
L_MSGNB = MESSAGE_NUMBER.
CALL FUNCTION 'CALL_MESSAGE_SCREEN'
EXPORTING
I_MSGID = MESSAGE_ID
I_LANG = SY-LANGU
I_MSGNO = L_MSGNB
I_MSGV1 = MESSAGE_V1
I_MSGV2 = MESSAGE_V2
I_MSGV3 = MESSAGE_V3
I_MSGV4 = MESSAGE_V4
I_CONDENSE = 'X'
EXCEPTIONS
INVALID_MESSAGE1 = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
this FM gets by default logical dynpro 999 and physical dynpro 2999 and when i click on the OK push button i get directed to the menu where there is the button of my z transaction and not to dynpro 100.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After your error screen call, leave to the screen.
CALL FUNCTION 'CALL_MESSAGE_SCREEN'
EXPORTING
I_MSGID = MESSAGE_ID
I_LANG = SY-LANGU
I_MSGNO = L_MSGNB
I_MSGV1 = MESSAGE_V1
I_MSGV2 = MESSAGE_V2
I_MSGV3 = MESSAGE_V3
I_MSGV4 = MESSAGE_V4
I_CONDENSE = 'X'
EXCEPTIONS
INVALID_MESSAGE1 = 1
OTHERS = 2.
<b>leave to screen 200.</b>
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.