Back and Exit button not enabling in screen program [closed] - abap

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am trying to enable back and exit buttons on application tool bar. I created pf-status choosing dialog box. I am not able to figure out which function code should be assigned to back and exit button. I need to have option where the output can be displayed in either popup dialog box or normal screen. Can anyone please explain how to achieve this?

It doesn't really matter what function code you assign to those buttons, because you have to implement the PAI module which handles the reactions to those buttons yourself anyway. There doesn't seem to be a convention either: SAP standard programs all use different function codes for those buttons.
Here is an example for such a handler. In this case the GUI-Status assigns "BACK", "EXIT" and "CANCEL" to the green, yellow and red button respectively:
MODULE handle_navigation INPUT.
CASE sy-ucomm.
WHEN 'BACK'. " Green button
LEAVE TO SCREEN 100.
WHEN 'EXIT'. " Yellow button
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = 'Would you like to save before quitting?'
IMPORTING
answer = lv_answer.
IF lv_answer = '1'. " Yes, save and then quit
PERFORM write_data_to_db.
LEAVE PROGRAM.
ELSEIF lv_answer = '2'. " No, quit without saving
LEAVE PROGRAM.
ELSE.
" User canceled the popup - do nothing
ENDIF.
WHEN 'CANCEL'. " Red button
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.

Related

Bold Text in Dialog Box - DXL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
I'm trying to make an program in DXL whos asks the user some data. For this reason, I would like show the instruction to user with an Dialog Box. How can I do put a bold strings in the Dialog Box? (I'm new in this language).
Although the question is already answered, I update the question so that future readers can understand it better:
I know how dialog boxes are created and displayed in DXL, as follows:
DB dialog = create("My DB box.", styleCentered | styleFixed);
label(dialog, "ALL");
show dialogue
But what I want to do is add bold text inside it.
This depends on where you need the bold text. As far as I know it is e.g. not possible to make a label of a field bold, but you could perhaps create a DBE of type richField (or richText) on your dialog box and fill it with richtext, like in
void doSomething (DBE x) {ack "boo!"}
DB dialog = create("hi there")
richField (dialog, "", "Remember to {\\b save your module} before calling this function", 60, true)
button (dialog, "Do something", doSomething)
show dialog
For more complex texts you might want to look at drawing text on a DBE canvas

Visual Basic Forms: how to make a button click interrupt a previous button click? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Say i press button1 and this starts an infinite while loop. How do i make it so that if button2 is pressed, it will pause the current action and do the code inside button2 firs before carrying on with the process in button1?
If the first button really is in an infinite loop, you can't. You might be able to make a button that would interrupt other code, but the event handler for that button can't ever fire because the first button is preventing your app from processing event messages.
So be careful not to create infinite (or even long-running) event handlers (of any type) on the default/UI thread.

If Statement for When button is clicked [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am trying to write an If statement in VBA that is somewhat in this format:
If Button A is clicked
Then
Open a file
End If
I am stuck at the first part where I am not sure how to write the portion for the "If Button A is clicked". Would greatly appreciate any advice on this.
Code
The expected result would be that the file opens when the user presses button A and specifies the location of the file that is to be opened.
A button being clicked is an ephemeral event that happens, not state that you can test with an "if". Set an event handler to call the code when the button is clicked, and don't worry about an "if".

Trigger an event on clicking "OK" on the messagebox in an access form [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have an access form in which after the user performs few operations a message box will appear. When the user clicks "OK" on the message box I want to close the current form and open a new form. How can I do this?
the VBA code execution is suspended until the user clicks ok. Therefore the next line of code after the msgbox call will be your spot to do the 'magic'
You want to open the new form first, then close the current form.
You can either do it by just putting the code directly after the MsgBox command, or by checking the response of the user in a multi-response messagebox. For example:
If MsgBox("Do you really want to continue?" & vbCrLf, vbYesNo) = vbYes Then
DoCmd.Close MyFormName
Else
...Perform some other function
End If
This will pop up a messagebox with both Yes and No buttons, and allows you to run some alternate code if the response is No.

Microsoft Access - Loading Continous form as subform into Tab Page [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I would like to know how to create a subform that is a continous form. I have a Form that contains a Tab control. On one of my tab pages, I would like to host 2 continous forms(sub-forms), and toggle display of each based on records returned from the database. What I have right now is a blank page with a sub-form. I am unable to drag the continuous form control onto the sub-form and I am unable to drag it, it seems to the tab page either.
How can I add a continuous form to a Tab Page?
The general idea is that you simply create the continues form, you then save it. Now just open up your form with the tab control on it. Say a form that looks like this:
In above, I selected the second tab called pricing. And you can see I have placed a number of controls on this tab, but I am also about ready and am going to drag + drop in that continues form from the left side called tblBookOptions1.
When you drag, make sure you see the whole tab go "black", else this means you not dragging the form on to the tab control, but are likely "missing" it when you drop the form in. So the highlight has to go black, else you mssing the tab control.
You see this:
After you "drop" and let go of mouse, then resulting form in design mode this looks like this:
Of course the most fantastic feature of Access is those sub forms, and in fact I then can take the above whole complex form and drop it into another form using the same drag + drop.
The result is incredible relational data modeling of child tables, and it all works without having to write one line of code to maintain such related structures.
The resulting form can thus have several continues forms. In this following example have a continues form at the top part (not behind a tab). You can also see the resulting continues form that displays as a grid in the bottom half – and note how it is displaying based on the tab that selected in this case (pricing).