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

report query1

Former Member
0 Likes
780

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.

6 REPLIES 6
Read only

Former Member
0 Likes
752

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.

Read only

Former Member
0 Likes
752

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...

Read only

varma_narayana
Active Contributor
0 Likes
752

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>

Read only

Former Member
0 Likes
752

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.

Read only

Former Member
0 Likes
752

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.

Read only

0 Likes
752

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.