Showing posts with label intaractive report. Show all posts
Showing posts with label intaractive report. Show all posts

Wednesday, November 6, 2019

Hierarchical Alv Tree Based Report (upto 6 levels)

                Hierarchical Alv Tree Based Report (upto 6 levels and still expandable ):
For Hierarchical ALV, we do not have much examples available on sap sdn or google or any other sites.I was  given a task to develop a report in which entire sales hierarchy target vs achievement report  month wise should come.
So that the  management could track which part of thier sale's team is not working well and where they could force and boost the performance , We did not HR module implemented while developing this report , so it was difficult for me to design the entire  system.

Concept Behind : Developer who knows the concept of Linked List, can easily solve this problem,if you look at problem , at start even i was confused how to start i tried each and every site of SAP SDN, SAP TECHNICAL , Google  found there was no  exact solution  to this kind of Required.
I was getting the  few example but the restriction was of 3 levels or upto 9 Column, I had to show 30 Columns Results.
Input Screen :

 1st Level Tree :
 3rd Level Extended:
It can further be extended if required as it just node mapping and node leveling and linking of Node to one another and setting them in a particular level.
if you want code kindly mail @ programmer2117@gmail.com
 









Saturday, October 6, 2018

Interactive report using Hotspot and GET cursor

*&---------------------------------------------------------------------*
*& Report  ZINTDEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZINTDEMO.
DATA IT_MARA TYPE TABLE OF MARA,
       WA_MARA TYPE MARA,
       IT_MAKT TYPE TABLE OF MAKT,
       WA_MAKT TYPE MAKT.
DATA FNAM(20)FVAL(30).

SELECT-OPTIONS S_MATNR FOR WA_MARA-MATNR.

INITIALIZATION.

AT SELECTION-SCREEN.
  PERFORM VALIDATE_INPUT.

START-OF-SELECTION.
  PERFORM GET_DATA.
  PERFORM DISPLAY_DATA.

TOP-OF-PAGE.
  PERFORM DISPLAY_TOPOFPAGE.

AT LINE-SELECTION.
  PERFORM DISPLAY_SECONDLIST.

TOP-OF-PAGE DURING LINE-SELECTION.
  PERFORM LINE_TOPOFPAGE.
FORM VALIDATE_INPUT .
  IF S_MATNR IS INITIAL.
    MESSAGE 'Enter material' TYPE 'E'.
  ENDIF.
ENDFORM.
FORM GET_DATA .
  SELECT FROM MARA INTO TABLE IT_MARA WHERE MATNR IN S_MATNR.
ENDFORM.
FORM DISPLAY_DATA .
  LOOP AT IT_MARA INTO WA_MARA.
    WRITE: WA_MARA-MATNR HOTSPOT on,
             WA_MARA-MTART,

             WA_MARA-MATKL,
             WA_MARA-MEINS.
  ENDLOOP.
ENDFORM.
FORM DISPLAY_SECONDLIST.

  GET CURSOR FIELD FNAM VALUE FVAL.
  CONDENSE FNAM.
  CONDENSE FVAL.
  IF FNAM 'WA_MARA-MATNR'.
    SELECT SINGLE FROM MARA INTO WA_MARA WHERE MATNR FVAL .
    WRITE:/ WA_MARA-MATNRWA_MARA-MBRSHWA_MARA-MTARTWA_MARA-MATKLWA_MARA-MEINSWA_MARA-ERSDAWA_MARA-ERNAM.

  ENDIF.

ENDFORM.
FORM DISPLAY_TOPOFPAGE .
  WRITE:'Material Details' COLOR 4.
 ULINE .
ENDFORM.
FORM LINE_TOPOFPAGE .
  IF FNAM 'WA_MARA-MATNR'.
    WRITE:'Material details 'WA_MARA-MATNR COLOR 5.

ULINE.

  ENDIF.
ENDFORM.

Interactive Report using GET CURSOR technique

*&---------------------------------------------------------------------*
*& Report  ZINTDEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZINTDEMO.
DATA IT_MARA TYPE TABLE OF MARA,
       WA_MARA TYPE MARA,
       IT_MAKT TYPE TABLE OF MAKT,
       WA_MAKT TYPE MAKT.
DATA FNAM(20)FVAL(30).

SELECT-OPTIONS S_MATNR FOR WA_MARA-MATNR.

INITIALIZATION.

AT SELECTION-SCREEN.
  PERFORM VALIDATE_INPUT.

START-OF-SELECTION.
  PERFORM GET_DATA.
  PERFORM DISPLAY_DATA.

TOP-OF-PAGE.
  PERFORM DISPLAY_TOPOFPAGE.

AT LINE-SELECTION.
  PERFORM DISPLAY_SECONDLIST.

TOP-OF-PAGE DURING LINE-SELECTION.
  PERFORM LINE_TOPOFPAGE.
FORM VALIDATE_INPUT .
  IF S_MATNR IS INITIAL.
    MESSAGE 'Enter material' TYPE 'E'.
  ENDIF.
ENDFORM.
FORM GET_DATA .
  SELECT FROM MARA INTO TABLE IT_MARA WHERE MATNR IN S_MATNR.
ENDFORM.
FORM DISPLAY_DATA .
  LOOP AT IT_MARA INTO WA_MARA.
    WRITE:/ WA_MARA-MATNRWA_MARA-MTARTWA_MARA-MATKLWA_MARA-MEINS.
  ENDLOOP.
ENDFORM.
FORM DISPLAY_SECONDLIST.

  GET CURSOR FIELD FNAM VALUE FVAL.
  CONDENSE FNAM.
  CONDENSE FVAL.
  IF FNAM 'WA_MARA-MATNR'.
    SELECT SINGLE FROM MARA INTO WA_MARA WHERE MATNR FVAL .
    WRITE:/ WA_MARA-MATNRWA_MARA-MBRSHWA_MARA-MTARTWA_MARA-MATKLWA_MARA-MEINSWA_MARA-ERSDAWA_MARA-ERNAM.

  ENDIF.

ENDFORM.
FORM DISPLAY_TOPOFPAGE .
  WRITE:'Material Details' COLOR 4.
 ULINE .
ENDFORM.
FORM LINE_TOPOFPAGE .
  IF FNAM 'WA_MARA-MATNR'.
    WRITE:'Material details 'WA_MARA-MATNR COLOR 5.

ULINE.

  ENDIF.
ENDFORM.


 
 if you click on the material number then you will get inside another detail list .