cancel
Showing results for 
Search instead for 
Did you mean: 

Generic DataSource with Submit Program : RSA3 Working fine but Infopackage not able to fetch Data

0 Kudos

Hello Experts,

Please find the attachment.

Requirement :

-----

Generic Datasource using Function Module - the extractor logic will get the Still to be inv (Qty) and still to be Inv (Value) of ME2N Transaction

Summary :

I created generic DataSource using Function Module. The Function Module will fetch data from ME2N Transaction report.

Function Module Pseudocode :

1) Created Variant using - RS_CREATE_VARIANT. ( Every time new variant will be created in my logic )

2) Submit the ME2N Program 'RM06EN00' with Dynamically created Variant.

3) Get the data in to Memory and import. Convert data to Asci Format.

4) Split the data at Pipe delimiter and capture the fields values accordingly.

5) Return the data to the DataSource.

Issue :

The logic is working Fine In ECC Dev system ECC [RSA3] as well as BW Dev system [Infopackage] and able to retrieve data in BW.

The logic is working fine in ECC Quality system also. In BW the infopackage is in green status but not able fetch data.

Infopackage is in green status with following message

No data available

Diagnosis

The data request was a full update. In this case, the corresponding table in the source system does not contain any data. System Response Info IDoc received with status 8. Procedure

Check the data basis in the source system.

infopackage-error.jpg

Logic:

=========

FUNCTION ZFM_GET_ME2N_DATA
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA TYPE ZTME2N_EXTRACT OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"----------------------------------------------------------------------
*----------------------------------------------------------------------*
* Purpose : This Function Module is the backend extractor logic for the
* DataSource - "ZMM_ME2N_DS", to get the Still to be inv (Qty)
* and still to be Inv (Value) of ME2N Transaction
*----------------------------------------------------------------------*

*Data : wa_I_T_SELECT LIKE LINE OF I_T_SELECT.
DATA : wa_i_t_select TYPE rsselect.

* DataSource for table ZTME2N_EXTRACT.
* TABLES : ZTME2N_EXTRACT.

* Auxiliary Selection criteria structure
DATA: l_s_select TYPE srsc_s_select.

* Maximum number of lines for DB table
STATICS: s_s_if TYPE srsc_s_if_simple,

* counter
s_counter_datapakid LIKE sy-tabix.

CONSTANTS : lv_variant TYPE rsvar-variant VALUE 'ZBI_ME2N_BWEXT'.

* Report
CONSTANTS : c_report TYPE rsvar-report VALUE 'RM06EN00'.

* Max number of rows
DATA: lv_maxsize TYPE sy-tabix.

* Number of rows in current run
DATA: lv_cursize TYPE sy-tabix.

* Flag to indicate Max size reached
DATA: lv_maxed.

* pass this to an internal variable
lv_maxsize = i_maxsize.

*-----------------------------------------------------------*
* DECLARATIONS *
*-----------------------------------------------------------*
TYPES: BEGIN OF ty_listasci,
default(2620) TYPE c,
END OF ty_listasci.

DATA : it_me2n1 TYPE STANDARD TABLE OF zme2n_extract,
wa_me2n1 LIKE LINE OF it_me2n1.

DATA : list TYPE TABLE OF abaplist.
DATA : it_listasci TYPE STANDARD TABLE OF ty_listasci, " WITH HEADER LINE.
wa_listasci LIKE LINE OF it_listasci.

DATA : lt_outtab TYPE TABLE OF merep_outtab_purchdoc,
wa_outtab LIKE LINE OF lt_outtab.

DATA : lv_dummy01(1) TYPE c.

DATA : lv_menge(7) TYPE n, " QUAN 13 ??? to be checked / changed ??
lv_lagmg TYPE string,
lv_netpr TYPE string,
lv_peinh TYPE string,
lv_ktwrt TYPE string,
lv_ofzwt TYPE string,
lv_ktwto TYPE string,
lv_ktwtr TYPE string,
lv_ktmng TYPE string,
lv_ofzmg TYPE string,
lv_ktmgr TYPE string,
lv_mglief TYPE string,
lv_wtlief TYPE string,
lv_mginv TYPE string,
lv_wtinv TYPE string,
lv_azpos TYPE string,
lv_netwr TYPE string,
lv_lamng TYPE string.

