‎2006 Aug 10 8:15 PM
Hello Friends,
I have a requiremnt and it has 2 screens in it.
When i enter data in the first screen it has to show the results in the table in the first screen. I have a push button on the first screen. if i click the push button it should take me to second screen. When i enter the required input in the second screen it should show me the result in the table of the second screen.
However what my code is doing is,
When i enter the required input in the first screen it is directly going to the second screen without showing the results on the first screen.
However if i input data on the secnd screen it shows the results for the second screen.
So i am unable to see the results on the first screen.
Any tips on this.
Shejal.
‎2006 Aug 10 8:23 PM
Please check the OK-CODE when you press ENTER and for the PUSH button.
I feel the problem lies in the ok-code.
Regards
Anurag
‎2006 Aug 10 8:17 PM
‎2006 Aug 10 8:18 PM
‎2006 Aug 10 8:23 PM
Please check the OK-CODE when you press ENTER and for the PUSH button.
I feel the problem lies in the ok-code.
Regards
Anurag
‎2006 Aug 10 8:25 PM
Thanks for the help.
I will look into it and will get back to you guys.
Yes I am hitting enter to trigger.
Shejal.
‎2006 Aug 10 8:27 PM
‎2006 Aug 10 8:37 PM
Anurag Bankley,
below is the code.
&----
*& Module pool SAPMZASH_TC *
*& *
&----
PROGRAM SAPMZASH_TC .
TABLES : VBAP,
VBAK.
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
END OF IT_VBAP.
DATA : BEGIN OF IT_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
ERNAM LIKE VBAK-ERNAM,
END OF IT_VBAK.
DATA : WA_VBAP LIKE IT_VBAP.
CONTROLS TC TYPE TABLEVIEW USING SCREEN '100'.
CONTROLS TC1 TYPE TABLEVIEW USING SCREEN '200'.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
CASE OK_CODE.
WHEN 'ENT1'.
SELECT VBELN POSNR MATNR
FROM VBAP INTO TABLE IT_VBAP
WHERE VBELN = VBAP-VBELN.
READ TABLE IT_VBAP INDEX SY-DBCNT.
WA_VBAP = IT_VBAP.
SET SCREEN'200'.
LEAVE SCREEN .
WHEN 'NEXT'.
SET SCREEN '200'.
CLEAR SY-UCOMM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ABC'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*************************************************************************
For Screen 200
*************************************************************************
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'UPDATE'.
SELECT VBELN ERDAT ERNAM FROM
VBAK INTO TABLE IT_VBAK
WHERE ERDAT = VBAK-ERDAT.
READ TABLE IT_VBAK INDEX SY-DBCNT.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS '200'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
Thanks Shejal.
‎2006 Aug 10 8:46 PM
WHEN 'ENT1'.
SELECT VBELN POSNR MATNR
FROM VBAP INTO TABLE IT_VBAP
WHERE VBELN = VBAP-VBELN.
READ TABLE IT_VBAP INDEX SY-DBCNT.
WA_VBAP = IT_VBAP.
SET SCREEN'200'.
LEAVE SCREEN .
I presume that ENT1 is for enter and it seems to take you screen 200...hence the issue !!
U need to take out the set screen command and use that code when you press the button.
Regards
anurag
Message was edited by: Anurag Bankley
‎2006 Aug 10 8:49 PM
‎2006 Aug 10 8:52 PM
hi shejal,
u r enetering data in the 1st screen in some i/o fields right!!
if the name of the field is v_vbeln then u can give,,,
IF V_VBELN IS NOT INITIAL.
SELECT VBELN POSNR MATNR
FROM VBAP INTO TABLE IT_VBAP
WHERE VBELN = v_VBELN.
LEAVE TO SCREEN 200.
ENDIF.
the fields in the table control r they from Program or Dictionary??
since u have declared the table it_vbap in pgm..
u can drag those fields into the table control...
then if u press enter the values will be displayed in table of the first screen.
Message was edited by: Priya
‎2006 Aug 10 9:24 PM