Application Development 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: 

Checking Records in multiple screens using module pool programming

Former Member
0 Kudos

Hi,

    I created student registration form using module pool programming.In first SCREEN i designed like the Below.

          Name:     <INPUT/OUTPUT Field>

 

         Emailid:    <INPUT/OUTPUT Field>

         Password:<INPUT/OUTPUT Field>

          CREATE<Push Button>    SIGNIN<Push Button>       cancel<Push Button>

in  screen 1000 I created like the above screen and i wrote the code for it.It's successfully inserted records in ZSTUDENT database.

BUT

    when i call the second screen 2000.I design the screen like below.And database table is ZSTU_LOGIN.

      username : <INPUT/OUTPUT Field>

     password  : <INPUT/OUTPUT Field>

         LOGIN<push Button>   EXIT<Push Button>

AND i created Third screen 3000.Like full of detail of student details like First Name,Last Name,DOB,Education Details,Contact Details etc...

BUT I'm facing the pbm is

              whatever the record is stored in table ZSTUDENT-Name & password when i call the screen 2000 that USERNAME & PASSWORD are same

Then go to THIRD screen 3000.BUT i wrote the code for second screen 2000 by using SELECT statement.without my code check it will go to third

screen 3000 By the Statement of Call screen 3000.

PLZ any one help me HOW to CHECK the Exact Record From second Screen 2000 to First Screen 1000.

HOW to Check the code AND can u provide me any code available.

thanks,

Anusha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Anusha,

This is what I understand:

Screen 1000: is used to create entries in Z table - no issues here.

Screen 2000: User name and password.

Screen 3000: if the user name and password is correct then screen 3000 gets called and you need the information in screen 3000 based on the user name in screen 2000.

If the above is correct.

screen 2000:  PAI

check user name and password.

if not correct 'error message and exit'.

if correct - in PAI of SCREEN 2000, make the select single on ZSTUDENT and put the data in the fields lv_fname, lv_lname etc.

then call screen 3000.

the fields names on the select statement and the field names in screen 3000, should be the same. else you need to move them manually.

alternatively, you can call screen 3000 and then write the select single in the PBO of screen 3000.

Hope this helps.

Thanks,

Vikram.M

4 REPLIES 4

Former Member
0 Kudos

Anusha,

This is what I understand:

Screen 1000: is used to create entries in Z table - no issues here.

Screen 2000: User name and password.

Screen 3000: if the user name and password is correct then screen 3000 gets called and you need the information in screen 3000 based on the user name in screen 2000.

If the above is correct.

screen 2000:  PAI

check user name and password.

if not correct 'error message and exit'.

if correct - in PAI of SCREEN 2000, make the select single on ZSTUDENT and put the data in the fields lv_fname, lv_lname etc.

then call screen 3000.

the fields names on the select statement and the field names in screen 3000, should be the same. else you need to move them manually.

alternatively, you can call screen 3000 and then write the select single in the PBO of screen 3000.

Hope this helps.

Thanks,

Vikram.M

0 Kudos

Thanks,

But can u provide me code for the second screen 2000.

0 Kudos

Lets say you have 2 fields first name and last name in the screen 3000. you have named these fields as first_name and last_name

On the top include, create 2 fields first_name and last_name.

In screen 3000:

PBO:

module get_data.

create the subroutine get_data.

in this module add the below code.

select single fname lname                   " fname and lname are the fields in your Z table

          from ZSTUDENT

          into (first_name, last_name)

          where fname EQ                      " what ever value was entered in screen 2000

          and    lname EQ                      " what ever value was entered in screen 2000.

endselect.

Thanks,

Vikram.M

0 Kudos

Hi vikram,

    I wrote the code for screen 2000 like below.

MODULE STATUS_2000 OUTPUT.

*  SET PF-STATUS 'xxxxxxxx'.

*  SET TITLEBAR 'xxx'.

   TABLES : ZSTUDENT_ENTER.

  TYPES: BEGIN OF ST_TAB1,

      USERNAME TYPE ZSTUDENT_ENTER-USERNAME,

     PASSWORD1 TYPE ZSTUDENT_ENTER-PASSWORD1,

     END OF ST_TAB1.

   DATA : W_TAB1 TYPE ZSTUDENT_ENTER.

   DATA : IT_TAB1 TYPE STANDARD TABLE OF ZSTUDENT_ENTER.

   DATA : USERNAME TYPE CHAR50,

         PASSWORD1 TYPE CHAR25.

ENDMODULE.                 " STATUS_2000  OUTPUT

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_2000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE USER_COMMAND_2000 INPUT.

CLEAR W_TAB1.

   MOVE-CORRESPONDING W_TAB TO W_TAB1.

IF SY-SUBRC EQ 0.

   SELECT SINGLE MAILID PASSWORD

     INTO CORRESPONDING FIELDS OF W_TAB

       FROM ZSTUDENT_INFO

       WHERE USERNAME = W_TAB-MAILID AND

            PASSWORD1 = W_TAB-PASSWORD.

       CALL SCREEN 2000.

       ENDSELECT.

             ELSEIF SY-SUBRC NE 0.

           MESSAGE 'INVALID USERNAME/PASSWORD'.

           ELSEIF SY-UCOMM = 'LOGIN'.

             CALL SCREEN 3000.

             ENDIF.

ENDMODULE.                 " USER_COMMAND_2000  INPUT


But i could not found whether code is write or not.

syntax error is USERNAME is Unknown.


could solve me my pbm anybody.....


Thanks,

Anusha