* Variant Parameters

DATA: lt_params TYPE TABLE OF rsparams, " WITH HEADER LINE.
wa_params LIKE LINE OF lt_params.

DATA : wa_vari_desc TYPE varid. " Variant directory

CLEAR : list.
CLEAR : lv_menge,
lv_lagmg,
lv_netpr,
lv_peinh,
lv_ktwrt,
lv_ofzwt,
lv_ktwto,
lv_ktwtr,
lv_ktmng,
lv_ofzmg,
lv_ktmgr,
lv_mglief,
lv_wtlief,
lv_mginv,
lv_wtinv,
lv_azpos,
lv_netwr,
lv_lamng.

CLEAR : wa_outtab,
lv_dummy01.

FREE : list,
lt_outtab.

FREE : it_me2n1.
CLEAR : wa_me2n1.

*-----------------------------------------------------------*
* Declaration Part : creating variant programatically

DATA: lt_cont TYPE TABLE OF rsparams,
wa_cont TYPE rsparams,
lt_text TYPE TABLE OF varit,
wa_text TYPE varit,
ls_varid TYPE varid,
lv_xvariant TYPE variant.

CLEAR : lv_xvariant.

*-----------------------------------------------------------*

wa_vari_desc-mandt = sy-mandt.
wa_vari_desc-report = c_report.
wa_vari_desc-variant = lv_variant.
*-----------------------------------------------------------*

* Check DataSource validity
* CASE i_dsource.
* WHEN 'ZMM_ME2N_DS'.
*
* ENDCASE.

IF i_initflag = 'X'. " get the data into memory

REFRESH lt_params.
*-----------------------------------------------------------*
* Step ::: Main <<< Creating Variant

* CONCATENATE 'ZME2N_' sy-uzeit INTO lv_xvariant.
CONCATENATE 'ZBI_EXT_' sy-uzeit INTO lv_xvariant. " 14 Character
* 8 + 6
CLEAR: ls_varid.
ls_varid-report = 'RM06EN00'.
ls_varid-variant = lv_xvariant.
ls_varid-transport = 'F'. "?????????????
ls_varid-environmnt = 'A'. " Background and Online Variant


*-----------------------
* READ TABLE i_t_select INTO wa_i_t_select WITH KEY fieldnm = 'ZZEBELN'. " to be uncommented later
* IF sy-subrc = 0.

* Assign Range value for PO
CLEAR: wa_cont.
wa_cont-selname = 'EN_EBELN'.
wa_cont-kind = 'S'.
wa_cont-sign = 'I'.
wa_cont-option = 'BT'.
wa_cont-low = '1500000000'. "wa_i_t_select-low.
wa_cont-high = '2500016403'. " wa_i_t_select-high.
APPEND wa_cont TO lt_cont.
CLEAR: wa_cont.
* endif.

* Assign value for EN_SELKB

CLEAR: wa_cont.
wa_cont-selname = 'EN_SELKB'. " EN_SELKB
wa_cont-kind = 'P'.
* wa_cont-sign = 'I'.
* wa_cont-option = 'BT'.
wa_cont-low = 'X'.
* wa_cont-high = wa_i_t_select-high.
APPEND wa_cont TO lt_cont.
CLEAR: wa_cont.

* Assign value for EN_SELKL

CLEAR: wa_cont.
wa_cont-selname = 'EN_SELKL'. " EN_SELKL
wa_cont-kind = 'P'.
* wa_cont-sign = 'I'.
* wa_cont-option = 'BT'.
wa_cont-low = 'X'.
* wa_cont-high = wa_i_t_select-high.
APPEND wa_cont TO lt_cont.
CLEAR: wa_cont.

* Assign value for LISTU

