Code for selenium

Installing Selenium from scratch involves setting up the Java environment, installing the Eclipse IDE, and finally configuring the Selenium libraries. As of 2026, Selenium 4 is the industry standard. Below is the step-by-step guide to get you up and running. Phase 1: Install Java (JDK) Selenium is a Java-based library, so you must have the Java Development Kit (JDK) installed. Download: Go to the Oracle JDK Downloads or Adoptium (OpenJDK). Download the latest LTS version (e.g., JDK 21 or 25). Install: Run the installer and follow the prompts. Set Environment Variables (Windows): Search for "Edit the system environment variables" in your Start menu. Click Environment Variables. Under System Variables, click New and add JAVA_HOME with the path to your JDK folder (e.g., C:\Program Files\Java\jdk-21). Find the Path variable, click Edit, and add %JAVA_HOME%\bin. Verify: Open Command Prompt and type java -version. You should see the version details. Phase 2: Install Eclipse IDE Dow...

Sap abap report code

REPORT zpet_join_report.

TYPES: BEGIN OF ty_full,
         pet_id TYPE zpet_id_de,
         pet_name TYPE zpet_name_de,
         pet_type TYPE zpet_type_de,
         owner_id TYPE char10,
         owner_name TYPE char30,
       END OF ty_full.

DATA it_full TYPE TABLE OF ty_full.

SELECT 
    a~pet_id,
    a~pet_name,
    a~pet_type,
    b~owner_id,
    b~owner_name
  FROM zpet_adoption AS a
  INNER JOIN zpet_owner AS b
    ON a~pet_id = b~pet_id
  INTO TABLE @it_full.

IF sy-subrc <> 0.
  WRITE: / 'No data found.'.
  EXIT.
ENDIF.

LOOP AT it_full INTO DATA(ls_full).
  WRITE: / 'Pet ID :', ls_full-pet_id,
         / 'Pet Name :', ls_full-pet_name,
         / 'Pet Type :', ls_full-pet_type,
         / 'Owner ID :', ls_full-owner_id,
         / 'Owner Name:', ls_full-owner_name,
         / '-----------------------------'.
ENDLOOP.



Alv report:--------



REPORT zpet_join_alv.

TYPE-POOLS: slis.

*-----------------------------
* Structure for JOIN Result
*-----------------------------
TYPES: BEGIN OF ty_full,
         pet_id TYPE zpet_id_de,
         pet_name TYPE zpet_name_de,
         pet_type TYPE zpet_type_de,
         owner_id TYPE char10,
         owner_name TYPE char30,
       END OF ty_full.

DATA: it_full TYPE TABLE OF ty_full,
      wa_full TYPE ty_full.

*-----------------------------
* ALV Components
*-----------------------------
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
      wa_fieldcat TYPE slis_fieldcat_alv.

*-----------------------------
* Fetch Data Using JOIN
*-----------------------------
SELECT 
    a~pet_id,
    a~pet_name,
    a~pet_type,
    b~owner_id,
    b~owner_name
  FROM zpet_adoption AS a
  INNER JOIN zpet_owner AS b
    ON a~pet_id = b~pet_id
  INTO TABLE @it_full.

IF sy-subrc <> 0.
  MESSAGE 'No records found in join' TYPE 'I'.
  LEAVE PROGRAM.
ENDIF.

*-----------------------------
* Field Catalog Build
*-----------------------------
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PET_ID'.
wa_fieldcat-seltext_m = 'Pet ID'.
APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PET_NAME'.
wa_fieldcat-seltext_m = 'Pet Name'.
APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PET_TYPE'.
wa_fieldcat-seltext_m = 'Pet Type'.
APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'OWNER_ID'.
wa_fieldcat-seltext_m = 'Owner ID'.
APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'OWNER_NAME'.
wa_fieldcat-seltext_m = 'Owner Name'.
APPEND wa_fieldcat TO it_fieldcat.

*-----------------------------
* Call ALV
*-----------------------------
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_structure_name = ''
    it_fieldcat = it_fieldcat
  TABLES
    t_outtab = it_full
  EXCEPTIONS
    program_error = 1
    OTHERS = 2.

IF sy-subrc <> 0.
  MESSAGE 'Error in ALV Display' TYPE 'E'.
ENDIF.

Comments

Popular posts from this blog

ES practical syit sem 4

TYBSc IT Semester 6 Information Security Practicals

Master Linux Practical for B.Sc. IT Semester 5: Download pdf and the Comprehensive Guide

Java programming practical

Introduction to computer system

Advanced Web Designing (AWD) Practical Guide for B.Sc. IT 5th Semester

CGA practical