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: 

LOOP AT SCREEN

Former Member
0 Kudos

HI experts!!

I have a screen 9100 which displays an ALV Grid for the table SFLIGHT and contains two buttons: NEW and MODIFY.

The two buttons both CALL SCREEN 9200 containing all the fields of SFLIGHT..

I want when i click the NEW button, all fields are enabled in the screen 9200 and data can be inserted and when i click the MODIFY button after selecting a row in the ALV, the screen 9200 appear with Key fields are disabled and the remaining fields can me modified.

On screen 9200 there is are buttons SAVE and CANCEL.

Waiting for your solutions....

Thank you in aniticipation..

Regards,

Yahsaar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If i understand your problem correctly then you dont need LOOP AT SCREEN.

as the element on the Screen is the container.

the ALV is being displayed in that container.

so you will have to code the al TO make it editable by checking SY-UCOMM.

check the below links for the same

[http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database(OOPS)]

[;

5 REPLIES 5

Former Member
0 Kudos

Hi,

If i understand your problem correctly then you dont need LOOP AT SCREEN.

as the element on the Screen is the container.

the ALV is being displayed in that container.

so you will have to code the al TO make it editable by checking SY-UCOMM.

check the below links for the same

[http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database(OOPS)]

[;

Former Member
0 Kudos

Not yet answered

raymond_giuseppi
Active Contributor
0 Kudos

In the PAI of the 9100 dynpro user-command module store the "which key was pressed" information in a global variable (like a g_mode field "NEW" or "MODIFY" defined in TOP include), then check this field value in the PBO of the 9200 dynpro, assign the fields of 9200 that are not allowed to change in "MODIFY" mode with a group to get a clear coding.

Regards,

Raymond

jj
Active Contributor
0 Kudos

In PBO module of screen 9200.

you check which button was clicked and then make your screen key fields as display mode.

CASE Button name

WHEN 'NEW'.

WHEN 'MODIFY'

LOOP AT SCREEN.

IF screen-name = 'key field'.

screen-invisible = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endcase.

Former Member
0 Kudos

in the 9100 PAI put one variable to store the event. eg : program name : pg_name and variable : gv_event.

in the 9200 PBO put one module.

inside the module get the event in the screen 9100.

like

data : event type(17) c '(pg_name)gv_event'.

field symbol : <fs> type sy-ucomm.

assign (event) to <fs>.

now the <fs> have the user command value based on that

loop at screen we will enable or disable the fields