Regarding status in Work In Progress ALV Format Report.
Dear All,
I am creating ALV Report for Work In Progress for PP-module. I want to display Object Status i.e. field STAT table JEST
so for doing this I am Bringing objnr (object number) from table AUFK in my ITAB (it_so) by comparing AUFK-AUFNR
with my ITAB (it_so) AUFNR, then bringing corresponding STAT(object status) from JEST by comparing JEST-OBJNR
with it_so-objnr. Now , the problem is that I am getting only 1st STAT value(I0001). but there are so many STAT For
OBJNR (OR000010018621).
what do do, how to bring all data (STAT) comparing with it_so-objnr.
Hi,
Check the code below:
REPORT ztest_00000002.
DATA : BEGIN OF itab OCCURS 0,
aufnr LIKE caufv-aufnr,
objnr LIKE caufv-objnr,
END OF itab.
DATA :BEGIN OF itab1 OCCURS 0,
objnr LIKE caufv-objnr,
stat LIKE jest-objnr,
END OF itab1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : sp_aufnr LIKE caufv-aufnr.
SELECTION-SCREEN END OF BLOCK b1.
SELECT aufnr objnr FROM caufv INTO TABLE itab
WHERE aufnr = sp_aufnr.
IF itab[] IS NOT INITIAL.
SELECT objnr stat FROM jest INTO TABLE itab1
for ALL entries in itab
WHERE objnr = itab-objnr.
ENDIF.
LOOP AT itab1.
WRITE : / itab1-objnr, itab1-stat.
ENDLOOP.
Thanks,
Sriram Ponna.
Similar Messages
-
Absence request status = "Work in Progress" ?? in SSHR
Hi exprts
we tried to post an absnece request (ex. holiday). The status is set to "Work in Progress". The approver is also nominated. But he did not get the request for approval.
Question: What can be the reason.
Now if w click on yellow pencile for update and submit it the approver will get the notification, and the status is set to "Pending for Approval".
Question: Have somebody facing this issue, and what is your suggestion.
Thx
mehdiSolution:
1. You request for holiday, than cliking on Next -next, Next.
2. before submit you are clicking on Home button
3. A message window appear(the changes you mad.......)
4. Click on Ok
4. Comming back to your Summary page and you see: The Approval Status is set to Work in Progress and Absnece status is set to confirmed. In this case you must sendyour request again.
That was the reason and solution.
Mehdi -
Leave with approval status ''Work in progress''
Hi,
I try to delete or complete the leave with approval status ''Work in progress'' and there is no way to do that .. can anybody help .
This issue happened when i request annual leave and the session expired .. i login again and i found the request stuck at absence summary and i can't do any thing even deleting.
snapshot of the issue:
http://www.2shared.com/photo/B2F8Aysg/work_in_progress_leave.html
Thanks in advanceHi,
Yes i know its not should be disabled at site level i did that on test envroment .
i tried to put it at user but its not possible
after i put the profile on value 'Yes' the delete and update columns appeared at absence summary with warning massege and i can delete the Leave with approval status ''Work in progress'':
http://www.2shared.com/photo/QqRfjReY/Warning_mass-2.html
and when i try to create new leave gave this error massege:
http://www.2shared.com/photo/LL1sU9xB/Warning_mass-1.html
can you guide me how can i know the earlier personalization done on the absence page ??
thaks alot for your helping -
Please send HR ALV format programs
hai all,
if any body develop the hr report in alv format pls send the code that wiil be usefull to me.
thanks,
lakshmaHave a look at http://www.sapdevelopment.co.uk/programs/custom/zp_postcode.htm
*: Report: ZP_POSTCODE :
*: Author: www.SAPDev.co.uk :
*: Date : 2004 :
*: Description: Displays report of employees by postcode area, :
*: includes current travelling allowances (i.e. parking :
*: permit or transport card etc..) :
*: Use: Help encourage the use of car sharing and public :
*: transport where appropriate. :
REPORT zp_postcode.
type-pools: slis. "ALV Declarations
NODES: pernr.
INFOTYPES: 0000, 0001, 0002, 0006, 0008, 0014, 0105, 0121.
SELECTION-SCREEN BEGIN OF BLOCK pcode WITH FRAME TITLE text-s01.
SELECT-OPTIONS: so_pcode FOR p0006-pstlz.
SELECTION-SCREEN END OF BLOCK pcode.
TYPES: BEGIN OF t_output,
pernr TYPE p0001-pernr, "personnel name
anredtxt TYPE t522t-atext, "title (based on p0002-anred)
fname TYPE p0002-vorna, "first name
lname TYPE p0002-nachn, "last name
orgtx TYPE t527x-orgtx, "dept
fte TYPE p0008-bsgrd, "fte
parking(20) TYPE c,
payslip TYPE t526-sachn, "payslip address
telno TYPE p0105-usrid_long, "tel number(p0105-usrty = 0020)
email TYPE p0105-usrid_long, "email (p0105-usrty = MAIL)
postcode type p0006-pstlz,
END OF t_output.
DATA: it_output TYPE STANDARD TABLE OF t_output INITIAL SIZE 0,
wa_output TYPE t_output.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv,
gd_count(6) type n,
gd_outtext(70) type c,
gd_lines type i.
*START-OF-SELECTION.
START-OF-SELECTION.
clear: gd_count.
GET pernr.
Infotype 0121 is used to store multiple contracts for personnel.
Field p0121-hpern contains the personnel number for the main contract.
PROVIDE * from p0121 between pn-begda and pn-endda.
Check if main contract
if p0121-pernr ne p0121-hpern.
reject.
endif.
ENDPROVIDE.
add 1 to gd_count.
concatenate 'Processing personnel data'(m10) gd_count into gd_outtext
separated by ' '.
Display indicator for employee count
perform progress_indicator using gd_outtext.
Retrieve datd from infotypes
rp_provide_from_last p0000 space pn-begda pn-endda.
rp_provide_from_last p0001 space pn-begda pn-endda.
rp_provide_from_last p0002 space pn-begda pn-endda.
rp_provide_from_last p0006 space pn-begda pn-endda.
rp_provide_from_last p0008 space pn-begda pn-endda.
rp_provide_from_last p0014 space pn-begda pn-endda.
Check post code
CHECK p0006-pstlz IN so_pcode. "cp
Post code
wa_output-postcode = p0006-pstlz.
Personnel number
wa_output-pernr = pernr-pernr.
Personnel title
SELECT SINGLE atext
FROM t522t
INTO wa_output-anredtxt
WHERE sprsl EQ sy-langu AND
anred EQ p0002-anred.
First name
wa_output-fname = p0002-vorna.
Last name
wa_output-lname = p0002-nachn.
Organizational Unit text (dept)
SELECT SINGLE orgtx
FROM t527x
INTO wa_output-orgtx
WHERE sprsl EQ sy-langu AND
orgeh EQ p0001-orgeh AND
endda GE sy-datum.
FTE
wa_output-fte = p0008-bsgrd.
Parking / travel deducted?
CASE p0014-lgart.
WHEN '7180' OR '7181' OR '7182'.
wa_output-parking = text-002.
WHEN '7183'.
wa_output-parking = text-001.
WHEN '7171' OR '7172' or '7173' or '7174' or
'7175' or '7176' or '7177' or '7178'.
wa_output-parking = text-003.
ENDCASE.
Payslip Address
SELECT SINGLE sachn
FROM t526
INTO wa_output-payslip
WHERE werks EQ p0001-werks AND
sachx EQ p0001-sacha.
PROVIDE * from p0105 between pn-begda and pn-endda.
Telephone numbers
if p0105-usrty = '0020'.
wa_output-telno = p0105-usrid_long.
endif.
Email address
if p0105-usrty = 'MAIL'.
wa_output-email = p0105-usrid_long.
endif.
ENDPROVIDE.
append wa_output to it_output.
clear: wa_output.
*END-OF-SELECTION.
END-OF-SELECTION.
describe table it_output lines gd_lines.
if gd_lines gt 0.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
else.
message i003(zp) with 'No records found'.
endif.
*& Form PROGRESS_INDICATOR
Displays progress indicator on SAP screen
form progress_indicator using p_text.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = p_text.
endform. " PROGRESS_INDICATOR
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
fieldcatalog-fieldname = 'PERNR'.
fieldcatalog-seltext_m = 'Personnel No.'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'ANREDTXT'.
fieldcatalog-seltext_m = 'Title'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'FNAME'.
fieldcatalog-seltext_m = 'First Name'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'LNAME'.
fieldcatalog-seltext_m = 'Last Name'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'ORGTX'.
fieldcatalog-seltext_m = 'Department'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'FTE'.
fieldcatalog-seltext_m = 'FTE'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PARKING'.
fieldcatalog-seltext_m = 'Parking/Metrocard'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PAYSLIP'.
fieldcatalog-seltext_m = 'Payslip Add.'.
fieldcatalog-col_pos = 7.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TELNO'.
fieldcatalog-seltext_m = 'Telephone'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EMAIL'.
fieldcatalog-seltext_m = 'E-mail'.
fieldcatalog-col_pos = 9.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'POSTCODE'.
fieldcatalog-seltext_m = 'Post code'.
fieldcatalog-col_pos = 10.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-zebra = 'X'.
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
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_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. " DISPLAY_ALV_REPORT
Best Regards,
Vibha
*Plz mark useful answers -
F3 function key not work in this ALV pgm
Hi,
How to make the F3 function key (go back to previous screen) work in this ALV program?
Thanks,
Helen
REPORT z_pgm.
TYPE-POOLS : slis.
INITIALIZATION.
PERFORM sub_fieldcat_init CHANGING gi_fieldcat.
PERFORM sub_eventtab_build USING gi_events[].
PERFORM sub_event_exit_build CHANGING gi_event_exit.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_xvariant
EXCEPTIONS
not_found = 2.
*EVENT : AT SELECTION-SCREEN OUTPUT *
AT SELECTION-SCREEN OUTPUT.
EVENT : START-OF-SELECTION
START-OF-SELECTION.
PERFORM sub_comment_build USING gi_list_top_of_page.
PERFORM sub_get_data.
EVENT : END-OF-SELECTION
END-OF-SELECTION.
IF l_error IS INITIAL.
PERFORM sub_grid_display USING gi_adrc_disp.
ENDIF.
*& Form sub_fieldcat_init
FORM sub_fieldcat_init CHANGING li_fieldcat LIKE gi_fieldcat[]."#EC *
DATA : lw_fieldcat TYPE slis_fieldcat_alv.
REFRESH gi_fieldcat[].
CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'SELKZ'.
lw_fieldcat-tabname = 'gi_adrc_disp'.
lw_fieldcat-hotspot = 'X'.
lw_fieldcat-outputlen = '8'.
APPEND lw_fieldcat TO li_fieldcat.
CLEAR lw_fieldcat.
lw_fieldcat-fieldname = 'LOCATION'.
lw_fieldcat-tabname = 'gi_adrc_disp'.
lw_fieldcat-seltext_s = text-002.
lw_fieldcat-seltext_m = text-002.
lw_fieldcat-seltext_l = text-002.
lw_fieldcat-outputlen = '20'.
APPEND lw_fieldcat TO li_fieldcat.
ENDFORM. " sub_fieldcat_init
*& Form SUB_EVENTTAB_BUILD
FORM sub_eventtab_build USING li_events TYPE slis_t_event.
DATA: lw_event TYPE slis_alv_event.
*to call top_of_page event
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = li_events.
READ TABLE li_events WITH KEY name = slis_ev_top_of_page
INTO lw_event.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO lw_event-form.
APPEND lw_event TO li_events.
ENDIF.
ENDFORM. " SUB_EVENTTAB_BUILD
FORM SUB_COMMENT_BUILD *
FORM sub_comment_build USING li_lt_top_of_page TYPE slis_t_listheader.
DATA: lw_line TYPE slis_listheader.
Listenüberschrift: Typ H
CLEAR lw_line.
lw_line-typ = 'H'.
lw_line-info = text-013.
APPEND lw_line TO li_lt_top_of_page.
Kopfinfo: Typ S
CLEAR lw_line.
lw_line-typ = 'S'.
lw_line-key = text-014.
lw_line-info = text-015.
APPEND lw_line TO li_lt_top_of_page.
ENDFORM. "SUB_COMMENT_BUILD
*& Form sub_VARIANT_INIT
FORM sub_variant_init .
CLEAR g_variant.
g_variant-report = g_repid.
ENDFORM. " sub_VARIANT_INIT
*& Form SUB_F4_FOR_VARIANT
To get the existing variant
FORM sub_f4_for_variant .
g_variant-report = g_repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
it_default_fieldcat =
IMPORTING
e_exit = g_exit
es_variant = g_xvariant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
ENDIF.
ENDFORM. " SUB_F4_FOR_VARIANT
FORM TOP_OF_PAGE
FORM top_of_page. "#EC CALLED
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gi_list_top_of_page.
ENDFORM. "TOP_OF_PAGE
FORM sub_grid_display USING li_final_disp LIKE gi_final_disp.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "#EC *
EXPORTING
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_program = g_repid
i_callback_user_command = 'SUB_CB_USER_COMMAND'
i_grid_title = l_title
it_fieldcat = gi_fieldcat
is_layout = gw_layout
i_save = g_save
is_variant = g_variant
it_events = gi_events[]
it_event_exit = gi_event_exit[]
IMPORTING
e_exit_caused_by_caller = g_exit_caused_by_caller
es_exit_caused_by_user = gs_exit_caused_by_user
TABLES
t_outtab = gi_adrc_disp
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " sub_grid_display
*& Form *
FORM sub_get_data .
CLEAR l_error.
IF NOT rb_loc IS INITIAL.
IF p_loc EQ space.
MESSAGE i100(zm01) WITH
'Please Enter Location Code and SET ID'.
l_error = 'X'.
ENDIF.
SELECT addrnumber location name1 name2 building floor
name_co country street str_suppl1 str_suppl3 city1
city2 region post_code1 transpzone
INTO TABLE gi_adrc_disp
FROM adrc
WHERE region = p_region
AND str_suppl3 = p_loc.
ELSEIF NOT rb_all IS INITIAL.
SELECT addrnumber location name1 name2 building floor
name_co country street str_suppl1 str_suppl3 city1
city2 region post_code1 transpzone
INTO TABLE gi_adrc_disp
FROM adrc
WHERE transpzone NE space.
ENDIF.
IF sy-subrc NE 0.
l_error = 'X'.
MESSAGE i100(zm01) WITH
'No Record Exists for Input'.
EXIT.
ENDIF.
lw_adrc-selkz = c_add.
MODIFY gi_adrc_disp FROM lw_adrc TRANSPORTING selkz
WHERE transpzone = space.
lw_adrc-selkz = c_remove.
MODIFY gi_adrc_disp FROM lw_adrc TRANSPORTING selkz
WHERE transpzone NE space.
ENDFORM. " sub_get_data
*& Form sub_cb_user_command
FORM sub_cb_user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
l_index = rs_selfield-tabindex.
ENDFORM. "sub_cb_user_command
*& Form sub_cb_user_command
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'MAIN'.
ENDFORM. "set_pf_statusHi,
this is for setting the PF-status.
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'MAIN'.
ENDFORM. "set_pf_status
and double click on main and see what is the Function key and function code associated for BACK.
FORM sub_cb_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
case r_ucomm.
when <b>'BACK'.</b> <<<<i assumed Focde is BACK for BACK
leave to screen 0.
endform.
Regards
vijay -
Display Nested table data in an ALV format
Hi All,
Is there any way to display nested table data in an ALV format. This table has 20-30 structures in it and there is no way to create a common structure using all the fields. Kindly let me know what is the best way to display the nested structure data.
Thanks a lot for your responce.
Regards,
PritiREPORT yh_alvtreedemo1.
TYPE-POOLS : fibs,stree.
TYPE-POOLS:slis.
DATA : t_node TYPE snodetext.
DATA : it_node LIKE TABLE OF t_node,
wa_node LIKE t_node.
DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
fs_fieldcat TYPE slis_fieldcat_alv.
DATA:w_repid LIKE sy-repid.
*Internal Table declarations
DATA: BEGIN OF fs_scarr,
carrid LIKE scarr-carrid,
END OF fs_scarr.
DATA:BEGIN OF fs_spfli,
carrid LIKE spfli-carrid,
connid LIKE spfli-connid,
END OF fs_spfli.
DATA:BEGIN OF fs_sflight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
END OF fs_sflight.
DATA:BEGIN OF fs_sbook,
carrid LIKE sbook-carrid,
connid LIKE sbook-connid,
fldate LIKE sbook-fldate,
bookid LIKE sbook-bookid,
END OF fs_sbook.
DATA:t_scarr LIKE TABLE OF fs_scarr,
t_spfli LIKE TABLE OF fs_spfli,
t_sflight LIKE TABLE OF fs_sflight,
t_sbook LIKE TABLE OF fs_sbook.
START-OF-SELECTION.
PERFORM get_data.
PERFORM build_tree.
PERFORM display_tree.
*& Form get_data
FORM get_data .
SELECT carrid
FROM scarr
INTO TABLE t_scarr.
SELECT carrid
connid
FROM spfli
INTO TABLE t_spfli
FOR ALL ENTRIES IN t_scarr
WHERE carrid EQ t_scarr-carrid.
ENDFORM. " get_data
*& Form build_tree
FORM build_tree .
CLEAR: it_node,
wa_node.
SORT: t_scarr BY carrid,
t_spfli BY carrid connid,
t_sflight BY carrid connid fldate,
t_sbook BY carrid connid fldate bookid.
wa_node-type = 'T'.
wa_node-name = 'Flight Details'.
wa_node-tlevel = '01'.
wa_node-nlength = '15'.
wa_node-color = '4'.
wa_node-text = 'Flight'.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
LOOP AT t_scarr INTO fs_scarr.
wa_node-type = 'P'.
wa_node-name = 'CARRID'.
wa_node-tlevel = '02'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = fs_scarr-carrid.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
LOOP AT t_spfli INTO fs_spfli WHERE carrid EQ fs_scarr-carrid.
wa_node-type = 'P'.
wa_node-name = 'CONNID'.
wa_node-tlevel = '03'.
wa_node-nlength = '8'.
wa_node-color = '1'.
wa_node-text = fs_spfli-connid.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
ENDLOOP.
ENDLOOP.
ENDFORM. " build_tree
*& Form display_tree
FORM display_tree .
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = it_node.
w_repid = sy-repid.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = w_repid
callback_user_command = 'USER_COMMAND'
callback_gui_status = 'SET_PF'.
ENDFORM. " display_tree
*& Form pick
* -->COMMAND text
* -->NODE text
FORM user_command TABLES pt_nodes STRUCTURE seucomm
USING pv_command TYPE c
CHANGING pv_exit TYPE c
pv_list_refresh TYPE c.
pv_list_refresh = 'X'.
IF pt_nodes-tlevel = '03'.
CLEAR t_fieldcat[].
SELECT carrid
connid
fldate
FROM sflight
INTO TABLE t_sflight
WHERE connid EQ pt_nodes-text.
fs_fieldcat-col_pos = 1.
fs_fieldcat-fieldname = 'CARRID'.
fs_fieldcat-seltext_m = 'Airlinecarrier'.
fs_fieldcat-key = 'X'.
fs_fieldcat-hotspot = 'X'.
APPEND fs_fieldcat TO t_fieldcat.
CLEAR fs_fieldcat.
fs_fieldcat-col_pos = 2.
fs_fieldcat-fieldname = 'CONNID'.
fs_fieldcat-seltext_m = 'Connection No'.
fs_fieldcat-key = 'X'.
fs_fieldcat-hotspot = 'X'.
APPEND fs_fieldcat TO t_fieldcat.
CLEAR fs_fieldcat.
fs_fieldcat-col_pos = 3.
fs_fieldcat-fieldname = 'FLDATE'.
fs_fieldcat-seltext_m = 'Flight Date'.
fs_fieldcat-key = 'X'.
fs_fieldcat-hotspot = 'X'.
APPEND fs_fieldcat TO t_fieldcat.
CLEAR fs_fieldcat.
w_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = t_fieldcat[]
TABLES
t_outtab = t_sflight.
ENDIF.
ENDFORM. "pick
*& Form set_pf
* text
FORM set_pf.
SET PF-STATUS 'MYPF'.
ENDFORM. "set_pf -
Modification in report into ALV Format
Hi Experts
How can I modify this report in ALV Format with Top of page and Parameters should be display on runtime.
Can anyone modify my program please
Thanks in advanced.
REPORT FZEL LINE-SIZE 220 LINE-COUNT 75
NO STANDARD PAGE HEADING.
TABLES : equi,
equz,
imptt,
imrg,
eqkt,
iloa.
TYPES: BEGIN OF ty_data ,
equnr type equnr, " Euipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
idate type imrg-idate, " Measuring Date
recdu type imrg-recdu, " Unit of measuring ='KM','L','H'
recdv type imrg-recdv, " Counter reading data
cancl type imrg-cancl,
END OF ty_data.
TYPES: BEGIN OF ty_final,
equnr type equnr, " Equipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
idate type imrg-idate, " Measuring Date
min_date_km type imrg-idate, " Min Date
min_km type imrg-recdv, " Max Km
max_date_km type imrg-idate,
max_km type imrg-recdv, " Min km
t_max_min_km type imrg-recdv, " Total min_km-max_km
min_date_hr type imrg-idate, " Max Date
min_hr type imrg-recdv, " Max hr
max_date_hr type imrg-idate,
max_hr type imrg-recdv, " Min hr
t_max_min_hr type imrg-recdv, " Total min_hr-max_hr
min_date_lit type imrg-idate,
min_lit type imrg-recdv, " Min lit
max_date_lit type imrg-idate,
max_lit type imrg-recdv, " Max lit
fuel_con type imrg-recdv, " Total_hrs / t_max_min_hr
fuel_con2 type imrg-recdv, " Total_hrs / t_max_min_hr
km_l type imrg-recdv, " t max_min_km / t_max_min_lit
l_p type imrg-recdv , " t_max_min_lit / t_max_min_hr
l_p2 type imrg-recdv ,
END OF ty_final.
DATA: i_data TYPE TABLE OF ty_data, " internal table
wa_data TYPE ty_data, " work area
i_final TYPE TABLE OF ty_final, " internal table
wa_final TYPE ty_final. " work area
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_equnr FOR equi-equnr OBLIGATORY, "no-extension no intervals,
p_idate FOR imrg-idate. "NO-EXTENSION NO INTERVALS OBLIGATORY,
"p_recdu FOR imrg-recdu." NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk.
TOP-OF-PAGE.
FORMAT INTENSIFIED ON.
WRITE:/55(40) ' WAGNERS INVESTMENT LIMITED '.
WRITE:/50(40) ' VEHICLE FUEL CONSUMPTION REPORT ' CENTERED ,
2 'Page', sy-pagno.
FORMAT INTENSIFIED OFF.
WRITE:/50(40) '----
' CENTERED .
FORMAT INTENSIFIED ON.
WRITE:/2 sy-datum COLOR 3, sy-uzeit .
"WRITE:/1 S903-SPMON ."p_yearf.
ULINE.
"CENTERED.
write: /2 'Equipment No :'left-justified,p_equnr-low color 2 , ' to ' , p_equnr-high color 2.
write: /2 'Date From :', p_idate-low color 2 , ' to ' , p_idate-high color 2.
"write: /2 'Sort Field:'left-justified,p_eqfnr-low color 2 , ' to ' , p_eqfnr-high color 2.
SKIP.
ULINE.
WRITE:/1 sy-vline,
2 ' EQUIP#', 10 sy-vline ,
11 ' NAME', 40 sy-vline,
41 ' SORT', 60 sy-vline,
61 ' START DATE', 74 sy-vline,
75 ' END DATE', 87 sy-vline,
88 ' START KM', 100 sy-vline,
101 ' END KM' , 113 sy-vline,
114 ' TOTAL KM', 126 sy-vline,
127 ' START HR', 139 sy-vline,
140 ' END HR', 152 sy-vline,
153 ' TOTAL HR', 167 sy-vline,
168 ' FUEL CON ', 180 sy-vline,
181 ' KM L', 193 sy-vline,
194 ' LIT PER HR ', 206 sy-vline,
207 ' EQUIP NO', 220 sy-vline,
223 'KM L', 232 sy-vline,
233 'LIT PER KM', 245 sy-vline,
246 'TOTAL L/HR', 258 sy-vline.
FORMAT COLOR 3 ON.
ULINE.
END-OF-PAGE.
START-OF-SELECTION.
select aequnr deqktx feqfnr eidate erecdu erecdv
into table i_data
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate and
e~cancl ne 'X'.
loop at i_data into wa_data.
CLEAR: wa_final.
READ TABLE i_final into wa_final
with key equnr = wa_data-equnr." BINARY SEARCH.
if sy-subrc EQ 0.
PERFORM F_GET_MAX_DATA.
PERFORM F_GET_MAX_HOURS.
PERFORM F_GET_MAX_LIT.
PERFORM prepare_final_rec USING'M'. " Modify Existing Record
ElSE.
PERFORM prepare_final_rec USING'A'. " Append New Record.
ENDIF.
ENDLOOP.
LOOP AT i_final into wa_final.
on change of wa_final-equnr.
WRITE:/1 sy-vline,
2 wa_final-equnr , 10 sy-vline,
11 wa_final-eqktx , 40 sy-vline,
41 wa_final-eqfnr , 60 sy-vline,
61 wa_final-min_date_km color 2 , 74 sy-vline,
75 wa_final-max_date_km color 2 LEFT-JUSTIFIED , 87 sy-vline,
88 wa_final-min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED color 3 , 100 sy-vline,
101 wa_final-max_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED color 3 , 113 sy-vline,
114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 126 sy-vline,
127 wa_final-min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED color 4 , 139 sy-vline,
140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED color 4 , 152 sy-vline,
153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 167 sy-vline,
168 wa_final-fuel_con2 EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED , 180 sy-vline,
181 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED ,193 sy-vline,
194 wa_final-l_p2 EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED color 2 , 206 sy-vline,
207 wa_final-equnr ,220 sy-vline.
endon.
endloop.
refresh i_final.
clear i_final.
FORM F_GET_MAX_DATA.
select single MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
into corresponding fields of (wa_final-max_date_km,wa_final-min_date_km,wa_final-max_km ,wa_final-min_km)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'KM'
AND a~equnr = wa_data-equnr.
ENDFORM.
FORM F_GET_MAX_HOURS.
select single MAX( erecdv ) MIN( erecdv )
into corresponding fields of (wa_final-max_hr, wa_final-min_hr)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'H'
AND a~equnr = wa_data-equnr .
ENDFORM.
FORM F_GET_MAX_LIT.
select SUM( e~recdv )
into corresponding fields of (wa_final-fuel_con2)
from equi AS a
inner join eqkt as b
on bequnr = aequnr
inner join imptt as c
on cmpobj = aobjnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'L'
AND a~equnr = wa_data-equnr.
ENDFORM.
FORM prepare_final_rec USING p_mode TYPE char1.
wa_final-t_max_min_km = wa_final-max_km - wa_final-min_km .
wa_final-t_max_min_hr = wa_final-max_hr - wa_final-min_hr.
if wa_final-t_max_min_km <> 0 .
wa_final-km_l = ( wa_final-max_km - wa_final-min_km ) / ( wa_final-fuel_con2 ) .
ELSE.
wa_final-km_l = 0.
endif.
if wa_final-t_max_min_hr <> 0 .
wa_final-l_p2 = ( wa_final-fuel_con2 ) / ( wa_final-t_max_min_hr ) .
ELSE.
wa_final-l_p2 = 0.
endif.
IF p_mode = 'A'.
wa_final-equnr = wa_data-equnr.
wa_final-eqktx = wa_data-eqktx.
wa_final-eqfnr = wa_data-eqfnr.
wa_final-t_max_min_km = wa_final-min_km - wa_final-max_km .
wa_final-t_max_min_hr = wa_final-max_hr - wa_final-min_hr.
wa_final-km_l = ( wa_final-max_km - wa_final-min_km ) / ( wa_final-fuel_con2 ).
wa_final-l_p2 = ( wa_final-fuel_con2 ) / ( wa_final-t_max_min_hr ) .
APPEND wa_final TO i_final .
ELSE.
MODIFY i_final FROM wa_final
TRANSPORTING
eqfnr
max_date_km
min_date_km
max_date_lit
min_date_lit
max_date_hr
min_date_hr
max_km
min_km
max_hr
min_hr
t_max_min_km
t_max_min_hr
fuel_con2
km_l
l_p2
where equnr = wa_data-equnr.
ENDIF.
ENDFORM. " PREPARE_FINAL_RECHi Guys
Thanks for your reply, I know how to implement the FM for ALV but little confused where to call , See my correction below it is displaying the result in different way that ie...first displaying Equipment no, name,.correctly but the other values such as km,L,HR all are displaying zero first, when I press back then it is displying the value twice thrise........keep on displaying duplicate records continuesly when back back is press can anyone correct this please
REPORT XYZ LINE-SIZE 220 LINE-COUNT 75
NO STANDARD PAGE HEADING.
TABLES : equi,
equz,
imptt,
imrg,
eqkt,
iloa.
type-pools: slis. "ALV Declarations
TYPES: BEGIN OF ty_data ,
equnr type equnr, " Euipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
idate type imrg-idate, " Measuring Date
recdu type imrg-recdu, " Unit of measuring ='KM','L','H'
recdv type imrg-recdv, " Counter reading data
cancl type imrg-cancl,
END OF ty_data.
TYPES: BEGIN OF ty_final,
equnr type equnr, " Equipment no
eqktx type eqkt-eqktx, " Equipment Text
eqfnr type iloa-eqfnr, " Equipment Sort field
idate type imrg-idate, " Measuring Date
min_date_km type imrg-idate, " Min Date
min_km type P DECIMALS 2, " Max Km
max_date_km type imrg-idate,
max_km type P DECIMALS 2, " Min km
t_max_min_km type P DECIMALS 2, " Total min_km-max_km
min_date_hr type imrg-idate, " Max Date
min_hr type P DECIMALS 2, " Max hr
max_date_hr type imrg-idate,
max_hr type P DECIMALS 2, " Min hr
t_max_min_hr type P DECIMALS 2, " Total min_hr-max_hr
min_date_lit type imrg-idate,
min_lit type P DECIMALS 2, " Min lit
max_date_lit type imrg-idate,
max_lit type P DECIMALS 2, " Max lit
fuel_con type P DECIMALS 2, " Total_hrs / t_max_min_hr
fuel_con2 type P DECIMALS 2, " Total_hrs / t_max_min_hr
km_l type P DECIMALS 2, " t max_min_km / t_max_min_lit
l_p type P DECIMALS 2 , " t_max_min_lit / t_max_min_hr
l_p2 type P DECIMALS 2 ,
END OF ty_final.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
DATA: i_data TYPE TABLE OF ty_data, " internal table
wa_data TYPE ty_data, " work area
i_final TYPE TABLE OF ty_final, " internal table
wa_final TYPE ty_final. " work area
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_equnr FOR equi-equnr OBLIGATORY, "no-extension no intervals,
p_idate FOR imrg-idate. "NO-EXTENSION NO INTERVALS OBLIGATORY,
"p_recdu FOR imrg-recdu." NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk.
TOP-OF-PAGE.
FORMAT INTENSIFIED ON.
WRITE:/55(40) ' WAGNERS INVESTMENT LIMITED '.
WRITE:/50(40) ' VEHICLE FUEL CONSUMPTION REPORT ' CENTERED ,
2 'Page', sy-pagno.
FORMAT INTENSIFIED OFF.
WRITE:/50(40) '----
' CENTERED .
FORMAT INTENSIFIED ON.
WRITE:/2 sy-datum COLOR 3, sy-uzeit .
"WRITE:/1 S903-SPMON ."p_yearf.
ULINE.
"CENTERED.
write: /2 'Equipment No :'left-justified,p_equnr-low color 2 , ' to ' , p_equnr-high color 2.
write: /2 'Date From :', p_idate-low color 2 , ' to ' , p_idate-high color 2.
END-OF-PAGE.
START-OF-SELECTION.
select aequnr deqktx feqfnr eidate erecdu erecdv
into table i_data
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate and
e~cancl ne 'X'.
loop at i_data into wa_data.
CLEAR: wa_final.
READ TABLE i_final into wa_final
with key equnr = wa_data-equnr." BINARY SEARCH.
if sy-subrc EQ 0.
PERFORM F_GET_MAX_DATA.
PERFORM F_GET_MAX_HOURS.
PERFORM F_GET_MAX_LIT.
PERFORM prepare_final_rec USING'M'. " Modify Existing Record
ElSE.
PERFORM prepare_final_rec USING'A'. " Append New Record.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
ENDIF.
ENDLOOP.
refresh i_final.
clear i_final.
FORM F_GET_MAX_DATA.
select single MAX( eidate ) Min( eidate ) MAX( erecdv ) MIN( erecdv )
into corresponding fields of (wa_final-max_date_km,wa_final-min_date_km,wa_final-max_km ,wa_final-min_km)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'KM'
AND a~equnr = wa_data-equnr.
ENDFORM.
FORM F_GET_MAX_HOURS.
select single MAX( erecdv ) MIN( erecdv )
into corresponding fields of (wa_final-max_hr, wa_final-min_hr)
from equi AS a
inner join equz as b
on aequnr = bequnr
inner join iloa as f
on biloan = filoan
inner join imptt as c
on aobjnr = cmpobj
inner join eqkt as d
on aequnr = dequnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'H'
AND a~equnr = wa_data-equnr .
ENDFORM.
FORM F_GET_MAX_LIT.
select SUM( e~recdv )
into corresponding fields of (wa_final-fuel_con2)
from equi AS a
inner join eqkt as b
on bequnr = aequnr
inner join imptt as c
on cmpobj = aobjnr
inner join imrg as e
on epoint = cpoint
where a~equnr in p_equnr
and
e~idate in p_idate
and
e~cancl ne 'X' and
e~recdu = 'L'
AND a~equnr = wa_data-equnr.
ENDFORM.
FORM prepare_final_rec USING p_mode TYPE char1.
wa_final-t_max_min_km = wa_final-max_km - wa_final-min_km .
wa_final-t_max_min_hr = wa_final-max_hr - wa_final-min_hr.
if wa_final-t_max_min_km <> 0 .
wa_final-km_l = ( wa_final-max_km - wa_final-min_km ) / ( wa_final-fuel_con2 ) .
ELSE.
wa_final-km_l = 0.
endif.
if wa_final-t_max_min_hr <> 0 .
wa_final-l_p2 = ( wa_final-fuel_con2 ) / ( wa_final-t_max_min_hr ) .
ELSE.
wa_final-l_p2 = 0.
endif.
IF p_mode = 'A'.
wa_final-equnr = wa_data-equnr.
wa_final-eqktx = wa_data-eqktx.
wa_final-eqfnr = wa_data-eqfnr.
wa_final-t_max_min_km = wa_final-min_km - wa_final-max_km .
wa_final-t_max_min_hr = wa_final-max_hr - wa_final-min_hr.
wa_final-km_l = ( wa_final-max_km - wa_final-min_km ) / ( wa_final-fuel_con2 ).
gd_repid = sy-repid.
wa_final-l_p2 = ( wa_final-fuel_con2 ) / ( wa_final-t_max_min_hr ) .
APPEND wa_final TO i_final .
ELSE.
MODIFY i_final FROM wa_final
TRANSPORTING
eqfnr
max_date_km
min_date_km
max_date_lit
min_date_lit
max_date_hr
min_date_hr
max_km
min_km
max_hr
min_hr
t_max_min_km
t_max_min_hr
fuel_con2
km_l
l_p2
where equnr = wa_data-equnr.
ENDIF.
ENDFORM. " PREPARE_FINAL_REC
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EQUNR'.
fieldcatalog-seltext_m = 'Equip no'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EQKTX'.
fieldcatalog-seltext_m = 'Description'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EQFNR'.
fieldcatalog-seltext_m = 'Sortfield'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MIN_DATE_KM'.
fieldcatalog-seltext_m = 'Min Date'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAX_DATE_KM'.
fieldcatalog-seltext_m = 'Max Date'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MIN_KM' .
fieldcatalog-seltext_m = 'Min KM'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAX_KM' .
fieldcatalog-seltext_m = 'Max KM'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'T_MAX_MIN_KM' .
fieldcatalog-tabname = 'i_final'.
fieldcatalog-seltext_m = 'Total KM'.
fieldcatalog-col_pos = 7.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MIN_HR' .
fieldcatalog-seltext_m = 'Min Hr'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAX_HR' .
fieldcatalog-seltext_m = 'Max Hr'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 9.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'T_MAX_MIN_HR' .
fieldcatalog-seltext_m = 'Total HR'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 10.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'FUEL_CON2' .
fieldcatalog-seltext_m = 'Km/L'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 11.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'L_P2' .
fieldcatalog-seltext_m = 'Lit/HR'.
fieldcatalog-tabname = 'i_final'.
fieldcatalog-col_pos = 12.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
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' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
tables
t_outtab = i_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. " DISPLAY_ALV_REPORT -
Auto GR/IR for Semi Finished goods in Work in Progress stage.
Dear All,
What are account postings going to happen while issuing semi finished goods from from one process to other process by using Auto GR/IR.
Regards,
Venkat.Dear sapper2000,
Work in progress:If my understanding is correct,then any unfinished product can be said as work in progress.
Work in process or progress are partially completed goods, parts, or subassemblies that are no longer part of the raw
materials inventory and not yet part of the finished products inventory.Check this link to explore more on this topic,
http://wiki.sdn.sap.com/wiki/display/ERPFI/UnderstandingResultsAnalysisforWIP
Regards
Mangalraj.S -
MB5T background schedule ouput in alv format
Hi all,
Please help me to get MB5T report ouput of background schedule in ALV.
I have put that report in bacground scheduling & the output of the same in BEST format but my client want the output in AlV format.
Please suggest.
Regards,
AnantOutput of MB5T can't be in ALV format in background. In foreground also this is done in two steps., In first system display in BEST format..this can be changed to ALV manually in second step.
-
Table to be displayed in ALV format in WD.
Hi Experts,Gurus.
I want to display data in the ALV format in my web dynpro component. Can any please tell the procedure to achieve this
Regards,
Yugeshhi Yugesh ,
refer this article :
SAP List Viewer (ALV) [original link is broken]
Configuring ALV
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?overridelayout=true
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706;jsessionid=(J2EE3414800)ID0133346050DB00727847586176044227End?overridelayout=true&bcsi_scan_06B6B0A4B65849C2=0
using ALV
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4;jsessionid=(J2EE3417400)ID0488867050DB10849380333905377829End
hope these basic tutorials help u .
regards,
amit -
LSMW for changing user status on work order(IW32)
Hi All,
I have created a LSMW for changing user status on work order using transaction IW32. It does not change the status when i run the LSMW. In the recording for the LSMW, i select the radio button on the user status i want to select.
When i run the LSMW in the foreground, it does everything except select the correct status.
Is there a way to fix this or is it a problem with LSMW. I'm using ECC6
Kind Regards
EmanuelHi ,
I am not sure whether it would work with LSMW but if your on ECC 6.00 ,Enhacement Pack 3 then you have BADIs which allow you to make collective status changes in IW38 .The below are those BADIs :-
BADI_EAM_RIAUFK20_FCODE_CUS1 :Implement Customer Function Code in Order List
BADI_EAM_RIAUFK20_FCODE_SAP1 :Implement SAP Function Code in Order List
Else if your on lower version then write up a batch programme which checks the PM Order types with specific status and sets user status using FM STATUS_CHANGE_EXTERN[This is used to set or delete User Status] in SE37 ..
regrds
pushpa -
ALV Report to KSB1 Report-- KSB1 Report outputs in Non-ALV Format
Hi Gurus,
I am calling KSB1 from report ALV output.
After execution of KSB1, Report outputs in Classical report format.
While I execute KSB1 manually it shows in ALV Report.
From my report how to retain output of KSB1 in ALV Format.
Thanks in advance.Add some lines to BDC to force ALV display, like
perform bdc_dynpro using 'RKAEP000' '0100'.
perform bdc_field using 'BDC_CURSOR'
'KOSTL-LOW'.
* Call the option
perform bdc_field using 'BDC_OKCODE'
'=UCSS'.
* Force grid
perform bdc_dynpro using 'SAPLKAE2' '0200'.
perform bdc_field using 'BDC_CURSOR'
'KAEP_SETT-MAXSEL'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KAEP_SETT-USEGRD'
record-USEGRD_004.
perform bdc_field using 'KAEP_SETT-MAXSEL'
record-MAXSEL_005.
* back to initial screen
perform bdc_dynpro using 'RKAEP000' '0100'.
Regards,
Raymond -
Classical List to ALV format in sap abap report
Hi All,
I have a requirement to change the existing abap report in which teh output is dispalyed in classical list format.
I want to convert this list report output into ALV format.
COuld anyone please help me how to convert this from Classical list to ALV format?
Thanks,
Komal.
Moderator message: sorry, this not the place to teach the basics, please search for available information. If you understand the classical list and how to use ALV, then you can also do the transfer yourself.
Edited by: Thomas Zloch on Aug 12, 2011 4:44 PMThis will be very difficult for you.....
Since you are getting a time out error....it looks like, you are runnning this report in foreground....................
Try running it in background it will work...
ELSE....you have to fetch in small chunks....but the question is how will you do it. Since the USR02 only has BNAME as primary key...
Either put the BNAME as part of selection screen and fetch the data.....it will solve your problem....
Only fetch for those BNAME which is entered in the selection screen...
Hope it helps! -
Issue Regarding ALV List Report
Hi,
I have prepared a ALV List report.
I have made use of <b>REUSE_ALV_LIST_DISPLAY</b>.
I have put a <b>check box</b> in the output at the begining of every Record.
Now what i want is to put a <b>SELECT ALL</b> & <b>DESELECT ALL Buttons</b> on Application Tool Bar & If i hit on them i should be able to <b>SELECT & DE-SELECT</b> all the <b>Records/Check Boxes</b> in the output.
Can anybody tell me the logic for both <b><b>SELECT & DE-SELECT</b></b> functionalities.
Thanks in advance.
Thanks & Regards,
Prasad.
<b></b>Hi,
<b>Call to F.M is as below:</b>
FORM f_display_alv_report .
DATA: l_valid,
l_params LIKE pri_params.
SET PF-STATUS c_alv.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'BATCH'
report = v_repid
no_dialog = c_x
IMPORTING
out_parameters = l_params
valid = l_valid.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = c_command
i_callback_pf_status_set = c_alv
is_layout = i_gd_layout
it_fieldcat = i_fieldcatalog[]
it_events = i_events
is_print = i_params
i_save = c_x
TABLES
t_outtab = i_display_data
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. " f_display_alv_report
<b>Then User Command Call is as below:</b>
FORM f_user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CLEAR: v_field, v_index, v_line, v_value.
IF p_ucomm EQ c_select.
LOOP AT i_display_data.
i_display_data-selected = c_x.
MODIFY i_display_data TRANSPORTING selected.
CLEAR i_display_data.
ENDLOOP.
ELSEIF p_ucomm EQ c_deselect.
LOOP AT i_display_data.
i_display_data-selected = space.
MODIFY i_display_data TRANSPORTING selected.
CLEAR i_display_data.
ENDLOOP.
ENDIF.
Get cursor field, value and Line
GET CURSOR FIELD v_field
VALUE v_value
LINE v_line.
v_line = v_line - 3.
CLEAR: i_display_data,
i_mem,
v_mem_kschl,
v_mem_printer,
v_ucomm,
v_mem_print.
REFRESH: i_mem.
LOOP AT i_display_data
WHERE selected EQ c_x.
i_mem-v_mem_vbeln = i_display_data-vbeln.
i_mem-v_mem_posnr = i_display_data-posnr.
APPEND i_mem.
CLEAR i_mem.
ENDLOOP.
READ TABLE i_display_data INDEX v_line.
IF sy-subrc EQ 0.
v_mem_kschl = p_kschl.
v_mem_printer = p_print.
v_ucomm = sy-ucomm.
EXPORT i_mem TO MEMORY ID 'MEM'.
EXPORT v_mem_kschl TO MEMORY ID 'KSCHL'.
EXPORT v_mem_printer TO MEMORY ID 'PRINTE'.
EXPORT v_ucomm TO MEMORY ID 'UCOM'.
ENDIF.
CASE p_ucomm.
To Print SAP Script Output
WHEN c_print.
v_mem_print = c_x.
EXPORT v_mem_print TO MEMORY ID 'PRINT'.
v_return_code = c_999.
v_screen = c_x.
IF ( v_field EQ c_mark OR
v_field EQ c_selected OR
v_field EQ c_vbeln OR
v_field EQ c_posnr OR
v_field EQ c_kschl ) AND
NOT v_value IS INITIAL.
PERFORM f_entry IN PROGRAM zasdf0012_sales_order
USING v_return_code v_screen.
ENDIF.
Display SAP Script Output
WHEN c_pripreview.
v_return_code = c_999.
v_screen = c_x.
IF ( v_field EQ c_mark OR
v_field EQ c_selected OR
v_field EQ c_vbeln OR
v_field EQ c_posnr OR
v_field EQ c_kschl ) AND
NOT v_value IS INITIAL.
PERFORM f_entry IN PROGRAM zasdf0012_sales_order
USING v_return_code v_screen.
ENDIF.
WHEN c_back.
BACK.
WHEN c_exit.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN 0.
WHEN c_cancel.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN 0.
WHEN c_others.
ENDCASE.
ENDFORM. " F_USER_COMMAND
<b>The Field Catalog Build up is :</b>
i_fieldcatalog-fieldname = 'KSCHL'.
i_fieldcatalog-tabname = 'I_DISPLAY_DATA'.
i_fieldcatalog-seltext_m = 'Output Type'.
i_fieldcatalog-col_pos = 1.
i_fieldcatalog-outputlen = 11.
APPEND i_fieldcatalog.
CLEAR i_fieldcatalog.
i_fieldcatalog-fieldname = 'VBELN'.
i_fieldcatalog-tabname = 'I_DISPLAY_DATA'.
i_fieldcatalog-seltext_m = 'Sales Document No'.
i_fieldcatalog-col_pos = 2.
i_fieldcatalog-outputlen = 17.
APPEND i_fieldcatalog.
CLEAR i_fieldcatalog.
i_fieldcatalog-fieldname = 'POSNR'.
i_fieldcatalog-tabname = 'I_DISPLAY_DATA'.
i_fieldcatalog-seltext_m = 'Sales Item No'.
i_fieldcatalog-col_pos = 3.
i_fieldcatalog-outputlen = 14.
APPEND i_fieldcatalog.
CLEAR i_fieldcatalog.
<b>Events Build Up:</b>
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = i_events.
READ TABLE i_events
INTO wa_events
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE c_top_of_page TO wa_events-form.
MODIFY i_events FROM wa_events INDEX sy-tabix.
ENDIF.
READ TABLE i_events WITH KEY name = c_user_command
INTO wa_events.
IF sy-subrc = 0.
MOVE c_command TO wa_events-form.
MODIFY i_events FROM wa_events INDEX sy-tabix.
ENDIF.
<b>Layout Buil up is as:</b>
i_gd_layout-no_input = space.
i_gd_layout-colwidth_optimize = c_x.
i_gd_layout-totals_text = 'Totals'(201). "#EC *
i_gd_layout-box_fieldname = 'SELECTED'.
i_gd_layout-box_tabname = 'I_DISPLAY_DATA'.
i_gd_layout-edit = c_x.
Here one thing we need to take care id i am combining Check Box with & another field Output Type [KSCHL] like in Std. TCode VL71.
Can anybody solve this issue!
Thanks for reply.
Thanks & Regards,
Prasad. -
MB51 should come in ALV format
Hi,
When we are running the Transaction MB51 with a Material, it displayed the output in a standard format. In this screen, one icon is showing i.e. Detail List. After click on it, it shows the output in ALV format.
We want that when we execute the MB51 transaction, the output should come in ALV format directly.. means standard format must be skip.
Note: - I try to skip this screen by the SHD0, but there is not any screen number to do so.
Please tell me, how can i skip that standard screen and open in ALV format directly....
Regards...Hi, Dear
Check the Sample Program Given Bellow hope will help you to solve out your problem,
TABLES: mseg, mkpf, makt.
TYPES: BEGIN OF ty_mb51,
werks LIKE mseg-werks,
matnr LIKE mseg-matnr,
maktx LIKE makt-maktx,
budat LIKE mkpf-budat,
mblnr LIKE mkpf-mblnr,
shkzg LIKE mseg-shkzg,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
cputm LIKE mkpf-cputm,
END OF ty_mb51.
SELECT-OPTIONS: somatnr FOR mseg-matnr OBLIGATORY.
DATA: it_mb51 TYPE STANDARD TABLE OF ty_mb51,
wa_mb51 LIKE LINE OF it_mb51.
SELECT mseg~werks
mseg~matnr
makt~maktx
mkpf~budat
mkpf~mblnr
mseg~shkzg
mseg~menge
mseg~meins
mkpf~cputm
INTO CORRESPONDING FIELDS OF TABLE it_mb51
FROM mseg INNER JOIN mkpf ON ( mseg~mblnr = mkpf~mblnr AND mseg~mjahr = mkpf~mjahr )
INNER JOIN makt ON ( mseg~matnr = makt~matnr AND makt~spras = 'E' )
WHERE mseg~matnr IN somatnr.
LOOP AT it_mb51 INTO wa_mb51.
IF wa_mb51-shkzg = 'H'.
MULTIPLY: wa_mb51-menge BY -1.
MODIFY it_mb51 FROM wa_mb51 INDEX sy-tabix.
ENDIF.
ENDLOOP.
LOOP AT it_mb51 INTO wa_mb51.
WRITE: / wa_mb51-werks, wa_mb51-matnr, wa_mb51-maktx, wa_mb51-budat, wa_mb51-mblnr, wa_mb51-menge, wa_mb51-meins, wa_mb51-cputm.
AT LAST.
SUM.
WRITE: /90(15) wa_mb51-menge.
ENDAT.
ENDLOOP.
Best Regards,
Faisal
Maybe you are looking for
-
Query Reg env-entry in ejb jar xml
Hi, I have the following tag in the ejb-jar of my application: <env-entry> <env-entry-name>postingDate</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>Request</env-entry-value> </env-entry> When a JNDI LookUp is do
-
Assignment of colour profiles in indesign vs PDF colour profile
Hi all, If in the assign colour profiles menu of indesign I had the same setting for all my indesign files, as shown in screenshot attached. And then when a PDF is created from an Indesign file using a different CMYK profile, will the original indesi
-
Simulation Capture Problem CP4 - last character in text box cut off.
This is somewhat difficult for me to explain, but here is what we are experience. The issue we are having is when capturing a demonstration or simulation of our Windows based form in Captivate 4, occasionally the last character of text in a text box
-
UDM_DISPUTE - Change field
Hello All, We have a requirement where we need to add extra details into the description of the sold-to party in UDM_DISPUTE transaction. For example there is a sold-to-party 123556 and the description shown is ABCD ,we would like to change the descr
-
We receive the error CMS is unstable and will shut down immediately. Reason: Database access error. Reason ORA-00904: "CMS_INCREMENTWITHROLLOVER5": invalid identifier. when we try and start our CMS. We are running the CMS on Oracle as you can tell fr