CLEAR: wa_cont.
wa_cont-selname = 'LISTU'. " LISTU [ALV]
wa_cont-kind = 'P'.
* wa_cont-sign = 'I'.
* wa_cont-option = 'BT'.
wa_cont-low = 'ALV'.
* wa_cont-high = wa_i_t_select-high.
APPEND wa_cont TO lt_cont.
CLEAR: wa_cont.

*-----------------------

*CLEAR: wa_cont.
*wa_cont-selname = 'EN_EBELN'.
*wa_cont-kind = 'S'.
*wa_cont-sign = 'I'.
*wa_cont-option = 'BT'.
*wa_cont-low = '4500015910'.
*wa_cont-high = '4500015920'.
*APPEND wa_cont TO lt_cont.

CLEAR: wa_text.
wa_text-langu = sy-langu.
wa_text-report = ls_varid-report.
wa_text-variant = ls_varid-variant.
wa_text-vtext = lv_xvariant. " Variant Description same as variant name

CONDENSE wa_text-vtext.
APPEND wa_text TO lt_text.

CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
curr_report = ls_varid-report
curr_variant = ls_varid-variant
vari_desc = ls_varid
TABLES
vari_contents = lt_cont
vari_text = lt_text.

*-----------------------------------------------------------*
* Step ::: 1
* Calling Main Variant and lookup the variant values and find the selected PO

CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = c_report
* variant = lv_variant " Old Fixed Variant created manually in ME2N
variant = lv_xvariant " Dynamic variant created in this program
TABLES
valutab = lt_params
EXCEPTIONS
variant_non_existent = 1
variant_obsolete = 2
OTHERS = 3.

SUBMIT (c_report) USING SELECTION-SET lv_xvariant EXPORTING LIST TO MEMORY
AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list
EXCEPTIONS
not_found = 1
OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
with_line_break = 'X'
TABLES
listasci = it_listasci
listobject = list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.

LOOP AT it_listasci INTO wa_listasci.

IF sy-tabix GT 3.
IF wa_listasci+0(1) NE '-'.
* IF wa_listasci+0(1) NE '-' or wa_listasci+0(1) NE '*'.

" Split pipe delimited data
SPLIT wa_listasci AT '|' INTO lv_dummy01
wa_outtab-ebeln
wa_outtab-ebelp
wa_outtab-bsart
wa_outtab-bstyp
wa_outtab-superfield
wa_outtab-ekorg
wa_outtab-ekgrp
wa_outtab-bedat
wa_outtab-ematn
wa_outtab-txz01
wa_outtab-matkl
wa_outtab-icon_po_hist
* wa_outtab-icon_comp_cons
wa_outtab-loekz
wa_outtab-pstyp
wa_outtab-epstp
wa_outtab-knttp
wa_outtab-bednr
wa_outtab-werks
wa_outtab-lgort
* wa_outtab-MENGE
lv_menge
wa_outtab-meins
lv_lagmg
* wa_outtab-LAGMG
wa_outtab-lmein
lv_netpr
* wa_outtab-NETPR
wa_outtab-waers
lv_peinh
* wa_outtab-PEINH
wa_outtab-konnr
wa_outtab-ktpnr
lv_ktwrt
* wa_outtab-KTWRT
lv_ofzwt
* wa_outtab-OFZWT
lv_ktwto
* wa_outtab-KTWTO
lv_ktwtr
* wa_outtab-KTWTR
lv_ktmng
* wa_outtab-KTMNG
lv_ofzmg
* wa_outtab-OFZMG
lv_ktmgr
* wa_outtab-KTMGR
wa_outtab-kdatb
wa_outtab-kdate
lv_mglief
* wa_outtab-MGLIEF
lv_wtlief
* wa_outtab-WTLIEF
lv_mginv
* wa_outtab-MGINV
lv_wtinv
* wa_outtab-WTINV
wa_outtab-agdat
wa_outtab-statu
wa_outtab-submi
lv_azpos
* wa_outtab-AZPOS
wa_outtab-bsakz
wa_outtab-infnr
wa_outtab-packno
wa_outtab-frggr
wa_outtab-frgsx
wa_outtab-frgzu
wa_outtab-frgke
wa_outtab-reslo
wa_outtab-vendor_name
wa_outtab-bprme
wa_outtab-mwskz
wa_outtab-txjcd
lv_netwr
* wa_outtab-NETWR
wa_outtab-memory
wa_outtab-memorytype
lv_lamng
* wa_outtab-LAMNG
wa_outtab-sgt_scat
wa_outtab-sgt_rcat
wa_outtab-exlin
wa_outtab-exsnr
wa_outtab-ehtyp
wa_outtab-prio_urg
wa_outtab-prio_req
wa_outtab-longnum
wa_outtab-fsh_season_year
wa_outtab-fsh_season
wa_outtab-fsh_collection
wa_outtab-fsh_theme
wa_outtab-wrf_charstc1
wa_outtab-wrf_charstc1_txt
wa_outtab-wrf_charstc2
wa_outtab-wrf_charstc2_txt
wa_outtab-wrf_charstc3
wa_outtab-wrf_charstc3_txt.
wa_me2n1-zzebeln = wa_outtab-ebeln.

