Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dialogue Programming

Former Member
0 Likes
850

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
824

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

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
824

Make sure that you are clearing your OK_CODE in the PAI.

case ok_code.
  when 'PUSH'.
<b>     clear ok_code.</b>
     ....
  when 'BACK'.
      clear ok_code.
      leave program.
endcase.

Regards,

Rich Heilman

Read only

0 Likes
824

After entering the data on the first screen, I assume that you are hitting ENTER to trigger the table to be filled?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
825

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

Read only

0 Likes
824

Thanks for the help.

I will look into it and will get back to you guys.

Yes I am hitting enter to trigger.

Shejal.

Read only

0 Likes
824

Please cut-paste the PAI code if you wish us to have a look.

Read only

0 Likes
824

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.

Read only

0 Likes
824

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

Read only

0 Likes
824

You need to comment out these lines of you don't want it to go to the second screen.




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.

<b>SET SCREEN'200'.
LEAVE SCREEN .</b>


Regards,

Rich Heilman

Read only

0 Likes
824

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

Read only

0 Likes
824

Thanks Everyone.

The problem is solved.

Shejal,