‎2007 Sep 25 10:56 AM
I need to develop a Ztcode(Report transaction). When user run this ZTcode, a screen with four pushbuttons will appear. Here one pushbutton is for one report. The user has to select all these pushbuttons one after another as they appear in screen. When user push one button the contol leads to respective report's selection screen. Suppose The user directly push second pushbutton without push first pushbutton (ie without executing first report), an error merssage " please run the first report" should be raised, which means, the user has to run reports in sequence. can anybody suggest what is logic to implement this requirement.
Regards,
Zakir.
‎2007 Sep 25 11:02 AM
Hi Zakir,
declare an integer a = 0.
and assign in the sy-ucomm.
when Push 1 : a = 1.
when Push 2 : if a = 1. call report. a = 2. else. message 'pls run the first report'.
when Push 3 : a = 3.
when Push 4 : a = 4.
Like that u can do.
Please reward points if useful.
‎2007 Sep 25 11:03 AM
make one global report in which put 4 push buttons.
now declare one variable as FLAG type I.
now when user click on first button make its value FLAG = 1.
now when the second button is clicked ..check the following conditoin.
if FLAG = 1.
call second program..
FLAG = 2.
else.
message ' please run the first program.
endif.
same now check for the other buttons.
reward points please...
‎2007 Sep 25 11:06 AM
hI zakir,
Declare a Variable in the Global data.
DATA : V_SEQ TYPE C.
For each button click assign a particular value for the Sequence variable .
CASE SY-UCOMM.
WHEN 'BUTTON1'.
IF V_SEQ NE 0.
MESSAGE 'Execute the Report1 First' type 'E'.
ENDIF.
V_SEQ = '1'.
WHEN 'BUTTON2'.
IF V_SEQ NE 1.
MESSAGE 'Execute the Report2 First' type 'E'.
ENDIF.
V_SEQ = '2'.
WHEN 'BUTTON3'.
IF V_SEQ NE 2.
MESSAGE 'Execute the Report2 First' type 'E'.
ENDIF.
V_SEQ = '3'.
ENDCASE.
<b>Reward if Helpful. </b>
‎2007 Sep 25 11:07 AM
Hi Zakir,
1. Declare one Temp Variable [Temp] . Give the condition in first program,
When 'First Button' -
> When user clicks the First Buttom.
Temp = 'x'.
2. Then You have to write the condition in second Push Button.
when 'Second Button'.
if temp ne x.
message 'Please Click The First Button' Type 'I'.
endif.
Thanks,
Reward If Helpful.
‎2007 Sep 25 11:09 AM
HI,
do like this.
PARAMETERS:rad1 RADIOBUTTON GROUP rad default 'X',
rad2 RADIOBUTTON GROUP rad,
rad3 RADIOBUTTON GROUP rad,
rad4 RADIOBUTTON GROUP rad.
data:temp.
GET PARAMETER ID 'sample' FIELD temp.
if rad1 = 'X' and temp = ' '.
temp = 1.
write:/ 'report1'.
ELSEIF rad2 = 'X' and temp = '1'.
temp = 2.
write:/ 'report2'.
ELSEIF rad3 = 'X' and temp = '2'.
temp = 3.
write:/ 'report3'.
ELSEIF rad4 = 'X' and temp = '3'.
temp = ' '.
write:/ 'report4'.
ELSE.
temp = ' '.
endif.
SET PARAMETER ID 'sample' field temp.
rgds,
bharat.
‎2007 Sep 28 3:06 PM
Hi Bharat,
Ur ans is very helpful. But the thing is whenever user try to execute second radiobutton without first, an error message should be displayed. i.e. user has to perform all reports in sequence. Can u pls suggest this.
Regards,
Zakir.