** Populating Order Unit and Currency Key Values

wa_me2n1-zzmeins = wa_outtab-meins.
wa_me2n1-zzwaers = wa_outtab-waers.

*-------------------------------------------
REPLACE ALL OCCURRENCES OF ',' IN lv_mglief WITH space.
CONDENSE lv_mglief.

wa_me2n1-zzmglief = lv_mglief. " Still to be Delivered (Quantity)
*-------------------------------------------
REPLACE ALL OCCURRENCES OF ',' IN lv_wtlief WITH space.
CONDENSE lv_wtlief.
wa_me2n1-zzwtlief = lv_wtlief. " Still to be Delivered (Value)

*-------------------------------------------

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_outtab-ebelp
IMPORTING
output = wa_outtab-ebelp.

wa_me2n1-zzebelp = wa_outtab-ebelp.

REPLACE ALL OCCURRENCES OF ',' IN lv_mginv WITH space.
CONDENSE lv_mginv.
wa_outtab-mginv = lv_mginv.
wa_me2n1-zzmginv = wa_outtab-mginv.

REPLACE ALL OCCURRENCES OF ',' IN lv_wtinv WITH space.
CONDENSE lv_wtinv.



wa_me2n1-zzwtinv = lv_wtinv.



APPEND wa_outtab TO lt_outtab.
CLEAR : wa_outtab.
DELETE lt_outtab WHERE ebeln IS INITIAL.

APPEND wa_me2n1 TO it_me2n1.
CLEAR wa_me2n1.
DELETE it_me2n1 WHERE zzebeln IS INITIAL.
ENDIF.
ENDIF.
ENDLOOP.

IF it_me2n1 IS NOT INITIAL.

APPEND LINES OF it_me2n1 TO gt_e_t_data.

ENDIF.

ELSE.

IF gv_nomore = 'X'. " All data was sent.. Exit.
RAISE no_more_data.
ENDIF.

IF i_maxsize IS NOT INITIAL.
LOOP AT gt_e_t_data FROM gv_idx_start.
IF lv_cursize => lv_maxsize.
lv_maxed = 'X'. " we have hit the limit for this packet
gv_idx_start = sy-tabix. " start here on the next run
EXIT.
ELSE.
APPEND gt_e_t_data TO e_t_data. " add a row
lv_cursize = lv_cursize + 1. " add a count
ENDIF.
ENDLOOP.
IF lv_maxed <> 'X'. "the loop didn't exit due to max size so we must be done...
gv_nomore = 'X'.
ENDIF.
ELSE.
APPEND LINES OF gt_e_t_data TO e_t_data. "Just send all the data
gv_nomore = 'X'.
ENDIF.

ENDIF.

ENDFUNCTION.

Thanks,

Vijay

raymond_giuseppi
Active Contributor
0 Kudos

