ALV list followed by ABAP list
Hi,
I have created an ALV list using REUSE_ALV_LIST_DISPLAY with checkbox.
After processing the checkbox selection in ALV list, I would like to display my results in the normal ABAP list. How can i use the usual TOP-OF-PAGE and END-OF-PAGE in the ABAP list?
Use the event TOP-OF-PAGE DURING LINE-SELECTION to display the heading in the secondary list.
The system triggers this event for each detail list. If you want to create different page headers for
different list levels, you must program the processing block of this event accordingly, for example
by using system fields such as SY-LSIND or SY-PFKEY in control statements (IF, CASE).
As on the basic list, the page header of a detail list remains displayed even when you scroll
vertically.
top-of-page at line-selection.
case sy-lsind.
when 1.
write:/ 'Heading for first list'.
when 2.
write:/ 'Heading for second list'.
when 3.
write:/ 'Heading for third list'.
endcase.
Similar Messages
-
Differences between ABAP lists and ALV lists
what is the differences between ABAP lists and ALV lists?
Edited by: pong pong on Apr 9, 2008 5:08 AMHello Pong Pong,
Please go thru help topics:
ALV Grid
http://help.sap.com/saphelp_47x200/helpdata/en/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
ABAP Lists
http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb408a455611d189710000e8322d00/frameset.htm
Regards,
Siddhesh -
Query regarding SAP ABAP ALV List display
Hi All,
Have a requirement where in, when a user double clicks on a particular field as shown below, the particular cell where he has clicked has to be changed to editable and input mode. I am using ALV LIST DISPLAY.
Please reply me if someone has worked on similar requirement.Hi Priya,
Check this link: http://www.saptechnicl.com/Tutorials/ALV/Edit/demo.htm. I think this is exactly what you require.
Hope this helps! Do let me know if you need anything else!!
(rename "technicl" as "technical", my apologies for the typo).
Cheers,
Shailesh. -
How to print text on container using oop on alv list
Hello Guru's,
pl guide me how to print text on container using alv list-display which have interactive events using oop classes/methods ...
I want to print hard coded text on coantainer , on double clicking it will call another screen.
Pl Help..
Message was edited by:
paresh sonavaneHi Paresh,
1. Go to the Layout and Create One custom container box and give name it.
2. Custom Container is the one type of tool and its used for Displaying the Reports
with the use of ABAP Objects.
3. Go to se38 and Write The Following Code.
tables ZTEAM_GD.
DATA : OBJ TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJ1 TYPE REF TO CL_GUI_ALV_GRID.
DATA IT_TEAM LIKE TABLE OF ZPLAYER_BAT_DET .
SELECT * FROM ZPLAYER_BAT_DET INTO TABLE IT_TEAM.
CREATE OBJECT OBJ
EXPORTING
CONTAINER_NAME = 'ALV'. -
> Give ur Container Name
CREATE OBJECT OBJ1
EXPORTING
I_PARENT = OBJ.
CALL METHOD OBJ1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'ZPLAYER_BAT_DET'
CHANGING
IT_OUTTAB = IT_TEAM.
*CALL METHOD OBJ1->SET_DROP_DOWN_TABLE
EXPORTING
I_STRUCTURE_NAME = 'ZTEAM_GD'
CHANGING
IT_OUTTAB = IT_TEAM.
CALL SCREEN 9000.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE SY-UCOMM.
WHEN 'EXT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPU
Thanks.
Reward If Helpful. -
Alv List print printer information in 1st page
Hi,
At the time of alv list printing the following information is printed on 1st page. How to avoid this information when printing.
INITSTRING
Start r_3-Prolog
Drucker : Wipro EX-330+DX
System : RAP (reprdfo)
User : 11BO
End r_3-Prolog
Thanks in advance.Hi GoldMoon,
(edit) Print another basic ABAP list (print anything else) on the same printer to see if that first page is printed. If yes, it's probably either SAP, OS, or Print Server cover page. They are explained in "cover page" SDN wiki, there are explanations how the cover page can be output (and so you can deduce how to remove it).
Best regards,
Sandra
Edited by: Sandra Rossi, 5 minutes later -
hai,
i get following dump error when tryign to print a alv list report.
'Illegal interruption of the event LOAD-OF-PROGRAM.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLSZA12" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
During the flow of the event LOAD-OF-PROGRAM (event for the
initialization of an ABAP program), a condition occurred under which
the event was to be left early. This is not permitted as it would
result in an inconsistent status in the ABAP program.'
the problem resolves for a particular output(when i restrict the list to lesser rows) by changing FORMAT from
X_65_255 to X_90_120 in the print dialog properties option..
anycase i will have to print the output for all conditions.hi,
did check..
i am using a report program(and directly executing from se38)
it doesnt come under module pool.
however u r link suggests that,when the function module for ALV LIST DISPLAY is called,the error is triggered(LOAD OF PROGRAM)..
hmm checking further in these lines..
thanks for the inputs.. -
ALV list -Runtime error using the Spreadsheet button(CTRL+SHIFT+F7)
Hi,
We are on ECC6.0.When ever I try to use the button 'Spreadsheet' (CTRLSHIFTF7) it gives me the following runtime error.It works fine if I use the export button.Also it works for ALV grid.Issue is only with ALV list.
Can you pelase advise waht could be the issue.
Thanks
Venkat
Runtime Errors GETWA_NOT_ASSIGNED
Date and Time 08.06.2009 16:02:22
Short text
Field symbol has not yet been assigned.
What happened?
Error in the ABAP Application Program
The current ABAP program "CL_SALV_BS_TT_RESULT_TABLE====CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
You attempted to access an unassigned field symbol
(data segment 32781).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
Trigger Location of Runtime Error
Program CL_SALV_BS_TT_RESULT_TABLE====CP
Include CL_SALV_BS_TT_RESULT_TABLE====CM00L
Row 165
Module type (METHOD)
Module Name GET_CELL_VALUE
Source Code Extract
Line
SourceCde
135
call method cl_alv_xslt_transform=>get_days_since_1900
136
exporting
137
i_date = l_date
138
receiving
139
e_num = attribute01.
140
141
elseif ls_attribute-s_dfies-inttype eq cl_abap_typedescr=>typekind_time. "Time
142
data:
143
l_time type t.
144
145
l_time = <l_data>.
146
147
call method cl_alv_xslt_transform=>get_isotime_from_inttime
148
exporting
149
i_value = l_time
150
receiving
151
e_value = value.
152
153
*... fill attribute01 with percent value of actual day
154
call method cl_alv_xslt_transform=>get_percent_of_act_day
155
exporting
156
i_time = l_time
157
receiving
158
e_num = attribute01.
159
160
elseif ls_attribute-s_dfies-inttype ca if_salv_bs_log_exp_operand=>c_numeric and
161
ls_attribute-s_dfies-convexit is initial.
162
case ls_attribute-s_dfies-reference_field_type.
163
when if_salv_bs_c_data=>reffieldtype_curr.
164
*... get iso value for currency value
>>>>>
call method cl_alv_xslt_transform=>get_isonum_from_intnum
166
exporting
167
i_value = <l_data>
168
i_currency = <l_reference>
169
i_decimals = ls_attribute-s_dfies-decimals
170
importing
171
e_value = l_isovalue.
172
173
when if_salv_bs_c_data=>reffieldtype_quan.
174
*... get iso value for quantity value
175
call method cl_alv_xslt_transform=>get_isonum_from_intnum
176
exporting
177
i_value = <l_data>
178
i_unit = <l_reference>
179
i_decimals = ls_attribute-s_dfies-decimals
180
importing
181
e_value = l_isovalue.
182
183
when others.
184
*... get iso value for valueHi Pinaki,
Thanks for your reply.
below is my code.
data: t_fieldcat type slis_t_fieldcat_alv,
w_fieldcat like line of t_fieldcat,
w_layout type slis_layout_alv,
t_sort type slis_t_sortinfo_alv,
w_sort like line of t_sort,
t_events type slis_t_event,
w_events like line of t_events.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZSD_ORDERS'
i_bypassing_buffer = 'X'
changing
ct_fieldcat = t_fieldcat.
data: l_lines_fieldcat type i.
describe table t_fieldcat lines l_lines_fieldcat.
clear: w_fieldcat.:
w_fieldcat-col_pos = l_lines_fieldcat + 1.
w_fieldcat-datatype = 'QUAN'.
w_fieldcat-just = ' '.
w_fieldcat-do_sum = ' '.
w_fieldcat-fieldname = 'ZZSCLQTY'.
w_fieldcat-tabname = 'T_DATA'.
w_fieldcat-qfieldname = 'VRKME'.
w_fieldcat-seltext_s = text-a01.
w_fieldcat-seltext_m = text-a01.
w_fieldcat-seltext_l = text-a01.
append w_fieldcat to t_fieldcat.
Modify column headings
loop at t_fieldcat into w_fieldcat.
case w_fieldcat-fieldname.
when 'MATNR'.
w_fieldcat-no_zero = 'X'.
when 'ZZPRICECHECK'.
w_fieldcat-reptext_ddic = text-l01.
when 'KZWI5'.
w_fieldcat-reptext_ddic = text-l02.
when 'VBELN'.
w_fieldcat-hotspot = 'X'.
when 'BMENG'.
w_fieldcat-do_sum = 'X'.
when 'COUNTER'.
w_fieldcat-do_sum = 'X'.
w_fieldcat-reptext_ddic = text-l03.
when 'OBJDE'.
w_fieldcat-reptext_ddic = 'Obj ID'.
endcase.
modify t_fieldcat from w_fieldcat.
endloop.
Format output options
clear w_layout.
w_layout-colwidth_optimize = 'X'.
w_layout-zebra = 'X'.
w_layout-get_selinfos = 'X'.
w_layout-detail_initial_lines = 'X'.
w_layout-group_change_edit = 'X'.
Specify list processing events
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
append w_events to t_events.
Fit Add List Variant from Selection Screen "003
clear: w_variant.
w_variant-report = sy-repid.
w_variant-variant = sp_vari.
end Fit02
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = w_repid
is_layout = w_layout
it_sort = t_sort
i_callback_user_command = 'USER_COMMAND'
is_variant = w_variant
i_save = 'A'
it_fieldcat = t_fieldcat[]
it_events = t_events[]
tables
t_outtab = t_data.
endform. -
Alv list report-problems while printing
hai,
i get following dump error when tryign to print a alv list report.
'Illegal interruption of the event LOAD-OF-PROGRAM.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLSZA12" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
During the flow of the event LOAD-OF-PROGRAM (event for the
initialization of an ABAP program), a condition occurred under which
the event was to be left early. This is not permitted as it would
result in an inconsistent status in the ABAP program.'
the problem resolves for a particular output(when i restrict the list to lesser rows) by changing FORMAT from
X_65_255 to X_90_120 in the print dialog properties option..
however this restricts the coloumn width..
anycase i will have to print the output for all conditions.
the problem seems to be centred around number of rows in the list output..is somethign wrong with the values in this internal table gt_comtypes_tab...
this is where the dump is pointing..at LAOD OF PROGRAM EVENT
1 FUNCTION addr_get_conversion_table.
2 *"----
3 ""Lokale Schnittstelle:
4 *" EXPORTING
5 *" VALUE(COMTYPES_TAB) TYPE ADCOMTYPES_TAB
6 *" EXCEPTIONS
7 *" INTERNAL_ERROR
8 *"----
9
10 comtypes_tab = gt_comtypes_tab.
11
12 ENDFUNCTION.
values of gt_comtypes_tab.
2 TEL ADTEL
3 FAX ADFAX
4 TTX ADTTX
5 TLX ADTLX
6 INT ADSMTP
7 RML ADRML
8 X40 ADX400
9 RFC ADRFC
10 PRT ADPRT
11 SSF ADSSF
12 URI ADURI
13 PAG ADPAG -
Hi,
how to refresh an ALV LIST display?
Thanks.Hi,
Content and Structure Change
Use
You are able to change the internal data table in various ways. Depending on which type of change you use, you have to proceed differently to make the change visible on the front end in the ALV output as well.
You are able to make the following changes:
· You change content or the sequence of the individual data records
Afterwards you need to refresh the ALV output
· You replace the entire data table
Refresh Display of the ALV Output
If you have changed single values, added rows or deleted rows in the data table of list-type ALV outputs, you need to complete these changes in the ALV output as well by refreshing the ALV display.
For Changes in the Tree Structure you do not have to refresh the display. In the other ALV tools, you do not have to refresh the ALV output when you make the following changes:
§ Changes to the Display of Columns
§ Changes Sequence of Columns in the ALV display
§ Changes to the DDIC Reference of Columns
By default, the ALV output automatically scrolls to the beginning. However, you are able to determine that the current display (position on the screen) not be changed.
You are able to refresh the ALV output in two ways:
· All settings for filters and sorting remain.
This setting can lead to newly inserted data records not being displayed because the filter setting hid exactly these data records.
· All settings for filters and sorting remain.
Features
For changes to content and structure, you are able to make the following settings:
· Refresh ALV output
· Swap the data table of the ALV output
Refresh ALV output
With the refresh, you ensure that the changed values are available on the front end as well.
Display type
ALV Tool
Classic ABAP list
Full screen
In the Container
Simple, two-dimensional table
Yes
Yes
Yes
Hierarchical-sequential list
Yes
Tree structure
No
No
Methods
Function
Class
Method
Refresh ALV output without deleting filter and sort settings
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
REFRESH
(Parameter REFRESH_MODE: SOFT)
Refresh ALV output and delete filter and sort settings
REFRESH
(Parameter REFRESH_MODE: FULL)
Change the Structure of the Data Table with SET_DATA
Depending on which ALV tool you are using, the parameters of the SET_DATA method are different:
If you assign a new structure with SET_DATA, all objects that referred to the previous structure will be deleted such as all sort objects in list-type ALV outputs or all node objects in tree structures.
Methods
Function
Class
Method
Change structure and data table
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
CL_SALV_TREE
CL_SALV_HIERSEQ_LEVEL
SET_DATA
Change the Structure of the Data Table with the SET_DATA Method
ALV Tool
Parameter
Remarks
Simple, two-dimensional table
T_TABLE
Table for structure and contents of the ALV output
Hierarchical-sequential list
(in CL_SALV_HIERSEQ_TABLE)
LEVEL
Hierarchy level whose structure you wish to change
T_TABLE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
(in CL_SALV_HIERSEQ_LEVEL)
VALUE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
Tree structure
T_TABLE
Initial table
Empty table, only sets the structure -
How to edit particular field in alv list display-urgent
HI ALL,
my requirement is i am displaying output using alv list display. now my rewuirement :
i am displaying out in edit mode only. when user clicks one particular field
for example record is like
runrate a01 maheed -> if user clicks on a01 this field should be editable. i have a following code
w_field-edit = w_edit.
w_field-input = 'X'. -> using this code i can able to display entire colomn in edit mode. this not suits my requirement.anybody can send me the sample code please.
thanks,
maheedhar.tCan you please send me the sample code plz.
i am sending my code below.
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
data : checkbox type c value 'X',
action type c,
end of it_secobjects.
data : begin of it_secobjects1 occurs 0.
include structure ZUSER_SECOBJECTS.
data : checkbox type c VALUE 'X',
end of it_secobjects1.
data : wa_ita like line of it_secobjects.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
maheed-start.
*when 'SAVE'.
*LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
CLEAR IT_SECOBJECTS1.
DELETE IT_SECOBJECTS.
*ENDLOOP.
*DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
WHEN 'DELETE'.
loop at it_SECOBJECTS where checkbox eq 'X'.
delete it_SECOBJECTS.
endloop.
*RS_SELFIELD-REFRESH = 'X'.
maheed-end.
maheed-start. apr 13
WHEN 'DELETE'.
loop at it_SECOBJECTS where checkbox eq 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
delete it_SECOBJECTS.
endloop.
RS_SELFIELD-REFRESH = 'X'.
when 'SAVE'.
DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
commit work.
refresh :IT_SECOBJECTS1.
maheed-end. apr 13
*when 'SAVE'.
*LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
APPEND IT_SECOBJECTS1.
CLEAR IT_SECOBJECTS1.
DELETE IT_SECOBJECTS.
*ENDLOOP.
*DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
ENDCASE.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog." USING w_edit TYPE any.
data : w_edit type c.
clear w_edit.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-EDIT = 'X'. "maheed
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_PARTNER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m03.
w_field-edit = w_edit.
w_field-input = 'X'.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'INACTIVE'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 3.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
DATA : LC_GLAY TYPE LVC_S_GLAY.
LC_GLAY-EDT_CLL_CB = 'X'.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'ACTION'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.t -
How to skip the alv list when submit a report by SUBMIT statement?
Dear Experts,
I have to submit a report(RMVKON00) for a special request in my add-on program, I use the following statment:
SUBMIT RMVKON00
AND RETURN EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ABAPLIST_TAB
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
* EXPORTING
* LIST_INDEX = -1
* WITH_LINE_BREAK = ' '
TABLES
LISTASCI = LISTASCI_TAB[]
LISTOBJECT = ABAPLIST_TAB
EXCEPTIONS
EMPTY_LIST = 1
LIST_INDEX_INVALID = 2
OTHERS = 3
But it still display the alv list , and I must click button 'BACK' ,then it return my add on program.
I hope to skip the alv list (does not display the alv list ) .
Would you like to help me?
Thanks and Best Regards,
Colin.
Edited by: Colin on Jan 8, 2010 10:09 AMHi Colin,
I dont think you would be able to skip the ALV output using SUBMIT. However try changing the value of sy-lsind after the submit statement.
SUBMIT RMVKON00
AND RETURN EXPORTING LIST TO MEMORY.
sy-lsind = sy-lsind - 1.
If that doesnt work then try using JOB_START JOB_SUBMIT, JOB_CLOSE...
Thanks,
Best regards,
Prashant -
How to add check box in the ALV list
dear Experts,
i have a requirement.
i want show the check boxes in my ALV list.
can u please give the solution.
thanksTYPE-POOLS: slis.
*---internal tables
DATA: BEGIN OF it_flight OCCURS 0,
SEL, " add a single character field in the final output table
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight,
*--internal tables for alv
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fieldcat,
layout TYPE slis_layout_alv,
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort.
DATA: BEGIN OF it_flight_sel OCCURS 0,
SEL,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight_sel.
data: wa_flight like it_flight.
In the layout set give the name of the field
whose checkbox will be created ( SEL as it has 1 char only )
layout-box_fieldname = 'SEL'.
*---start-of-selection .
START-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
*----get data
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = 'UL'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&IC1'. "'&DATA_SAVE'. "user presses SAVE
loop at it_flight into wa_flight.
if wa_flight-Sel EQ 'X'.
collecting records in table it_flight_sel to process further
append wa_flight to it_flight_sel.
clear wa_flight.
TYPE-POOLS: slis.
*---internal tables
DATA: BEGIN OF it_flight OCCURS 0,
SEL, " add a single character field in the final output table
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight,
*--internal tables for alv
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fieldcat,
layout TYPE slis_layout_alv,
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort.
DATA: BEGIN OF it_flight_sel OCCURS 0,
SEL,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight_sel.
data: wa_flight like it_flight.
In the layout set give the name of the field
whose checkbox will be created ( SEL as it has 1 char only )
layout-box_fieldname = 'SEL'.
*---start-of-selection .
START-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
*----get data
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = 'UL'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&IC1'. "'&DATA_SAVE'. "user presses SAVE
loop at it_flight into wa_flight.
if wa_flight-Sel EQ 'X'.
collecting records in table it_flight_sel to process further
append wa_flight to it_flight_sel.
clear wa_flight.
Please follow the code. -
How to read modifed data in ALV List
Hi,
I have one input enabled field in my ALV list. User can modify the values of that field. How i can get what are all the records are modified by the user.
Thanks
stallinHi,
Try this code...
REPORT ZTEST_EDIT_ALV .
*Data Declaration
DATA: BEGIN OF T_EKKO,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
* FLAG TYPE C,
* HANDLE_STYLE TYPE LVC_T_STYL,
END OF T_EKKO.
DATA: GD_REPID LIKE SY-REPID, "Exists
REF_GRID TYPE REF TO CL_GUI_ALV_GRID. "new
DATA: BEGIN OF IT_EKKO OCCURS 0.
INCLUDE STRUCTURE T_EKKO.
DATA: END OF IT_EKKO.
DATA: BEGIN OF IT_BACKUP OCCURS 0.
INCLUDE STRUCTURE T_EKKO.
DATA: END OF IT_BACKUP.
*ALV data declarations
TYPE-POOLS: SLIS. "ALV Declarations
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
*Start-of-selection.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
IT_BACKUP[] = IT_EKKO[].
PERFORM DISPLAY_ALV_REPORT.
*& Form build_fieldcatalog
* text
FORM BUILD_FIELDCATALOG.
REFRESH FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELN'.
FIELDCATALOG-SELTEXT_M = 'Purchase Order'.
FIELDCATALOG-INPUT = 'X'.
FIELDCATALOG-EDIT = 'X'.
FIELDCATALOG-COL_POS = 2.
APPEND FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELP'.
FIELDCATALOG-SELTEXT_M = 'PO Item'.
FIELDCATALOG-COL_POS = 3.
APPEND FIELDCATALOG.
CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM BUILD_LAYOUT.
"Permet d'ajuster les colonnes au text
* gd_layout-colwidth_optimize = 'X'.
* GD_LAYOUT-TOTALS_TEXT = 'Totals'(201).
* gd_layout-box_fieldname = 'SELECT'.
* gd_layout-box_tabname = 'IT_EKKO'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM DISPLAY_ALV_REPORT .
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
* i_callback_top_of_page = 'TOP-OF-PAGE'
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
* i_grid_title = 'My Title'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
TABLES
T_OUTTAB = IT_EKKO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
WRITE:/ SY-SUBRC.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM DATA_RETRIEVAL.
SELECT EBELN EBELP
UP TO 10 ROWS
FROM EKPO
INTO CORRESPONDING FIELDS OF TABLE IT_EKKO.
ENDFORM. " DATA_RETRIEVAL
* FORM SET_PF_STATUS *
FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD_FULLSCREEN1' EXCLUDING RT_EXTAB.
ENDFORM. "set_pf_status
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
*then insert the following code in your USER_COMMAND routine...
<b> IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA
ENDIF.</b>*modify
CASE R_UCOMM.
WHEN '&IC1'.
CHECK RS_SELFIELD-TABINDEX > 0.
IF RS_SELFIELD-VALUE EQ '6000000001'.
CALL TRANSACTION 'ZTEST'.
ENDIF.
WHEN 'REFRESH'.
READ TABLE IT_EKKO INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
READ TABLE IT_BACKUP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
IF IT_EKKO <> IT_BACKUP.
* then do your check
ENDIF.
ENDIF.
ENDIF.
PERFORM DATA_RETRIEVAL.
RS_SELFIELD-REFRESH = 'X'.
ENDCASE.
ENDFORM. "user_command
Regards
vijay -
Regarding Runtime error in ALV List Display.
am using following to display data in ALV List.
but after executing of program am getting runtime error called 'Field Symbol has Not been assigned' .
please tell me how to correct the error.
Very urgent
Suitable answers rewarded with Maximum Ponits...
REPORT zmatrix.
TYPE-POOLS: slis.
TABLES: agr_define, sza5_d0700.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.
SELECT-OPTIONS: s_role FOR agr_define-agr_name OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
D A T A *
TYPES: BEGIN OF ty_agr_1251_inf,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_agr_1251_inf.
TYPES: BEGIN OF ty_agr_1251_tcode,
agr_name TYPE agr_1251-agr_name,
object TYPE agr_1251-object,
field TYPE agr_1251-field,
low(20) TYPE c,
high TYPE agr_1251-high,
tcode TYPE tstct-tcode,
ttext TYPE tstct-ttext,
END OF ty_agr_1251_tcode.
TYPES: BEGIN OF ty_t582s,
infty TYPE agval,
itext TYPE t582s-itext,
END OF ty_t582s.
TYPES: BEGIN OF ty_code,
tcode TYPE tstct-tcode,
ttext TYPE ttext_stct,
END OF ty_code.
TYPES: BEGIN OF ty_inf,
infty TYPE t582s-infty,
itext TYPE t582s-itext,
END OF ty_inf.
TYPES: BEGIN OF ty_role,
agr_name TYPE agr_1251-agr_name,
END OF ty_role.
TYPES: BEGIN OF tys_role_dtls,
agr_name TYPE agr_name,
value TYPE c,
property TYPE c,
END OF tys_role_dtls.
TYPES: BEGIN OF tys_infotype_final,
text(60),
text1(60),
value(4),
END OF tys_infotype_final.
I N T E R N A L T A B L E S *
DATA: wa_infotyp_final TYPE tys_infotype_final.
DATA: t_infotyp_final TYPE TABLE OF tys_infotype_final.
DATA: BEGIN OF wa_infotyp_dtls,
infty TYPE infty,
itext TYPE intxt,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_infotyp_dtls.
DATA: BEGIN OF wa_tcode_dtls,
tcode TYPE tcode,
ttext TYPE ttext_stct,
role_dtls TYPE TABLE OF tys_role_dtls,
END OF wa_tcode_dtls.
DATA: t_infotyp_dtls LIKE TABLE OF wa_infotyp_dtls,
t_tcode_dtls LIKE TABLE OF wa_tcode_dtls,
t_role_dtls TYPE TABLE OF tys_role_dtls,
wa_role_dtls TYPE tys_role_dtls.
DATA: wa_inf TYPE ty_inf,
t_inf TYPE STANDARD TABLE OF ty_inf.
DATA: wa_role TYPE ty_role,
t_role TYPE STANDARD TABLE OF ty_role.
DATA: wa_tcode TYPE ty_code,
t_tcode TYPE TABLE OF ty_code.
DATA: wa_agr_1251_inf TYPE ty_agr_1251_inf.
DATA: wa_agr_1251_tcode TYPE ty_agr_1251_tcode.
DATA: t_agr_1251_inf TYPE STANDARD TABLE OF ty_agr_1251_inf.
DATA: t_agr_1251_tc TYPE STANDARD TABLE OF ty_agr_1251_tcode.
DATA: wa_582s TYPE ty_t582s.
DATA: t_582s TYPE STANDARD TABLE OF ty_t582s.
DATA: t_range_tcode TYPE RANGE OF tcode.
DATA: t_range_inf TYPE RANGE OF infotyp.
DATA: wa_range_inf LIKE LINE OF t_range_inf.
DATA: wa_range_tcode LIKE LINE OF t_range_tcode.
DATA: wa_field TYPE slis_fieldcat_alv.
DATA: t_field TYPE slis_t_fieldcat_alv.
VARIABLES FOR OLE *
DATA: text(20),
count(20).
DATA: text1(30).
DATA: agr_name TYPE agr_1251-agr_name.
DATA: flag TYPE i VALUE '0'.
DATA: string1 TYPE string.
DATA: str TYPE string VALUE 'SAP%'.
DATA: count1 TYPE i VALUE '0'.
*& Event START-OF-SELECTION
START-OF-SELECTION.
PERFORM f100_get_inf_data.
PERFORM f200_process_inf_data.
count1 = 1.
PERFORM f300_prepare_field_catalog.
PERFORM f110_main_data.
PERFORM f400_display_data.
PERFORM f100_get_trans_data.
*& Form f110_main_data
text
FORM f110_main_data.
wa_infotyp_final-text = 'Access to Infotypes'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = 'Infotype'.
wa_infotyp_final-text1 = 'Description'.
APPEND wa_infotyp_final TO t_infotyp_final.
wa_infotyp_final-text = '*'.
wa_infotyp_final-text1 = 'Acess to all Infotypes'.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'INFTY' low = '*'.
IF syst-subrc = 0.
wa_infotyp_final-value = 'X'.
ENDIF.
ENDLOOP.
APPEND wa_infotyp_final TO t_infotyp_final.
LOOP AT t_inf INTO wa_inf WHERE infty <> ' '.
wa_infotyp_final-text = wa_inf-infty.
wa_infotyp_final-text1 = wa_inf-itext.
LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
Role Name
CLEAR wa_role_dtls.
flag = 1.
wa_role_dtls-agr_name = wa_role-agr_name.
For Value D & F
READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
WITH KEY agr_name = wa_role-agr_name field = 'AUTHC'..
IF syst-subrc EQ 0.
IF wa_agr_1251_inf-low = 'R'.
wa_infotyp_final-value = 'D'.
ELSE.
wa_infotyp_final-value = 'F'.
ENDIF.
ENDIF.
APPEND wa_role_dtls TO t_role_dtls.
APPEND wa_infotyp_final TO t_infotyp_final.
ENDLOOP.
ENDLOOP.
ENDFORM. "f110_main_data
*& Form f100_get_inf_data
text
FORM f100_get_inf_data.
Logic for Infotypes *
SELECT aagr_name aobject
afield alow a~high
INTO TABLE t_agr_1251_inf
FROM agr_1251 AS a INNER JOIN agr_define AS b
ON aagr_name EQ bagr_name
WHERE ( ( aobject EQ 'P_ORGIN' OR aobject EQ 'P_PERNR' )
AND ( aagr_name IN s_role ) AND ( bagr_name NOT LIKE str ) ).
ENDFORM. "f100_get_inf_data
*& Form f200_get_inf_process_data
text
FORM f200_process_inf_data.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'EQ'.
wa_range_inf-low = wa_agr_1251_inf-low.
APPEND wa_range_inf TO t_range_inf.
ELSE.
CLEAR wa_range_inf.
wa_range_inf-sign = 'I'.
wa_range_inf-option = 'BT'.
wa_range_inf-low = wa_agr_1251_inf-low.
wa_range_inf-high = wa_agr_1251_inf-high.
APPEND wa_range_inf TO t_range_inf.
ENDIF.
ENDLOOP.
SORT t_range_inf.
DELETE ADJACENT DUPLICATES FROM t_range_inf.
IF t_range_inf IS NOT INITIAL.
SELECT infty itext FROM t582s
INTO TABLE t_582s
WHERE sprsl = 'EN' AND infty IN t_range_inf.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf-high IS INITIAL.
READ TABLE t_582s INTO wa_582s
WITH KEY infty = wa_agr_1251_inf-low.
IF syst-subrc EQ 0.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_582s INTO wa_582s
WHERE infty GE wa_agr_1251_inf-low
AND infty LE wa_agr_1251_inf-high.
IF count LE 1.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
TRANSPORTING infty itext.
IF syst-subrc EQ 0.
CLEAR wa_582s.
ENDIF.
ELSE.
wa_agr_1251_inf-high = space.
wa_agr_1251_inf-infty = wa_582s-infty.
wa_agr_1251_inf-itext = wa_582s-itext.
APPEND wa_agr_1251_inf TO t_agr_1251_inf.
ENDIF.
CLEAR wa_agr_1251_inf.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
wa_role-agr_name = ' '.
APPEND wa_role TO t_role.
LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
IF wa_agr_1251_inf IS NOT INITIAL.
wa_role-agr_name = wa_agr_1251_inf-agr_name.
wa_inf-infty = wa_agr_1251_inf-infty.
wa_inf-itext = wa_agr_1251_inf-itext.
APPEND wa_role TO t_role.
APPEND wa_inf TO t_inf.
ENDIF.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_inf BY infty.
DELETE ADJACENT DUPLICATES FROM t_inf.
ENDFORM. "f200_get_process_inf_data
*& Form f100_get_trans_data
text
FORM f100_get_trans_data.
Logic for Transaction Codes *
SELECT aagr_name aobject
afield alow a~high
INTO CORRESPONDING FIELDS OF TABLE t_agr_1251_tc
FROM agr_1251 AS a
INNER JOIN agr_define AS b ON aagr_name EQ bagr_name
WHERE a~agr_name IN s_role
AND a~object EQ 'S_TCODE'.
ENDFORM. "f100_get_trans_data
*& Form f200_process_trans_data
text
FORM f200_process_trans_data.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'EQ'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
APPEND wa_range_tcode TO t_range_tcode.
ELSE.
CLEAR wa_range_tcode.
wa_range_tcode-sign = 'I'.
wa_range_tcode-option = 'BT'.
wa_range_tcode-low = wa_agr_1251_tcode-low.
wa_range_tcode-high = wa_agr_1251_tcode-high.
APPEND wa_range_tcode TO t_range_tcode.
ENDIF.
ENDLOOP.
SORT t_range_tcode.
DELETE ADJACENT DUPLICATES FROM t_range_tcode.
IF t_range_tcode IS NOT INITIAL.
SELECT tcode
ttext
FROM tstct
INTO TABLE t_tcode
WHERE sprsl EQ 'E'
AND tcode IN t_range_tcode.
IF sy-subrc EQ 0.
ENDIF.
ENDIF.
SORT t_agr_1251_tc BY agr_name.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
IF wa_agr_1251_tcode-high IS INITIAL.
READ TABLE t_tcode INTO wa_tcode
WITH KEY tcode = wa_agr_1251_tcode-low.
IF syst-subrc EQ 0.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext.
IF syst-subrc EQ 0.
ENDIF.
ENDIF.
ELSE.
CLEAR count.
LOOP AT t_tcode INTO wa_tcode
WHERE tcode GE wa_agr_1251_tcode-low
AND tcode LE wa_agr_1251_tcode-high.
IF count LE 1.
agr_name = wa_agr_1251_tcode-agr_name.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
TRANSPORTING tcode ttext high.
IF syst-subrc EQ 0.
CLEAR wa_tcode.
ENDIF.
count = 1.
ELSE.
wa_agr_1251_tcode-high = space.
wa_agr_1251_tcode-agr_name = agr_name.
wa_agr_1251_tcode-low = wa_tcode-tcode.
wa_agr_1251_tcode-tcode = wa_tcode-tcode.
wa_agr_1251_tcode-ttext = wa_tcode-ttext.
APPEND wa_agr_1251_tcode TO t_agr_1251_tc.
ENDIF.
CLEAR wa_agr_1251_tcode.
count = count + 1.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
wa_role-agr_name = wa_agr_1251_tcode-agr_name.
APPEND wa_role TO t_role.
ENDLOOP.
SORT t_role BY agr_name.
DELETE ADJACENT DUPLICATES FROM t_role.
SORT t_tcode BY tcode.
DELETE ADJACENT DUPLICATES FROM t_tcode.
ENDFORM. "f200_process_trans_data
*& Form f100_prepare_field_catalog
text
FORM f300_prepare_field_catalog.
LOOP AT t_role INTO wa_role.
wa_field-col_pos = count1.
wa_field-fieldname = wa_role-agr_name.
APPEND wa_field TO t_field.
count1 = count1 + 1.
ENDLOOP.
ENDFORM. "f100_prepare_field_catalog
*& Form f100_display_data
text
FORM f400_display_data.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
it_fieldcat = t_field[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_infotyp_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "f100_display_datathis are the wasy u can build a field catalog...
1.----
FORM fill_fieldcat .
DATA: fld(30),
idx(2) TYPE n.
DEFINE no_output.
fieldcatalog-fieldname = &1.
fieldcatalog-no_out = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
DEFINE catalog.
fieldcatalog-fieldname = &1.
fieldcatalog-seltext_s = &2.
if not &3 is initial.
fieldcatalog-seltext_m = &3.
else.
fieldcatalog-seltext_m = fieldcatalog-seltext_s.
endif.
if not &4 is initial.
fieldcatalog-seltext_l = &4.
else.
fieldcatalog-seltext_l = fieldcatalog-seltext_m.
endif.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
END-OF-DEFINITION.
catalog 'AVAIL_BASE'
'Base Qty.'
'Base Qty. Available'
'Base Quantity Available'.
catalog 'AVAIL_SALES'
'Sales Qty.'
'Sales Qty. Available'
'Sales Quantity Available'.
LOOP AT t_char_data.
idx = sy-tabix.
CONCATENATE 'CHR' idx INTO fld.
catalog fld
t_char_data-atbez
t_char_data-atbez
t_char_data-atbez.
ENDLOOP.
ADD 1 TO idx.
WHILE idx LE 15.
CONCATENATE 'CHR' idx INTO fld.
no_output fld.
ADD 1 TO idx.
ENDWHILE..
fieldcatalog-fieldname = 'EXACT'.
fieldcatalog-checkbox = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
2.----
FORM fieldcatalog.
REFRESH fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'KUNNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'NAME1_K'.
fc-ref_tabname = 'KNA1'.
fc-ref_fieldname = 'NAME1'.
APPEND fc. CLEAR fc.
fc-tabname = 'HEADER'.
fc-fieldname = 'TOTAL'.
fc-ref_tabname = 'MBEW'.
fc-ref_fieldname = 'SALK3'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MATNR'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'MAKTX'.
fc-ref_tabname = 'MAKT'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'CHARG'.
fc-ref_tabname = 'MSKU'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'WERKS'.
fc-ref_tabname = 'MSKU'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc.
fc-tabname = 'LIST'.
fc-fieldname = 'NAME1_W'.
fc-ref_tabname = 'T001W'.
fc-ref_fieldname = 'NAME1'.
fc-no_out = 'X'.
APPEND fc. CLEAR fc. -
End of page in alv list output.
Hi All,
Can any body help me out for how to show end of page in alv list output.
Thanks,
Rakesh SinghRefer this link:
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
Regards,
Ravi
Maybe you are looking for
-
How can I remove the blue background from my PDFs files
How can I remove the blue background from my PDFs files
-
It's happened a bad thing. My Z10 (OS 10.1.0.4181) has decided to delete, from all my email account , each emails from july to today!!!! It's unacceptable!!! I have paid 700 Euro for a smartphone that delete my email?! It has deleted also emails from
-
Figuring out how to access a device using Windows.Devices.HumanInterfaceDevice?
Before I start, I would like to share this link I used to access windows RT libraries from Desktop applications (only the ones stated in MSDN documentation that are accessible from desktop applications): http://blogs.msdn.com/b/cdndevs/archive/2013/1
-
The link from my email for verification of my apple account is not working correctly!
So i created a new apple ID account. And they successfully sent an email link to verify the email address. When i open the link, it asked me to sign in. After i sign in, it directly sends me to a site saying, "Sorry! sorry your session has been expir
-
Change data capture-staging table
hi, while using change data capture in oracle 11g,r2.I used source table and target table in the mapping.[ both source and target are oracle]. Do i have to use staging table for the mapping ,instead of target table.?? if yes, then where and how do i