2008 Apr 21 8:59 AM
hello
i've generated two tablecontrols with the wizard in one dynpro and when i scroll or interact with that table the last ok_code is executed.
for example:
i push the save button and data is saved, then i scroll down the tablecontrol and it saves again. or when i toggle display/change and then scroll the tablecontrol it toggles display/change again.
i don't know what to do... but it just shouldnt do that when you scroll the table...
thx in advance, rafe.
2008 Apr 21 9:51 AM
i made it just like that...
----
MODULE user_command_0110 INPUT
----
*
----
MODULE user_command_0110 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK'.
PERFORM clear_fields.
CALL SCREEN 0100.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'UNLOCK'.
PERFORM unlock_entry.
WHEN 'SAVE'.
PERFORM save_entry.
WHEN 'DELETE'.
PERFORM delete_entry.
ENDCASE.
CLEAR ok_code.
ENDMODULE. "user_command_0110 INPUT
but when i interact with the tablecontrol there is a pai event where the ok_code is the same than the previous action (save, delete etc.) like i described it before...
2008 Apr 21 9:39 AM
You have to create a extra variabl for ok_code,
ie, in top include
data:
save_ok type sy-ucomm.
and in PAI where u write the CASE statements for function codes, write like this,
ie, In PAI
save_ok = ok_code.
clear ok_code.
case save_ok.
when 'SAVE'.
your conditions..etc.
endcase.
2008 Apr 21 9:40 AM
Hi Rafe,
You have to write code like this in the PAI by writing MODULE.
You have to differentiate for each function code.
Regards,
Venkat.O
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_1000 input.
case ok_code.
when 'SAVE'. "Write save related code here
when 'CHANGE'. "Change related.
endcase.
endmodule.
2008 Apr 21 9:51 AM
i made it just like that...
----
MODULE user_command_0110 INPUT
----
*
----
MODULE user_command_0110 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK'.
PERFORM clear_fields.
CALL SCREEN 0100.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'UNLOCK'.
PERFORM unlock_entry.
WHEN 'SAVE'.
PERFORM save_entry.
WHEN 'DELETE'.
PERFORM delete_entry.
ENDCASE.
CLEAR ok_code.
ENDMODULE. "user_command_0110 INPUT
but when i interact with the tablecontrol there is a pai event where the ok_code is the same than the previous action (save, delete etc.) like i described it before...
2008 Apr 21 12:11 PM
Hi Rafe,
Do one thing,just before you scroll,put /h and enter a break point..then scroll...see what is the sy-ucomm captured..
if it is any of your custom sy-ucomms it means you have not cleared it properly..so in the code do the needful clearing....
Just check and revert back
Regards
Byju
2008 Apr 21 2:42 PM
clear sy-ucomm solved the problem...
i think u helped me most... so you will be rewarded with 10pt 😃