Do not use "Answer" but "Comment" to reply to an answer or comment. (Read the 'Before answering' text at lower-right corner)

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor
0 Kudos

Since this report is an ALV, could you consider using class cl_salv_bs_runtime_info to

  • Prevent the ALV from being displayed
  • Get the actual internal table generated by the program and not a spool (This should also avoid most of the impacts associated with some user defined default ALV variants or print parameters value)

Also, why create a report variant, when you could just pass the selections with the WITH option of SUBMIT?

0 Kudos

Hello Raymond Giuseppi,

Thanks for the Response.

Following is the updated comment.

I am able get the records using class cl_salv_bs_runtime_info. The following logic is working fine in Dev system , but the same is not working in Quality system. In the Quality system, the PSA is turning green but no data extracted.

----------------

FUNCTION zbi_mm_me2n_fm.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA TYPE ZTME2N_EXTRACT OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"----------------------------------------------------------------------
*----------------------------------------------------------------------*
* Purpose : This Function Module is the backend extractor logic for the
* DataSource - "ZMM_ME2N_DS", to get the Still to be inv (Qty)
* and still to be Inv (Value) of ME2N Transaction
*----------------------------------------------------------------------*

*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
* Standard Declarations

DATA : wa_i_t_select TYPE rsselect.

** Auxiliary Selection criteria structure
DATA: l_s_select TYPE srsc_s_select.

** Maximum number of lines for DB table
STATICS: s_s_if TYPE srsc_s_if_simple,

** counter
s_counter_datapakid LIKE sy-tabix.

CONSTANTS : lv_variant TYPE rsvar-variant VALUE 'ZBI_ME2N_BWEXT'.

** Report
CONSTANTS : c_report TYPE rsvar-report VALUE 'RM06EN00'.

** Max number of rows
DATA: lv_maxsize TYPE sy-tabix.

** Number of rows in current run
DATA: lv_cursize TYPE sy-tabix.

** Flag to indicate Max size reached
DATA: lv_maxed.

** pass this to an internal variable
lv_maxsize = i_maxsize.

*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*

FIELD-SYMBOLS : <lt_me2n_data> TYPE ANY TABLE,
<lw_me2n_data> TYPE any.

DATA : lr_me2n_data TYPE REF TO data.

DATA: lt_selscreen TYPE TABLE OF rsparams,
wa_selscreen LIKE LINE OF lt_selscreen.

DATA : lt_me2n_main TYPE TABLE OF merep_outtab_purchdoc,
wa_me2n_main LIKE LINE OF lt_me2n_main.

TYPES : BEGIN OF ty_me2n1,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
mginv TYPE merep_mginv,
meins TYPE bstme,
wtinv TYPE merep_wtinv,
waers TYPE waers,
mglief TYPE merep_mglief,
wtlief TYPE merep_wtlief,
END OF ty_me2n1.

DATA : it_me2n1 TYPE STANDARD TABLE OF ty_me2n1, "zme2n_extract,
wa_me2n1 LIKE LINE OF it_me2n1.

FREE : lt_selscreen,
it_me2n1.

CLEAR : wa_selscreen,
wa_me2n1.

*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
* Begin...

IF i_initflag = 'X'. " get the data into memory

* Creating Variant


READ TABLE i_t_select INTO wa_i_t_select WITH KEY fieldnm = 'ZZEBELN' BINARY SEARCH.
IF sy-subrc = 0.
* Assign Range value for PO
CLEAR: wa_selscreen.
wa_selscreen-selname = 'EN_EBELN'.
wa_selscreen-kind = 'S'.
wa_selscreen-sign = 'I'.
wa_selscreen-option = 'BT'.
wa_selscreen-low = wa_i_t_select-low. " '4500000000'.
wa_selscreen-high = wa_i_t_select-high. " '4500016403'.
APPEND wa_selscreen TO lt_selscreen.
CLEAR: wa_selscreen.
ENDIF.
* Assign value for EN_SELKB


