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

Retrieving data from a table to a screen.

Former Member
0 Likes
528

Hi,

I'm working with a screen where an user can create new records or change previously created records. The problem is that when the user selects the modify option and after searching and finding the proper record the information is not displayed on the screen and the fields remain empty.

I read the data on to a workarea and then move the correspondent fields to a structure. The names of the fields of the structure are the same as the fields on the screen. But the fields on the screen appears blank even after checking that they exists on the table.

Here is a piece of the code:

MODULE USER_COMMAND_0200 INPUT.

CASE OK_CODE.

WHEN 'FIND'.

MOVE SB_ACCNUMBER TO WA_ZPRGL012-ACCNUMBER.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF WA_ZPRGL012

FROM ZPRGL012

WHERE ACCNUMBER = WA_ZPRGL012-ACCNUMBER.

PERFORM CHECK_ACCNT_EXISTENCE.

IF SY-SUBRC = 0.

MOVE-CORRESPONDING WA_ZPRGL012 TO ST_ZPRGL012.

LEAVE TO SCREEN 100.

ENDIF.

ENDCASE.

<b>WA_ZPRGL012</b> is the name of the internal table.

<b>ST_ZPRGL012</b> is the name of the structure.

<b>SB_ACCNUMBER</b> is the name of the field on the screen.

Did I miss something?

Any help will be appreciated.

Thanks,

Orlando.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
493

Hi,

Here is the flow about how the dialogue programming works:

After any event in screen,

First it triggers PAI event and then PBO events of that screen

But when you say statement like "leave to screen 1000" then

it calls screen 1000 which triggers from PBO frist and then PAI event with user interaction.

Please check any clear statements that used for that structure at end of PAI event or in PBO event for screen 1000 that before dipslaying the fields in that screen.

Generally, under PBO event

you need to write a piece of code to swap feilds values from struture/internal table fields to the screen fields in order to get displayed in particular screen.

Otherwise

provide piece of code that you written under PBO event for screen 1000.

thanks,

Naga

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
493

Hi,

What does the subroutine PERFORM CHECK_ACCNT_EXISTENCE do? may be the value is getting cleared in here.. Did you try to debug? put break points after the select statement and after the perform statement. may be the sy-subrc is ne 0 after the preform.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
494

Hi,

Here is the flow about how the dialogue programming works:

After any event in screen,

First it triggers PAI event and then PBO events of that screen

But when you say statement like "leave to screen 1000" then

it calls screen 1000 which triggers from PBO frist and then PAI event with user interaction.

Please check any clear statements that used for that structure at end of PAI event or in PBO event for screen 1000 that before dipslaying the fields in that screen.

Generally, under PBO event

you need to write a piece of code to swap feilds values from struture/internal table fields to the screen fields in order to get displayed in particular screen.

Otherwise

provide piece of code that you written under PBO event for screen 1000.

thanks,

Naga

Read only

former_member186741
Active Contributor
0 Likes
493

Hi Orlando,

could you please show us the screen flow logic for screens 100 and 200. I

Without seeing this it looks to me like you are not moving the contents of the work structure back to the screen's variables which should be done in the PBO (often this is just a simple move like 'variable_a = variable_a' as the screen and abap variables can have the same names).