Skip to Content

Objective:

Every organization use multiple reports like Sales, Shipping, Billing and Profit & Loss to make good business decision. In this all areas we might have developed and used huge BEx reports, in all reports we might restrict (include/exclude) characteristics(like 0MATERIAL, 0PLANT) values 1001, 2002 for company codes, S01, S02 for Sales organization , Doc Type , Plant to meet business report requirement.

Every organization will expand their business, as part of business growth organization might merge or establish new plant, company codes, sales organizations etc.

Technical Impact due to organization changes.

Due to organization changes we might get into technical challenges/issues for example as part of business expand Company ABC new plant has been acquired (Plant 0567) and now I would like to include this new plant wherever already nearby plants (0545) included to same area manager to analysis inbound/outbound business data,  for this I need to search where existing plant 0545 is restricted so that I can include new plant 0567.

Approaches to find 0545.

  • Search manually respective reports in BEx designer like Filters Area, Default Area, Restricted Key Figure  and Selections, etc….might be restricted anywhere in report like cells, so its very tough job if its complex report’s
  • Search in table level,  however its required skill like BEx tables and relationship between tables
  • Search through FM however its gives unstructured data, need to format and also it works one report at a time.

Solution “One Click Away”

So, I had written ABAP program which will give list of reports which are restricted by given Infoprovider/InfoObect and characteristics value.

Here we can search based on Multiprovider/InfoCube/DSO OR Infoset wise, we have to select Radio button based on requirement as like below

 

/wp-content/uploads/2015/08/1_771379.png

Example for Mulitprovider.

 

Example 1

Now, I am searching based on Mulitprovider/InfoCube and selections as like below

 

Multi/Cube Tech Name: ALL (Means all Mulitproviders and Infocubes)

 

Infoobject Tech Name: 0PLANT (For Plant) You can give more infoobjects at a time.

 

Infoobject Value          : ALL (Means for All Plants).

 

 

/wp-content/uploads/2015/08/2_771417.png

Output:

 

Provides list of reports restricted by All 0PLANT values

 

Example 2

Now, I am searching based on Mulitprovider/InfoCube and selections as like below

 

Multi/Cube Tech Name: ALL (Means all Mulitproviders and Infocubes)

 

Infoobject Tech Name: 0PLANT (For to Plant) you can give more infoobjects at a time.

 

Infoobject Value            : 1111 (Where Plant equal to 1111).

 

/wp-content/uploads/2015/08/3_771431.png

Output

 

Provides list of reports where plant restricted by 1111

 

/wp-content/uploads/2015/08/4_771422.png

Example for InfoSet.

Example 1

 

Now, I am searching based on Infoset and selections as like below

 

Multi/Cube Tech Name : ALL (Means all Infosets)

 

Infoobject Tech Name  : 0PLANT (For Plant) You can give more infoobjects at a time.

 

Infoobject Value            : ALL (Means for All Plants).

 

/wp-content/uploads/2015/08/5_771432.png

Output:

 

Provides list of reports restricted by All 0PLANT values

 

Example 2

Now, I am searching based on Infoset and selections as like below

 

Multi/Cube Tech Name: ALL (Means all Infosets)

 

Infoobject Tech Name: 0PLANT (For Plant), You can give more infoobjects at a time.

 

Infoobject Value            : 111 (Where Plant equal to 111).

 

/wp-content/uploads/2015/08/6_771433.png

Output

 

Provides list of reports where plant restricted by 111

/wp-content/uploads/2015/08/7_771426.png

Selection Screen Names

I_CHAR InfoObject Value
I_CHARM InfoObject Value
I_INFSET InfoSet Tech Name
I_MULTI Multi/Cube Tech Name
I_OBJECM InfoObject Tech Name
I_OBJECT InfoObject Tech Name
P_IS Infoset
P_MC Multiprovider/InfoCube

 

Attached ABAP Code.


REPORT ZBW_ BEX_SEL_TRACK.

 

TABLES: RSZRANGE,RSZ_X_RANGE. “Comment this line in 7.5 BW version
TYPE-POOLSSLIS.

