‎2007 Jun 18 5:26 AM
Hi guys,
data: object_type like crmd_orderadm_h-object_type.
data: ok_code like sy-ucomm.
ok_code = sy-ucomm.
object_type = ok_code.
case object_type.
when 'PHC'.
Perform ....
endcase.
here in this code no values r coming when im debugging...i want to trigger object_type value when it checks.... in my code did i do any mistake... send me right code...plz....
‎2007 Jun 18 5:38 AM
hi guys,
the values are not comming in SY-UCOMM and ok_code variables... its showing blank when iam debugging...
‎2007 Jun 18 5:29 AM
Hi,
Make sure the object type is of data type syucomm..
data: object_type TYPE syucomm.
data: ok_code like sy-ucomm.
ok_code = sy-ucomm.
object_type = ok_code.
case object_type.
when 'PHC'.
Perform ....
endcase.
Thanks
Naren
‎2007 Jun 18 5:31 AM
Hi
The error is that, you are trying to assign the sy-ucomm to object_type.
You can say,
CASE ok_code.
WHEN 'PHC'.
perform <subroutine name>
ENDCASE.
Regards
Raj
‎2007 Jun 18 5:32 AM
I think its a module pool... if it is so then
you have to code it in PAI module..
like
module pai input.
ok_code = sy-ucomm.
object_type = ok_code.
case object_type.
when 'PHC'.
Perform ....
endcase.
endmodule.
now when user will interact with the screen (pressing push button or something) it will trigger and give you the correct output...
regards
shiba dutta
‎2007 Jun 18 5:46 AM
then you have to write the code in at user-command event and when user will make some interaction with menu bar then it will trigger else sy-ucomm will be initial. You can set your own menu bar also by set pf-status 'ZSPD' like this.
if you are not interacting with menu bar sy-ucomm remain initial.
at user-command.
ok_code = sy-ucomm.
object_type = ok_code.
case object_type.
when 'PHC'.
Perform ....
endcase.
regards
shiba dutta
‎2007 Jun 18 5:38 AM
hi guys,
the values are not comming in SY-UCOMM and ok_code variables... its showing blank when iam debugging...
‎2007 Jun 18 5:40 AM
Hi,
Which kind of report is this. Is it a normal program or module pool?
Regards,
Atish
‎2007 Jun 18 5:42 AM
‎2007 Jun 18 5:46 AM
in the screen painter, in 'element list' tab -> Genral attributes, have you filled in Name 'ok_code' for the type 'ok' ??
Let me know.
‎2007 Jun 18 5:51 AM
Hi,
In the normal ABAP program you can't get anything in the Sy-ucomm. As you can see from the field description itself this is User command field. In this program user is not interacting with the code so this field will be blank. This field will be filled if you convert this report into interactive report.
Hope it is clear. if you just want to see how CASE statement work see the code below.
data value TYPE i.
value = 1.
CASE value .
WHEN 1.
WRITE: / 'Value is 1'.
WHEN 2.
WHEN OTHERS.
ENDCASE.
Reward points if useful.
Regards,
Atish
‎2007 Jun 18 5:46 AM
hi
if on click of object-type ur debugger is getting activated then probably u must have made a mistake somewhere else in the code.
had it been not taking value ur debugger wont let u to move to the code.
<b>have u clear the object type before using it.</b>
regards
ravish
<b>plz dont forget to reward points if helpful</b>
Message was edited by:
ravish goyal