CLEAR: wa_selscreen.
wa_selscreen-selname = 'EN_SELKB'. " EN_SELKB
wa_selscreen-kind = 'P'.
* wa_selscreen-sign = 'I'.
* wa_selscreen-option = 'BT'.
wa_selscreen-low = 'X'.
* wa_selscreen-high = wa_i_t_select-high.
APPEND wa_selscreen TO lt_selscreen.
CLEAR: wa_selscreen.

* Assign value for EN_SELKL

CLEAR: wa_selscreen.
wa_selscreen-selname = 'EN_SELKL'. " EN_SELKL
wa_selscreen-kind = 'P'.
* wa_selscreen-sign = 'I'.
* wa_selscreen-option = 'BT'.
wa_selscreen-low = 'X'.
* wa_selscreen-high = wa_i_t_select-high.
APPEND wa_selscreen TO lt_selscreen.
CLEAR: wa_selscreen.

* Assign value for LISTU

CLEAR: wa_selscreen.
wa_selscreen-selname = 'LISTU'. " LISTU [ALV]
wa_selscreen-kind = 'P'.
* wa_selscreen-sign = 'I'.
* wa_selscreen-option = 'BT'.
wa_selscreen-low = 'ALV'.
* wa_selscreen-high = wa_i_t_select-high.
APPEND wa_selscreen TO lt_selscreen.
CLEAR: wa_selscreen.


* Step 1 :
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).


* Submit ME2N
* SUBMIT rm06en00 WITH SELECTION-TABLE lt_selscreen
* AND RETURN.

SUBMIT (c_report) WITH SELECTION-TABLE lt_selscreen
AND RETURN.

* Step 2 :
TRY.

cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_me2n_data ).
ASSIGN lr_me2n_data->* TO <lt_me2n_data>.

CATCH cx_salv_bs_sc_runtime_info.
MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.

*Step 3 :

cl_salv_bs_runtime_info=>clear_all( ).

* Step 4 :

* Populate Final table
IF <lt_me2n_data> IS ASSIGNED.
LOOP AT <lt_me2n_data> ASSIGNING <lw_me2n_data>.
IF <lw_me2n_data> IS ASSIGNED.
MOVE-CORRESPONDING <lw_me2n_data> TO wa_me2n1.
APPEND wa_me2n1 TO it_me2n1.
CLEAR wa_me2n1.
ENDIF.
ENDLOOP.

IF it_me2n1 IS NOT INITIAL.
APPEND LINES OF it_me2n1 TO gt_e_t_data.
ENDIF.
ENDIF.
ELSE.

IF gv_nomore = 'X'. " All data was sent.. Exit.
RAISE no_more_data.
ENDIF.

IF i_maxsize IS NOT INITIAL.
LOOP AT gt_e_t_data FROM gv_idx_start.
IF lv_cursize => lv_maxsize.
lv_maxed = 'X'. " we have hit the limit for this packet
gv_idx_start = sy-tabix. " start here on the next run
EXIT.
ELSE.
APPEND gt_e_t_data TO e_t_data. " add a row
lv_cursize = lv_cursize + 1. " add a count
ENDIF.
ENDLOOP.
IF lv_maxed <> 'X'. "the loop didn't exit due to max size so we must be done...
gv_nomore = 'X'.
ENDIF.
ELSE.
APPEND LINES OF gt_e_t_data TO e_t_data. "Just send all the data
gv_nomore = 'X'.
ENDIF.

ENDIF.

----------------------

Please suggest.

raymond_giuseppi
Active Contributor
0 Kudos
  • Are you able to display some data with transaction ME2N with those selection criteria
  • Did you check for authorization failures
  • Did you use same tool in development and quality (e.g. executing a Processa Chain vs executing RSA3)
0 Kudos

Thank you Very Much Raymond Giuseppi ,

It's Resolved.

Implemented logic using class cl_salv_bs_runtime_info , worked fine.

Issues due to Authorization :- Authorization for ALEREMOTE in Dev is different from QA and PRD.

Answers (0)