Report list 2 internal table
how to copy report list to internal table
Hi Durga, chk this,
pls check the below code for example:
codeDATA LIST_TAB TYPE TABLE OF ABAPLIST.
DATA: BEGIN OF olist OCCURS 0,
filler1(1500) TYPE c,
END OF olist.
SUBMIT YTEST04 WITH MATNR EQ 't000001'
EXPORTING LIST TO MEMORY
AND RETURN.
BREAK-POINT.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = LIST_TAB
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1
TABLES
LISTASCI = oLIST
LISTOBJECT = LIST_TAB
EXCEPTIONS
EMPTY_LIST = 1
LIST_INDEX_INVALID = 2
OTHERS = 3.
BREAK-POINT.
ENDIF.[/code]
cheers,
Hema.
Similar Messages
-
Report using internal table events
Hi,
i have an internal table with the fields 1. profitcenter 2. company code 3. gl account 4. amount
for each profit center i need to seggregate accounts based on company code.
the report should look like the one below.
please suggest some code using internal table events at new , at end etc. as im not using alv. your help will be rewarded
regards,
ravi.
-Profitcenter-companycodeglaccount-amount---
-pfcenter1----
glaccount1-1000---
glaccount2-2000---
4444-total--3000---
glaccount1-4000---
glaccount2-1000---
3333-total--5000---
-profitcentre1*total8000---
profitcentre2.........Hi.
TYPES: BEGIN OF G_I_DATA,
PROFIT(4) TYPE C,
COMPANY(4) TYPE C,
ACCOUNT(10) TYPE C,
AMOUNT TYPE P,
END OF G_I_DATA.
DATA: G_IT_DATA TYPE TABLE OF G_I_DATA,
G_WA_DATA TYPE G_I_DATA.
DATA: G_SUM_COMPANY TYPE P,
G_SUM_PROFIT TYPE P,
G_AMOUNT TYPE P.
G_WA_DATA-PROFIT = '0001'.
G_WA_DATA-COMPANY = '1111'.
G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
G_WA_DATA-AMOUNT = 2000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0001'.
G_WA_DATA-COMPANY = '1111'.
G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
G_WA_DATA-AMOUNT = 3000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0001'.
G_WA_DATA-COMPANY = '2222'.
G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
G_WA_DATA-AMOUNT = 4000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0001'.
G_WA_DATA-COMPANY = '2222'.
G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
G_WA_DATA-AMOUNT = 5000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0002'.
G_WA_DATA-COMPANY = '1111'.
G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
G_WA_DATA-AMOUNT = 2000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0002'.
G_WA_DATA-COMPANY = '1111'.
G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
G_WA_DATA-AMOUNT = 3000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0002'.
G_WA_DATA-COMPANY = '2222'.
G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
G_WA_DATA-AMOUNT = 4000.
APPEND G_WA_DATA TO G_IT_DATA.
G_WA_DATA-PROFIT = '0002'.
G_WA_DATA-COMPANY = '2222'.
G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
G_WA_DATA-AMOUNT = 5000.
APPEND G_WA_DATA TO G_IT_DATA.
SORT G_IT_DATA BY PROFIT COMPANY ACCOUNT.
WRITE: /6 'ProfitCenter', 20 'CompanyCode',
34 'Glaccount', 48 'Amount'.
WRITE: /6 SY-ULINE(50).
LOOP AT G_IT_DATA INTO G_WA_DATA.
AT NEW PROFIT.
WRITE: /6 G_WA_DATA-PROFIT.
ENDAT.
G_AMOUNT = G_WA_DATA-AMOUNT.
AT NEW ACCOUNT.
WRITE: /34 G_WA_DATA-ACCOUNT,
48 G_AMOUNT.
ENDAT.
G_SUM_PROFIT = G_SUM_PROFIT + G_WA_DATA-AMOUNT.
G_SUM_COMPANY = G_SUM_COMPANY + G_WA_DATA-AMOUNT.
AT END OF COMPANY.
WRITE: /20 G_WA_DATA-COMPANY,
34 'Totle',
48 G_SUM_COMPANY.
CLEAR G_SUM_COMPANY.
WRITE: /6 '*******'.
ENDAT.
AT END OF PROFIT.
WRITE: /6 G_WA_DATA-PROFIT,
20 'Totle',
48 G_SUM_PROFIT.
CLEAR G_SUM_PROFIT.
WRITE: /6 '*************************************'.
ENDAT.
ENDLOOP. -
Submit report using internal table
Hi Experts!!,
REPORT 1
TYPES: BEGIN OF ty_out_table,
partner LIKE /sapsll/pntbp-partner,
bpvsy LIKE /sapsll/pntbp-bpvsy,
country LIKE adrc-country,
END OF ty_out_table.
internal table declaration & definition
DATA: gt_out_table TYPE STANDARD TABLE OF ty_out_table
WITH KEY partner
bpvsy.
I have data in internal table gt_out_table.
I want to pass data gt_out_table in report 2. using SUBMIT REPORT.
How to do that ?
REPORT 2
select-options: s_partnr for /sapsll/pntbp-bpvsy.
parameters: p_upd,
p_value .
please suggest.
Thanks
Aneehai,
... WITH SELECTION-TABLE rspar
Effect
If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
SELNAME (length 8),
KIND (length 1),
SIGN (length 1),
OPTION (length 2),
LOW (length 45),
HIGH (length 45).
To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
Notes
In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display. -
How to send the edited output fields of an ABAP report into internal table
Hi,
I had edited the output fields of an ALV GRID report now how can i again update the fields of the internal table with this edited new data .
Please suggest me if any method or FM exists for this.
Thanks in advance
With Regards
Ajayhi,
you have to use the following code in the user command
*& Form command
* TO HANDLE USER ACTIONS AGAINST PF-STATUS
* -->UCOMM text
* -->SELFIELD text
FORM COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
DATA : LV_OKCODE TYPE SY-UCOMM.
LV_OKCODE = UCOMM.
CASE LV_OKCODE.
WHEN 'PROCESS'. "button
selfield-refresh = 'X'.
ENDCASE.
ENDFORM. "command
hope this helps
Regards
Ritesh -
SUBMIT and return the value of that report into internal table
Dear all,
I have a requirement. I want to submit a report and return the value of that report into my internal table.
How to do this.
Pl. guide.Hi Vidhya,
Below links from SAP help will resolve your issue.
http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bd1358411d1829f0000e829fbfe/content.htm
Edited by: Harsh Bhalla on Jan 2, 2010 11:54 AM -
Submit report with internal table
Hi Experts !
I have a requirement where report is showing output in ALV1. Based user action I need to process further in background mode.
I have developed a report which I am submitting for this background mode.
I am opening a Job sumbitting created report with return. Job close.
This created report is in scheduled status in SM37. I have to go there and release it.
To pass parameters to newly created report I have used WITH field names with developed report name. But I am not getting parameters at new report. Similarly used import/export --- set/get but still not getting parameters at submitted report.
Is it because it is in background mode? If so how can I achieve this functionality. Can anybody suggest me something ?Hi,
IMPORT and EXPORT from memory doesn't work here.
Have a look into the SAP documentation:
When the program is scheduled in the background task, the selections specified by the user or in the additions for filling the selection screen are stored in an internal variant. When the program is executed in the background request, it is processed fully but the selection screen is processed in the background. The system triggers all events, including that for selection screen processing. The variant stored internally is transferred to the selection screen between the INITIALIZATION and AT SELECTION SCREEN OUTPUT events.
The transfer of the parameters should work, if you don't have any statements that clear those parameters. Maybe parameters with SET/GET parameters also will cause a problem. But it should work with this internal variants. Before you start the jov, please have a look in those generated variants, whether the parameters have the right values.
Regards,
Klaus
Edited by: Klaus Babl on Feb 8, 2011 6:58 AM -
Submit Report including internal table
hi ,
My Req is call Report2 from report1 .
EXPORT itab to MEMORY ID 'DEVIC'.
SUBMIT ZREPORT2 AND RETURN.
free memory id 'DEVIC'.
is this correct?
Thankshi ,
My Req is call Report2 from report1 and utilize itab of report1 in report2..
EXPORT itab to MEMORY ID 'DEVIC'.
SUBMIT ZREPORT2 AND RETURN.
free memory id 'DEVIC'.
is this correct?
Thanks -
IMPORT Statement Issue (Internal Table)
Hi All,
I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
Is there any way by which I can include the whole internal table of that report in my program just like
'INCLUDE STRUCTURE VBRK'.
Thanks in advanceHi, CHeck this code related to your problem..This will helpful to you...
I have done this program earlier..I hope it will helpful to u..
This programa calling the other program to import the data..
Check it out...
*" Tables declarations.................................................
TABLES:
spfli.
*" Type declarations...................................................
Type declaration of the structure to hold data from table SPFLI *
TYPES:
BEGIN OF type_s_spfli,
carrid LIKE spfli-carrid, " Carrier Id
connid LIKE spfli-connid, " Connection Number
cityfrom LIKE spfli-cityfrom, " City from
cityto LIKE spfli-cityto, " City to
airpfrom LIKE spfli-airpfrom, " Airport from
airpto LIKE spfli-airpto, " Airport to
countryfr LIKE spfli-countryfr, " Country from
countryto LIKE spfli-countryto, " Country to
END OF type_s_spfli.
Data Declaration...................................................*
Field String To Hold Flight Details Record from SPFLI *
DATA
fs_spfli TYPE type_s_spfli.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SPFLI *
DATA
t_spfli LIKE STANDARD TABLE OF fs_spfli.
TYPES:
BEGIN OF types_s_itab,
carrid LIKE sflight-carrid, " Carrier id
connid LIKE sflight-connid, " Connection number
fldate LIKE sflight-fldate, " Flight date
END OF types_s_itab.
Data Declaration...................................................*
Field String To Hold Flight Details Record from SFLIGHT *
DATA
fs_itab TYPE types_s_itab.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SFLIGHT *
DATA
t_itab LIKE STANDARD TABLE OF fs_itab.
*" Type declarations...................................................
Type declaration of the structure to hold data from table SBOOK *
TYPES:
BEGIN OF type_s_sbook,
carrid LIKE sbook-carrid, " Carrier Id
connid LIKE sbook-connid, " Connection Number
fldate LIKE sbook-fldate, " Flight date
bookid LIKE sbook-bookid, " Booking number
loccuram LIKE sbook-loccuram, " Local currency
loccurkey LIKE sbook-loccurkey,
order_date LIKE sbook-order_date, " Booking date
END OF type_s_sbook.
Data Declaration...................................................*
Field String To Hold Flight Details Record from BOOK *
DATA
fs_sbook TYPE type_s_sbook.
Data Declaration...................................................*
Internal Table To Hold Flight Details Records from SBOOK *
DATA
t_sbook LIKE STANDARD TABLE OF fs_sbook.
DATA
w_checkbox. " Checkbox
SELECT-OPTIONS:
s_carr FOR spfli-carrid. " Carrier id range
START-OF-SELECTION EVENT *
START-OF-SELECTION.
PERFORM selectq.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
SET PF-STATUS 'YH1314_030502'.
PERFORM display_basic.
AT USER-COMMAND.
PERFORM ucomm.
*& Form selectq
This subroutine retreive data from SPFLI table
There are no interface parameters to be passed to this subroutine.
FORM selectq .
SELECT carrid " Carrier id
connid " Connection number
cityfrom " City from
cityto " City to
airpfrom " Airport from
airpto " Airport to
countryfr " Country from
countryto " Country to
INTO CORRESPONDING FIELDS OF TABLE t_spfli
FROM spfli
WHERE carrid IN s_carr.
ENDFORM. " Selectq
*& Form display_basic
This subroutine displays data from internal table
There are no interface parameters to be passed to this subroutine.
FORM display_basic .
LOOP AT t_spfli INTO fs_spfli.
WRITE:
/ w_checkbox AS CHECKBOX,
fs_spfli-carrid,
fs_spfli-connid,
fs_spfli-cityfrom,
fs_spfli-cityto,
fs_spfli-airpfrom,
fs_spfli-airpto,
fs_spfli-countryfr,
fs_spfli-countryto.
ENDLOOP. " LOOP AT T-SPFLI INTO...
ENDFORM. " Display_basic
*& Form UCOMM
This subroutine for at user-command event
There are no interface parameters to be passed to this subroutine.
FORM ucomm .
RANGES :
r_carr FOR spfli-carrid,
r_conn FOR spfli-connid,
r_carrid FOR sflight-carrid,
r_connid FOR sflight-connid,
r_fldate FOR sflight-fldate.
CASE sy-ucomm.
WHEN 'DISPLAY'.
DATA:
lw_lines TYPE i,
lw_lineno TYPE i VALUE 3.
DESCRIBE TABLE t_spfli LINES lw_lines.
DO lw_lines TIMES.
READ LINE lw_lineno FIELD
VALUE w_checkbox INTO w_checkbox
fs_spfli-carrid INTO fs_spfli-carrid
fs_spfli-connid INTO fs_spfli-connid.
IF sy-subrc = 0.
IF w_checkbox = 'X'.
r_carr-sign = 'I'.
r_carr-option = 'EQ'.
r_carr-low = fs_spfli-carrid.
APPEND r_carr.
r_conn-sign = 'I'.
r_conn-option = 'EQ'.
r_conn-low = fs_spfli-connid.
APPEND r_conn.
ENDIF. " IF W_CHECKBOX = 'X'
ENDIF. " IF SY-SUBRC = 0
ADD 1 TO lw_lineno.
ENDDO. " DO LW_LINES TIMES
SUBMIT yh1314_030502_call
WITH s_carr IN r_carr
WITH s_conn IN r_conn
AND RETURN.
IMPORT t_itab FROM MEMORY ID 'YH1314'.
LOOP AT t_itab INTO fs_itab.
r_carrid-sign = 'I'.
r_carrid-option = 'EQ'.
r_carrid-low = fs_itab-carrid.
APPEND r_carrid.
r_connid-sign = 'I'.
r_connid-option = 'EQ'.
r_connid-low = fs_itab-connid.
APPEND r_connid.
r_fldate-sign = 'I'.
r_fldate-option = 'EQ'.
r_fldate-low = fs_itab-fldate.
APPEND r_fldate.
ENDLOOP. " LOOP AT T_ITAB INTO.....
SELECT carrid " Carriee Id
connid " Connection number
fldate " Flight date
bookid " Booking number
loccuram " Local Currency
order_date " Booking date
INTO CORRESPONDING FIELDS OF TABLE t_sbook
FROM sbook
WHERE carrid IN r_carrid AND
connid IN r_connid AND
fldate IN r_fldate.
IF SY-SUBRC NE 0.
MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
ENDIF. " IF SY-SUBRC NE 0
LOOP AT t_sbook INTO fs_sbook.
AT FIRST.
WRITE: /5 'Carrier Id'(001),
20 'Conn Id'(002),
35 'Flight date'(003),
50 'Book Id'(004),
65 'Local Currency'(005).
ENDAT. " AT FIRST
WRITE: /5 fs_sbook-carrid,
20 fs_sbook-connid,
35 fs_sbook-fldate,
50 fs_sbook-bookid,
65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
ENDLOOP. " LOOP AT T_SBOOK INTO.....
ENDCASE. " CASE SY-UCOMM
ENDFORM. " UCOMM
Regards
Kiran -
How to code header and items in internal table
Hi all,
Iam new to abap.
I have to write a report in internal table , for 1 header item related child items must exist,suppose if header is org then the child like branches in diff cities must be printed under that org and other org ther related branches etc.
can u tell me how i have to approach this with code.
Thanx.Hi MJN,
U can either declare one internal table to hold the header & item data or u can declare two separate interal tables for each one of it.
Suppose i take only one internal table.
First declare a structure with all the relevant fields of the ORG & Branches then create an internal table for it.
Code:
TYPES:
Begin of t_struct,
org_field1 type <datatype> or <dataobj>,
org_field2 type <datatype> or <dataobj>,
branch_field1 type <datatype> or <dataobj>,
branch_field2 type <datatype> or <dataobj>,
END of t_struct.
Data:
t_data like table of t_struct with header line.
select <fields declared in struct> from ORG Inner Join Branch ON <org_field> = <branch_field>
where <some condition> into table t_data.
if sy-subrc <> 0.
message 'No Records Found:" type 'E'.
endif.
endselect.
Loop at t_data into t_data.
at new <org_field1>
write: org_field.
endat.
write: branch_field1, branch_field2.
endloop.
This shall solve the issue.
Thanks
Ravi -
Data populated in internal Table its not diplay in result
Hi ABAPers,
i have one doubt in internal table one field data is populated but in result its diplayed. can any one tell me the solution for this
regards,
kishore.hi this is a simple report on internal table.
REPORT zvenkattest0.
TABLES:pa0002,pa0008.
data:begin of it_pa0002 occurs 0,
pernr like pa0002-pernr,
begda like pa0002-begda,
endda like pa0002-endda,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
end of it_pa0002.
SELECT-OPTIONS: S_pernr FOR pa0002-pernr.
START-OF-SELECTION.
SELECT pernr
begda
endda
vorna
nachn
FROM pa0002
INTO TABLE IT_pa0002
WHERE pernr IN S_pernr.
sort it_pa0002 by pernr begda descending.
loop at it_pa0002.
write:/ it_pa0002-pernr,
it_pa0002-begda,
it_pa0002-endda,
it_pa0002-vorna,
it_pa0002-nachn.
endloop.
reward points if useful,
venkat. -
How can I get Number of Lines from internal table?
Hello at all,
i have in my Report a internal Table, which have many KUNNR.
For example the internal Table:
MANDT.......KUNNR......NAME.........FIRSTNAME........CITY
...040..........12345.........Owen............Michael........Liverpool
...040..........12345.........Owen............Michael........Liverpool
...040..........99999.......Johnson.......... Jeffrey........London
...040..........12345.........Owen............Michael........Liverpool
...040..........55555.......Hardley.......... Kingston.......Birmingham
I want to know, how many same KUNNR are existing in the internal Table?
In my example i need the result 3, because their is existing 3 times the Kunnr 12345 in the internal Table.
Have anyone an idea, how can I resolve this problem?
Edited by: Thomas Zloch on Jun 21, 2010 2:55 PM - one question mark at a time is sufficientHi,
1.Create two internal tables of same type and sort according to Kunnr then Delete the
adjusent duplicates by comparing KUNNR
2.Sort the table by KUNNR and use ON change of Concept in that Just increment the counter.
I am writing the sample logic here.
tables kna1.
data: t_kna1 type table of kna1,
w_kunnr type kna1-kunnr,
counter type i," Holds No.of KUNNRs in the T_kna1
t_kna2 type table of kna1.
select * from kna1 into table kna1 up to 100 rows.
t_kna2[] = t_kna1[].
delete t_kna2 by kunnr.
delete adjusent duplicates from t_kna2 by comparing kunnr."1st Method
read table t_kna2 transporting no-fields.
counter = sy-tfill."1st Method
loop at t_kna1 into kna1."2nd Method
at first.
w_kunnr = kna1-kunnr .
counter = 1.
endat.
if w_kunnr ne kna1-kunnr.
counter = counter + 1.
endif.
endloop.
Note : Here I used a sample table KNA1 in this there are no Duplicates of KUNNR . -
Report output list to internal table using submit report
Hello,
I have a report that generates the output in the form of an abap list. I want this data in an internal table for further processing. the report internally does not do a export data to memory so i cannot use import later on to get the data.
i did the following
SUBMIT <report name> exportING LIST TO MEMORY and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = ascitab
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
This returns the data in the ascitab, but the data contains additional unwanted info like lines and hyphens etc. Also the data is in a table with a single column, so pulling out individuals fields is again an issue. Is there a way to get this data into an internal table directly?
best regards,
Surajhi suraj
export the internal table of report
DATA: BEGIN OF SR_VBAK ,
VBELN LIKE VBAK-VBELN,
END OF SR_VBAK.
DATA: IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
EXPORT IR_VBAK TO MEMORY ID 'SALES'.
SUBMIT <program name in which u want internal table records > AND RETURN.
now import that data in submit program .
here u have to creat a internal table with same structure as the internal table from which u r trying to export the data
DATA: BEGIN OF SR_VBAK,
VBELN LIKE VBAK-VBELN,
END OF SR_VBAK.
DATA : IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
IMPORT IR_VBAK FROM MEMORY ID 'SALES'.
regards
ANIL CHAUDHaRY -
Save report painter output into internal table
Hi,
i have created a report painter for vendor aging report. got output in drill down format.
i need to show the data in smartform as well. so need to save the report painter output into an internal table. can anyone please help me resolving this.
regards,
sudha.mHi Sudha
You can use sample below:
DATA: list_tab TYPE TABLE OF ABAPLIST.
SUBMIT NROWS EXPORTING LIST TO MEMORY
AND RETURN VIA SELECTION-SCREEN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
Best regards -
ALV GRID Report is not showing all records which is in internal table
hi all,
have one doubt. please clarify me. ALV Report is working fine since long tiem. But suddenly this report is showing few records only for the given input. Example: it_main table have 50 records, but output is showing only 10 records only. (we have not made any modifications in this report).
temporarily i have given excel output file from it_main table. excel file is showing all records.
here it_main have all the records. but output is showing few records only. it is not showing any error. i have tested with REUSE_ALV_LIST_DISPLAY function also. but it also showing same results(few records only.)
please give me some idea.
FORM display_alv_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
is_layout = wa_layout
it_fieldcat = it_fcat
it_events = it_events
i_save = 'A'
is_variant = wa_variant
TABLES
t_outtab = it_main
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE text-204 " 'Error in Display the list'
TYPE 'I'.
LEAVE TO LIST-PROCESSING.
ENDIF.
ENDFORM. . "DISPLAY_ALV_REPORT
Best Regards,
Srinivashi
Please study this program and give me suggestions.
ALV Declaration
DATA : it_events TYPE slis_t_event, "ALV event
it_fcat TYPE slis_t_fieldcat_alv, "Field catalog
it_list_top_of_page TYPE slis_t_listheader,
c_tabname TYPE slis_tabname VALUE 'IT_MAIN'.
DATA : wa_layout TYPE slis_layout_alv,
wa_event TYPE slis_alv_event,
wa_fcat TYPE slis_fieldcat_alv,
wa_variant TYPE disvariant.
START-OF-SELECTION.
PERFORM material_pass.
PERFORM data_retrieval.
END-OF-SELECTION.
PERFORM sub_display_report.
FORM sub_display_report .
DATA status(1).
IF r1 = 'X'.
PERFORM build_fieldcatalog USING :
'1' 'ERDAT' 'S.O DATE' '' '10' 'X',
'2' 'VBELN' 'SALE ORDER' '' '10' 'X',
'3' 'POSNR' 'SALE ITEM' '' '6' '',
'4' 'BSTKD' 'CUSTOMER PO' '' '35' '',
'5' 'BEZEI' 'REASON FOR REJECTION' '' '40' '',
'6' 'PLNUM' 'PLANNED ORDER' '' '10' '',
'7' 'AUFNR' 'PROD.ORDER.' '' '12' '',
'8' 'MATNR' 'MATERIAL NUMBER' '' '18' '',
'9' 'MAKTX' 'MATERIAL DESCRIPTION' '' '40' '',
'10' 'WERKS' 'PLANT' '' '4' '',
'11' 'KWMENG' 'SALE ORDER QTY' '' '15' '',
'12' 'VRKME' 'UNIT' '' '4' '',
'13' 'GAMNG' 'PROD.ORDER QTY' '' '13' '',
'14' 'IGMNG' 'CONFIRMED ORDER QTY' '' '13' '',
'15' 'GMEIN' 'UNIT' '' '4' '',
'16' 'MENGE' 'G.R QUANTITY' '' '13' '',
'17' 'SOBAL' 'S.O BALANCE' '' '13' '',
'18' 'PRDBAL' 'PROD.BALANCE' '' '13' '',
'19' 'GSM' 'GSM' '' '4' '',
'20' 'SIZE1' 'SIZE1' '' '10' '',
'21' 'SIZE2' 'SIZE2' '' '10' ''.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = pathname
filetype = ftype
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = it_mains
EXCEPTIONS
file_write_error = 1.
IF sy-subrc = 0.
status = 'S'.
ELSE.
status = 'E'.
ENDIF.
ELSEIF r2 = 'X' OR r3 = 'X'.
PERFORM build_fieldcatalog USING :
'1' 'ERDAT' 'S.O DATE' '' '10' 'X',
'2' 'VBELN' 'SALE ORDER' '' '10' 'X',
'3' 'POSNR' 'SALE ITEM' '' '6' '',
'4' 'BSTKD' 'CUSTOMER PO' '' '35' '',
'5' 'BEZEI' 'REASON FOR REJECTION' '' '40' '',
'6' 'PLNUM' 'PLANNED ORDER' '' '10' '',
'7' 'AUFNR' 'PROD.ORDER.' '' '12' '',
'8' 'MATNR' 'MATERIAL NUMBER' '' '18' '',
'9' 'MAKTX' 'MATERIAL DESCRIPTION' '' '40' '',
'10' 'WERKS' 'PLANT' '' '4' '',
'11' 'KWMENG' 'SALE ORDER QTY' '' '15' '',
'12' 'VRKME' 'UNIT' '' '4' '',
'13' 'GAMNG' 'PROD.ORDER QTY' '' '13' '',
'14' 'IGMNG' 'CONFIRMED ORDER QTY' '' '13' '',
'15' 'GMEIN' 'UNIT' '' '4' '',
'16' 'MENGE' 'G.R QUANTITY' '' '13' '',
'17' 'SOBAL' 'S.O BALANCE' '' '13' '',
'18' 'PRDBAL' 'PROD.BALANCE' '' '13' '',
'19' 'GSM' 'GSM' '' '4' '',
'20' 'SIZE1' 'SIZE1' '' '10' '',
'21' 'CUT1' 'CUT1' '' '11' '',
'22' 'SIZE2' 'SIZE2' '' '10' '',
'23' 'CUT2' 'CUT2' '' '11' '',
'24' 'SIZE3' 'SIZE3' '' '10' '',
'25' 'CUT3' 'CUT3' '' '11' '',
'26' 'SIZE4' 'SIZE4' '' '10' '',
'27' 'CUT4' 'CUT4' '' '11' '',
'28' 'SIZE5' 'SIZE5' '' '10' '',
'29' 'CUT5' 'CUT5' '' '11' '',
'30' 'SIZE6' 'SIZE6' '' '10' '',
'31' 'CUT6' 'CUT6' '' '11' ''.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = pathname
filetype = ftype
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = it_mainall
EXCEPTIONS
file_write_error = 1.
IF sy-subrc = 0.
status = 'S'.
ELSE.
status = 'E'.
ENDIF.
ENDIF.
PERFORM build_layout.
PERFORM build_events.
PERFORM sub_comment_build USING it_list_top_of_page.
PERFORM sub_set_variant.
PERFORM display_alv_report.
IF status = 'S'.
MESSAGE 'Excel Output file Downloaded to Given Path' TYPE 'I'.
ELSE.
MESSAGE 'Download Not Possible' TYPE 'I'.
ENDIF.
ENDFORM. " SUB_DISPLAY_REPORT
FORM BUILD_FIELDCATALOG
FORM build_fieldcatalog USING p_col_pos
p_fieldname
p_text
p_datatype
p_outputlen
p_col_freez.
wa_fcat-row_pos = '1'.
wa_fcat-col_pos = p_col_pos.
wa_fcat-fieldname = p_fieldname.
wa_fcat-tabname = c_tabname.
wa_fcat-reptext_ddic = p_text.
wa_fcat-datatype = p_datatype.
wa_fcat-ddic_outputlen = p_outputlen.
wa_fcat-key = p_col_freez.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
FORM build_layout.
CLEAR: wa_layout.
wa_layout-window_titlebar = 'LIST OF GSM WISE OPEN SALE ORDERS'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-totals_text = 'CUMULATIVE'.
ENDFORM. "BUILD_LAYOUT
*& Form BUILD_EVENTS
FORM build_events.
CLEAR wa_event.
REFRESH it_events.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc = 0.
READ TABLE it_events INTO wa_event
WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
APPEND wa_event TO it_events.
CLEAR wa_event.
ENDIF.
ENDIF.
ENDFORM. "BUILD_EVENTS
-->P_IT_LIST_TOP_OF_PAGE text
FORM sub_comment_build USING it_top_of_page TYPE slis_t_listheader.
DATA ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = str1.
APPEND ls_line TO it_top_of_page.
CLEAR ls_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header[].
ENDFORM. " SUB_COMMENT_BUILD
*& Form SUB_SET_VARIANT
text
--> p1 text
<-- p2 text
FORM sub_set_variant .
CLEAR wa_variant.
wa_variant-report = sy-repid.
wa_variant-username = sy-uname.
wa_variant-variant = c_variant.
wa_variant-variant = p_layout.
ENDFORM. " SUB_SET_VARIANT
*& Form DISPLAY_ALV_REPORT
*Display Report Using ALV GRID
FORM display_alv_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
i_callback_pf_status_set = c_pf_status
i_callback_user_command = c_user_command
is_layout = wa_layout
it_fieldcat = it_fcat
it_sort = it_sort[]
it_events = it_events
i_save = 'A'
is_variant = wa_variant
TABLES
t_outtab = it_main
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE text-204 " 'Error in Display the list'
TYPE 'I'.
LEAVE TO LIST-PROCESSING.
ENDIF.
ENDFORM. . "DISPLAY_ALV_REPORT
*ALV Report Header
FORM top_of_page.
DATA : t_header TYPE slis_t_listheader WITH HEADER LINE,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.
wa_header-typ = 'H'.
T_HEADER-INFO = 'LIST OF GSM WISE OPEN SALE ORDERS'.
wa_header-info = str1.
APPEND wa_header TO t_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header[].
ENDFORM. "TOP_OF_PAGE
here it_main internal table having all data. but output is showing few records only.
pl. give some idea.
Thanks & Regards
Srinivas. -
Report output from memory to internal table (corresponding fields)
How can we pick any standard report output such as
RM07DOCS on to memory and from memory to an internal
table.Here by internal table ,i do not mean of type c
containing complete report but data should go from output to corresponding fields of internal table structure of whom is defined as same of the output.SUBMIT rfbila00 AND RETURN
EXPORTING LIST TO MEMORY
WITH sd_ktopl-low = ' '
WITH sd_bukrs IN s_bukrs
WITH sd_prctr IN s_prctr
WITH bilavers = p_fsv
WITH bilaspra = 'EN'
WITH bilbjahr = p_fyear
WITH b-monate IN s_per
WITH bilvjahr = v_cfyear
WITH v-monate = l_per
WITH bilagvar = P_LAYOUT
WITH bilagrid = 'X'
WITH bilabkon = '2'
WITH bilagkon = '3'
WITH bilasumm = '0'
WITH bilavart = '1'
WITH bilaskal = '3/0'.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = t_list
EXCEPTIONS
not_found = 1.
REFRESH t_ascii.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = t_ascii " list converted to ASCII
listobject = t_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
u will get the output in t_list...u have to split as per ur requir......
this will help u.....
Reward IF...........
Regards
Anbu
Maybe you are looking for
-
Exception not being thrown in try statement
I am trying to write a small program to handle exceptions. However, the program will not compile because it is giving me an error saying the exception InvalidDocumentCodeException will never be thrown in body of coresponding try statement. Here are t
-
I can't swipe to next page after placing my edge animation in dps
I've created an animation in Edge and exported it as a .oam file. I've placed it into dps (full page size) and although it plays fine I'm no unable to swipe between pages. Initially I thought instead of using the animation at the full page size I cou
-
Hello! I would like to set up qRFC for Business Process Monitoring in SAP Solution Manager. When I enter tcode RZ21 --> Technical Infrastructure --> Configure QRFC Monitoring I can see entry "SAP" with "X". Unfortunately it is not possible to deactiv
-
Hi, and first off --- thanks for reading this! The issue I have encountered with AS has been mentioned by a few people on this vast land of the internet, but I have found no solution, yet. When a text field / textarea is set to render as HTML, I can
-
Hi there, I have some problems in a Cisco UC540 with "Skinny Msg Server" having some CPU peaks. During peak all services are unavailable (calls, intermet access, etc. - this UC540 is our internet gateway): 100