ALV DISPLAY WIDTH PROBLEM
Hi
my internal table is
DATA: BEGIN OF IT_LFA1 OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
END OF IT_LFA1.
i am displaying this table with REUSE_ALV_LIST_DISPLAY.
field catelog is like
F_WA_LFA1-FIELDNAME = 'LIFNR'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NO'.
APPEND F_WA_LFA1 TO F_LFA1.
F_WA_LFA1-FIELDNAME = 'NAME1'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NAME'.
APPEND F_WA_LFA1 TO F_LFA1.
Here only 10 characters of vendor name are displayed.
How to display the complete name lfa1-name1
I dont want take static lenth like
F_WA_LFA1-outputlen = <b>some fixed number</b>
rather;
F_WA_LFA1-outputlen = <b>length of it_lfa1-lifnr</b>
Regards,
MB
Message was edited by:
M B
DATA: BEGIN OF IT_LFA1 OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
END OF IT_LFA1.
F_WA_LFA1-FIELDNAME = 'LIFNR'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NO'.
APPEND F_WA_LFA1 TO F_LFA1.
F_WA_LFA1-FIELDNAME = 'NAME1'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NAME'.
F_WA_LFA1-SELTEXT_M = 'VENDOR NAME'.
F_WA_LFA1-OUTPUTLEN = specify teh length of name1.
APPEND F_WA_LFA1 TO F_LFA1.
Refer http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
Hope this helps.
Similar Messages
-
We use ALV to display various data objects. The customer are wanting to know if they can have the ALV display on the screen expand to take the full screen width instead of having space on the right side. I have not seen a parameter to change this.
thx,
Mike DeGuireI'm using the OO for the ALV. My call is
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'zlx03_ALV'
IS_VARIANT = GS_VARIANT
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_PRINT = GS_PRINT
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = pgm_data[]
it_fieldcatalog = zlx03_ALV.
The examples you referenced only deal with
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
Any ideas?
thx,
Mike -
Hi all.
we are phasing a problem.
I am using alv to display in output.
I am using a Quantiti field (BDMNG),.
in this field if nodata is there then it is showing 0.000(that is the default value).
I don't want those zeros.I want only space(blank only).
Can any body help me to solve this issue.
Thanks in advance
Eswar.Hai,
While building field catalog For quantity field Set the NO-ZERO attribute to 'X'.
Or you can change the quantity filed to character in the alv display.
Mark points if helpful.
Regards,
Umasankar -
Code for hr-abap report in alv display
Hi Gurus,
I am new to hr-abap and I want some sample code to display a hr report in an alv.
Thanks,
Raj.This is one such...
REPORT yh_rep_hr_certified_instructor MESSAGE-ID yh_messages NO STANDARD
PAGE
HEADING .
Program : YH_REP_HR_CERTIFIED_INSTRUCTOR *
Description : Certified Instructor Eligibility Criteria *
TABLES *
TABLES :hrp1000 ,hrp1001, pa0000.
TYPE-POOLS *
*Type Pool for ALV display
TYPE-POOLS :slis. " Global types for generic cunning components
INTERNAL TABLES *
*Internal Table to keep Selection Screen field values
DATA : BEGIN OF t_validation OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA END OF t_validation.
*Internal Table for Business Event Groups
DATA : BEGIN OF t_bgrp OCCURS 0,
objid TYPE hrobjid,
blank(1),
stext TYPE stext,
END OF t_bgrp.
*Internal Table for Business Event Type IDs with text for selected Event
*GROUPS
DATA : BEGIN OF t_btyp OCCURS 0,
objid TYPE hrobjid,
blank(1),
stext TYPE stext,
END OF t_btyp.
*Internal Table for Business Event Type IDs for selected Event Groups
DATA : BEGIN OF t_eventtypelist OCCURS 0,
objid TYPE hrobjid,
END OF t_eventtypelist.
*Internal table to store the business Groups
DATA : BEGIN OF t_group OCCURS 0,
objid LIKE hrp1001-objid,
sobid LIKE hrp1001-sobid,
sclas LIKE hrp1001-sclas,
END OF t_group.
*Internal table to hold the business event group and/or bus. event types
DATA : BEGIN OF t_eventgroup OCCURS 0,
objid LIKE hrp1001-objid,
END OF t_eventgroup.
*Internal Table for FieldCatalog used for ALV Display
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
*Work Area for Checking Business Event Group Validity
DATA: BEGIN OF wa_bgrp,
objid TYPE hrobjid,
stext TYPE stext,
END OF wa_bgrp.
*Internal table to fetch object id for Qualification
DATA: BEGIN OF t_objid OCCURS 0,
objid TYPE hrp1000-objid,
sobid TYPE hrp1001-sobid,
sobid_copy TYPE hrp1001-objid,
END OF t_objid.
*Internal table to fetch Id of related object
*Fetches Pernr of Certified Instructors
DATA: BEGIN OF t_sobid OCCURS 0,
objid TYPE hrp1000-objid,
sobid TYPE hrp1001-sobid,
adatanr TYPE hrpad31-adatanr,
sobid_copy TYPE hrp1001-objid,
END OF t_sobid.
*Internal table to fetch skill rating
*of the Instructor
DATA: BEGIN OF t_prof OCCURS 0,
adatanr TYPE hrpad31-adatanr,
chara TYPE hrpad31-chara,
END OF t_prof.
*Internal table to fetch grade
*of the Insturctor
DATA: BEGIN OF t_grade OCCURS 0,
pernr TYPE pa0008-pernr,
yysalgr TYPE pa0008-yysalgr,
END OF t_grade.
*Internal table which contains all information about the Person like
*Name Project Project Manager Name Account and Vertical Name
DATA: t_projdetails TYPE zbapi_projdetails OCCURS 0 WITH HEADER LINE.
*Final Internal table which contains all information
*about the Instructors
DATA: BEGIN OF t_final OCCURS 0,
empid TYPE pa0000-pernr,
empname(84) TYPE c,
grade TYPE pa0008-yysalgr,
atndttt(3) TYPE c,
sklrate TYPE hrpad31-chara,
pgmng TYPE pa0001-ename,
accname TYPE hrp1000-stext,
vertname TYPE hrp1000-stext,
END OF t_final.
VARIABLES *
*ALV layout
DATA: gs_layout TYPE slis_layout_alv, "alvtot test
gt_events TYPE slis_t_event,
gt_list_top_of_page TYPE slis_t_listheader,
gs_variant LIKE disvariant, "For Layout
g_save. "For Layout Save
DATA: w_pos TYPE i VALUE 1, " Position of Fields in ALV
w_sort TYPE slis_t_sortinfo_alv, "ITab for Sorting Options
w_flag TYPE i,
w_repid TYPE sy-repid,
w_lineno TYPE sy-tabix.
DATA: l_short TYPE hrp1000-short. "variable to check the heirarchy
SELECTION-SCREEN DESIGN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. "NO INTERVALS .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-009 MODIF ID xyz.
PARAMETERS : p_bgrp TYPE hrobjid OBLIGATORY,
p_bgrp1 TYPE stext .
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS :s_btyp FOR hrp1000-objid OBLIGATORY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION *
INITIALIZATION.
*Assign Program Name into a variable
w_repid = sy-repid.
*Build layout for list display
gs_layout-detail_popup = 'X'.
*To get All Events in TOP-OF-PAGE
perform eventtab_build using gt_events[].
gs_variant-report = w_repid.
g_save = 'A'.
AT SELECTION SELECTION *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bgrp.
PERFORM get_bgrp.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-low.
IF NOT p_bgrp IS INITIAL .
PERFORM get_btyp USING 'l'.
ELSE .
MESSAGE s999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-high.
IF NOT p_bgrp IS INITIAL .
PERFORM get_btyp USING 'h'.
ELSE .
MESSAGE s999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON p_bgrp.
SELECT SINGLE objid stext
FROM hrp1000
INTO wa_bgrp
WHERE objid = p_bgrp AND
otype = 'L' AND
plvar = '01' AND
( short = 'ROLE' OR
short = 'TECH_PROGRAM' ).
IF sy-subrc EQ 0.
p_bgrp1 = wa_bgrp-stext.
ELSE.
MESSAGE e999 WITH text-e09.
ENDIF.
AT SELECTION-SCREEN ON s_btyp.
CLEAR : t_eventtypelist, t_group, t_eventgroup.
REFRESH : t_eventtypelist, t_group, t_eventgroup.
CLEAR : w_flag.
*Fetch all the subordinates under given Event Group - L/D
SELECT objid
sobid
sclas
FROM hrp1001
INTO TABLE t_group
WHERE objid = p_bgrp
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND ( sclas = 'L' OR sclas = 'D' ).
WHILE w_flag <> 1.
PERFORM get_objids.
ENDWHILE.
IF NOT t_eventtypelist[] IS INITIAL.
*Get only valid Event Types from input Event Types, for given Event
*Group - by deleting others..
LOOP AT t_eventtypelist.
IF t_eventtypelist-objid IN s_btyp.
EXIT.
ELSE.
DELETE t_eventtypelist.
ENDIF.
AT LAST.
*since we r checking Event Types, All other fields will be locked
*but we need Event Group field to be unlocked to edit again,
*if theres no theres no valid Event Types in given input
LOOP AT SCREEN.
CHECK screen-name = 'P_bgrp'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
MESSAGE e999 WITH text-e04.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
CHECK screen-name = 'P_bgrp'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
MESSAGE e999 WITH text-e03.
ENDIF.
FORM get_bgrp *
FORM get_bgrp .
SELECT objid stext
FROM hrp1000
INTO CORRESPONDING FIELDS OF TABLE t_bgrp
WHERE plvar = '01' AND
otype = 'L' AND
short = 'ROLE' OR
short = 'TECH_PROGRAM' .
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 75
endpos_row = 20
startpos_col = 30
startpos_row = 05
titletext = 'Select Business Event Group'
IMPORTING
choise = w_lineno
TABLES
valuetab = t_bgrp
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc EQ 0 .
READ TABLE t_bgrp INDEX w_lineno.
IF sy-subrc EQ 0.
p_bgrp = t_bgrp-objid.
p_bgrp1 = t_bgrp-stext.
ENDIF .
CLEAR t_bgrp .
REFRESH t_bgrp .
ENDIF .
ENDFORM . "get_bgrp
****subroutine for business eventtype input criteria
FORM get_btyp USING f_range.
CLEAR : t_validation,
t_btyp,
t_eventtypelist,
t_group,
t_eventgroup,
w_flag.
REFRESH : t_validation,
t_btyp,
t_eventtypelist,
t_group,
t_eventgroup.
t_validation-fieldname = 'P_BGRP'.
APPEND t_validation.
CLEAR t_validation.
*Getting Screen Values
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = w_repid
dynumb = '1000'
TABLES
dynpfields = t_validation
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE t_validation WITH KEY fieldname = 'P_BGRP'.
IF NOT t_validation-fieldname IS INITIAL.
*Getting Event Group ID that entered
LOOP AT t_validation.
IF t_validation-fieldname = 'P_BGRP'.
p_bgrp = t_validation-fieldvalue.
ENDIF.
ENDLOOP.
CLEAR t_validation.
REFRESH t_validation.
*To fetch the business event groups and business event types that belong
to the input business event group.Since a business group can have a
*business groups as well as business event types we have pick all of
*them
*Getting all subordinates - Event Group/Type under given Event Group
SELECT objid
sobid
sclas
FROM hrp1001
INTO TABLE t_group
WHERE objid = p_bgrp
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND endda = '99991231'
AND ( sclas = 'L' OR sclas = 'D' ).
*Getting all Event Types
WHILE w_flag <> 1.
PERFORM get_objids.
ENDWHILE.
IF NOT t_eventtypelist[] IS INITIAL.
SORT t_eventtypelist BY objid.
*Getting Names of Event Types
SELECT objid
stext
FROM hrp1000
INTO CORRESPONDING FIELDS OF TABLE t_btyp
FOR ALL ENTRIES IN t_eventtypelist
WHERE objid = t_eventtypelist-objid
AND otype = 'D' AND plvar = '01'
AND endda = '99991231'.
IF sy-subrc = 0.
*PopUp Display for Event Types
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 75
endpos_row = 20
startpos_col = 30
startpos_row = 05
titletext = 'Select Business Event Type ID'
IMPORTING
choise = w_lineno
TABLES
valuetab = t_btyp
EXCEPTIONS
break_off = 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.
ELSE.
*Since the Table returned by function module will have data in Header,
*clear the Header
*Retreive Selected Event Type into Select Option
READ TABLE t_btyp INDEX w_lineno.
IF sy-subrc EQ 0.
IF f_range = 'l'.
s_btyp-low = t_btyp-objid.
ELSE.
s_btyp-high = t_btyp-objid.
ENDIF.
ENDIF.
ENDIF.
ELSE.
MESSAGE s999 WITH text-e03.
ENDIF.
ELSE.
MESSAGE s999 WITH text-e01.
ENDIF.
ENDIF.
ENDFORM. " EVNTTY
FORM get_objids *
FORM get_objids.
*To delete the business event types that are found and push it in
*another table
IF NOT t_group[] IS INITIAL.
LOOP AT t_group.
*If event type
IF t_group-sclas = 'D'.
t_eventtypelist-objid = t_group-sobid.
APPEND t_eventtypelist.
CLEAR t_eventtypelist.
DELETE t_group.
*If event group
ELSEIF t_group-sclas = 'L'.
t_eventgroup-objid = t_group-sobid.
APPEND t_eventgroup.
CLEAR t_eventgroup.
DELETE t_group.
CLEAR t_group.
ENDIF.
ENDLOOP.
ELSE.
w_flag = 1.
ENDIF.
IF NOT t_eventgroup[] IS INITIAL.
*To get the second level of business groups and business event type
SELECT objid sobid sclas
FROM hrp1001
INTO TABLE t_group
FOR ALL ENTRIES IN t_eventgroup
WHERE objid = t_eventgroup-objid
AND plvar = '01'
AND rsign = 'B'
AND relat = '003'
AND endda = '99991231'
AND ( sclas = 'L' OR sclas = 'D' ).
CLEAR t_eventgroup.
REFRESH t_eventgroup.
ENDIF.
ENDFORM. " GET_OBJIDS
Start of Selection *
START-OF-SELECTION.
*Pass the Event Type and fetch the Related Id
*for the Qualification imparted by the Event
SELECT objid sobid
FROM hrp1001
INTO TABLE t_objid
WHERE objid IN s_btyp AND
otype = 'D' AND
plvar = '01' AND
relat = '028' AND
rsign = 'A' AND
sclas = 'Q'.
IF sy-subrc EQ 0.
*Pass the Qualification Id and fetch Object Id of the
*person who fulfills this Qualification
SELECT objid sobid adatanr
FROM hrp1001
INTO TABLE t_sobid FOR ALL ENTRIES IN t_objid
WHERE sobid = t_objid-sobid AND
otype = 'P' AND
plvar = '01' AND
relat = '032' AND
rsign = 'A' AND
sclas = 'Q' .
IF sy-subrc = 0.
*Fetch only the Person along with the skillrating
*who has skill rating as '0001' or '0003'
SELECT adatanr chara
FROM hrpad31
INTO TABLE t_prof
FOR ALL ENTRIES IN t_sobid
WHERE adatanr = t_sobid-adatanr AND
( chara = '0001' OR chara = '0003' ).
IF sy-subrc NE 0.
MESSAGE s999 WITH text-s01.
EXIT .
ELSE .
*Fetch only Employee Id's who meets the required skill rating
*which inturn has the EMPID who are all are Certified Instructors
LOOP AT t_sobid.
READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
IF sy-subrc NE 0.
DELETE t_sobid .
ENDIF.
ENDLOOP.
SORT t_sobid BY objid.
DELETE ADJACENT DUPLICATES FROM t_sobid.
ENDIF.
ENDIF.
ENDIF.
IF NOT t_sobid[] IS INITIAL.
data: begin of it_trgpernr occurs 0,
objid type hrp1000-objid,
sobid type hrp1001-sobid,
end of it_trgpernr.
select objid sobid
from hrp1001
into table it_trgpernr for all entries in t_sobid
where otype ='P' and
objid = t_sobid-objid and
sclas = 'D' and
sobid = '50008220'.
*Fetch Grade of the Certified Instructors by passing their EmpId's
SELECT pernr yysalgr
FROM pa0008
INTO TABLE t_grade
FOR ALL ENTRIES IN t_sobid
WHERE pernr = t_sobid-objid AND endda = '99991231'.
ENDIF.
For Heading in the Output Display Layout
PERFORM heading USING gt_list_top_of_page[].
End of Selection *
END-OF-SELECTION.
Populating data into Final Table which contains all information aboutthe Certified Instructors
*Retrieve Employee Id for the Certified Instructors only if he is active
LOOP AT t_sobid.
SELECT SINGLE *
FROM pa0000
WHERE pernr = t_sobid-objid AND
begda <= sy-datum AND
endda >= sy-datum AND
stat2 ='3'.
IF sy-subrc = 0.
t_final-empid = t_sobid-objid.
SELECT SINGLE *
FROM hrp1001
WHERE otype = 'P' AND
objid = t_sobid-objid AND
rsign = 'B' AND
relat = '25' AND
sclas = 'D' AND
sobid = '50008220'.
*DATA:W_SOBID TYPE HRP1001-SOBID.
*W_SOBID = t_sobid-objid. .
SELECT SINGLE *
FROM hrp1001
WHERE otype = 'D' AND
objid = '50008220' AND
rsign = 'B' AND
relat = '25' AND
sclas = 'P' AND
sobid = W_SOBID.
IF sy-subrc EQ 0.
t_final-atndttt = 'YES'.
ELSE.
t_final-atndttt = 'NO'.
ENDIF.
*Retrieve Employee SkillRating for the Certified Instructors
*by passing the adatanr value which inturn is fetched based on the empid
READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
IF sy-subrc EQ 0.
t_final-sklrate = t_prof-chara.
ENDIF.
*Retrieve Employee Grade for the given id
READ TABLE t_grade WITH KEY pernr = t_sobid-objid.
IF sy-subrc EQ 0.
t_final-grade = t_grade-yysalgr.
ENDIF.
REFRESH t_projdetails.
CLEAR t_projdetails.
*function which fetches the name project name account and
*vertical name of the person for the given empid
CALL FUNCTION 'ZBAPI_PROJDETAILS'
EXPORTING
pernr = t_sobid-objid
TABLES
it_finaltab = t_projdetails.
IF NOT t_projdetails[] IS INITIAL.
SHIFT t_sobid-objid LEFT DELETING LEADING '0'.
READ TABLE t_projdetails WITH KEY pernr = t_sobid-objid.
IF sy-subrc EQ 0.
t_final-empname = t_projdetails-ename.
IF NOT t_projdetails-proj IS INITIAL.
t_final-pgmng = t_projdetails-pmname.
ELSE.
t_final-pgmng = t_projdetails-gmname.
ENDIF.
t_final-accname = t_projdetails-accname.
t_final-vertname = t_projdetails-vertname.
ENDIF.
ENDIF.
APPEND t_final.
ENDIF.
CLEAR t_final.
ENDLOOP.
SORT t_final BY empid.
DELETE ADJACENT DUPLICATES FROM t_final.
*Enabling Sort by PERNR & Global ID in ALV display
PERFORM sub_sort_info.
*Form to Populate Field Catalog
PERFORM populate_fieldcatalog.
For the ALV ROW Optimize Width
gs_layout-colwidth_optimize = 'X' .
*perform alv_display tables final fieldcatalog.
IF NOT t_final[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = gs_layout
it_fieldcat = t_fieldcatalog[]
it_sort = w_sort
i_save = 'A'
it_events = gt_events[]
TABLES
t_outtab = t_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.
ELSE.
MESSAGE s000(vz) WITH 'No Records found for Given Input Criteria'.
ENDIF.
TOP OF PAGE *
*Outputs formatted simple header information at TOP-OF-PAGE.
TOP-OF-PAGE.
PERFORM top_of_page.
Subroutines *
*& Form eventtab_build
text`
-->P_GT_EVENTS[] text
FORM eventtab_build USING rt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
DATA: g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events.
READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE g_top_of_page TO ls_event-form.
APPEND ls_event TO rt_events.
ENDIF.
ENDFORM. " eventtab_build
*& Form HEADING
text
FORM heading USING lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
*Layout Display Text - "Caritor ( India ) Pvt.Ltd "
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-h01.
APPEND ls_line TO lt_top_of_page.
*Layout Display Text - "Certified Instructor Eligibility List "
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-h02.
APPEND ls_line TO lt_top_of_page.
ENDFORM. " HEADING
*& Form top_of_page
text
--> p1 text
<-- p2 text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. " top_of_page
*& Form sub_sort_info
text
--> p1 text
<-- p2 text
FORM sub_sort_info.
DATA : l_sort TYPE slis_sortinfo_alv .
CLEAR l_sort.
Employee ID
l_sort-fieldname = 'EMPID'.
l_sort-up = 'X'.
APPEND l_sort TO w_sort.
ENDFORM. " sub_sort_info
*& Form populate_fieldcatalog
text
--> p1 text
<-- p2 text
FORM populate_fieldcatalog.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'EMPID' ' ' text-011 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'EMPNAME' ' ' text-002 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'GRADE' ' ' text-003 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'ATNDTTT' ' ' text-004 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'PGMNG' ' ' text-006 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'ACCNAME' ' ' text-007 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'VERTNAME' ' ' text-008 20 w_pos.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_FINAL' 'SKLRATE' ' ' text-005 20 w_pos.
ENDFORM. " populate_fieldcatalog
*& Form FILL_FIELDS_OF_FIELDCATALOG
text
-->P_T_FIELDCATALOG text
-->P_0870 text
-->P_0871 text
-->P_0872 text
-->P_TEXT_001 text
-->P_20 text
-->P_W_POS text
FORM fill_fields_of_fieldcatalog TABLES fp_t_fieldcatalog STRUCTURE
t_fieldcatalog
USING fp_table
fp_field
fp_key
fp_text
fp_out_len
fp_pos.
fp_t_fieldcatalog-tabname = fp_table.
fp_t_fieldcatalog-fieldname = fp_field.
fp_t_fieldcatalog-seltext_l = fp_text.
fp_t_fieldcatalog-key = fp_key.
fp_t_fieldcatalog-outputlen = fp_out_len.
fp_t_fieldcatalog-col_pos = fp_pos.
APPEND fp_t_fieldcatalog.
CLEAR: fp_t_fieldcatalog.
fp_pos = fp_pos + 1.
ENDFORM. " FILL_FIELDS_OF_FIELDCATALOG
10.249.11.136\SAP-StudyMaterial -
Download to excel from alv display
Hi,
How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
Regards,
Sowmya.Hi Sowmya,
Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
Regards Sachin. -
ALV display for row s and columns in this format.have ur full points..
Hi ALL
I have to dispalay data in the ALV format as :
Basic
DA
HRA
PF
VPF
20000
500
5000
| 1500 | 600 | |
Details : Basic HRA in one Row and PF , VPF in second Row.
The Amount regarding htese fields are also displayed in the next rows for all emp. numbers.
its urgent for me and need helpful answers...
Regards
Lakhansee the attached code it will display the hierarchial display as per your need
change the internal tables with dat of your own orgn structure and pass it to the fun module.
Description : Pick Status Report
This is an ALV report using the heirarchical ALV list display. The
report selects all deliveries that fulfil the selection criteria
and displays a summary of all items in that delivery with reference
to certain statuses: overall status, goods issue status, transfer
order status, load to pallet status, pallet count status, loaded to
van status, van manifest printed status and end of day manifest
printed status. These statuses have been defined by the business.
There is extra functionality required to trigger printing of the van
and end of day manifests from this report, and to set the loading
end status of a shipment if the last handling unit of a particular
shipment has been loaded onto a van for which the van manifest has
been triggered.
REPORT zwmr_pick_status_report NO STANDARD PAGE HEADING
MESSAGE-ID zw.
Type Pools
TYPE-POOLS: icon, slis.
Tables
TABLES: tvst,
likp,
t30b,
vekp,
*{ INSERT UKMK900355 4
zhu_to_link, "AS03
*} INSERT
zpallettr,
vttk, "MB01
zvantr.
Types
TYPES:
BEGIN OF ty_data,
lgtor LIKE likp-lgtor, " door
vbeln LIKE likp-vbeln, " delivery
wbstk LIKE vbuk-wbstk, " Goods movement status
kostk LIKE vbuk-kostk, " Picking status
posnr LIKE lips-posnr, " item
route LIKE likp-route, " route
wadat LIKE likp-wadat, " goods issue date
lvsta LIKE vbup-lvsta, " warehouse status
packvorschr LIKE vekp-packvorschr, " pack mnemonic
exidv LIKE vekp-exidv, " handling unit
zpallet_no(10), "like zpallettr-zpallet_no, " pallet no
zdep_point LIKE zpallettr-zdep_point, "Departur Point "Jvdm01
zcount_check LIKE zpallettr-zcount_check," count check flag
zvan_no(10), "like zvantr-zvan_no, " van no
zvan_print LIKE zvantr-zvan_print, " van manifest print
tknum LIKE vttk-tknum, " Shipment No "ANV 11523
zeod_print LIKE zvantr-zeod_print, " eod manifest print
zzpackclass LIKE vekp-zzpackclass, " package class
zzti LIKE vekp-zzti, " T.I. value
vstel LIKE likp-vstel, "Shipping point RM050906
anzpk TYPE znopack, "No of packages in dlv MB01+
END OF ty_data.
TYPES:BEGIN OF x_likp ,
vbeln LIKE likp-vbeln,
vstel LIKE likp-vstel, "RM050906
lgtor LIKE likp-lgtor,
zzroute2lgtor LIKE likp-zzroute2lgtor, "MB01
route LIKE likp-route,
wadat LIKE likp-wadat,
zz2route LIKE likp-zz2route, "MB01+
zzexproute LIKE likp-zzexproute, "MB01+
zzroute2 LIKE likp-zzroute2, "MB01+
anzpk LIKE likp-anzpk,
END OF x_likp.
TYPES: BEGIN OF x_vbuk,
vbeln TYPE vbuk-vbeln,
wbstk TYPE vbuk-wbstk, " Goods movement status
kostk TYPE vbuk-kostk, " Picking status
END OF x_vbuk.
TYPES: BEGIN OF x_lips,
vbeln TYPE lips-vbeln, " delivery
posnr TYPE lips-posnr, " item
pstyv TYPE lips-pstyv,
matnr TYPE lips-matnr,
charg TYPE lips-charg,
END OF x_lips.
TYPES: BEGIN OF x_vbup,
vbeln TYPE vbup-vbeln, " delivery
posnr TYPE vbup-posnr, " item
lvsta TYPE vbup-lvsta, " warehouse status
END OF x_vbup.
TYPES: BEGIN OF x_vepo,
venum TYPE vepo-venum, "Internal Handling Unit
Number
vepos TYPE vepo-vepos, "Handling Unit Item
vbeln TYPE vepo-vbeln, " delivery
posnr TYPE vepo-posnr, " item
exidv TYPE vekp-exidv,
END OF x_vepo.
TYPES: BEGIN OF x_vepo1,
venum TYPE vekp-venum, "Internal Handling Unit
Number
exidv TYPE vekp-exidv,
END OF x_vepo1.
Start of changes by ANV SR#11523
TYPES: BEGIN OF x_vttp,
tknum TYPE tknum, " Shipment No
tpnum TYPE tpnum, " Item No
vbeln TYPE vbup-vbeln, " delivery
laufk LIKE vttk-laufk, " leg indicator MB01+
END OF x_vttp.
End of changes by ANV SR#11523
Data
RANGES: r_del FOR likp-vbeln,
r_lgtor FOR likp-lgtor.
RANGES: r_vanno FOR zvantr-zvan_no,
r_palno FOR zpallettr-zpallet_no.
DATA: BEGIN OF number_range OCCURS 0,
mark(1),
id(3),
num(10) TYPE n,
desc LIKE zpalletmd-zdesc,
END OF number_range.
DATA: t_disp_tab TYPE STANDARD TABLE OF zpickdisp,
t_data_tab TYPE ty_data OCCURS 0 WITH HEADER LINE,
it_likp TYPE x_likp OCCURS 0 WITH HEADER LINE, "SUM
it_vbuk TYPE x_vbuk OCCURS 0 WITH HEADER LINE, "SUM
it_lips TYPE x_lips OCCURS 0 WITH HEADER LINE, "SUM
it_vbup TYPE x_vbup OCCURS 0 WITH HEADER LINE, "SUM
it_vepo TYPE x_vepo OCCURS 0 WITH HEADER LINE, "SUM
it_vepo2 TYPE x_vepo OCCURS 0 WITH HEADER LINE, "SUM
*{ INSERT UKMK900355 3
t_vepo_low TYPE x_vepo OCCURS 0 WITH HEADER LINE, " AS01
*} INSERT
it_vepo1 TYPE x_vepo1 OCCURS 0 WITH HEADER LINE, "SUM
it_vttp TYPE x_vttp OCCURS 0 WITH HEADER LINE, "ANV SR#11523
t_disp_head TYPE STANDARD TABLE OF zpickhead.
DATA wa_item_tab TYPE zpickdisp OCCURS 0 WITH HEADER LINE.
"ANV SR#11113
DATA: w_numrnge LIKE number_range,
w_number(10) TYPE n.
DATA: t_likp LIKE likp OCCURS 0 WITH HEADER LINE,
t_lips LIKE lips OCCURS 0 WITH HEADER LINE,
t_vbuk LIKE vbuk OCCURS 0 WITH HEADER LINE,
t_vbup LIKE vbup OCCURS 0 WITH HEADER LINE,
t_vepo LIKE vepo OCCURS 0 WITH HEADER LINE,
t_vekp LIKE vekp OCCURS 0 WITH HEADER LINE,
t_vantr LIKE zvantr OCCURS 0 WITH HEADER LINE,
t_pallettr LIKE zpallettr OCCURS 0 WITH HEADER LINE,
w_likp like likp,
w_lips LIKE lips,
w_vbuk LIKE vbuk,
w_vbup LIKE vbup,
w_vepo LIKE vepo,
w_vekp LIKE vekp,
w_vepo TYPE x_vepo1,
w_vbup TYPE x_vbup,
w_vttp TYPE x_vttp, " ANV SR#11523
w_lips TYPE x_lips,
w_vbuk TYPE x_vbuk,
w_likp TYPE x_likp, "MB01-+
w_tplst LIKE vttk-tplst. "MB01+
DATA: s_variant LIKE disvariant, "MB01+
def_variant LIKE disvariant.
ALV DATA *****
DATA:
g_grid TYPE REF TO cl_gui_alv_grid,
g_sort TYPE slis_t_sortinfo_alv,
g_custom_container TYPE REF TO cl_gui_custom_container,
g_layout TYPE slis_layout_alv,
gt_fieldcat TYPE slis_t_fieldcat_alv,
t_fldcat LIKE LINE OF gt_fieldcat,
g_keyinfo TYPE slis_keyinfo_alv,
gt_events TYPE slis_t_event,
gs_event TYPE slis_alv_event,
w_sy_repid LIKE sy-repid.
DATA: BEGIN OF seltab OCCURS 0.
INCLUDE STRUCTURE rsparams.
DATA: END OF seltab.
SYSTEM GENERATED TABLE CONTROL DATA ********
DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
CONTROLS: tc_tabcon TYPE TABLEVIEW USING SCREEN 0100.
LINES OF TABLECONTROL 'TC_TABCON'
DATA: g_tc_tabcon_lines LIKE sy-loopc.
DATA: ok_code LIKE sy-ucomm.
Constants
CONSTANTS: c_data_class LIKE klah-class VALUE 'DG_DATA',
c_mat_class LIKE rmclf-klart VALUE '001',
c_pack LIKE lips-mtart VALUE 'VERP',
c_a(1) VALUE 'A',
c_b(1) VALUE 'B',
c_c(1) VALUE 'C',
c_yes(1) VALUE 'X',
c_no(1) VALUE ' '.
Selection screen
standard report select options block
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-002.
SELECT-OPTIONS:
s_wadat FOR likp-wadat NO-EXTENSION OBLIGATORY. " Goods Issue Date
*parameters: "TR01-
p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
SELECT-OPTIONS: "TR01+
p_vstel FOR tvst-vstel. " Shipping Point "TR01+
SELECT-OPTIONS:
s_lfart FOR likp-lfart, " Delivery type
s_lgtor FOR t30b-lgtor, " Door selection
s_exidv FOR vekp-exidv, " Handling Unit
s_vbeln FOR likp-vbeln, " Delivery "MB01-+
s_lfdat FOR likp-lfdat. " Delivery date
PARAMETERS:
p_exdata AS CHECKBOX. " Show extra columns flag
SELECTION-SCREEN END OF BLOCK a.
van/pallet specific select options block
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_palno FOR zpallettr-zpallet_no, " no-extension,
s_vanno FOR zvantr-zvan_no. " no-extension.
SELECT-OPTIONS:
s_deppnt FOR zpallettr-zdep_point, "Jvdm01
s_tplst FOR vttk-tplst. "MB01
SELECTION-SCREEN END OF BLOCK b.
MB01 - START - Display variant
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-019.
PARAMETERS: p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK c.
MB01 - END
Value Request Events
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_palno-low.
CLEAR: number_range, w_number .
REFRESH number_range.
select numbers and display pop up screen for selection
PERFORM select_pal_nos.
s_palno-low = w_number.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_palno-high.
CLEAR: number_range, w_number .
REFRESH number_range.
select numbers and display pop up screen for selection
PERFORM select_pal_nos.
s_palno-high = w_number.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vanno-low.
CLEAR: number_range, w_number .
REFRESH number_range.
select numbers and display pop up screen for selection
PERFORM select_van_nos.
s_vanno-low = w_number.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vanno-high.
CLEAR: number_range, w_number .
REFRESH number_range.
select numbers and display pop up screen for selection
PERFORM select_van_nos.
s_vanno-high = w_number.
MB01 - START - display variant
F4-Help for variant
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
MB01 - END
At Selection Screen
AT SELECTION-SCREEN.
PERFORM validate_selections.
Initialization
INITIALIZATION.
MB01 - START INSERT
1. Transportation planning point
Import transportation planning point from user parameters and
populate
select option.
GET PARAMETER ID 'TDP' FIELD w_tplst.
MOVE: 'I' TO s_tplst-sign,
'EQ' TO s_tplst-option,
w_tplst TO s_tplst-low.
APPEND s_tplst.
2. Display variant
CLEAR s_variant.
s_variant-report = sy-repid.
Get default variant
s_def_variante = s_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = s_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = s_variant-variant.
ENDIF.
MB01 - END INSERT
Start of selection
START-OF-SELECTION.
clear all data tables
CLEAR: t_likp,
it_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr,
w_likp,
w_lips,
w_vbuk,
w_vbup,
w_vepo,
w_vekp.
REFRESH: t_likp,
it_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr.
select data for ALV
due to different input parameters being used, to streamline the data
selection process, different selection methods are required
IF NOT s_vanno IS INITIAL
OR NOT s_palno IS INITIAL
OR NOT s_deppnt IS INITIAL. "Jvdm01
if selecting by van/pallet number, need to select the data from the
handling unit upwards to delivery
PERFORM select_data_up.
ELSE.
otherwise the data can be selected from the delivery downwards
PERFORM select_data_down.
ENDIF.
End of selection
END-OF-SELECTION.
call hierarchical ALV display function module
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZWMR_PICK_STATUS_REPORT'
i_callback_pf_status_set = 'SET_STATUS'
i_callback_user_command =
'USER_COMMAND' "custom gui status form
is_layout = g_layout "user command form
it_fieldcat = gt_fieldcat
it_sort = g_sort
i_save = 'X' "MB01+
is_variant = s_variant
it_events = gt_events
i_tabname_header = 't_disp_head'
i_tabname_item = 't_disp_tab'
i_structure_name_header = 'ZPICKHEAD'
i_structure_name_item = 'ZPICKDISP'
is_keyinfo = g_keyinfo
TABLES
t_outtab_header = t_disp_head
t_outtab_item = t_disp_tab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
FORMS
Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
INCLUDE zwmr_pick_o01.
INCLUDE zwmr_pick_status_reporto01 .
INCLUDE zwmr_pick_i01.
INCLUDE zwmr_pick_status_reporti01 .
INCLUDE zwmr_pick_f01.
INCLUDE zwmr_pick_status_reportf01 .
*& Form select_pal_nos
select pallet numbers for search help
FORM select_pal_nos.
DATA: BEGIN OF t_palno OCCURS 0,
zpallet_no LIKE zpallettr-zpallet_no,
END OF t_palno.
select all available pallet numbers
SELECT DISTINCT zpallet_no FROM zpallettr
INTO CORRESPONDING FIELDS OF TABLE t_palno.
LOOP AT t_palno.
get pallet id
SELECT SINGLE zpallet_id FROM zpallettr
INTO number_range-id
WHERE zpallet_no = t_palno-zpallet_no.
get pallet description
SELECT SINGLE zdesc FROM zpalletmd
INTO number_range-desc
WHERE zpallet_id = number_range-id.
number_range-num = t_palno-zpallet_no.
append to search help table
APPEND number_range.
ENDLOOP.
call pop up dialog box
CALL SCREEN 0100 STARTING AT 5 5.
ENDFORM. " select_pal_nos
*& Form select_van_nos
select van numbers for search help
FORM select_van_nos.
DATA: BEGIN OF t_vanno OCCURS 0,
zvan_no LIKE zvantr-zvan_no,
END OF t_vanno.
select available van numbers
SELECT DISTINCT zvan_no FROM zvantr
INTO CORRESPONDING FIELDS OF TABLE t_vanno.
LOOP AT t_vanno.
select van id
SELECT SINGLE zvan_id FROM zvantr
INTO number_range-id
WHERE zvan_no = t_vanno-zvan_no.
select van description (maintained in pallet tables)
SELECT SINGLE zdesc FROM zpalletmd
INTO number_range-desc
WHERE zpallet_id = number_range-id.
number_range-num = t_vanno-zvan_no.
append to search help table
APPEND number_range.
ENDLOOP.
call pop up dialog box
CALL SCREEN 0100 STARTING AT 5 5.
ENDFORM. " select_van_nos
*& Form select_data_down
select data if selecting from delivery down
FORM select_data_down.
select all deliveries from LIKP that fulfill selection criteria
Start SU01 optmization changes
SELECT vbeln vstel lgtor route wadat "RM050906
SELECT vbeln vstel lgtor route wadat
zzroute2lgtor zz2route zzexproute zzroute2 anzpk "MB01-+
FROM likp INTO CORRESPONDING FIELDS OF TABLE it_likp"MB01-+
WHERE vbeln IN s_vbeln
AND vstel IN p_vstel
AND lfart IN s_lfart
AND wadat IN s_wadat
AND lfdat IN s_lfdat "MB01+
AND
( lgtor IN s_lgtor OR zzroute2lgtor IN s_lgtor ) ."MB01+
IF sy-subrc NE 0.
no data found
MESSAGE i007.
EXIT.
ENDIF.
IF NOT t_likp[] IS INITIAL. "SUM
IF NOT it_likp[] IS INITIAL.
SORT it_likp BY vbeln. "SUM
select sales document headers from VBUK
SELECT vbeln wbstk kostk
FROM vbuk INTO TABLE it_vbuk
FOR ALL ENTRIES IN it_likp "SUM
WHERE vbeln EQ it_likp-vbeln. "SUM
SORT it_vbuk BY vbeln.
select all relevant delivery items from LIPS
SELECT vbeln posnr pstyv matnr charg
FROM lips INTO TABLE it_lips
FOR ALL ENTRIES IN it_likp
WHERE vbeln EQ it_likp-vbeln
AND pckpf NE 'B' "cannot be packed "AS05
AND pstyv NE 'ZPAC' "AS05
AND pstyv NE 'ZGDP' "TR02+ "AS05
AND lfimg GT 0. "TR01+
ENDIF.
IF NOT it_lips[] IS INITIAL.
select all sales document line items from VBUP
SORT it_lips BY vbeln posnr. "SUM
SELECT vbeln posnr lvsta
FROM vbup INTO TABLE it_vbup
FOR ALL ENTRIES IN it_lips
WHERE vbeln EQ it_lips-vbeln
AND posnr = it_lips-posnr.
SORT it_vbup BY vbeln posnr.
select corresponding handling unit ID's (venum)
TR03 Replace
start
select * from vepo appending corresponding fields of table t_vepo
for all entries in t_lips
where vbeln = t_lips-vbeln
and posnr = t_lips-posnr
and matnr = t_lips-matnr
and charg = t_lips-charg.
SELECT vepoVENUM vepoVEPOS vepovbeln vepoposnr
FROM vepo as vepo
INNER JOIN vekp as vekp ON vepovenum = vekpvenum
APPENDING corresponding fields of table it_vepo
FOR ALL ENTRIES IN it_lips
WHERE vepo~vbeln = it_lips-vbeln
AND vepo~posnr = it_lips-posnr
AND vepo~matnr = it_lips-matnr
AND vepo~charg = it_lips-charg
AND vekp~exidv IN s_exidv.
SELECT venum vepos vbeln posnr
FROM vepo INTO TABLE it_vepo2
FOR ALL ENTRIES IN it_lips
WHERE vbeln = it_lips-vbeln
AND posnr = it_lips-posnr
AND matnr = it_lips-matnr
AND charg = it_lips-charg.
SORT it_vepo2 BY venum vepos.
*{ INSERT UKMK900355 1
Ice-multis: replace lower-level HUs with highest level " AS01
PERFORM replace_highest_hu. " AS01
*} INSERT
Start of changes by ANV SR#11523
MB01 - extract shipment header as well to populate leg indicator
Therefore, join vttp with vttk
Limit as well by transportation planning point
SELECT vttptknum vttptpnum vttpvbeln vttklaufk
FROM vttp INNER JOIN vttk
ON vttptknum = vttktknum
INTO TABLE it_vttp
FOR ALL ENTRIES IN it_lips
WHERE vttp~vbeln = it_lips-vbeln
AND vttk~tplst IN s_tplst.
MB01 - END
End of changes by ANV SR#11523
IF NOT it_vepo2[] IS INITIAL.
SELECT venum exidv
FROM vekp INTO TABLE it_vepo1
FOR ALL ENTRIES IN it_vepo2
WHERE venum = it_vepo2-venum
AND exidv IN s_exidv.
ENDIF.
SORT it_vepo1 BY venum.
CLEAR: w_vepo, it_vepo.
LOOP AT it_vepo1.
READ TABLE it_vepo2 WITH KEY venum = it_vepo1-venum.
IF sy-subrc = 0.
it_vepo2-exidv = it_vepo1-exidv.
MODIFY it_vepo2 TRANSPORTING exidv
WHERE venum = it_vepo1-venum .
ENDIF.
ENDLOOP.
DELETE it_vepo2 WHERE exidv IS initial.
it_vepo[] = it_vepo2[].
TR03 Replace end
ENDIF.
build process table
PERFORM move_to_table.
ENDFORM. "select_data_down
*& Form select_data_up
select data if selecting from van/pallet up
FORM select_data_up.
IF NOT s_vanno IS INITIAL.
if van then select van numbers and hence pallet numbers
SELECT * FROM zvantr INTO TABLE t_vantr
WHERE zvan_no IN s_vanno.
and vstel eq p_vstel."TR01-
IF NOT t_vantr[] IS INITIAL.
SORT t_vantr BY zvan_id zvan_no vstel zpallet_no. "SUM
SELECT * FROM zpallettr INTO TABLE t_pallettr
FOR ALL ENTRIES IN t_vantr
WHERE zpallet_no EQ t_vantr-zpallet_no
AND zdep_point IN s_deppnt. "Jvdm01
and vstel eq p_vstel."TR01-
ENDIF.
ELSE.
otherwise can get pallet numbers directly
SELECT * FROM zpallettr INTO TABLE t_pallettr
WHERE zpallet_no IN s_palno
AND zdep_point IN s_deppnt. "Jvdm01
and vstel eq p_vstel."TR01-
ENDIF.
IF NOT t_pallettr[] IS INITIAL.
from the pallet nos. we can select the handling units
SORT t_pallettr BY zpallet_id zpallet_no vstel exidv. "SUM
SELECT * FROM vekp INTO TABLE t_vekp
FOR ALL ENTRIES IN t_pallettr
WHERE exidv EQ t_pallettr-exidv
AND exidv NE space
AND exidv IN s_exidv "TR03+
AND ( exida = 'E' "TR01+
OR exida = 'F' ). "TR01+
ENDIF.
SORT t_vekp BY venum. "SUM
IF NOT t_vekp[] IS INITIAL.
build vbeln range from t_vekp.
LOOP AT t_vekp.
r_del-sign = 'I'.
r_del-option = 'EQ'.
r_del-low = t_vekp-vpobjkey.
APPEND r_del.
ENDLOOP.
select all deliveries from LIKP that correspond to HU's
SELECT * FROM likp INTO TABLE t_likp
WHERE vbeln IN r_del
AND wadat IN s_wadat
AND lfart IN s_lfart.
ENDIF.
MB01- START
SELECT vbeln lgtor route wadat
FROM likp INTO TABLE it_likp
WHERE vbeln IN r_del
AND wadat IN s_wadat
AND lfart IN s_lfart.
SELECT vbeln vstel lgtor route wadat
zzroute2lgtor zz2route zzexproute zzroute2 anzpk "MB01-+
FROM likp INTO CORRESPONDING FIELDS OF TABLE it_likp
WHERE vbeln IN r_del
AND lfart IN s_lfart
AND wadat IN s_wadat "MB01-+
AND lfdat IN s_lfdat. "MB01+
MB01- END
ENDIF.
IF NOT it_likp[] IS INITIAL.
SORT it_likp BY vbeln . "SUM
select sales document headers from VBUK
SELECT * FROM vbuk INTO TABLE t_vbuk
FOR ALL ENTRIES IN t_likp
WHERE vbeln EQ t_likp-vbeln.
SELECT vbeln wbstk kostk
FROM vbuk INTO TABLE it_vbuk
FOR ALL ENTRIES IN it_likp
WHERE vbeln EQ it_likp-vbeln.
SORT it_vbuk BY vbeln. "SUM
select all relevant delivery items from LIPS
SELECT * FROM lips INTO TABLE t_lips
FOR ALL ENTRIES IN t_likp
WHERE vbeln EQ t_likp-vbeln
AND pstyv NE 'ZPAC'
AND pstyv NE 'ZGDP' "TR02+
AND lfimg GT 0. "TR01+
SELECT vbeln posnr pstyv matnr charg
FROM lips INTO TABLE it_lips
FOR ALL ENTRIES IN it_likp
WHERE vbeln EQ it_likp-vbeln
AND pckpf NE 'B' "cannot be packed "AS05
AND pstyv NE 'ZPAC' "AS05
AND pstyv NE 'ZGDP' "TR02+ "AS05
AND lfimg GT 0. "TR01+
ENDIF.
IF NOT it_lips[] IS INITIAL.
SORT it_lips BY vbeln posnr. "SUM
select all sales document line items from VBUP
SELECT * FROM vbup INTO TABLE t_vbup
FOR ALL ENTRIES IN t_lips
WHERE vbeln EQ t_lips-vbeln
AND posnr = t_lips-posnr.
Start of changes by ANV SR#11523
MB01 - START
join vttp with vttk to obtain leg indicator
SELECT tknum tpnum vbeln
FROM vttp INTO TABLE it_vttp
FOR ALL ENTRIES IN it_lips
WHERE vbeln = it_lips-vbeln.
SELECT vttptknum vttptpnum vttpvbeln vttklaufk
FROM vttp INNER JOIN vttk
ON vttptknum = vttktknum
INTO TABLE it_vttp
FOR ALL ENTRIES IN it_lips
WHERE vttp~vbeln = it_lips-vbeln
AND vttk~tplst IN s_tplst.
MB01 - END
End of changes by ANV SR#11523
SELECT vbeln posnr lvsta
FROM vbup INTO TABLE it_vbup
FOR ALL ENTRIES IN it_lips
WHERE vbeln EQ it_lips-vbeln
AND posnr = it_lips-posnr.
SORT t_vbup BY vbeln posnr. "SUM
select corresponding handling unit ID's (venum)
SELECT * FROM vepo APPENDING CORRESPONDING FIELDS OF TABLE t_vepo
FOR ALL ENTRIES IN t_lips
WHERE vbeln = t_lips-vbeln
AND posnr = t_lips-posnr
AND matnr = t_lips-matnr
AND charg = t_lips-charg.
SELECT venum vepos vbeln posnr
FROM vepo APPENDING CORRESPONDING FIELDS OF TABLE it_vepo
FOR ALL ENTRIES IN it_lips
WHERE vbeln = it_lips-vbeln
AND posnr = it_lips-posnr
AND matnr = it_lips-matnr
AND charg = it_lips-charg.
*{ INSERT UKMK900355 1
it_vepo2[] = it_vepo[]. " DS01
PERFORM replace_highest_hu. " DS01
it_vepo[] = it_vepo2[]. " DS01
*} INSERT
ENDIF.
build process table
PERFORM move_to_table.
ENDFORM. "select_data_up
*& Form move_to_table
move data to processing table
FORM move_to_table.
LOOP AT it_vepo.
CLEAR t_data_tab.
delivery lines.
CLEAR w_lips.
READ TABLE it_lips WITH KEY vbeln = it_vepo-vbeln
posnr = it_vepo-posnr
INTO w_lips BINARY SEARCH. "SUM
MOVE-CORRESPONDING w_lips TO t_data_tab.
sales document line items
CLEAR w_vbup.
READ TABLE it_vbup WITH KEY vbeln = it_vepo-vbeln
posnr = it_vepo-posnr
INTO w_vbup BINARY SEARCH. "SUM
if w_vbup-kosta = space. "TR01-
not relevant for picking
delete t_vepo. "TR01-
continue. "TR01-
else. "TR01-
MOVE-CORRESPONDING w_vbup TO t_data_tab.
endif. "TR01-
sales doc header
CLEAR w_vbuk.
READ TABLE it_vbuk WITH KEY vbeln = it_vepo-vbeln
INTO w_vbuk BINARY SEARCH. "SUM
MOVE-CORRESPONDING w_vbuk TO t_data_tab.
delivery header
CLEAR w_likp.
READ TABLE it_likp WITH KEY vbeln = it_vepo-vbeln
INTO w_likp BINARY SEARCH. "SUM
MOVE-CORRESPONDING w_likp TO t_data_tab.
MB01 - START
DATA: w_routetype TYPE i. "0=non-global,1=1st route,2=2nd
route,3=both
At this point move DOOR2 if it falls within the global route scenario
and the door2 is satisfies the selection criteria for door
1. Does delivery fall within global route scenario
CLEAR w_routetype.
IF w_likp-zz2route = 'Y' .
1.a. First route - does door1 satisfy the selection criteria
IF w_likp-lgtor IN s_lgtor.
w_routetype = 1.
MOVE w_likp-zzexproute TO t_data_tab-route.
1.b. Second route - does door2 satisfy the selection criteria
ELSEIF w_likp-zzroute2lgtor IN s_lgtor.
here we need to move door2 to lgtor
w_routetype = 2.
MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
MOVE w_likp-zzroute2 TO t_data_tab-route.
ENDIF.
If both routes satsify the criteria, append for 2nd leg ***REVISIT!
IF w_likp-lgtor IN s_lgtor AND w_likp-zzroute2lgtor IN s_lgtor.
w_routetype = 3.
ENDIF.
ENDIF.
MB01 - END
Start of changes by ANV SR#11523
MB01 - If the delivery falls within the global route scenario... need
to select either preliminary shipment leg OR subsequent leg
when laufk= 1 (prelim) and linked to route1, if laufk = 2 (subseq) &
linked to route2
Shipment Number
SORT it_vttp BY vbeln laufk.
CLEAR w_vttp.
CASE w_routetype.
WHEN 0.
READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
INTO w_vttp BINARY SEARCH.
WHEN 1.
READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
laufk = '1'
INTO w_vttp BINARY SEARCH.
WHEN 2.
READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
laufk = '3'
INTO w_vttp BINARY SEARCH.
WHEN 3. "REVISIT
ENDCASE.
MOVE w_vttp-tknum TO t_data_tab-tknum.
MB01 - END
End of changes by ANV SR#11523
select handling unit info using vepo entry
CLEAR w_vekp.
IF t_vekp[] IS INITIAL.
SELECT SINGLE * FROM vekp INTO w_vekp
WHERE venum = it_vepo-venum.
ELSE.
READ TABLE t_vekp WITH KEY venum = it_vepo-venum
INTO w_vekp BINARY SEARCH. "SUM
IF sy-subrc NE 0.
SELECT SINGLE * FROM vekp INTO w_vekp
WHERE venum = t_vepo-venum.
ENDIF.
ENDIF.
MOVE-CORRESPONDING w_vekp TO t_data_tab.
*{ INSERT UKMK900355 2
WM status for HU "AS03
SELECT SINGLE * FROM zhu_to_link WHERE lgnum EQ w_vekp-lgnum"AS03
AND exidv EQ w_vekp-exidv."AS03
IF sy-subrc EQ 0. "AS03
IF zhu_to_link-zpick_comp EQ space. "AS03
t_data_tab-lvsta = 'B'. "AS03
ELSE. "AS03
t_data_tab-lvsta = 'C'. "AS03
ENDIF. "AS03
ENDIF. "AS03
*} INSERT
select pallet / van load information "Jvdm01-
SELECT SINGLE zpallet_no zcount_check FROM zpallettr "Jvdm01-
INTO (t_data_tab-zpallet_no, "Jvdm01-
t_data_tab-zcount_check) "Jvdm01-
WHERE exidv EQ w_vekp-exidv. "Jvdm01-
PERFORM read_pallet. "MB01+
SELECT SINGLE zpallet_no zcount_check zdep_point "Jvdm01+
FROM zpallettr "Jvdm01+
INTO (t_data_tab-zpallet_no, "Jvdm01+
t_data_tab-zcount_check, "Jvdm01+
t_data_tab-zdep_point) "Jvdm01+
WHERE exidv EQ w_vekp-exidv. "Jvdm01+
WHERE exidv EQ w_vekp-exidv "MB01-+
AND zpallet_id = t_data_tab-lgtor."MB01+
MB01 - INSERT START
If pallet number specified and
we are in the global route scenario & both doors fall within the
selection criteria, we need to copy the one that is currently in a
specified pallet
IF NOT s_palno IS INITIAL AND not t_data_tab-zpallet_no in s_palno
AND w_routetype = '3' .
Switch doors & get 2nd shipment
MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
MOVE w_likp-zzroute2 TO t_data_tab-route.
Read subsequent leg shipment
READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
laufk = '3'
INTO w_vttp BINARY SEARCH.
IF sy-subrc = 0.
MOVE w_vttp-tknum TO t_data_tab-tknum.
ENDIF.
PERFORM read_pallet. "MB01+
ENDIF.
MB01 - INSERT END
IF NOT t_data_tab-zpallet_no IN s_palno. "TR01+
CONTINUE. "TR01+
ENDIF. "TR01+
IF sy-subrc = 0. "mb01+
perform read_van. "MB01+
SELECT SINGLE zvan_no zvan_print zeod_print FROM zvantr
INTO (t_data_tab-zvan_no,
t_data_tab-zvan_print,
t_data_tab-zeod_print)
WHERE zpallet_no EQ t_data_tab-zpallet_no.
MB01 - INSERT START
If van number specified and
we are in the global route scenario & both doors fall within the
selection criteria, we need to copy the one that is currently on a
specified van
IF NOT s_vanno IS INITIAL AND not t_data_tab-zvan_no in s_vanno AND
w_routetype = '3' .
Switch doors & get 2nd shipment
MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
MOVE w_likp-zzroute2 TO t_data_tab-route.
Read subsequent leg shipment
READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
laufk = '3'
INTO w_vttp BINARY SEARCH.
IF sy-subrc = 0.
MOVE w_vttp-tknum TO t_data_tab-tknum.
ENDIF.
PERFORM read_pallet. "MB01+
perform read_van.
ENDIF. "mb01-
MB01 - INSERT END
IF NOT t_data_tab-zvan_no IN s_vanno. "TR01+
CONTINUE. "TR01+
ENDIF. "TR01+
ENDIF.
APPEND t_data_tab.
ENDLOOP.
*-----> TR01+ start
If the delivery has yet to be packed, then need to include in report
Thus delete t_lips here and if any entries left after looping through
t_vepo, these will also need to be added to t_data_tab
if the selection is by handling unit though we do not want
these"TR03+
IF s_exidv IS INITIAL. "TR03+
*{ REPLACE UKMK900355 1
*\ LOOP AT it_vepo.
*\ READ TABLE it_lips WITH KEY vbeln = it_vepo-vbeln
*\ posnr = it_vepo-posnr
*\ BINARY SEARCH. "SUM
*\ IF sy-subrc = 0.
*\ DELETE it_lips INDEX sy-tabix.
*\ ENDIF.
*\ ENDLOOP.
Higher-level HUs can contain more than one delivery item " AS01
LOOP AT it_lips. " AS01
READ TABLE t_vepo_low WITH KEY vbeln = it_lips-vbeln " AS01
posnr = it_lips-posnr. " AS01
CHECK sy-subrc EQ 0. " AS01
DELETE it_lips. " AS01
ENDLOOP. " AS01
*} REPLACE
IF NOT it_lips[] IS INITIAL.
move any unpacked items to the data table
PERFORM move_lips_to_table.
ENDIF.
ENDIF. "TR03+
*<---- TR01+ End
get relevant status icons
PERFORM select_icons.
prepare ALV data
PERFORM prepare_alv.
ENDFORM. " select_data
*& Form select_icons
select icons for display and move data to display table
FORM select_icons.
DATA: w_disp_tab LIKE zpickdisp,
w_disp_head LIKE zpickhead,
w_color LIKE zpickdisp-color,
ov_icon LIKE zpickdisp-ov_icon,
gi_icon LIKE zpickdisp-gi_icon,
to_icon LIKE zpickdisp-to_icon,
lp_icon LIKE zpickdisp-lp_icon,
pc_icon LIKE zpickdisp-pc_icon,
lv_icon LIKE zpickdisp-lv_icon,
vm_icon LIKE zpickdisp-vm_icon,
em_icon LIKE zpickdisp-em_icon,
sp_icon LIKE zpickdisp-sp_icon, " ANV SR#11523
t_ovst_tab LIKE t_disp_tab WITH HEADER LINE.
CONSTANTS: c_col1(3) VALUE 'C10',
c_col2(3) VALUE 'C20'.
SORT t_data_tab BY lgtor vbeln.
w_color = c_col2.
LOOP AT t_data_tab.
AT NEW lgtor.
fill ALV header table
CLEAR w_disp_head.
w_disp_head-lgtor = t_data_tab-lgtor.
APPEND w_disp_head TO t_disp_head.
ENDAT.
goods issue status & overall amber/green only
CASE t_data_tab-wbstk.
WHEN c_c.
MOVE icon_green_light TO gi_icon.
MOVE icon_green_light TO ov_icon.
WHEN OTHERS.
MOVE icon_red_light TO gi_icon.
MOVE icon_yellow_light TO ov_icon.
ENDCASE.
transfer order status
CASE t_data_tab-lvsta.
WHEN c_a.
MOVE icon_red_light TO to_icon.
WHEN c_b.
MOVE icon_yellow_light TO to_icon.
WHEN c_c.
MOVE icon_green_light TO to_icon.
WHEN space.
write N/A
to_icon = 'N/A'.
ENDCASE.
loaded to pallet status
IF NOT t_data_tab-zpallet_no IS INITIAL.
MOVE icon_green_light TO lp_icon.
ELSE.
MOVE icon_red_light TO lp_icon.
ENDIF.
pallet count status
IF NOT t_data_tab-zcount_check IS INITIAL.
MOVE icon_green_light TO pc_icon.
ELSE.
MOVE icon_red_light TO pc_icon.
ENDIF.
loaded to van status
IF NOT t_data_tab-zvan_no IS INITIAL.
MOVE icon_green_light TO lv_icon.
ELSE.
MOVE icon_red_light TO lv_icon.
ENDIF.
van manifest status
IF NOT t_data_tab-zvan_print IS INITIAL.
MOVE icon_green_light TO vm_icon.
ELSE.
MOVE icon_red_light TO vm_icon.
ENDIF.
Start of changes by ANV SR#11523
Shipment status
IF NOT t_data_tab-tknum IS INITIAL.
MOVE icon_green_light TO sp_icon.
ELSE.
MOVE icon_red_light TO sp_icon.
ENDIF.
End of changes by ANV SR#11523
end of day manifest status
IF NOT t_data_tab-zeod_print IS INITIAL.
MOVE icon_green_light TO em_icon.
ELSE.
MOVE icon_red_light TO em_icon.
ENDIF.
move working data table to display table
MOVE-CORRESPONDING t_data_tab TO w_disp_tab.
w_disp_tab-ov_icon = ov_icon.
w_disp_tab-gi_icon = gi_icon.
w_disp_tab-to_icon = to_icon.
w_disp_tab-lp_icon = lp_icon.
w_disp_tab-pc_icon = pc_icon.
w_disp_tab-lv_icon = lv_icon.
w_disp_tab-vm_icon = vm_icon.
w_disp_tab-em_icon = em_icon.
w_disp_tab-sp_icon = sp_icon. "ANV SR#11523
w_disp_tab-color = w_color.
fill N/A values for initial fields for display
IF w_disp_tab-packvorschr IS INITIAL.
w_disp_tab-packvorschr = 'N/A'.
ENDIF.
IF w_disp_tab-exidv IS INITIAL.
w_disp_tab-exidv = 'N/A'.
ENDIF.
IF w_disp_tab-zpallet_no IS INITIAL.
WRITE 'N/A' TO w_disp_tab-zpallet_no.
ENDIF.
IF w_disp_tab-zvan_no IS INITIAL.
WRITE 'N/A' TO w_disp_tab-zvan_no.
ENDIF.
display different color for new doc number
AT END OF vbeln.
IF w_color = c_col1.
w_color = c_col2.
ELSEIF w_color = c_col2.
w_color = c_col1.
ENDIF.
ENDAT.
APPEND w_disp_tab TO t_disp_tab.
CLEAR w_disp_tab.
ENDLOOP.
we have all the icons in display but need to check the overall status
as this refers to the line items
green and amber statuses already set and use the same criteria as the
goods issue status unless detected as red here
DATA: ov_stat_red(1).
CLEAR w_disp_tab.
SORT t_disp_tab BY vbeln.
LOOP AT t_disp_tab INTO w_disp_tab.
AT NEW vbeln.
check all line items for delivery
LOOP AT t_data_tab WHERE vbeln = w_disp_tab-vbeln.
IF t_data_tab-lvsta = c_a.
set overall status to red
ov_stat_red = c_yes.
EXIT.
ELSE.
leave green/amber status icon as previosly determined
ENDIF.
ENDLOOP.
IF ov_stat_red = c_yes.
set overall status to red for all items in that delivery
CLEAR ov_stat_red.
MOVE icon_red_light TO w_disp_tab-ov_icon.
MODIFY t_disp_tab FROM w_disp_tab TRANSPORTING ov_icon
WHERE vbeln = w_disp_tab-vbeln.
ENDIF.
ENDAT.
ENDLOOP.
ENDFORM. " select_icons
*& Form fill_layout
fill ALV layout parameters
FORM fill_layout.
CLEAR g_layout.
g_layout-colwidth_optimize = c_yes. " column width optimisation
g_layout-zebra = space. " alternate line colors
g_layout-box_fieldname = 'MARK'. " checkbox fieldname
g_layout-info_fieldname = 'COLOR'. " highlight row indicator
g_layout-no_vline = space. " vertical line
g_layout-key_hotspot = space. " hotspot field
g_layout-f2code = 'PICK'. " F2 ok_code
g_layout-numc_sum = c_yes. " sum numc fields
g_layout-box_tabname = 't_disp_head'. " checkbox table name
g_layout-expand_fieldname = 'EXPAND'. " expand field name
ENDFORM. " fill_layout
*& Form fill_sort
fill ALV sort table
FORM fill_sort.
DATA: w_g_sort TYPE slis_sortinfo_alv.
w_g_sort-spos = 1.
w_g_sort-fieldname = 'LGTOR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
APPEND w_g_sort TO g_sort.
w_g_sort-spos = 2.
w_g_sort-fieldname = 'VBELN'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
APPEND w_g_sort TO g_sort.
w_g_sort-spos = 3.
w_g_sort-fieldname = 'POSNR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
APPEND w_g_sort TO g_sort. -
hi gurus,
In my report program i have a monthly report displaying the data for that month.
1. Now in my ALV grid i want The SUB-TOTALS for the work center wise data for a field of the alv. there are many workcenters data in my report. So after the end of each work center , i want the subtotal of a calculated TAT field.
2. At the end of the report, I want the average TAT(field calculated by my report program) for that month.
So how can i make the coding for the above.
Iam a fresher to this field, so give me in detail.
regards,
chaitanyaHi
i am giving a sample example for subtotals of alv.
REPORT z_alv_subtotal.
*& Table declaration
TABLES: EKKO.
*& Type pool declaration
TYPE-POOLS: SLIS. " Type pool for ALV
*& Selection screen
SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN.
*& Type declaration
Type declaration for internal table to store EKPO data
TYPES: BEGIN OF X_DATA,
EBELN TYPE CHAR30, " Document no.
EBELP TYPE EBELP, " Item no
MATNR TYPE MATNR, " Material no
MATNR1 TYPE MATNR, " Material no
WERKS TYPE WERKS_D, " Plant
WERKS1 TYPE WERKS_D, " Plant
NTGEW TYPE ENTGE, " Net weight
GEWE TYPE EGEWE, " Unit of weight
END OF X_DATA.
*& Internal table declaration
DATA:
Internal table to store EKPO data
I_EKPO TYPE STANDARD TABLE OF X_DATA INITIAL SIZE 0,
Internal table for storing field catalog information
I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
Internal table for Top of Page info. in ALV Display
I_ALV_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
Internal table for ALV Display events
I_EVENTS TYPE SLIS_T_EVENT,
Internal table for storing ALV sort information
I_SORT TYPE SLIS_T_SORTINFO_ALV,
I_EVENT TYPE SLIS_T_EVENT.
*& Work area declaration
DATA:
WA_EKKO TYPE X_DATA,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_EVENTS TYPE SLIS_ALV_EVENT,
WA_SORT TYPE SLIS_SORTINFO_ALV.
*& Constant declaration
CONSTANTS:
C_HEADER TYPE CHAR1
VALUE 'H', "Header in ALV
C_ITEM TYPE CHAR1
VALUE 'S'.
*& Start-of-selection event
START-OF-SELECTION.
Select data from ekpo
SELECT EBELN " Doc no
EBELP " Item
MATNR " Material
MATNR " Material
WERKS " Plant
WERKS " Plant
NTGEW " Quantity
GEWEI " Unit
FROM EKPO
INTO TABLE I_EKPO
WHERE EBELN IN S_EBELN
AND NTGEW NE '0.00'.
IF SY-SUBRC = 0.
SORT I_EKPO BY EBELN EBELP MATNR .
ENDIF.
To build the Page header
PERFORM SUB_BUILD_HEADER.
To prepare field catalog
PERFORM SUB_FIELD_CATALOG.
Perform to populate the layout structure
PERFORM SUB_POPULATE_LAYOUT.
Perform to populate the sort table.
PERFORM SUB_POPULATE_SORT.
Perform to populate ALV event
PERFORM SUB_GET_EVENT.
END-OF-SELECTION.
Perform to display ALV report
PERFORM SUB_ALV_REPORT_DISPLAY.
*& Form sub_build_header
To build the header
No Parameter
FORM SUB_BUILD_HEADER .
Local data declaration
DATA: L_SYSTEM TYPE CHAR10 , "System id
L_R_LINE TYPE SLIS_LISTHEADER, "Hold list header
L_DATE TYPE CHAR10, "Date
L_TIME TYPE CHAR10, "Time
L_SUCCESS_RECORDS TYPE I, "No of success records
L_TITLE(300) TYPE C. " Title
Title Display
L_R_LINE-TYP = C_HEADER. " header
L_TITLE = 'Test report'(001).
L_R_LINE-INFO = L_TITLE.
APPEND L_R_LINE TO I_ALV_TOP_OF_PAGE.
CLEAR L_R_LINE.
Run date Display
CLEAR L_DATE.
L_R_LINE-TYP = C_ITEM. " Item
WRITE: SY-DATUM TO L_DATE MM/DD/YYYY.
L_R_LINE-KEY = 'Run Date :'(002).
L_R_LINE-INFO = L_DATE.
APPEND L_R_LINE TO I_ALV_TOP_OF_PAGE.
CLEAR: L_R_LINE,
L_DATE.ENDFORM. " sub_build_header
*& Form sub_field_catalog
Build Field Catalog
No Parameter
FORM SUB_FIELD_CATALOG .
Build Field Catalog
PERFORM SUB_FILL_ALV_FIELD_CATALOG USING:
'01' '01' 'EBELN' 'I_EKPO' 'L' 'Doc No'(003) ' ' ' ' ' ' ' ',
'01' '02' 'EBELP' 'I_EKPO' 'L' 'Item No'(004) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR' 'I_EKPO' 'L' 'Material No'(005) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR1' 'I_EKPO' 'L' 'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L' 'Plant'(006) 'X' 'X' ' ' ' ',
'01' '04' 'WERKS1' 'I_EKPO' 'L' 'Plant'(006) ' ' ' ' ' ' ' ',
'01' '05' 'NTGEW' 'I_EKPO' 'R' 'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'
ENDFORM. " sub_field_catalog
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM SUB_FILL_ALV_FIELD_CATALOG USING P_ROWPOS TYPE SYCUROW
P_COLPOS TYPE SYCUCOL
P_FLDNAM TYPE FIELDNAME
P_TABNAM TYPE TABNAME
P_JUSTIF TYPE CHAR1
P_SELTEXT TYPE DD03P-SCRTEXT_L
P_OUT TYPE CHAR1
P_TECH TYPE CHAR1
P_QFIELD TYPE SLIS_FIELDNAME
P_QTAB TYPE SLIS_TABNAME.
Local declaration for field catalog
DATA: WA_LFL_FCAT TYPE SLIS_FIELDCAT_ALV.
WA_LFL_FCAT-ROW_POS = P_ROWPOS. "Row
WA_LFL_FCAT-COL_POS = P_COLPOS. "Column
WA_LFL_FCAT-FIELDNAME = P_FLDNAM. "Field Name
WA_LFL_FCAT-TABNAME = P_TABNAM. "Internal Table Name
WA_LFL_FCAT-JUST = P_JUSTIF. "Screen Justified
WA_LFL_FCAT-SELTEXT_L = P_SELTEXT. "Field Text
WA_LFL_FCAT-NO_OUT = P_OUT. "No output
WA_LFL_FCAT-TECH = P_TECH. "Technical field
WA_LFL_FCAT-QFIELDNAME = P_QFIELD. "Quantity unit
WA_LFL_FCAT-QTABNAME = P_QTAB . "Quantity table
IF P_FLDNAM = 'NTGEW'.
WA_LFL_FCAT-DO_SUM = 'X'.
ENDIF.
APPEND WA_LFL_FCAT TO I_FIELDCAT.
CLEAR WA_LFL_FCAT.
ENDFORM. " sub_fill_alv_field_catalog
*& Form sub_populate_layout
Populate ALV layout
No Parameter
FORM SUB_POPULATE_LAYOUT . CLEAR WA_LAYOUT.
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'." Optimization of Col width
ENDFORM. " sub_populate_layout
*& Form sub_populate_sort
Populate ALV sort table
No Parameter
FORM SUB_POPULATE_SORT .
Sort on material
WA_SORT-SPOS = '01' .
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-TABNAME = 'I_EKPO'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO I_SORT .
CLEAR WA_SORT.
Sort on plant
WA_SORT-SPOS = '02'.
WA_SORT-FIELDNAME = 'WERKS'.
WA_SORT-TABNAME = 'I_EKPO'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO I_SORT .
CLEAR WA_SORT.
ENDFORM. " sub_populate_sort
*& Form sub_get_event
Get ALV grid event and pass the form name to subtotal_text
event
No Parameter
FORM SUB_GET_EVENT .
CONSTANTS : C_FORMNAME_SUBTOTAL_TEXT TYPE SLIS_FORMNAME VALUE
'SUBTOTAL_TEXT'.
DATA: L_S_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 4
IMPORTING
ET_EVENTS = I_EVENT
EXCEPTIONS
LIST_TYPE_WRONG = 0
OTHERS = 0.
Subtotal
READ TABLE I_EVENT INTO L_S_EVENT
WITH KEY NAME = SLIS_EV_SUBTOTAL_TEXT.
IF SY-SUBRC = 0.
MOVE C_FORMNAME_SUBTOTAL_TEXT TO L_S_EVENT-FORM.
MODIFY I_EVENT FROM L_S_EVENT INDEX SY-TABIX.
ENDIF.
ENDFORM. " sub_get_event
*& Form sub_alv_report_display
For ALV Report Display
No Parameter
FORM SUB_ALV_REPORT_DISPLAY .
DATA: L_REPID TYPE SYREPID .
L_REPID = SY-REPID .
This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = L_REPID
I_CALLBACK_TOP_OF_PAGE = 'SUB_ALV_TOP_OF_PAGE'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = I_FIELDCAT
IT_SORT = I_SORT
IT_EVENTS = I_EVENT
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = I_EKPO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.ENDFORM. " sub_alv_report_display
FORM sub_alv_top_of_page
Call ALV top of page
No parameter
FORM SUB_ALV_TOP_OF_PAGE. "#EC CALLED
To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_ALV_TOP_OF_PAGE.
ENDFORM. "alv_top_of_page
*& Form subtotal_text
Build subtotal text
P_total Total
p_subtot_text Subtotal text info
FORM SUBTOTAL_TEXT CHANGING
P_TOTAL TYPE ANY
P_SUBTOT_TEXT TYPE SLIS_SUBTOT_TEXT.
Material level sub total
IF P_SUBTOT_TEXT-CRITERIA = 'MATNR'.
P_SUBTOT_TEXT-DISPLAY_TEXT_FOR_SUBTOTAL
= 'Material level total'(009).
ENDIF.
Plant level sub total
IF P_SUBTOT_TEXT-CRITERIA = 'WERKS'.
P_SUBTOT_TEXT-DISPLAY_TEXT_FOR_SUBTOTAL = 'Plant level total'(010).
ENDIF. -
hi experts,
well i am having a problem regarding ALV display...the requirement is :
ALV DISPLAY SHOULD BE LIKE THIS
Open Balance 12345
SY-DATUM POSTING DATE DOC. NUMBER LOCAL CURRENCY AMOUNT
now the sum of the amount is displayed in front of open balance field, which is displayed in a first row of ALV display. And below are the columns with heading are having a details of the GL-ACCOUNT.
Is this possible using a same ALV grid display or i have to use 2 ALV grid display? In both cases plz let me know to get this sort of output?
regards,
Yahya Shoaib.In the heading part you can display the total..
*& Report ZTRN_ALV1
REPORT ZTRN_ALV1.
TYPE-POOLS: SLIS.
DATA: REPID LIKE SY-REPID,
FCAT TYPE SLIS_T_FIELDCAT_ALV,
GCAT TYPE SLIS_FIELDCAT_ALV,
FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
GCAT1 TYPE SLIS_FIELDCAT_ALV,
LAYOUT TYPE SLIS_LAYOUT_ALV,
T_EVENTS TYPE SLIS_T_EVENT,
EVENTS TYPE SLIS_ALV_EVENT,
HEADING TYPE SLIS_T_LISTHEADER,
HEADER TYPE SLIS_LISTHEADER.
PARAMETERS: CCODE LIKE LFB1-BUKRS.
DATA: BEGIN OF ITAB OCCURS 0,
lifnr LIKE LFA1-LIFNR,
BUKRS LIKE LFB1-BUKRS,
NAME1 LIKE LFA1-NAME1,
END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
lifnr LIKE LFA1-LIFNR,
AEDAT LIKE EKKO-AEDAT,
END OF JTAB.
*DATA: JTAB LIKE STANDARD TABLE OF EKKO WITH HEADER LINE INITIAL SIZE 0.
START-OF-SELECTION.
REPID = SY-REPID.
PERFORM FETCH.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM GET_EVENTS.
PERFORM EVENTS.
PERFORM OUTPUT.
*& Form FETCH
text
--> p1 text
<-- p2 text
FORM FETCH .
SELECT ALIFNR ANAME1 BBUKRS INTO CORRESPONDING FIELDS OF TABLE ITAB FROM LFA1 AS A JOIN LFB1 AS B ON ALIFNR EQ B~LIFNR WHERE
B~BUKRS EQ CCODE.
ENDFORM. " FETCH
*& Form FIELDCAT
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
GCAT-COL_POS = '1'.
GCAT-FIELDNAME = 'BUKRS'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND GCAT TO FCAT.
GCAT-COL_POS = '2'.
GCAT-FIELDNAME = 'LIFNR'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'VENDOR NUMBER'.
APPEND GCAT TO FCAT.
GCAT-COL_POS = '3'.
GCAT-FIELDNAME = 'NAME1'.
GCAT-TABNAME = ITAB.
GCAT-SELTEXT_M = 'VENDOR NAME'.
APPEND GCAT TO FCAT.
ENDFORM. " FIELDCAT
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form GET_EVENTS
text
--> p1 text
<-- p2 text
FORM GET_EVENTS .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = T_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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. " GET_EVENTS
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
READ TABLE T_EVENTS INTO EVENTS WITH KEY NAME = 'TOP_OF_PAGE'.
EVENTS-FORM = 'TOP_OF_PAGE'.
MODIFY TABLE T_EVENTS FROM EVENTS TRANSPORTING FORM.
READ TABLE T_EVENTS INTO EVENTS WITH KEY NAME = 'USER_COMMAND'.
EVENTS-FORM = 'USER_COMMAND'.
MODIFY TABLE T_EVENTS FROM EVENTS TRANSPORTING FORM.
ENDFORM. " EVENTS
*& Form OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = T_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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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. " OUTPUT
*& Form TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM TOP_OF_PAGE .
CLEAR HEADING[]. <----IN THIS INTERNAL TABLE YOU EASILY DISPLAY TOTAL...
HEADER-TYP = 'H'.
HEADER-INFO = 'WIPRO TECHNOLOGIES'.
APPEND HEADER TO HEADING.
HEADER-TYP = 'S'.
HEADER-INFO = 'ADVANCED ABAP TRAINING'.
APPEND HEADER TO HEADING.
HEADER-TYP = 'A'.
HEADER-INFO = 'LIST OF VENDORS'.
APPEND HEADER TO HEADING.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. -
OO ALV displaying without Values despite Internal table contains
My below OO ALV displaying without Values despite Internal table contains the values ...
Help please ...
REPORT zsd_concession1 NO STANDARD PAGE HEADING
LINE-SIZE 285
LINE-COUNT 64
MESSAGE-ID zz.
Program Description ******************************
This report is to Calculate consession against Quotations
complying standards for enhanced Performance, Readability &
Maintenance.
Change Log *********************************
Remedy # / Who When Why / What
Transport #
CLASS lcl_event_handler DEFINITION DEFERRED.
*& Data Definitions .
DATA: BEGIN OF vbap_wa,
vbeln TYPE vbak-vbeln, "Quotation#
erdat TYPE vbak-erdat, "Quot date
knumv TYPE vbak-knumv, "Cond Rec#
posnr TYPE vbap-posnr, "Line Item
matnr TYPE vbap-matnr, "Mat#
zansicat TYPE zmarall-zansicat, "AnsiCat#
zansigrd TYPE zmarall-zansigrd, "Grade
zcurrvaltnarea TYPE zco002-zcurrvaltnarea,"Val Area
zcurrcstusd TYPE zco002-zcurrcstusd, "Cost$
zzbrndnm TYPE mara-zzbrndnm, "Brand
zqedscgrp TYPE zglbprc-zqedscgrp, "QE Disc Grp
mstav TYPE mara-mstav, "Status
kwmeng TYPE vbap-kwmeng, "Qty
lprc TYPE konv-kbetr, "List Price ZBP1
sprc TYPE konv-kbetr, "Std Pric ZNAA,ZNAX
netpr TYPE vbap-netpr, "Quot price
mrgn TYPE konv-kbetr, "margin%
END OF vbap_wa,
BEGIN OF konv_wa,
knumv TYPE konv-knumv, "Cond#
kposn TYPE konv-kposn, "Cond Item#
kappl TYPE konv-kappl, "Applic
kschl TYPE konv-kschl, "Cond Typ
kbetr TYPE konv-kbetr, "Price ZBP1,ZNAA,ZNAX
END OF konv_wa,
BEGIN OF vbpa_wa,
vbeln TYPE vbpa-vbeln, "Quot#
posnr TYPE vbpa-posnr, "Item#
parvw TYPE vbpa-parvw, "Prt Fn
kunnr TYPE vbpa-kunnr, "Cust#
END OF vbpa_wa,
BEGIN OF result_wa,
posnr TYPE vbap-posnr, "Line Item
matnr TYPE vbap-matnr, "Mat#
zansicat TYPE zmarall-zansicat, "AnsiCat#
zansigrd TYPE zmarall-zansigrd, "Grade
zcurrvaltnarea TYPE zco002-zcurrvaltnarea,"Val Area
zcurrcstusd TYPE zco002-zcurrcstusd, "Cost$
zzbrndnm TYPE mara-zzbrndnm, "Brand
zqedscgrp TYPE zglbprc-zqedscgrp, "QE Disc Grp
mstav TYPE mara-mstav, "Status
kwmeng TYPE vbap-kwmeng, "Qty
lprc TYPE konv-kbetr, "List Price ZBP1
sprc TYPE konv-kbetr, "Std Pric ZNAA,ZNAX
netpr TYPE vbap-netpr, "Quot price
mrgn TYPE konv-kbetr, "margin%
END OF result_wa.
DATA: ikonv LIKE STANDARD TABLE OF konv_wa,
ivbap LIKE STANDARD TABLE OF vbap_wa,
ivbpa LIKE STANDARD TABLE OF vbpa_wa,
iresult LIKE STANDARD TABLE OF result_wa.
*Work storage
DATA: BEGIN OF ws,
vbeln TYPE vbak-vbeln,
ok_code TYPE sy-ucomm,
alv_save TYPE c, "ALV save
alv_variant TYPE disvariant, "ALV Variant
alv_sort TYPE lvc_t_sort, "Sort table
END OF ws.
*Data declarations for ALV Main list
DATA : ty_lay1 TYPE lvc_s_layo,
it_fieldcat TYPE lvc_t_fcat ,
ty_fieldcat TYPE lvc_s_fcat ,
l_smenu TYPE REF TO cl_ctmenu,
c_alv1 TYPE REF TO cl_gui_alv_grid,
c_cont1 TYPE REF TO cl_gui_custom_container,
e_dclick TYPE REF TO lcl_event_handler.
*Data declarations for ALV Interactive list
DATA : ty_lay2 TYPE lvc_s_layo,
it_fcat TYPE lvc_t_fcat ,
ty_fcat TYPE lvc_s_fcat ,
c_alv2 TYPE REF TO cl_gui_alv_grid,
c_cont2 TYPE REF TO cl_gui_custom_container.
*Field-Symbols
FIELD-SYMBOLS:
<konv> LIKE konv_wa,
<vbap> LIKE vbap_wa.
*Constants
CONSTANTS:
c_end_row TYPE i VALUE 65000.
*CLASS lcl_event_receiver DEFINITION
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row.
ENDCLASS. "lcl_event_handler DEFINITION
*CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_double_click.
DATA: sec_wa LIKE LINE OF iresult.
*Reading the selected data into a variable
READ TABLE iresult INDEX e_row-index INTO sec_wa.
*Select the field details of the selected table
SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
WHERE tabname EQ ls_dd02l-tabname.
*Calling the ALV containing the field values
CALL SCREEN 101.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_handler IMPLEMENTATION
*& SELECTION-SCREEN.
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_vbeln FOR ws-vbeln DEFAULT '2002354788' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK a.
INITIALIZATION.
PERFORM setup_screen_defaults.
START-OF-SELECTION.
PERFORM gather_report_data.
END-OF-SELECTION.
PERFORM create_output.
*& Form initialization
FORM setup_screen_defaults.
CLEAR: ws, konv_wa, vbap_wa, vbpa_wa.
REFRESH: ivbpa, ikonv, ivbap, iresult.
ENDFORM. " setup_screen_defaults
*& Form gather_report_data
FORM gather_report_data.
SELECT vbeln posnr parvw kunnr
INTO TABLE ivbpa
FROM vbpa
WHERE vbeln IN s_vbeln
AND ( parvw = 'SP' OR "SoldTO
parvw = 'WE' OR "ShipTo
parvw = 'ZT' ). "Top Parent
SELECT vkvbeln vkerdat vkknumv vpposnr vp~matnr
z1zansicat z1zansigrd z2~zcurrvaltnarea
z2zcurrcstusd m1zzbrndnm zg~zqedscgrp
m1mstav vpkwmeng vp~netpr
INTO CORRESPONDING FIELDS OF TABLE ivbap
FROM vbak AS vk
INNER JOIN vbap AS vp
ON vpvbeln = vkvbeln
INNER JOIN zmarall AS z1
ON z1matnr = vpmatnr
INNER JOIN zco002 AS z2
ON z2matnr = vpmatnr
INNER JOIN zglbprc AS zg
ON zgmatnr = vpmatnr
INNER JOIN mara AS m1
ON m1matnr = vpmatnr
WHERE vk~vbeln IN s_vbeln
AND vk~auart = 'AG'."AG = Quot
SORT ivbap BY posnr matnr.
SELECT kvknumv kvkposn kvkappl kvkschl kv~kbetr
INTO TABLE ikonv
FROM konv AS kv
FOR ALL ENTRIES IN ivbap
WHERE kv~knumv = ivbap-knumv
AND kv~kposn = ivbap-posnr
AND kv~kappl EQ 'V'
AND ( kv~kschl EQ 'ZBP1'
OR kv~kschl EQ 'ZNAX'
OR kv~kschl EQ 'ZNAA' ).
SORT ikonv BY knumv kposn.
LOOP AT ivbap ASSIGNING <vbap>.
CLEAR konv_wa.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZBP1'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-lprc = konv_wa-kbetr.
ENDIF.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZNAX'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-sprc = konv_wa-kbetr.
ENDIF.
READ TABLE ikonv INTO konv_wa WITH KEY
knumv = <vbap>-knumv
kposn = <vbap>-posnr
kschl = 'ZNAA'
BINARY SEARCH.
IF sy-subrc EQ 0.
<vbap>-sprc = konv_wa-kbetr.
ENDIF.
ENDLOOP.
SORT ivbap BY posnr matnr.
LOOP AT ivbap INTO vbap_wa.
MOVE-CORRESPONDING vbap_wa TO result_wa.
APPEND result_wa TO iresult.
CLEAR: vbap_wa, result_wa.
ENDLOOP.
ENDFORM. " gather_report_data
*& Form create_output
FORM create_output.
CALL SCREEN 100.
FREE: iresult.
ENDFORM. " create_output
*& Module PBO_0100 OUTPUT
text
MODULE pbo_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
IF c_cont1 IS INITIAL.
*Creating object of container
CREATE OBJECT c_cont1
EXPORTING
container_name = 'CCONT1'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Creating object of alv
CREATE OBJECT c_alv1
EXPORTING
i_parent = c_cont1.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Alv layout
PERFORM alv_100_layout.
PERFORM save_alv_layout.
*Alv field catalogue
PERFORM alv_100_fieldcat.
*Displaying the ALV grid
CALL METHOD c_alv1->set_table_for_first_display
EXPORTING
is_layout = ty_lay1
i_save = ws-alv_save
is_variant = ws-alv_variant
CHANGING
it_outtab = iresult[]
it_sort = ws-alv_sort
it_fieldcatalog = it_fieldcat[].
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Create object of the event class
*and setting handler for double click
CREATE OBJECT e_dclick.
SET HANDLER e_dclick->handle_double_click FOR c_alv1.
ENDIF.
ENDMODULE. " PBO_0100 OUTPUT
*& Module PAI_0100 INPUT
text
MODULE pai_0100 INPUT.
ws-ok_code = sy-ucomm.
CASE ws-ok_code.
WHEN 'BACK'.
CALL SELECTION-SCREEN 1000.
CLEAR ws-ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
CLEAR ws-ok_code.
EXIT.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
CLEAR ws-ok_code.
EXIT.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " PAI_0100 INPUT
*& Form alv_100_layout
text
--> p1 text
<-- p2 text
FORM alv_100_layout.
ty_lay1-numc_total = 'X'. " Numc total line
ty_lay1-cwidth_opt = 'X'. " Optimal column width
ty_lay1-detailinit = 'X'. " Show values that are initial in
ty_lay1-sel_mode = 'A'. " Column selection mode
ty_lay1-no_merging = 'X'. " No merging while sorting columns
ty_lay1-keyhot = 'X'.
ty_lay1-grid_title = 'SD Concessions'.
ty_lay1-zebra = 'X'.
ty_lay1-no_toolbar = ' '.
ENDFORM. " alv_100_layout
*& Form alv_100_fieldcat
text
--> p1 text
<-- p2 text
FORM alv_100_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'posnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Item#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'matnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Mat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'zansicat'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'AnsiCat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'zansigrd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Grade'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'zcurrvaltnarea'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Val Area'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 6.
ty_fieldcat-fieldname = 'zcurrcstusd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Cost $'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 7.
ty_fieldcat-fieldname = 'zzbrndnm'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Brand'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 8.
ty_fieldcat-fieldname = 'zqedscgrp'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'QE'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 9.
ty_fieldcat-fieldname = 'mstav'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Status'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 9.
ty_fieldcat-fieldname = 'kwmeng'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Qty'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 10.
ty_fieldcat-fieldname = 'lprc'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'List Price'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 11.
ty_fieldcat-fieldname = 'sprc'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Discount'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 12.
ty_fieldcat-fieldname = 'netpr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Quot Price'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 13.
ty_fieldcat-fieldname = 'mrgn'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Margin%'.
ty_fieldcat-outputlen = 15.
APPEND ty_fieldcat TO it_fieldcat.
ENDFORM. " alv_100_fieldcat
*& Module PBO_0101 OUTPUT
text
MODULE pbo_0101 OUTPUT.
*Check if the Custom container exists.
IF c_cont2 IS INITIAL.
*Creating container object
CREATE OBJECT c_cont2
EXPORTING
container_name = 'CCONT2'.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*creating ALV grid for interactive list
CREATE OBJECT c_alv2
EXPORTING
i_parent = c_cont2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*ALV layout
PERFORM alv_101_layout.
*ALV fieldcatalogue
PERFORM alv_101_fieldcat.
*Sorting the output by field position
SORT iresult BY posnr.
*ALV for display field details
CALL METHOD c_alv2->set_table_for_first_display
EXPORTING
is_layout = ty_lay2
CHANGING
it_outtab = iresult[]
it_fieldcatalog = it_fieldcat.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDMODULE. " PBO_0101 OUTPUT
*& Module PAI_0101 INPUT
text
MODULE pai_0101 INPUT.
ENDMODULE. " PAI_0101 INPUT
*& Form alv_101_layout
text
--> p1 text
<-- p2 text
FORM alv_101_layout.
ty_lay2-grid_title = 'Line Details'.
ty_lay2-zebra = 'X'.
ty_lay2-no_toolbar = 'X'.
ENDFORM. " alv_101_layout
*& Form alv_101_fieldcat
text
--> p1 text
<-- p2 text
FORM alv_101_fieldcat.
REFRESH it_fieldcat.
REFRESH it_fcat.
CLEAR ty_fcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 1.
ty_fieldcat-fieldname = 'posnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Item#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 2.
ty_fieldcat-fieldname = 'matnr'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Mat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 3.
ty_fieldcat-fieldname = 'zansicat'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'AnsiCat#'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 4.
ty_fieldcat-fieldname = 'zansigrd'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Grade'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
CLEAR ty_fieldcat.
ty_fieldcat-row_pos = 1.
ty_fieldcat-col_pos = 5.
ty_fieldcat-fieldname = 'zcurrvaltnarea'.
ty_fieldcat-tabname = 'iresult'.
ty_fieldcat-coltext = 'Val Area'.
ty_fieldcat-outputlen = 10.
APPEND ty_fieldcat TO it_fieldcat.
ENDFORM. " alv_101_fieldcat
*& Form save_alv_layout
text
--> p1 text
<-- p2 text
form save_alv_layout.
ws-alv_save = 'A'.
ws-alv_variant-report = sy-repid.
endform. " save_alv_layoutHello
Creating fieldcatalogs manually is one of the major error sources in ALV programming.
There is hardly any reason why NOT to use the standard-fm LVC_FIELDCATALOG_MERGE in order to create a proper fieldcatalog.
If you need some modification of the standard fieldcatalog (e.g. renaming of columns, etc.) just do your post-processing after calling the fm.
Regards
Uwe -
Reg: Check boxes in ALV Display
Hi Experts,
I have a problem with ALV Display. I am able to display the contents in output.
But my client requirement is, they need to insert 'check boxes' before each record.
I hope you understood. any way let me explain some thing...
I am displaying records in ALV, but they need check boxes before each record. Like.... you can see database tables. in database tables like MARA.. it will display
check box client field1 field2 field3.......................
Please help me in this regard.....
Thanks in Advance
Sai babuHi This is my code,
As of you people suggested me, i write like this.... but it is not working....
please guide me....
FORM SUB_DISP_REP .
PERFORM SUB_FIELD_DEF USING :
' ' '1' 'PERNR' 'Personnel Number' ' ' ' ' ' ' ,
' ' '2' 'STAT2' 'Employee Status' '' '' '' ,
' ' '3' 'STELL' 'Job Title' '' '' '' ,
' ' '4' 'VORNA' 'First Name' '' '' '' ,
' ' '5' 'NACHN' 'Last Name' '' '' '' ,
' ' '6' 'KTART' 'Absence Quota Type' '' '' '' ,
' ' '7' 'ANZHL' 'Number of Employee Time Quota' '' '' '' ,
' ' '8' 'KVERB' 'Deduction of Employee Time Quota' '' '' '' ,
' ' '9' 'QUONR' 'Counter for time quotas' '' '' '' ,
' ' '10' 'DESTA' 'Start Date for Quota Deduction' '' '' '' ,
' ' '11' 'DEEND' 'Quota Deduction to' '' '' '' .
CALL FUNCTION 'REUSE_ALV_GRID_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_CALLBACK_TOP_OF_PAGE = 'X'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'TRVPICTURE08'
I_GRID_TITLE = 'EMPLOYEE ABSENCE QUOTA'
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = T_FCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = T_SUBTOT
* 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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = T_OUTPUT
* 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. " SUB_DISP_REP
form SUB_FIELD_DEF using P_chk TYPE char1
P_COL TYPE CHAR2
P_NAME TYPE CHAR10
P_TEXT TYPE CHAR40
P_SUM TYPE CHAR1
P_EDIT TYPE CHAR1
P_OUT TYPE CHAR1.
W_FCAT-checkbox = 'X'.
W_FCAT-COL_POS = P_COL .
W_FCAT-FIELDNAME = P_NAME .
W_FCAT-SELTEXT_M = P_TEXT .
W_FCAT-DO_SUM = P_SUM .
W_FCAT-EDIT = P_EDIT .
W_FCAT-NO_OUT = P_OUT .
APPEND W_FCAT TO T_FCAT .
CLEAR W_FCAT .
endform. " SUB_FIELD_DEF -
Hi,
I have encountered one problem.
I am displaying the records in the alv. let there are 5 records, The record that i choosed from the ALV display( let first one out of those 5) is updating or inserted in the Ztable.
what should i do so that , the record that was choosen for updating
should not get displayed on the screen once it get updated or inserted in the
ZTABLEHi,
In the USER-COMMAND Subroutine where u actually save the record, you can set the flag as to SELFIELD-REFRESH = 'X' and delete the record that you have saved from the Internal table. This will refresh you ALV Grid also.
regards,
Mahesh -
SQ01 ALV DISPLAY WHEN USING LOGOCAL DATABASE
Dear All,
I'm using a logical database (EMM) to build a query in SQ01, I need an ALV display.
If I use only three tables of the logical database hierarchy it works fine, but as soon as I try to use a fourth one, then the ALV display does not work anymore.
At the parameter selection screen, instead of the usual "Sap List Viewer" field I've got a "Save with ID" tick box, and on the result screen, it is not possible to select "Alv display" (no such buton).
Is this normal way of is there anything I could do ?
Please note that if using a "simple" join between the 4th tables instead of the logical database , then it works fine.
Regards
FrancoisHi,
Its only because of Fieldcatalog problem.
Only one thing you need to take care is that when you refer any dictionary field do not use TYPE Instead use LIKE statement, then It works.
You can have a example..
TYPE-POOLS: SLIS.
DATA: PROGNAME LIKE SY-REPID,
GT_FCAT0 TYPE SLIS_T_FIELDCAT_ALV,
GT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: IT_MARA0 TYPE TABLE OF MARA.
DATA: BEGIN OF IT_MARA1 OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
END OF IT_MARA1.
PROGNAME = SY-REPID.
* internal table definition with type of a structure
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA0'
I_STRUCTURE_NAME = 'MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT0[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
* own internal table definition
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA1'
I_INCLNAME = PROGNAME
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT1[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
Thanks
Arbind -
The display width of characters in forms 10g
Hi,
I am facing problem in setting the display width of titles in the form dynamically.
Please tell if there is any fixed display width of characters in the form(including the small letters and caps).
And if not then Is there any way to determine it instead of hit and trial.
Thanks in advance,
PreetiHello,
You can get it with 2 lines of Java
public static int getWidth (Font f, String s)
Rectangle2D rect = f.getStringBounds(s,new FontRenderContext(new AffineTransform(),true,true));
return (int)rect.getWidth();
} With the following sample code:
System.out.println("Width="+getWidth(new Font("Arial", Font.PLAIN,14),"Hello"));Francois -
How to go back to an ALV display.
hello there,
i need to create an ALV report then in this ALV when i click on a custom made button,the system call a transaction. if the user press the back button,the system must redirect to the previous ALV display.
my question is how can i perform this task.
i cant access the code of the transaction been called.
thanks in advance.thank Aditi Wason.
i have one more question. the thing is that i have not done the entire coding yet,am still investigating on my problem because i thought to be able to perform the back operation i should create a module pool.
when i call the required transaction in the first screen i must input some details and by pressing enter the system call another screen. so my second question is, will it works, as you kindly replied previously, in this situation also; that is the back operation will bring me back to the alv from the second screen in the transaction?
thank again.
Edited by: click_17 on Aug 23, 2009 7:01 AM -
ALV displays a maximum of 130 characters for field
Hi all!
I have a problem with the ALV display and Debug textbox.
I have a var which has 220 of length but alv only displays the first 130.
Also, debugging, this var is showed in the textbox with the first 130 characters, but if I write l_message+100 i can see that the rest of message exists.
The ALV is Ok. I have changed the length of the field to 200 chars instead the l_message type but it still happens. I think that there is any routine or something that is forcing the vision of 130 characters in the ALV and DEBUG.
Do u know anything?
Thanks!I am able to get upto 255 characters. Are you doing grid or ALV list.
check whether you gave line size in report line.
check the fieldcatalog output length what you gave and if any reference table name filed name you gave.
Maybe you are looking for
-
Error when Starting OIS server
When I was trying to start OIS, I got the following error. start_ois_server_nptl Using NPTL Threading Library. OIS Server started with pid: 20964 [root@localhost ~]# bind: ?????? Identity server: Error: bind Starting OIS server Watchdog..... OIS Serv
-
My wife and I are going to share a PC,, W7,, can we have seperate iTunes accounts and libraries on the same PC?
-
Can I create a LaunchDaemon for my 3rd-party wireless card?
Hi there, I wanted to get .11n wireless on my old Power Mac G5 (Quad 2.5) so I bought a third-party PCI-E card. It works fine, however it's not AirPort compatible, and so at present I have to run it from my Login Items, which in turn means the networ
-
Creation of Time stream in APO from R/3
We always prefer our ECC system to be the master data system . We intend to create Time stream in APO based on planning calenders from ECC system . Kindly confirm if SAP has provided any time stream creation logic in APO from an OLTP system or R
-
It steams movie previews so i know it is connected to the internet and it sees my movies but when i click on them to play they take unusually long and then if they start they just dont load. I have had this unit for a year and have not had any proble