‎2013 Jun 26 2:15 PM
Hello,
I'm working with a sub screen for the equipment transaction IE02.
I have added a push button that call an external report and the code is explained below:
SCREEN 1002
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1002.
---------------------------------------------------------------
MODULE user_command_1002 INPUT.
ok_code = sy-ucomm.
IF ok_code = 'REP'.
SUBMIT rsscd100 WITH objekt = 'ZIHPA'
WITH objektid = zitob-equnr
WITH datum = sy-datum
AND RETURN.
ENDIF.
ENDMODULE. " USER_COMMAND_1002 INPUT
It works correctly but the problem come out when i come back from the submitted program, even if i press enter, the sy-ucomm is still 'REP' and the external report is called again.
I think i need to clear the sy-ucomm but i don't know how?
I have tried with clear sy-ucomm before the submit but doesn't work.
Any suggestion?
‎2013 Jun 26 3:59 PM
I have found the solution.
The subscreen inherit the ok field from the main screen and is not editable in subscreen Element List.
I have used the field symbol to access to that information and now the below code works correctly.
TOP INCLUDE
DATA: ok_code(21) VALUE '(SAPMIEQ0)RM63E-FCODE'.
DATA: zrm63e TYPE rm63e.
FIELD-SYMBOLS <ok> TYPE any.
------------------------------------------------------
MODULE user_command_1002 INPUT.
ASSIGN (ok_code) TO <ok>.
zrm63e = <ok>.
IF zrm63e = 'REP'.
SUBMIT rsscd100 WITH objekt = 'ZIHPA'
WITH objektid = zitob-equnr
WITH datum = sy-datum
AND RETURN.
ENDIF.
ENDMODULE. " USER_COMMAND_1002 INPUT
‎2013 Jun 26 3:00 PM
‎2013 Jun 26 3:04 PM
I think i had to fill the General attribute for the field OK and not use the command ok_code = sy-ucomm but the field is not editable as shown in attached file.
How can i do?
‎2013 Jun 26 3:28 PM
Instead of Submit, did you tried "Call transaction" ?
e.g.
MODULE user_command_1002 INPUT.
CASE sy-ucomm.
WHEN 'REP'..
CALL TRANSACTION 'TCODE for the report to be called' .
endcase.
ENDMODULE. " USER_COMMAND_1002 INPUT
‎2013 Jun 26 3:59 PM
I have found the solution.
The subscreen inherit the ok field from the main screen and is not editable in subscreen Element List.
I have used the field symbol to access to that information and now the below code works correctly.
TOP INCLUDE
DATA: ok_code(21) VALUE '(SAPMIEQ0)RM63E-FCODE'.
DATA: zrm63e TYPE rm63e.
FIELD-SYMBOLS <ok> TYPE any.
------------------------------------------------------
MODULE user_command_1002 INPUT.
ASSIGN (ok_code) TO <ok>.
zrm63e = <ok>.
IF zrm63e = 'REP'.
SUBMIT rsscd100 WITH objekt = 'ZIHPA'
WITH objektid = zitob-equnr
WITH datum = sy-datum
AND RETURN.
ENDIF.
ENDMODULE. " USER_COMMAND_1002 INPUT