DATAI_CHAR_D(80)   TYPE C,
I_OBJECT_D(30TYPE C,
I_INFOSET_D    TYPE RSQINFOSET,
I_INFOCUBE     TYPE RSINFOPROV.

DATASYTABIX     LIKE SYTABIX,
W_TXTLG     TYPE RSTXTLG,
W_FALIAS    TYPE RSQALIAS,
W_INFOSET   TYPE RSQINFOSET,
W_DEFTP     TYPE RSZDEFTP,
W_MAPNAME   TYPE RSZCOMPID,
W_FNAME     TYPE RSINFOPROV,
W_IOBJNMR   TYPE RSIOBJNM,
FLAG_Q(1)   TYPE C,
FLAG_O(1)   TYPE C,
FLAG_S(1)   TYPE C,
LD_COLOR(1TYPE C.

DATAFIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
GD_REPID     LIKE SYREPID.

DATALD_LENGTH TYPE I.

DATAGT_EVENTS     TYPE SLIS_T_EVENT.

*Types declaration

TYPESBEGIN OF TY_ODS,
ODSOBJECT TYPE RSDODSOBJECT,
END OF TY_ODS.

TYPESBEGIN OF TY_PROVIDER,
PROVIDER TYPE RSQINFOSET,
END OF TY_PROVIDER.

TYPESBEGIN OF TY_INFOSET,
INFOSET TYPE RSQINFOSET,
FALIAS  TYPE RSQALIAS,
TALIAS  TYPE RSQALIAS,
FNAME   TYPE RSINFOPROV,
END OF TY_INFOSET.

TYPESBEGIN OF TY_NAV,
ATRNAVNM TYPE RSATRNAVNM,
END OF TY_NAV.

TYPESBEGIN OF QRY_DET,
COMPUID  TYPE RSRREPDIRCOMPUID,
INFOCUBE TYPE RSRREPDIRINFOCUBE,
COMPID   TYPE RSRREPDIRCOMPID,
LASTUSER TYPE RSRREPDIRLASTUSER,
END OF QRY_DET.

TYPESBEGIN OF QRY_DESC,
ELTUID TYPE RSZELTTXTELTUID,
TXTLG  TYPE RSZELTTXTTXTLG,
END OF QRY_DESC.

TYPESC_T_ELTDIR TYPE RSZ_X_ELTDIR,
C_T_RANGE  TYPE RSZ_X_RANGE.

TYPESBEGIN OF OUTPUT,
COMPID        TYPE RSRREPDIRCOMPID,
TXTLG         TYPE RSZELTTXTTXTLG,
INFOCUBE      TYPE RSRREPDIRINFOCUBE,
DEFTP         TYPE RSZELTDIRDEFTP,
MAPNAME       TYPE RSZELTDIRMAPNAME,
SIGN(10)      TYPE C,
OPT           TYPE RSZ_OPERATOR,
LOW           TYPE RSCHAVLEXT,
HIGH          TYPE RSCHAVLEXT,
INFOBJ(40)    TYPE C,
INFOBJI(40)   TYPE C,
LASTUSER      TYPE RSRREPDIRLASTUSER,
LINE_COLOR(4TYPE C,
END OF OUTPUT.

TYPESBEGIN OF TY_RSQFOBJ,
INFOSET TYPE RSQINFOSET,
FALIAS  TYPE RSQALIAS,
FNAME   TYPE RSINFOPROV,
END OF TY_RSQFOBJ.

TYPESBEGIN OF TY_RSZSELECT,
ELTUID TYPE SYSUUID_25,
IOBJNM TYPE RSIOBJNM,
END OF TY_RSZSELECT.
TYPESBEGIN OF TY_IOBJ,
IOBJNM TYPE RSDIOBJNM,
END OF TY_IOBJ.

*Table declartion
DATAT_ODS       TYPE STANDARD TABLE OF TY_ODS,
T_IOBJ      TYPE STANDARD TABLE OF TY_IOBJ,
T_INFOSET   TYPE STANDARD TABLE OF TY_INFOSET,
T_PROVIDER  TYPE STANDARD TABLE OF  TY_PROVIDER,
T_NAV       TYPE STANDARD TABLE OF TY_NAV,
T_RSZSELECT TYPE STANDARD TABLE OF TY_RSZSELECT,
T_QRY_DET   TYPE STANDARD TABLE OF QRY_DET,
T_QRY_DESC  TYPE STANDARD TABLE OF QRY_DESC,
T_ELTDIR    TYPE STANDARD TABLE OF  C_T_ELTDIR,
T_RANGE     TYPE STANDARD TABLE OF  C_T_RANGE,
T_OUTPUT    TYPE STANDARD TABLE OF OUTPUT,
T_RSQFOBJ   TYPE STANDARD TABLE OF TY_RSQFOBJ.

*Workarea declartion:
DATAWA_ODS       TYPE TY_ODS,
WA_IOBJ      TYPE TY_IOBJ,
WA_INFOSET   TYPE TY_INFOSET,
WA_PROVIDER  TYPE TY_PROVIDER,
WA_NAV       TYPE TY_NAV,
WA_RSZSELECT TYPE TY_RSZSELECT,
WA_QRY_DET   TYPE QRY_DET,
WA_QRY_DESC  TYPE QRY_DESC,
WA_ELTDIR    TYPE RSZ_X_ELTDIR,
WA_RANGE     TYPE RSZ_X_RANGE,
WA_OUTPUT    TYPE OUTPUT,
WA_RSQFOBJ   TYPE TY_RSQFOBJ.

PARAMETERSP_MC RADIOBUTTON GROUP SEL DEFAULT ‘X’ USER-COMMAND AC,
P_IS RADIOBUTTON GROUP SEL.

SELECTION-SCREEN BEGIN OF BLOCK MULTI
WITH FRAME TITLE TITLE2.

SELECT-OPTIONSI_MULTI FOR I_INFOSET_D DEFAULT ‘ALL’ OBLIGATORY MODIF ID UC2.
SELECT-OPTIONSI_OBJECM FOR I_OBJECT_D  DEFAULT ‘0PLANT’ OBLIGATORY MODIF ID UC2.
SELECT-OPTIONSI_CHARM FOR I_CHAR_D  DEFAULT ‘ALL’ OBLIGATORY MODIF ID UC2.

SELECTION-SCREEN END   OF BLOCK MULTI.

SELECTION-SCREEN BEGIN OF BLOCK INFOSET
WITH FRAME TITLE TITLE1.

SELECT-OPTIONSI_INFSET FOR  I_INFOCUBE DEFAULT ‘ALL’ OBLIGATORY MODIF ID UC1.
SELECT-OPTIONSI_OBJECT FOR I_OBJECT_D  DEFAULT ‘0PLANT’ OBLIGATORY MODIF ID UC1.
SELECT-OPTIONSI_CHAR FOR I_CHAR_D  DEFAULT ‘ALL’ OBLIGATORY MODIF ID UC1.

SELECTION-SCREEN END   OF BLOCK INFOSET.

***************************** Performs *******************************

CLEART_PROVIDER,T_NAV,T_QRY_DET,T_QRY_DESCT_RANGE,T_ELTDIR,T_RSQFOBJ,T_ODS.

*Error handling
IF I_OBJECTLOW EQ ‘ALL’.
MESSAGE E208(00WITH ‘(ALL) is invalid InfoObject,enter Valid InfoObject’ .
ENDIF.

IF I_OBJECMLOW EQ ‘ALL’.
MESSAGE E208(00WITH ‘(ALL) is invalid InfoObject,enter Valid InfoObject’ .
ENDIF.

INITIALIZATION.
TITLE1 ‘Infoset’.
TITLE2 ‘Multiprovider/Infocube/ODS’.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
IF P_MC ‘X’.
IF SCREENGROUP1 ‘UC1’.
SCREENINPUT ‘0’.
ENDIF.
IF SCREENGROUP1 ‘UC2’.
SCREENINPUT ‘1’.
ENDIF.
ELSEIF P_IS ‘X’.
IF SCREENGROUP1 ‘UC2’.
SCREENINPUT ‘0’.
ENDIF.
IF SCREENGROUP1 ‘UC1’.
SCREENINPUT ‘1’.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

START-OF-SELECTION.

PERFORM SELECTION_FILL.
PERFORM QUERY_DETAILS.
PERFORM PROCESSDATA.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
PERFORM BUILD_EVENTS.
PERFORM DISPLAY_ALV_REPORT.
PERFORM CLEAR_TABS.

***************************** Forms *******************************

FORM SELECTION_FILL .
IF P_IS EQ ‘X’.
IF I_INFSETLOW EQ ‘ALL’.
SELECT INFOSET FROM RSQISET INTO TABLE T_PROVIDER
WHERE OBJVERS ‘A’.

ELSE.
SELECT INFOSET FROM RSQISET INTO TABLE T_PROVIDER
FOR ALL ENTRIES IN  I_INFSET WHERE INFOSET I_INFSETLOW.

ENDIF.

IF I_OBJECTLOW IS NOT INITIAL.
SELECT ATRNAVNM FROM RSDATRNAV INTO TABLE T_NAV FOR ALL ENTRIES IN
I_OBJECT WHERE ATTRINM I_OBJECTLOW AND
OBJVERS ‘A’.

IF T_NAV IS NOT INITIAL.
LOOP AT T_NAV INTO WA_NAV.
I_OBJECTLOW WA_NAVATRNAVNM.
I_OBJECTSIGN ‘I’.
I_OBJECTOPTION ‘EQ’.
APPEND I_OBJECT.
ENDLOOP.
ENDIF.

SORT I_OBJECT BY LOW.
DELETE ADJACENT DUPLICATES FROM I_OBJECT COMPARING LOW.

SELECT ELTUID IOBJNM FROM RSZSELECT INTO TABLE T_RSZSELECT WHERE IOBJNM IN I_OBJECM AND
OBJVERS ‘A’.
IF SYSUBRC 0.
SORT T_RSZSELECT BY ELTUID IOBJNM.
ENDIF.

ENDIF.

ELSEIF P_MC EQ ‘X’.

IF I_MULTILOW EQ ‘ALL’.
SELECT INFOCUBE FROM RSDCUBE INTO TABLE T_PROVIDER
WHERE CUBETYPE NE ‘A’ AND
OBJVERS ‘A’.

SELECT ODSOBJECT FROM RSDODSO INTO TABLE T_ODS
WHERE OBJVERS ‘A’.

IF SYSUBRC 0.

LOOP AT T_ODS INTO WA_ODS.
WA_PROVIDERPROVIDER  WA_ODSODSOBJECT.
APPEND WA_PROVIDER TO T_PROVIDER.
ENDLOOP.

ENDIF.
SELECT IOBJNM FROM RSDIOBJ INTO TABLE T_IOBJ WHERE OBJVERS ‘A’ AND
OBJSTAT ‘ACT’ AND
ATRONLYFL ”   .
IF SYSUBRC 0.

LOOP AT T_IOBJ INTO WA_IOBJ.
WA_PROVIDERPROVIDER WA_IOBJIOBJNM.
APPEND WA_PROVIDER TO T_PROVIDER.
ENDLOOP.
ENDIF.
ELSE.
SELECT INFOCUBE FROM RSDCUBE INTO TABLE T_PROVIDER
FOR ALL ENTRIES IN  I_MULTI WHERE INFOCUBE I_MULTILOW AND
OBJVERS ‘A’.

SELECT ODSOBJECT FROM RSDODSO INTO TABLE T_ODS
FOR ALL ENTRIES IN I_MULTI WHERE ODSOBJECT I_MULTILOW AND
OBJVERS ‘A’.

IF SYSUBRC EQ 0.
LOOP AT T_ODS INTO WA_ODS.
WA_PROVIDERPROVIDER  WA_ODSODSOBJECT.
APPEND WA_PROVIDER TO T_PROVIDER.
ENDLOOP.
ENDIF.

SELECT IOBJNM FROM RSDIOBJ INTO TABLE T_IOBJ WHERE IOBJNM IN I_MULTI AND
OBJVERS ‘A’ AND
OBJSTAT ‘ACT’ AND
ATRONLYFL ”   .
IF SYSUBRC 0.
LOOP AT T_IOBJ INTO WA_IOBJ.
WA_PROVIDERPROVIDER WA_IOBJIOBJNM.
APPEND WA_PROVIDER TO T_PROVIDER.
ENDLOOP.
ENDIF.

ENDIF.

IF I_OBJECMLOW IS NOT INITIAL.
SELECT ATRNAVNM FROM RSDATRNAV INTO TABLE T_NAV FOR ALL ENTRIES IN
I_OBJECM WHERE ATTRINM I_OBJECMLOW AND
OBJVERS ‘A’.

IF T_NAV IS NOT INITIAL.
LOOP AT T_NAV INTO WA_NAV.
I_OBJECMLOW WA_NAVATRNAVNM.
I_OBJECMSIGN ‘I’.
I_OBJECMOPTION ‘EQ’.
APPEND I_OBJECM.
ENDLOOP.
ENDIF.

SORT I_OBJECM BY LOW.
DELETE ADJACENT DUPLICATES FROM I_OBJECM COMPARING LOW.

SELECT ELTUID IOBJNM FROM RSZSELECT INTO TABLE T_RSZSELECT WHERE IOBJNM IN I_OBJECM AND
OBJVERS ‘A’.
IF SYSUBRC 0.
SORT T_RSZSELECT BY ELTUID IOBJNM.
ENDIF.

ENDIF.

ENDIF.

ENDFORM.                    ” SELECTION_FILL

*&———————————————————————*
*&      Form  query_details
*&———————————————————————*
*       text
*———————————————————————-*
FORM QUERY_DETAILS .
SELECT COMPUID INFOCUBE COMPID LASTUSER FROM RSRREPDIR INTO TABLE T_QRY_DET FOR ALL ENTRIES IN
T_PROVIDER WHERE INFOCUBE T_PROVIDERPROVIDER AND
OBJVERS ‘A’.
SORT T_QRY_DET BY COMPUID.

SELECT ELTUID TXTLG FROM RSZELTTXT INTO CORRESPONDING FIELDS OF TABLE T_QRY_DESC
FOR ALL ENTRIES IN T_QRY_DET WHERE ELTUID T_QRY_DETCOMPUID AND OBJVERS ‘A’.
SORT T_QRY_DESC BY ELTUID.

IF P_IS EQ ‘X’.
SELECT INFOSET FALIAS FNAME FROM RSQFOBJ INTO TABLE T_RSQFOBJ FOR ALL ENTRIES IN
T_PROVIDER WHERE INFOSET =  T_PROVIDERPROVIDER AND
FNAME IN I_OBJECT AND
OBJVERS ‘A’.
SORT T_RSQFOBJ BY INFOSET FALIAS FNAME.
ENDIF.
ENDFORM.                   ” QUERY_DETAILS
*&———————————————————————*
*&      Form  PROCESSDATA
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM PROCESSDATA .
LOOP AT T_QRY_DET  INTO WA_QRY_DET.
CLEARSYTABIX.
SYTABIX SYTABIX.

CALL FUNCTION ‘RSZ_X_COMPONENT_GET’
EXPORTING
I_COMPUID  WA_QRY_DETCOMPUID
I_OBJVERS  ‘A’
TABLES
C_T_ELTDIR T_ELTDIR
C_T_RANGE  T_RANGE.

IF P_IS EQ ‘X’.

SORT T_RANGE BY SELTP.
DELETE T_RANGE WHERE SELTP NE 1.
SORT T_RANGE BY LOWFLAG.
DELETE T_RANGE WHERE LOWFLAG EQ OR LOWFLAG EQ 3.
SORT T_RANGE BY LOW.
ELSEIF P_MC EQ ‘X’.

SORT T_RANGE BY SELTP.
DELETE T_RANGE WHERE SELTP NE AND SELTP NE 2.
SORT T_RANGE BY LOWFLAG.
DELETE T_RANGE WHERE LOWFLAG EQ OR LOWFLAG EQ 3.
SORT T_RANGE BY LOW.
ENDIF.

IF P_IS EQ ‘X’.

IF I_CHARLOW EQ ‘ALL’.
ELSE.
SORT T_RANGE BY LOW.
DELETE T_RANGE WHERE LOW NOT IN I_CHAR.
ENDIF.

ELSEIF P_MC EQ ‘X’.

IF  I_CHARMLOW EQ ‘ALL’.
ELSE.
SORT T_RANGE BY LOW.
DELETE T_RANGE WHERE LOW NOT IN I_CHARM.
ENDIF.

SORT T_RANGE BY IOBJNM.
DELETE T_RANGE WHERE IOBJNM NOT IN I_OBJECM.

ENDIF.

SORT T_RANGE BY ELTUID.
SORT T_ELTDIR BY ELTUID.

LOOP AT T_RANGE INTO WA_RANGE.
CLEARW_TXTLGW_FALIASW_INFOSET,W_DEFTP,W_MAPNAME,W_FNAME,W_IOBJNMR,
FLAG_QFLAG_OFLAG_S.

IF P_IS EQ ‘X’.

SPLIT WA_RANGEIOBJNM AT ‘___’ INTO W_INFOSET W_FALIAS.
READ TABLE T_RSQFOBJ INTO WA_RSQFOBJ WITH KEY
INFOSET W_INFOSET
FALIAS W_FALIAS BINARY SEARCH.
IF SYSUBRC EQ 0.
FLAG_O ‘X’.
W_FNAME WA_RSQFOBJFNAME.
W_IOBJNMR WA_RANGEIOBJNM.
ENDIF.

ELSEIF  P_MC EQ ‘X’.
FLAG_O ‘X’.
W_IOBJNMR WA_RANGEIOBJNM.
ENDIF.

READ TABLE T_QRY_DESC INTO WA_QRY_DESC WITH KEY ELTUID
WA_QRY_DETCOMPUID BINARY SEARCH.
IF SYSUBRC EQ 0.
W_TXTLG WA_QRY_DESCTXTLG.
FLAG_Q ‘X’.
ENDIF.

READ TABLE T_ELTDIR INTO WA_ELTDIR WITH KEY ELTUID
WA_RANGEELTUID BINARY SEARCH.
IF SYSUBRC EQ 0.
W_DEFTP WA_ELTDIRDEFTP.
W_MAPNAME WA_ELTDIRMAPNAME.
FLAG_S ‘X’.
ENDIF.

IF FLAG_Q EQ ‘X’ AND
FLAG_O EQ ‘X’ AND
FLAG_S EQ ‘X’.
CLEAR FLAG_S.
LD_COLOR LD_COLOR + 1.
IF LD_COLOR 3.
LD_COLOR 1.
ENDIF.
CONCATENATE ‘C’ LD_COLOR ’10’ INTO WA_OUTPUTLINE_COLOR.

WA_OUTPUTCOMPID  WA_QRY_DETCOMPID.
WA_OUTPUTTXTLG  W_TXTLG.
WA_OUTPUTINFOCUBE  WA_QRY_DETINFOCUBE.
WA_OUTPUTDEFTP W_DEFTP.
WA_OUTPUTMAPNAME W_MAPNAME.
IF WA_RANGESIGN EQ ‘I’.
WA_OUTPUTSIGN  ‘Include’.
ELSEIF WA_RANGESIGN EQ ‘E’.
WA_OUTPUTSIGN  ‘Exclude’.
ENDIF.
WA_OUTPUTOPT  WA_RANGEOPT.
WA_OUTPUTLOW WA_RANGELOW.
WA_OUTPUTHIGH WA_RANGEHIGH.
IF P_IS EQ ‘X’.
WA_OUTPUTINFOBJ W_FNAME.
ELSEIF P_MC EQ ‘X’.
WA_OUTPUTINFOBJ W_IOBJNMR.
ENDIF.
WA_OUTPUTINFOBJI W_IOBJNMR.
WA_OUTPUTLASTUSER  WA_QRY_DETLASTUSER.

APPEND WA_OUTPUT  TO T_OUTPUT.

ENDIF.

ENDLOOP.
CLEART_RANGE.

IF  T_RANGE IS NOT INITIAL“07/09/2018
LOOP AT T_RSZSELECT INTO WA_RSZSELECT.
IF P_IS EQ ‘X’.
*LD_COLOR = 0.

SPLIT WA_RSZSELECTIOBJNM AT ‘___’ INTO W_INFOSET W_FALIAS.
READ TABLE T_RSQFOBJ INTO WA_RSQFOBJ WITH KEY
INFOSET W_INFOSET
FALIAS W_FALIAS BINARY SEARCH.
IF SYSUBRC EQ 0.
FLAG_O ‘X’.
W_FNAME WA_RSQFOBJFNAME.
W_IOBJNMR WA_RSZSELECTIOBJNM.
ENDIF.

ELSEIF  P_MC EQ ‘X’.
FLAG_O ‘X’.
W_IOBJNMR WA_RSZSELECTIOBJNM.
ENDIF.

READ TABLE T_QRY_DESC INTO WA_QRY_DESC WITH KEY ELTUID
WA_QRY_DETCOMPUID BINARY SEARCH.
IF SYSUBRC EQ 0.
W_TXTLG WA_QRY_DESCTXTLG.
FLAG_Q ‘X’.
ENDIF.

READ TABLE T_ELTDIR INTO WA_ELTDIR WITH KEY ELTUID
WA_RSZSELECTELTUID BINARY SEARCH.
IF SYSUBRC EQ 0.
W_DEFTP WA_ELTDIRDEFTP.
W_MAPNAME WA_ELTDIRMAPNAME.
FLAG_S ‘X’.
ENDIF.

*        LD_COLOR = LD_COLOR + 1.

IF FLAG_Q EQ ‘X’ AND
FLAG_O EQ ‘X’ AND
FLAG_S EQ ‘X’.
CLEAR FLAG_S.
*        LD_COLOR = LD_COLOR + 1.
*        IF LD_COLOR = 1.
*          LD_COLOR = 0.
*        ENDIF.
*          CONCATENATE ‘C’ LD_COLOR ’10’ INTO WA_OUTPUT-LINE_COLOR.
*          CONCATENATE ‘C’  ’10’ INTO WA_OUTPUT-LINE_COLOR.
*          LD_COLOR = 1.

WA_OUTPUTCOMPID  WA_QRY_DETCOMPID.
WA_OUTPUTTXTLG  W_TXTLG.
WA_OUTPUTINFOCUBE  WA_QRY_DETINFOCUBE.
WA_OUTPUTDEFTP W_DEFTP.
WA_OUTPUTMAPNAME W_MAPNAME.
IF WA_RANGESIGN EQ ‘I’.
WA_OUTPUTSIGN  ‘Include’.
ELSEIF WA_RANGESIGN EQ ‘E’.
WA_OUTPUTSIGN  ‘Exclude’.
ENDIF.
WA_OUTPUTOPT  .“WA_RANGE-OPT.
WA_OUTPUTLOW .“WA_RANGE-LOW.
WA_OUTPUTHIGH .“WA_RANGE-HIGH.
IF P_IS EQ ‘X’.
WA_OUTPUTINFOBJ W_FNAME.
ELSEIF P_MC EQ ‘X’.
WA_OUTPUTINFOBJ W_IOBJNMR.
ENDIF.
WA_OUTPUTINFOBJI W_IOBJNMR.
WA_OUTPUTLASTUSER  WA_QRY_DETLASTUSER.

APPEND WA_OUTPUT  TO T_OUTPUT.
ENDIF.

ENDLOOP.
REFRESH T_RANGE.
DELETE T_QRY_DET  INDEX SYTABIX.
ENDIF.    “07/09/2018 “if given value not exist report then do not add to output.

*    IF LD_COLOR = 1.
*       LD_COLOR = 0.
*    ENDIF.

ENDLOOP.
SORT T_OUTPUT.
DELETE ADJACENT DUPLICATES FROM T_OUTPUT COMPARING ALL FIELDS.
ENDFORM.                    ” PROCESSDATA

*&———————————————————————*
*&      Form  build_fieldcatalog
*&———————————————————————*
*       text
*———————————————————————-*
FORM BUILD_FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘COMPID’.
FIELDCATALOGSELTEXT_M    ‘Report Tech Name’.
FIELDCATALOGOUTPUTLEN    10.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      1.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘TXTLG’.
FIELDCATALOGSELTEXT_M    ‘Report Name’.
FIELDCATALOGOUTPUTLEN    60.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      2.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘INFOCUBE’.
FIELDCATALOGSELTEXT_M    ‘InfoProvider’.
FIELDCATALOGOUTPUTLEN    10.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      3.

APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘DEFTP’.
FIELDCATALOGSELTEXT_M    ‘Element Type’.
FIELDCATALOGOUTPUTLEN    10.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      4.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘MAPNAME’.
FIELDCATALOGSELTEXT_M    ‘Element Name’.
FIELDCATALOGOUTPUTLEN    40.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      5.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘SIGN’.
FIELDCATALOGSELTEXT_M    ‘Include/Exclude’.
FIELDCATALOGOUTPUTLEN    10.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      6.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘OPT’.
FIELDCATALOGSELTEXT_M    ‘Option’.
FIELDCATALOGOUTPUTLEN    20.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      7.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘LOW’.
FIELDCATALOGSELTEXT_M    ‘Low’.
FIELDCATALOGOUTPUTLEN    80.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      8.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘HIGH’.
FIELDCATALOGSELTEXT_M    ‘High’.
FIELDCATALOGOUTPUTLEN    20.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      9.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘INFOBJ’.
FIELDCATALOGSELTEXT_M    ‘InfoObject’.
FIELDCATALOGOUTPUTLEN    40.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      10.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘INFOBJI’.
FIELDCATALOGSELTEXT_M    ‘Reference Object’.
FIELDCATALOGOUTPUTLEN    15.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      11.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

FIELDCATALOGFIELDNAME    ‘LASTUSER’.
FIELDCATALOGSELTEXT_M    ‘Changed By’.
FIELDCATALOGOUTPUTLEN    20.
FIELDCATALOGEMPHASIZE    ‘X’.
FIELDCATALOGCOL_POS      12.
APPEND FIELDCATALOG  TO FIELDCATALOG.
CLEAR  FIELDCATALOG.

ENDFORM.                    ” BUILD_FIELDCATALOG

*&———————————————————————*
*&      Form  build_layout
*&———————————————————————*
*       text
*———————————————————————-*
FORM BUILD_LAYOUT.

GD_LAYOUTNO_INPUT           ‘X’.
GD_LAYOUTCOLWIDTH_OPTIMIZE  ‘X’.
GD_LAYOUTTOTALS_TEXT        ‘Totals’(201).
GD_LAYOUTTOTALS_ONLY        ‘X’.
GD_LAYOUTINFO_FIELDNAME =      ‘LINE_COLOR’.

*  gd_layout-f2code            = ‘DISP’.  “Sets fcode for when double
*                                         “click(press f2)
GD_LAYOUTZEBRA             ‘X’.
*  gd_layout-group_change_edit = ‘X’.
GD_LAYOUTHEADER_TEXT       ‘Report List’.
ENDFORM.                    ” BUILD_LAYOUT

*&———————————————————————*
*&      Form  build_events
*&———————————————————————*
*       text
*———————————————————————-*
FORM BUILD_EVENTS.
DATALS_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION ‘REUSE_ALV_EVENTS_GET’
EXPORTING
I_LIST_TYPE 0
IMPORTING
ET_EVENTS   GT_EVENTS[].
READ TABLE GT_EVENTS  WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
INTO  LS_EVENT.
IF SYSUBRC 0.
MOVE ‘TOP-OF-PAGE’ TO LS_EVENTFORM.
APPEND LS_EVENT  TO GT_EVENTS.
ENDIF.

READ TABLE GT_EVENTS  WITH KEY NAME =  SLIS_EV_END_OF_LIST
INTO  LS_EVENT.
IF SYSUBRC 0.
MOVE ‘END_OF_LIST’ TO LS_EVENTFORM.
APPEND LS_EVENT  TO GT_EVENTS.
ENDIF.
ENDFORM.                    ” BUILD_EVENTS

*&———————————————————————*
*&      Form  display_alv_report
*&———————————————————————*
*       text
*———————————————————————-*
FORM DISPLAY_ALV_REPORT.
GD_REPID SYREPID.
CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’
EXPORTING
I_CALLBACK_PROGRAM GD_REPID
*     i_callback_user_command = ‘USER_COMMAND’
*     i_grid_title       = outtext
IS_LAYOUT          GD_LAYOUT
IT_FIELDCAT        FIELDCATALOG[]
*     it_special_groups  = gd_tabgroup
IT_EVENTS          GT_EVENTS
I_SAVE             ‘X’
*     is_variant         = z_template
TABLES
T_OUTTAB           T_OUTPUT
EXCEPTIONS
PROGRAM_ERROR      1
OTHERS             2.
IF SYSUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDFORM.                    ” DISPLAY_ALV_REPORT
*&———————————————————————*
*&      Form  CLEAR_TABS
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*
FORM CLEAR_TABS .
CLEAR:T_INFOSET,
T_PROVIDER,
T_NAV,
T_QRY_DET,
T_QRY_DESC,
T_ELTDIR,
T_RANGE,
T_OUTPUT,
T_RSQFOBJ,
T_RANGE,
T_ELTDIR,
T_ODS.
ENDFORM.                    ” CLEAR_TABS

 

Note:

  • Added code, provided option to  search ODS wise also,
  • And changed selection screen sequence for more convenient

 

Thanks for reading Blog.

 

 

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member

    These BW ABAP programs are great.  I had done a program to locate where an infoObject is used…you went a step further…Splendid.

    Thanks for sharing.

    (0) 

Leave a Reply