Fixed text when scrolling - abap

My program displays an ABAP list, I'm trying to show a header (some lines of text, nothing fancy) fixed when scrolling down in a report.
Is there some kind of tag or declaration that I have to use?

In SE38 you can define list heading with 'GOTO -> Text Elements -> List Headings`.
You can define a list header, and titles for your list (Columns heading).
One advantage: With GOTO -> Translations you can define different texts in different languages.
Another way to get this maintenance screen:
From your list, you can choose: System -> List -> List Header.
Another way:
You can use top-of-page to define your header text inside your report code.
top-of-page.
write 'My header'.

You can use the TOP OF PAGE event to write something that will stick at the top of the page while scrolling. You can find more info here.
You can also use the list headers from Text Elements menu. More info here.
Best regards,
Sergiu

One way is directly using top-of-page in your code.
Other way is calling reuse_alv_grid_display or reuse_alv_list_display (depending on your output type) and declaring "top-of-page" in the I_CALLBACK_TOP_OF_PAGE line. Then create a sub-routine with the same name as your "top-of-page". In that you can write
wa_list-typ = 'H'.
wa_list-info = ''.
APPEND wa_list to it_list.
clear wa_list.
OR
wa_list-typ = 'A'.
wa_list-info = 'Report Header'.
APPEND wa_list to it_list.
clear wa_list.
OR
wa_list-typ = 'S'.
wa_list-info = 'Report Header'.
APPEND wa_list to it_list.
clear wa_list.
depending on what you want (header, action or selection).
Finally you can use REUSE_ALV_COMMENTARY_WRITE function and call the table(in this example it_list).
Hope it helped.

Related

Click on first element contained in a div

I have a div that contains a set of dynamic elements. I want to click on the first search result.
I want to click on the first element contains in
I tried using creating a custom xPath like so but it didn't work. Any ideas here?
//div[1][contains(text(), 'listing')]
First of all It would've helped if you had provided more information.
best will be using pseudo-child like div.firstChild or if the elements are generated dynamically you can add a class and use document.querySelectorAll(".class") which will give you an array of elements that had the class.
You can use array[0] to use click on the first element.
For anyone coming across this thread here is the solution
const listings = await page.$x('//*[contains(#id,"listing_")]')

How can I change the program header in sap abap?

I want to change the header name of the ABAP program. What can I do or where can I find the option to edit the header?
Two ways for this:
Set it in program options. Select the program and check menu Goto / Attributes.
Or you can create a GUI title and set it via ABAP. This overwrites attributes' setting.
More about how to achieve: here.
To change the program header is more easier than it seems.
Just open you program via SE38 -> Goto -> Properties -> Check the title field and change -> Save
And you are done. :)
I have this.
Usually is changing the name in atributes with transaction se38, but sometimes this don't work, you need in the transaction se80, create a title GUI, if yuou don't have a title created, righ clic in the program name, create -> GUI title.
And put your name and code.
and in your program (se38) in PBO, you have to call the title with
SET TITLEBAR '100' (Put your title code)
(100 is the title code), but this instruction have to need inside of a moodle, if is outside don't will work.
I use the first moodle that i have in my PBO (i don't know if is the best decition or the right form, but is a way and works).
finally the title change
The path is SE38 -> (Put Program Name) -> Now open the program in edit mode -> Select the option GOTO -> select Properties Change the program title.

Make Text Field item as Read Only in APEX 5.0

I have some text field page items on my APEX 5.0 page and I want to make the textboxes as read only/non-editable. During the page load I want to use these text boxes for only the data display on the page and should be non-editable.
Can somebody advice on how to do that? What attributes need to set for this?
This answer is a bit late to the party, but I found myself confronted to this problem and I wanted to share the solution I came up with.
In fact you just need to create your item as a text area, let say P1_Text_Area and you give it a readonly attribute using JavaScript. Write thoses 2 lines in the "Function and Global Variable Declaration" of your page:
var disItem = document.getElementById('P1_Text_Area');
disItem.readOnly = true;
Hope this helps someone in need.
in item properties find the
Read Only group
and set Read Only Condition Type as Always
or the option that suits to you
You can use disabled + save session state ==> read only

The best Xpath option for the below example

Please let me know the best xpath for the below HTML, the button id's are dynamically populated. Hence I tried using the starts-with function as below
driver.findElement(By.xpath("*//button[starts-with(#id, 'j_idt')]")).click();
but, how to achieve if we have two buttons in the same page as per the attached screenshot.
There are multiple ways to find the button. One of the options is to rely on the text inside, e.g. for Login:
//button[span = 'Login']
Then, you can add other checks, e.g. check if it is of type submit:
//button[#type = 'submit' and span = 'Login']

Change parameter name on selection screen to a real text

I'm trying to replace the parameter name shown on the selection screen.
For example I have:
PARAMETERS pa_age TYPE age_type DEFAULT '18'.
It shows PA_AGE on the screen.
How to change it to How old are you? for instance?
You have to define a text via Goto->text elements->selection text.
If you develop in another language as you execute your code, you need also a translation.
Via menu Goto->Text Elements->Selection Text.