2019 Aug 27 7:42 AM
Hello!
In my custom report I need to use data from SAP standart report (hplcrpa0).
I've tried SUBMIT in my custom report and then LIST_FROM_MEMORY but unfortunately I'm getting exception - "not_found".
Here is the code I've used :
data: list_tab type table of abaplist.
submit hplcrpa0 exporting list to memory and RETURN
with pnppernr-low = '2681'
with pnpwerks-low = '0040'
with rep_id = '01'
with pnpbegda = '20190101'
with pnpendda = '20191231'.
call function 'LIST_FROM_MEMORY'
tables listobject = list_tab
exceptions
not_found = 1
others = 2.
I've also tried
try.
cl_salv_bs_runtime_info=>get_data_ref(
importing r_data = lo_data ).
assign lo_data->* to <lt_hplcrpa0>.
catch cx_salv_bs_sc_runtime_info.
message `Unable to retrieve ALV data` type 'E'.
endtry.
But it gives dumps all the time.
Could anyone help me please?
2019 Aug 27 10:01 AM
Not sure this report (HR-(PL?) will generate a spool (transactional use of Control Framework) also it should try to display a log when no record found...
In second case, did you also call
In any case you should provide more information on the dump (wrong parameters, data, structure, etc.) -> e.g. how did you define <lt_hplcrpa0> (should be a type cl_hr_br_p1510_hbrtrpa0=>gty_t_teven_text;etc.)
NB: As this report can generate a XML file, is it possible to generate the XML and read it in your caller report?
2019 Aug 27 8:25 AM
Hi there,
I couldn't find that report for trying out in my system(mine is S/4 HANA 1809).
But anyways, I have done a similar required just a few days ago & and it worked fine...
Firstly, I would suggest you to do a root cause analysis of the issue:-
1.) Whether the report is working properly in foreground.
2.) The parameter values which you pass is it getting the proper data.
3.) Check the DATE format while passing.
4.) Look for any conversion routines, if required.
5.) And last but not the least check the SAP community for similar question&answers.
https://answers.sap.com/questions/906614/submit-rep-exporting-list-to-memory-newbie-questio.html
https://answers.sap.com/questions/1933153/submitand-exporting-list-to-memory-how-to-get-resu.html
Here is my trails & it's working fine....
SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }
SUBMIT rmplan00
WITH plnty = 'Q'
WITH material = ls_mapl-matnr"'67999'
WITH werk = '3110'
EXPORTING LIST TO MEMORY
AND RETURN.
SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; }
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_ABAPLIST"list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = lt_asci
listobject = lt_ABAPLIST.
2019 Aug 27 8:27 AM
Hello!
The problem with tutorials is the fact they all use Z reports - thats working for me, but when I want to run standard report its not working anymore.
1. Yes its working correct
2. Yes, when i debug I see content of report is correct
3. It's fine
2019 Aug 27 8:26 AM
Code Snippet:-
SUBMIT rmplan00
WITH plnty = 'Q'
WITH material = ls_mapl-matnr"'67999'
WITH werk = '3110'
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_ABAPLIST"list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = lt_asci
listobject = lt_ABAPLIST.
2019 Aug 27 8:38 AM
As you can see it's the same as I post 🙂 but with "List_From_Memory" I'm getting sy-subrc = 1 (not_found) as i said in the first post
2019 Aug 27 8:30 AM
The solutions you mention above work only for precise cases (the first solution is for a report which outputs an ABAP List issued to the first default screen sequence, the second solution is for a report which outputs an ALV, provided that you use a minimal SAP version). There are other types of reports. Now, the question is to know in which context you are, and what technology is using this report HPLCRPA0 (that I don't know). Maybe if you share a screenshot it will help people to guess what technology it uses.
2019 Aug 27 8:37 AM
It's an ALV.
I guess the problem is that ALV doesn't have "flat" structure.
2019 Aug 27 10:01 AM
Not sure this report (HR-(PL?) will generate a spool (transactional use of Control Framework) also it should try to display a log when no record found...
In second case, did you also call
In any case you should provide more information on the dump (wrong parameters, data, structure, etc.) -> e.g. how did you define <lt_hplcrpa0> (should be a type cl_hr_br_p1510_hbrtrpa0=>gty_t_teven_text;etc.)
NB: As this report can generate a XML file, is it possible to generate the XML and read it in your caller report?
2019 Aug 27 11:25 AM
It does not generate a spool so thats the reason why I can't get it with LIST_FROM_MEMORY.
As for your instructions :
Yes of course I called set( ) & clear_all( ) methods.
lt_hplcrpa0 is of type any table.
the dump I'm getting is CX_SY_STRUCT_COMP_NAME in method CHECK_COMPONENT_TAB of class cl_abap_structdescr.
2019 Aug 27 1:10 PM
In which code/program was the dump raised (your code, the called program, execution of class cl_salv_bs_runtime_info, etc.)
Could you consider some inheritance from CL_HR_BR_P1510_HBRTRPA0 (CLASS xxx INHERITING FROM) in your caller?
2019 Aug 28 12:29 PM
Hello,
short text:
"In the source code, the termination point is in line 71 of (Include) program "CL_ABAP_STRUCTDESCR===========CM00I". The termination is due to exception "CX_SY_STRUCT_COMP_NAME" occurri procedure "CREATE_DATA_FOR_COMPONENT" "(METHOD)". This exception was not handled locally or declared in the RAISING clause in the procedure's signature however."
"Level 1 Class CX_SY_STRUCT_COMP_NAME
Program CL_ABAP_STRUCTDESCR===========CP Include CL_ABAP_STRUCTDESCR===========CM00I Row 71
Short Te Component Name '3B_AMOUNT' of the Component 7 Contains an Invalid Character"
"Component Name '3B_AMOUNT' of the Component 7 Contains an Invalid Character"
2019 Aug 28 12:48 PM
Could you put the whole dump as an attachment to your post. (or post the abap stack part of the dump)
Also try to set a break-point before the statement that raise the dump.
2019 Aug 28 12:56 PM
The problem is with component name - '3B_AMOUNT' (screen attached in main post)
2019 Aug 28 12:57 PM
2019 Aug 28 1:08 PM
it's my fault, I was not precise enough
Nevertheless if SAP defined its work area 'wild' with an invalid name, first character numeric and dump arise in a standard code and not in your called, that cannot be guessed from what you posted, you won't be able to export it, and so should look for another option
Proposal: with enhancement in standard program:
2019 Aug 28 1:14 PM
Unfortunately as of "security" reasons I cannot post whole dump, but the part i shared above should be enough about why that's happening and where.
I just don't know how to fix it
2019 Aug 28 1:38 PM
Then could you post the abap stack part of the dump, look for 'Active Calls/Events' block
Nb: in text format it's very easy to remove sensible data with notepad...
2019 Aug 28 1:59 PM
That's exactly the solution I was thinking about but since most of blogs on forum advise against exporting to memory and then read in my custom report I was thinking about a nicer way (cl_salv_bs_runtime_info).
Active Calls/Events screen :
2019 Aug 28 2:10 PM
As "GET_DATA_REF" triggered an exception related to field names when trying to build the internal table, could you try to use parameter R_DATA_LINE instead, or even method "GET_DATA".
NB: For your reference, this utility class use some export to/import from memory internally.
import t_component to lt_component from memory id cl_salv_bs_runtime_info=>c_memid_data_def.
So you could even build your own logic to recover data, with better error handling than the SAP tool.
2019 Aug 27 1:47 PM
If it's ALV, CL_SALV_BS_RUNTIME_INFO is the thing to try. Before the SUBMIT, did you first call:
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_true
data = abap_true ).
(as shown by Muralikrishnan Ponedath Vijayan)
2019 Aug 27 2:33 PM
2019 Aug 27 2:34 PM
Yes I did call set method first.
When I call it with display true i see correct report so I'm sure it's working just fine, I just can't read that in my Z-report.
2019 Aug 27 2:44 PM
Raymond gave you all the information you need. You must attach the short dump. You must define your field symbol as a table (at least generically), and access dynamically its components. Do some debug to display LO_DATA->*