ALV Grid disply?
Hi Guru's,
Developed a report to include fields like Model Number, Serial Number, Construction, Maintenance Plant, Plant section, Status inclusive, Status Exclusive, Customer, End Customer and SH Contract Release in the existing standard report IK17(Display measurement documents). The report has been developed by making a copy of the standard report as ZIK17 as the above mentioned additional fields need to be added into the standard functionality of IK17. All these fields Model Number, Serial Number, Construction, Maintenance Plant, Plant section, Customer, End Customer and SH Contract Release are fetched using tables like EQUI and IHPA.
In this is there any Function Module for Status inclusive and exclusive fields are fetched the data?
Finally all the fields are displayed using ALV grid display?
Regards,
SIVA
Hi Siva,
Also check the below FM's
BAPI_EQUI_GETSTATUS
BAPI_EQUI_GETDETAIL
BAPI_EQUI_GETLIST
Hope it helps you.
Regards,
Anki Reddy
Similar Messages
-
ALV grid disply with edit columns in output
Hi all,
i am using CALL METHOD MY_GRID->SET_TABLE_FOR_FIRST_DISPLAY
to display the output in alv format.there is 3 edit columns in output display.
if i fill one field & then put 'ENTER' then other two fields of that row should be filled with the appropriate data from the program.still control should be in output display.
which method i should use to go inside the program when i put 'ENTER' on any field of ALV output disply & how to use those methods inside the program.
i need some materials regarding OOPS (class, method ) . now i want to put OOPS concept in alv display.
correct answers will be rewarded.
Thanks & regardsHi,
Check,
OOPS
http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
ABAP Objects
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb#section7 [original link is broken]
check the below links lot of info and examples r there for OOPS
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
<b>Reward if helpful.</b> -
How to gve the colors to the TOP-OF-PAGE in ALV Grid Disply..
i want to give 3 different colors in the top-of-page(there are three different lines each line should disply in different colors)...
plaese tell me how can i do that...........Hi
Try like this...
form build_events.
clear gv_event.
refresh i_events.
Get the ALV events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = i_events
exceptions
list_type_wrong = 1
others = 2.
if sy-subrc = 0.
sort i_events by name.
endif.
Form for Top-of-Page ---------------------------------*
read table i_events with key name = slis_ev_top_of_page
into gv_event
binary search.
if sy-subrc = 0.
move gc_top_of_page to gv_event-form.
modify i_events from gv_event index sy-tabix.
endif.
Form for End-of-List ---------------------------------*
read table i_events with key name = slis_ev_end_of_list
into gv_event
binary search.
if sy-subrc = 0.
move gc_end_of_list to gv_event-form.
modify i_events from gv_event index sy-tabix.
endif.
Specify the ALV layout
wa_layout-max_linesize = gv_linsz.
wa_layout-min_linesize = gv_linsz.
endform. " build_events
form top_of_page_d.
format color col_heading.
write: / 'Satyanarayana'
format color col_total.
write: / 'Sayana'.
format reset.
endform.
Satya. -
How to declare top of page in alv grid disply
Hi
Can any ine let me know how to declare the top -of -page??
Arun JosephHi , check this one u will get easily .
*& Report ZMM_ANNEXURE4_ALV
REPORT ZMM_ANNEXURE4_ALV1.
TYPE-POOLS SLIS .
TABLES : J_1IEXCHDR,
J_1IEXCDTL,
J_1IGRXSUB, " FOR QTY
LFA1, " Vendor Master
ADRC, " Vendor Address
MSEG, " Batch - Identification Marks
MKPF. "
DATA : IT_J_1IEXCHDR LIKE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA : IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IEXCDTL LIKE J_1IEXCDTL OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IGRXSUB LIKE J_1IGRXSUB OCCURS 0 WITH HEADER LINE.
DATA : IT_MSGE LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_LFA1 LIKE LFA1 OCCURS 0 WITH HEADER LINE.
DATA : IT_ADRC LIKE ADRC OCCURS 0 WITH HEADER LINE.
DATA : IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
data: fieldcatalog type slis_t_fieldcat_alv with header line,
it_listheader type slis_t_listheader,
it_events type slis_t_event,
it_fieldcat type slis_t_fieldcat_alv,
gd_tab_group type slis_t_sp_group_alv,
IS_layout type slis_layout_alv,
SELL_MODE TYPE SLIS_T_SP_GROUP_ALV,
gd_repid like sy-repid.
INCLUDE <symbol>.
INCLUDE <icon>.
*DATA : TEXT1(100) TYPE C.
*DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : V_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : V_QTY LIKE EKPO-MENGE.
DATA : V_VAL LIKE MARA-NTGEW. " For calculation of Qty
DATA : V_VAL1 TYPE STRING. " For calculation of Qty
DATA : V_Q TYPE STRING. " Variable for calculating
" burning loss
DATA : V_WST TYPE STRING. " Variable 4 WasteM.
DATA : V_WST1 TYPE STRING. " Variable 4 WasteM.
DATA : V_SCPGN LIKE MSEG-MENGE.
DATA : V_WUNIT TYPE STRING.
DATA : V_QFPG1 TYPE STRING.
DATA : V_QFPG2 TYPE STRING.
DATA : V_AQTY TYPE STRING.
DATA : V_QTYR LIKE J_1IEXCDTL-MENGE.
DATA : V_QTYR1 TYPE STRING.
DATA : V_UNTQT TYPE STRING.
DATA : V_MEINS LIKE MSEG-MEINS.
DATA : V_MEINS1 LIKE MSEG-MEINS.
DATA : V_SCPGN1 TYPE STRING.
DATA : V_WSTMQ LIKE MSEG-MENGE.
DATA : V_WSTMQ1 TYPE STRING.
DATA : V_QFPGN LIKE MARA-NTGEW.
DATA : V_VALQ LIKE MARA-NTGEW.
DATA : V_UNITQ LIKE MARA-MEINS.
DATA : V_WGHT TYPE STRING.
DATA : V_WGHT1 TYPE STRING.
DATA : V_CHARG LIKE MSEG-CHARG.
DATA: TEXT TYPE STRING.
DATA: TEXT1 TYPE STRING.
DATA: TEXT2 TYPE STRING.
DATA :TEXT3 TYPE STRING.
DATA :TEXT4 TYPE STRING.
DATA:dat_frt(30).
SELECTION-SCREEN ************
SELECTION-SCREEN COMMENT /80(50) VER.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE tit2.
SELECT-OPTIONS: P_CHLN FOR IT_J_1IEXCDTL-EXNUM. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECT-OPTIONS: P_DATE FOR IT_J_1IEXCHDR-BUDAT. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk2.
SELECTION-SCREEN COMMENT /72(60) run.
DATA : BEGIN OF IT_FINAL OCCURS 1,
BUDAT type d, "1 Date of issue
MAKTX(40) TYPE C, "2Material Desc
CHAPID(22) TYPE C,
MENGE(18) TYPE C, "4 Qty removed weight
CHARG(25) TYPE C, "5 Identification Marks
ADRS(55) TYPE C," 6For Vendor Address
EXNUM LIKE J_1IEXCHDR-EXNUM, "7 Challan No. & Date
ADDLDATA1(40) TYPE C, "8 NatureProcessReq
DOCNO LIKE J_1IEXCHDR-DOCNO, "10 Document No.
CPUDT TYPE D, "9 Date of Receipt
V_QTY1(40) TYPE C, "10QtyofProcessedFinishedGoods
BURNING(12) TYPE C, "11 Burning Loss
WST_M(20) TYPE c, "12 Qty of waste material
ADDLDATA2(18) TYPE C,"13 Invoice No.&Date
V_PARTIC(25) TYPE C," 14Particulars of Payment
ADDLDATA2 LIKE J_1IEXCHDR-ADDLDATA2,"15 Invoice No.&Date
END OF IT_FINAL.
PERFORM INITIALZATION1.
PERFORM GET_DATA.
PERFORM CALL_FORM.
*& Form INITIALZATION
text
--> p1 text
<-- p2 text
form INITIALZATION1 .
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
CLEAR IT_FINAL[].
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " INITIALZATION
*****INITIALIZATION
INITIALIZATION.
tit2 = 'Selection Criteria'.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO
dat_frt.
CONCATENATE 'User ID : ' sy-uname ' Client ID : ' sy-mandt
' Run Date : ' dat_frt
INTO run SEPARATED BY space.
ver = 'Developed by CMC Limited. '.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
IF P_DATE <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE BUDAT IN P_DATE AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
IF P_CHLN <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE EXNUM IN P_CHLN AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
select *
FROM J_1IEXCDTL
INTO TABLE IT_J_1IEXCDTL
WHERE EXDAT IN P_DATE " Document No.
AND TRNTYP = '57FC'.
" Transaction type for subcontracting
LOOP AT IT_J_1IEXCHDR.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
select MATNR MAKTX CHAPID MENGE MEINS ADDLDATA1 EXNUM
FROM J_1IEXCDTL
INTO (IT_J_1IEXCDTL-MATNR, IT_FINAL-MAKTX,
IT_FINAL-CHAPID,V_QTYR, V_UNTQT,
IT_J_1IEXCDTL-ADDLDATA1, IT_J_1IEXCDTL-EXNUM)
WHERE DOCNO = IT_J_1IEXCHDR-DOCNO " Document No.
AND TRNTYP = '57FC'
" Transaction type for subcontracting
AND RDOC2 = IT_J_1IEXCHDR-RDOC. " Material Doc No.
IT_FINAL-MAKTX = IT_J_1IEXCDTL-MAKTX. " Material Desc
IT_FINAL-CHAPID = IT_J_1IEXCDTL-CHAPID. " Tariff Clasifi
IT_FINAL-MENGE = IT_J_1IEXCDTL-MENGE.
IT_FINAL-MEINS = IT_J_1IEXCDTL-MEINS.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
V_QTYR1 = V_QTYR.
CONCATENATE V_QTYR1 V_UNTQT INTO IT_FINAL-MENGE SEPARATED BY ''.
IF V_UNTQT = 'EA'.
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VALQ, V_UNITQ)
WHERE MATNR = IT_J_1IEXCDTL-MATNR.
V_WGHT = V_VALQ * V_QTYR.
V_WGHT1 = V_WGHT.
CONCATENATE V_WGHT1 V_UNITQ INTO V_WGHT1 SEPARATED BY ''.
CONCATENATE IT_FINAL-MENGE V_WGHT1 INTO IT_FINAL-MENGE
SEPARATED BY ' / '.
ENDIF.
SELECT SINGLE CHARG " Batch No.
FROM MSEG
INTO V_CHARG
WHERE MBLNR = IT_J_1IEXCHDR-RDOC AND " Material Doc No.
MATNR = IT_J_1IEXCDTL-MATNR AND
SHKZG = 'H'. " H- CREDIT
IT_FINAL-CHARG = V_CHARG.
CLEAR V_CHARG.
SELECT SINGLE REC_QTY MBLNR " Qtywaste material,mat docno.
FROM J_1IGRXSUB
INTO (IT_J_1IGRXSUB-REC_QTY, IT_J_1IGRXSUB-MBLNR)
WHERE EXNUM = IT_J_1IEXCHDR-EXNUM." AND
EXC_ZEILE = IT_J_1IEXCHDR-ZEILE.
SELECT SINGLE MENGE " QTY OF WASTE MATERIAL
FROM MSEG
INTO V_SCPGN " VARIABLE STORING QTY OF WASTE MTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 545.
V_WST = V_SCPGN.
SELECT SINGLE MENGE MEINS " QTY OF WASTE MATERIAL
FROM MSEG
INTO (V_WSTMQ, V_MEINS) "VARIABLE STORING QTYOFWASTEMTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
V_WSTMQ1 = V_WSTMQ.
CONCATENATE V_WSTMQ1 V_MEINS INTO V_SCPGN1.
ADDING UNIT 'KG' INTO WASTE MATERIAL.
CONCATENATE V_WST 'KG' INTO IT_FINAL-WST_M.
SELECT SINGLE MATNR
FROM MSEG
INTO IT_MSEG-MATNR
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
IF RECEIVED QTY IS IN EA THEN IT SHOULD COME IN KG ALSO
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VAL, V_WUNIT)
WHERE MATNR = IT_MSEG-MATNR.
V_VAL1 = V_VAL.
CONCATENATE V_VAL1 V_WUNIT INTO V_QFPG1 SEPARATED BY ''.
IT_FINAL-V_QTY1 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPG2 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPGN = V_QFPG2.
CONCATENATE V_QFPG2 V_WUNIT INTO V_QFPG2.
V_AQTY = IT_J_1IGRXSUB-REC_QTY.
IF V_QFPGN <> 0.
CONCATENATE V_SCPGN1 V_QFPG2 INTO IT_FINAL-V_QTY1 SEPARATED BY ' / '.
ELSE.
IT_FINAL-V_QTY1 = V_SCPGN1.
ENDIF.
BURNING LOSS
*Burning Loss = Qty-removed - ( Qty of processed finished goods +
Qty of waste material)
V_Q = V_QTYR - ( V_QFPGN + V_SCPGN ).
IF V_Q GE 0.
CONCATENATE V_Q 'KG' INTO IT_FINAL-BURNING
SEPARATED BY ''.
ELSE.
V_Q = 0.
IT_FINAL-BURNING = V_Q.
ENDIF.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
APPEND IT_FINAL.
endselect.
LOOP AT IT_FINAL.
SELECT SINGLE adrnr "Adress Number
FROM lfa1
INTO IT_LFA1-adrnr
WHERE lifnr = IT_J_1IEXCHDR-LIFNR.
SELECT " Vendor Address
SINGLE name1 street city1 post_code1 tel_number fax_number
house_num1
FROM adrc
INTO (IT_ADRC-name1,IT_ADRC-street,IT_ADRC-city1,
IT_ADRC-post_code1,
IT_ADRC-tel_number,IT_ADRC-fax_number,IT_ADRC-house_num1)
WHERE addrnumber = it_lfa1-adrnr.
CONCATENATION OF VENDOR NAME & ADDRESS INTO ONE FIELD i.e ADRS.
CONCATENATE IT_ADRC-NAME1 IT_ADRC-STREET IT_ADRC-CITY1
IT_ADRC-POST_CODE1
INTO IT_FINAL-ADRS SEPARATED BY ''.
MODIFY IT_FINAL.
ENDLOOP.
***************CLEAR STATEMENT
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
ENDLOOP.
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " GET_DATA
ADD
form alv_events using events type slis_t_event.
data : wa_events type slis_alv_event.
clear wa_events.
wa_events-name = 'TOP_OF_PAGE'.
wa_events-form = 'TOP_OF_PAGE'.
append wa_events to it_events.
endform. "alv_events
*FORM FOR TOP OF PAGE
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader.
endform. "top_of_page
FORM fill_fieldcat USING f d o t to p c.
data wa_fieldcat type slis_fieldcat_alv.
statics pos like sy-index value 1.
pos = pos + 1.
clear wa_fieldcat.
MOVE : 1 TO WA_FIELDCAT-ROW_POS,
POS TO WA_FIELDCAT-COL_POS,
F TO WA_FIELDCAT-FIELDNAME,
D TO WA_FIELDCAT-SELTEXT_L,
O TO WA_FIELDCAT-OUTPUTLEN,
T TO WA_FIELDCAT-TABNAME,
TO TO WA_FIELDCAT-DO_SUM,
P TO WA_FIELDCAT-FIX_COLUMN,
C TO WA_FIELDCAT-EMPHASIZE.
move : 1 to wa_fieldcat-row_pos,
pos to wa_fieldcat-col_pos,
f to wa_fieldcat-fieldname,
d to wa_fieldcat-seltext_l,
o to wa_fieldcat-outputlen,
t to wa_fieldcat-tabname,
to to wa_fieldcat-do_sum,
p to wa_fieldcat-fix_column.
append wa_fieldcat to it_fieldcat.
ENDFORM. " fill_fieldcat
*& Form CALL_FORM
text
--> p1 text
<-- p2 text
form CALL_FORM .
perform alv_header using it_listheader.
perform alv_events using it_events.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
For Columns Heading
LOOP AT IT_FIELDCAT INTO V_FIELDCAT.
CASE V_FIELDCAT-FIELDNAME.
WHEN 'BUDAT'.
V_FIELDCAT-SELTEXT_L = 'Date of Issue'.
WHEN 'MAKTX'.
V_FIELDCAT-SELTEXT_L = 'Description of goods (inputs)'.
WHEN 'CHAPID'.
V_FIELDCAT-SELTEXT_L = 'Tarrif Classification'.
WHEN 'MENGE'.
V_FIELDCAT-SELTEXT_L = 'Quantity Removed '.
WHEN 'CHARG'.
V_FIELDCAT-SELTEXT_L = 'Identification Marks, If any'.
WHEN 'ADRS'.
V_FIELDCAT-SELTEXT_L =
'Premises/Factory to which goods removed'.
WHEN 'EXNUM'.
V_FIELDCAT-SELTEXT_L = 'Challan No.'.
WHEN 'ADDLDATA1'.
V_FIELDCAT-SELTEXT_L = 'Nature of Processing required'.
WHEN 'CPUDT'.
V_FIELDCAT-SELTEXT_L = 'Date of Receipt'.
WHEN 'V_QTY1'.
V_FIELDCAT-SELTEXT_L = 'Qty of Processed Finished Goods '.
WHEN 'BURNING'.
V_FIELDCAT-SELTEXT_L = 'Process Loss'.
WHEN 'WST_M'.
V_FIELDCAT-SELTEXT_L = 'Quantity of Waste Material'.
WHEN 'ADDLDATA2'.
V_FIELDCAT-SELTEXT_L = 'Invoice No. & Date'.
WHEN 'V_PARTIC'.
V_FIELDCAT-SELTEXT_L = 'Particulars of Payment of Duty'.
V_FIELDCAT-REF_FIELDNAME = 'ERSDA'.
V_FIELDCAT-REF_TABNAME = 'J_1IEXCDTL'.
WHEN OTHERS. CONTINUE.
ENDCASE.
V_FIELDCAT-SELTEXT_S = V_FIELDCAT-SELTEXT_L.
V_FIELDCAT-SELTEXT_M = V_FIELDCAT-SELTEXT_L.
MODIFY IT_FIELDCAT FROM V_FIELDCAT.
ENDLOOP.
perform fill_layout_structure.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = 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
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 = IT_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. " CALL_FORM
*& Form FILL_LAYOUT_STRUCTURE
text
--> p1 text
<-- p2 text
form FILL_LAYOUT_STRUCTURE .
data: wa_event type slis_alv_event,
wa_listheader type slis_t_listheader.
clear is_layout.
is_layout-zebra = 'X'.
SELL_MODE = 'D'.
endform. " FILL_LAYOUT_STRUCTURE
*& Form ALV_HEADER
text
-->P_IT_LISTHEADER text
form ALV_HEADER using p_it_listheader.
data : wa_listheader type slis_listheader.
TEXT = 'Annexure - IV'.
clear wa_listheader.
wa_listheader-typ = 'H'.
move TEXT to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT1 = 'Account of Removal of inputs or partially processed goods'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT1
to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT2 = 'under Sub Rule 5a of Rule of CENVAT Credit Rules, 2002'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT2 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT3 = '(to be maintened by assessee who sends raw '.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT3 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT4 = 'materials/semifinished goods.'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT4 to wa_listheader-info.
append wa_listheader to it_listheader.
endform. " ALV_HEADER
Regards,
Gulrez Alam -
Subtotal in ALV grid for a particular type and Grand total in ALV
Hi,
I need to have sub total for a particular type(eg: goods, services).. and grand total at end in ALV grid..
ALV output required as below:
Type VAT registration number Country Total Gross Amounts Total Tax Amounts Total Amount, ex-tax
Goods ATU12345678 AT 222.42 0 222.42
Goods NL123456789B02 NL 3,417.00 0 3,417.00
Goods Total 3,639.42 - 3,639.42
Services ATU12345678 AT 2,342.34 0 2,342.34
Services NL123456789B02 NL 223.33 0 223.33
Services Total 2,565.67 - 2,565.67
Grand Total 6,205.09 - 6,205.09
Let me as to how to achieve the above type in ALV grid...
Regards
Shivacheck this link..
Grand Totals in ALV grid disply function module
or do like this..
REPORT ZALVTESTFORSUBTOTAL.
tables:pa0008.
type-pools:slis.
types:begin of ty_pa0008,
pernr like pa0008-pernr,
begda like pa0008-begda,
endda like pa0008-endda,
ansal like pa0008-ansal,
lga01 like pa0008-lga01,
bet01 like pa0008-bet01,
end of ty_pa0008.
data:it_pa0008 type standard table of ty_pa0008 with header line.
data:it_fieldcat type SLIS_T_FIELDCAT_ALV,
wa_fieldcat type slis_fieldcat_alv,
it_layout type slis_layout_alv,
WA_events TYPE slis_alv_event,
it_events TYPE slis_t_event.
select-options:s_pernr for pa0008-pernr.
start-of-selection.
perform getD_data.
perform disp_alv.
*& Form getD_data
text
--> p1 text
<-- p2 text
form getD_data .
select pernr
begda
endda
ansal
lga01
bet01
from pa0008
into table it_pa0008
where pernr in s_pernr.
sort it_pa0008 by pernr begda descending.
endform. " getD_data
*& Form disp_alv
text
--> p1 text
<-- p2 text
form disp_alv .
wa_fieldcat-fieldname = 'PERNR'.
wa_FIELDCAT-REPTEXT_DDIC = 'Personnel no'.
*WA_FIELDCAT-no_subtotals = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'BEGDA'.
wa_FIELDCAT-REPTEXT_DDIC = 'Start date'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ENDDA'.
wa_FIELDCAT-REPTEXT_DDIC = 'End date'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ANSAL'.
wa_FIELDCAT-REPTEXT_DDIC = 'Annula salary'.
wa_fieldcat-do_sum = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'LGA01'.
wa_FIELDCAT-REPTEXT_DDIC = 'Wage Type'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'BET01'.
wa_FIELDCAT-REPTEXT_DDIC = 'Amount for wagetype'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
DATA: sort TYPE slis_sortinfo_alv,
it_sort TYPE slis_t_sortinfo_alv.
sort-fieldname = 'PERNR'.
sort-subtot = 'X'.
SORT-UP = 'X'.
APPEND sort TO it_sort.
*sort-fieldname = 'BEGDA'.
*SORT-NO_SUBTOTS = 'X'.
*APPEND sort TO it_sort.
IT_layout-totals_text = 'total text'.
IT_layout-subtotals_text = 'Subtotal text'.
*WA_EVENTS-NAME = 'SUBTOTAL TEXT'.
*WA_EVENTS-FORM = 'SUBTOTAL TEXT'.
*APPEND WA_EVENTS TO IT_EVENTS.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
IS_LAYOUT = it_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
it_sort = it_sort
it_events = it_events
TABLES
t_outtab = it_pa0008 .
endform. " disp_alv -
How we can get an interactive report in alv grid display?
Hi experts
Plz tell me how we can get an interactive report in alv grid disply pls send me one sample code to understand this
thanks in advancehi,
check this one
*& Report ZALV_FIELD_GRID1
REPORT ZALV_FIELD_GRID1
NO STANDARD PAGE HEADING.
TABLES MARA.
type-pools :slis.
TYPES : BEGIN OF TMARA ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
ERSDA LIKE MARA-ERSDA,
color(4) type c,
SEL type c,
LIGHT TYPE C,
END OF TMARA.
TYPES: BEGIN OF TMAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
SEL TYPE C,
COLOR(4),
END OF TMAKT.
DATA: ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
wa_fieldcat type slis_fieldcat_alv,
fieldcat type slis_fieldcat_alv occurs 0,
i_layout type slis_layout_alv,
WA_LISTHEADER TYPE SLIS_LISTHEADER,
i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
V_EVENTS TYPE SLIS_T_EVENT ,
WA_EVENT TYPE SLIS_ALV_EVENT,
I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
PRINT_CONT type slis_print_alv.
SELECTION SCREE
selection-screen begin of block screen1 with frame title TEXT-001.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /32(35) COMM1.
SELECTION-SCREEN ULINE /27(35).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS MATNR FOR MARA-MATNR.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /30(50) COMM2.
SELECTION-SCREEN ULINE /27(40).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN SKIP.
selection-screen end of block screen1.
INITIALIZATION
INITIALIZATION.
MATNR-low = '23'.
MATNR-high = '1000'.
MATNR-option = 'BT'.
MATNR-sign = 'I'.
APPEND MATNR.
ERSDA-low = '20030124'.
ERSDA-high = '20050302' .
APPEND ERSDA.
PERFORM FILLFIELD.
PERFORM FILLLAYOUT.
PERFORM build_print_params.
PERFORM FILL_SORT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
comm1 ='SELECT MATERIAL NUMBER RANGE'.
comm2 ='SELECT MATERIAL CREATION DATE'.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM READDATA.
PERFORM POPDATA.
*& Form READDATA
text
FORM READDATA .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-LOW
IMPORTING
OUTPUT = MATNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-HIGH
IMPORTING
OUTPUT = MATNR-HIGH.
SELECT MATNR
ERSDA
MEINS
FROM MARA
INTO CORRESPONDING FIELDS OF
TABLE ITAB
WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
LOOP AT ITAB.
data id_color type i VALUE 1.
data id_colors(2) type c.
IF ITAB-MATNR < '000000000000000100'.
ITAB-LIGHT = '1'.
ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
'000000000000000100' .
ITAB-LIGHT = '2'.
ELSE.
ITAB-LIGHT = '3'.
ENDIF.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab-color.
modify itab.
CLEAR ITAB.
endloop.
ENDFORM. " READDATA
Form FILLFIELD
FORM FILLFIELD .
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-outputlen = 20.
WA_FIELDCAT-HOTSPOT = 'X'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
*WA_FIELDCAT-EMPHASIZE = 'C210'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-COL_POS = '2'.
*WA_FIELDCAT-EMPHASIZE = 'C510'.
WA_FIELDCAT-outputlen = 10.
wa_fieldcat-seltext_m = 'UNIT'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'ERSDA'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-outputlen = 15.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
*WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'CREAT DATE'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. "FILLFIELD
Setup print parameters
form build_print_params.
PRINT_CONT-reserve_lines = '3'. "Lines reserved for footer
PRINT_CONT-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
Form POPDATA
FORM POPDATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOPPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_MARA
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_EVENTS
IT_EVENT_EXIT =
IS_PRINT = PRINT_CONT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " POPDATA
Form TOPPAGE
FORM TOPPAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "TOPPAGE
Form FILLLAYOUT
FORM FILLLAYOUT .
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-lights_fieldname = 'LIGHT'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
I_LAYOUT-no_totalline = 'X'.
ENDFORM. "FILLLAYOUT
Form FILL_SORT
FORM FILL_SORT .
SORT-DOWN = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'MATNR'.
SORT-tabname = 'MARA'.
APPEND SORT.
ENDFORM. " FILL_SORT
Form EVENT_CALL
FORM EVENT_CALL .
DATA: I_EVENT LIKE V_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS.
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. " EVENT_CALL
Form POPULATE_EVENT
FORM POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
move 'END_OF_PAGE' to WA_EVENT-FORM.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
endif.
ENDIF.
ENDFORM. "POPULATE_EVENT
FORM END_OF_PAGE.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
ENDFORM.
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
when 'MATNR'.
read table itab with key matnr = RS_SELFIELD-VALUE.
if sy-subrc = 0.
PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
PERFORM BUILD_FIELDCATLOG_MAKT.
PERFORM FILLLAYOUT_MAKT.
PERFORM DISPLAY_ALV_MAKT.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
Form DATA_RETRIEVAL_MAKT
FORM DATA_RETRIEVAL_MAKT USING TMATNR .
SELECT MATNR
MAKTX
MAKTG
UP TO 100 ROWS
FROM MAKT
INTO TABLE ITAB1
WHERE SPRAS = 'EN' AND MATNR = TMATNR.
LOOP AT ITAB1.
data id_color type i VALUE 1.
data id_colors(2) type c.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab1-color.
modify itab1.
CLEAR ITAB1.
ENDLOOP.
ENDFORM. "DATA_RETRIEVAL_MAKT
Form FILLLAYOUT_MAKT
FORM FILLLAYOUT_MAKT .
CLEAR I_LAYOUT.
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
ENDFORM. " LAYOUT_MAKT
Form BUILD_FIELDCATLOG_MAKT
FORM BUILD_FIELDCATLOG_MAKT .
REFRESH FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
WA_FIELDCAT-EMPHASIZE = 'C510'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTX'.
WA_FIELDCAT-COL_POS = '2'.
WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTG'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-EMPHASIZE = 'C210'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG_MAKT
Form DISPLAY_ALV_MAKT
FORM TOP-OF-PAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB1 lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "TOP-OF-PAGE
*& Form DISPLAY_ALV_MAKT
text
FORM DISPLAY_ALV_MAKT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = I_TITLE_MAKT
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
TABLES
T_OUTTAB = ITAB1
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_MAKT
Rewards points -
Reg: Top_Of_List Events in ALV GRID Display
Hi ,
How can i use the the the Top_of_list Event Alv grid Disply.
I have passed Events table with event name and form name to GRID FM it_events.
Form details:-
T_LISTHEADER header deatils table with data. .
FORM TOP_OF_LIST.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
But still its not calling the form and also end_of list is working with same coding but top_of_list is not working can u give solution for this.
Regards,
rajHi Rajviji,
Please change the coding to below :-
*& Report ZR2K9_ALV008
REPORT alv_top_of_list
TABLES : t001.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
TYPES : BEGIN OF ty_comp.
INCLUDE STRUCTURE t001.
TYPES : END OF ty_comp.
DATA: T_EVENTS TYPE slis_t_event.
DATA: WA_EVENTS TYPE slis_alv_event .
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : it_comp TYPE TABLE OF ty_comp.
INITIALIZATION.
w_repid = sy-repid.
*Need to change here
wa_events-name = 'TOP_OF_PAGE'. "Instead of TOP_OF_LIST
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO t_events.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_comp up to 20 rows.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_COMP'
I_STRUCTURE_NAME = 't001'
i_inclname = w_repid
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
it_fieldcat = it_fieldcat[]
IT_EVENTS = T_EVENTS
TABLES
t_outtab = it_comp
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM TOP_OF_PAGE. "Form Name Changed
DATA: T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: LS_LISTHEADER TYPE SLIS_LISTHEADER.
CLEAR LS_LISTHEADER.
LS_LISTHEADER-TYP = 'S'.
LS_LISTHEADER-KEY = 'Po Heder Details :-'.
APPEND LS_LISTHEADER TO T_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM.
Regards
Sandipan -
ALV Grid not displying properly when spool is generated by print button
Hi All,
When print button is used to genarate spool of the ALV Grid, then in the spool the end of page content is getting over lapped on the main lines. Please let me know how to display end of page content without geting overlapped on the lines.
Below is the code which I have written.
<cut>
Edit: Please see next post.
Thanks in Advance!
Regards,
Preethi G
Edited by: Julius Bussche on Feb 14, 2010 9:15 AMHi All,
Sorry. Please ignore my first post. When print button is used to generate spool then in the spool file the end of page content is getting overlapped on the main lines. Please let me know to solve this.
Thanks in Advance!
Below is the code written
ALV Grid display
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
wa_print_info-no_print_listinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_grid_title = ''
i_callback_pf_status_set = 'FRM_SET_STATUS'
i_callback_user_command = 'FRM_USER_COMMAND'
is_layout = alv_layout
it_events = i_events
it_fieldcat = alv_fieldcat
is_print = wa_print_info
TABLES
t_outtab = it_payroll
EXCEPTIONS
program_error = 1
OTHERS = 2.
End of Page and End of list
IF sy-pagno = 0.
s_pageno = 1.
ELSE.
s_pageno = sy-pagno.
ENDIF.
CLEAR: i_list_comments[].
SKIP.
SKIP.
CONCATENATE 'u85AAu8D44u4E13u5458' '________' 'HRSu7ECFu7406' '________' 'u4EBAu529Bu8D44u6E90u603Bu76D1'
'________' 'u7EE9u6548u8D22u52A1u603Bu76D1' '________' 'u603Bu7ECFu7406' '________'''INTO s_out
SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) s_out CENTERED.
SKIP.
CONCATENATE s_pageno '-' v_pagsum 'u9875' INTO
w_list_comments-info SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) w_list_comments-info CENTERED.
Edited by: Julius Bussche on Feb 14, 2010 9:16 AM
Tried to fix formatting a bit. -
Page No in ALV GRID Header disply ?
Hi,
How to display the page No in ALV GRID Header display.
Thanks & Regards,
Amir.hai
I think u can use this funtion... Using this funtion u can find som solution for ur problem
*& Form BUILD_EVENTTAB
text
-->P_EVENTS[] text *
form build_eventtab using p_events type slis_t_event.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = p_events.
read table p_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move formname_top_of_page to ls_event-form.
append ls_event to p_events.
endif.
endform. " BUILD_EVENTTAB
*& Form BUILD_COMMENT
text
-->P_HEADING[] text *
form build_comment using p_heading type slis_t_listheader.
data: hline type slis_listheader,
text(60) type c,
test_date TYPE string,
test_date1 TYPE string,
sep(20) type c.
clear: hline, text.
hline-typ = 'H'.
write: text-101 to text+23.
hline-info = text.
append hline to p_heading.
clear text.
write: 'User: ' to text,
sy-uname to text+6,
'Date: ' to text+25,
sy-datum to text+31,
'Page: ' to text+50,
sy-pagno to text+56.
hline-info = text.
append hline to p_heading.
endform. " BUILD_COMMENT
FORM TOP_OF_PAGE *
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = heading.
endform.
regard
nawa -
FIeld headings in ALV Grid by label
Hi
I want disply the headings in alv grid display like this format.
I want write my own label in the output. (not in Normal LIST DISPLAY)
Sno | Sname | Marks
| | M1 | M2 | M3
How it is possible?
Edited by: Krishna Bommisetty on Sep 11, 2008 10:55 AMHi,
Check the below code.
WA_FCAT-SELTEXT_M = TEXT-073.
WA_FCAT-DDICTXT = 'M'.
We can define the name of the field label as mentioned above, where texto073 is nothing but the field label you want to give to the particular field.
DDICTXT you have to mention the length as small 'S', medium 'M' and large as 'L'. -
How to give colors to the top-of-page in ALV Grid
How to give colors to the top-of-page in ALV Grid
in table GT_LIST_TOP_OF_PAGE i am filling 3 rows ,i need 3 different colors to be displyed on top-of-page(one color to one row)
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
please help meeHI Kranthi,
Check out teh foll. link,
http://www.sapfans.com/forums/viewtopic.php?t=52107
Hope this helps. -
How to Hide, or Don't show colums in ALV Grid?
I am using the standard cataloging and Function Module, REUSE_ALV_DISPLAY to pass an internal table to display fields to my ALV output.
However, I'd like to give the user options on what the report will calculate, thus having the need to only diaply certain columns on the report. Because some columns will be blank.
How can I restrain certain columns from displying on my ALV grid? Is there some logic, or parameter manipulation I need to invoke prior to my calling REUSE_ALV_DISPLAY in order to do this?
Thank-YouHi
You have to change the parameter of catalog table, if you don't want to see some fields set NO_OUT = 'X'.
LOOP AT GT_FIELDCAT INTO LT_FIELDCAT.
CASE LT_FIELDCAT-FIELDNAME.
WHEN ....
LT_FIELDCAT-NO_OUT = 'X'.
MODIFY GT_FIELDCAT FROM LT_FIELDCAT.
ENDCASE.
ENDLOOP.
If you don't want those fields you can delete them from catalog too.
LOOP AT GT_FIELDCAT INTO LT_FIELDCAT.
CASE LT_FIELDCAT-FIELDNAME.
WHEN ....
delete GT_FIELDCAT.
ENDCASE.
ENDLOOP.
Max -
Set_table_for_first_display not displaying alv grid
HI my call to method set_table_for_first_display is not displying the grid ...this is my code...any idea what can be wrong ?
CALL METHOD cc_alvgrid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
is_layout = ws_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
CHANGING
it_outtab = it_final_list[]
it_fieldcatalog = int_fieldcat[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
*--Exception handling
ELSE .
CALL METHOD cc_alvgrid->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2 .
IF sy-subrc <> 0.
--Exception handling
ENDIF.
ENDIF .======================================================================
*C O N S T A N T S
======================================================================
CONSTANTS:
c_lpa(3) TYPE c VALUE 'LPA' ,
c_einkbeleg(9) TYPE c VALUE 'EINKBELEG'.
CONSTANTS:
C_X(1) TYPE C VALUE 'X' ,
C_9(1) TYPE C VALUE '9' ,
C_2(1) TYPE C VALUE '2' ,
C_3(1) TYPE C VALUE '3' ,
C_7(1) TYPE C VALUE '7' ,
C_4(1) TYPE C VALUE '4' ,
C_6(1) TYPE C VALUE '6' ,
C_10(2) TYPE C VALUE '10' ,
C_19(2) TYPE C VALUE '19' ,
C_35(2) TYPE C VALUE '35' ,
C_LIFNR(5) TYPE C VALUE 'LIFNR',
C_NAME1(6) TYPE C VALUE 'NAME1',
C_TABNAME(7) TYPE C VALUE 'TABNAME',
C_FNAME(5) TYPE C VALUE 'FNAME',
C_OBJECTID(8) TYPE C VALUE 'OBJECTID',
C_ITEM(4) TYPE C VALUE 'ITEM',
C_SLINE(5) TYPE C VALUE 'SLINE',
C_VALUE_NEW(9) TYPE C VALUE 'VALUE_NEW',
C_VALUE_OLD(9) TYPE C VALUE 'VALUE_OLD',
C_UDATE(5) TYPE C VALUE 'UDATE',
C_UTIME(5) TYPE C VALUE 'UTIME' ,
C_USERNAME(8) TYPE C VALUE 'USERNAME',
C_CDPOS(5) TYPE C VALUE 'CDPOS',
C_CDHDR(5) TYPE C VALUE 'CDHDR',
C_LFA1(4) TYPE C VALUE 'LFA1',
C_EKKO(4) TYPE C VALUE 'EKKO',
c_it_final_list(13) TYPE C VALUE 'IT_FINAL_LIST'.
======================================================================
*-> Final Output List
======================================================================
BEGIN OF tp_final,
lifnr TYPE ekko-lifnr,
name1 TYPE lfa1-name1,
tabname TYPE cdpos-tabname,
FNAME TYPE CDPOS-FNAME,
OBJECTID TYPE CDPOS-OBJECTID,
ITEM TYPE CDPOS-TABKEY,
SLINE TYPE CDPOS-TABKEY,
VALUE_OLD TYPE CDPOS-VALUE_OLD,
VALUE_NEW TYPE CDPOS-VALUE_NEW,
UDATE TYPE CDHDR-UDATE,
UTIME TYPE CDHDR-UTIME,
USERNAME TYPE CDHDR-USERNAME,
END OF tp_final.
======================================================================
*A L V G R I D
======================================================================
*--- ALV Grid instance reference
DATA cc_alvgrid TYPE REF TO cl_gui_alv_grid .
*--- Name of the custom control added on the screen
DATA ws_custom_control_name TYPE scrfname VALUE 'CC_ALV' .
*--- Custom container instance reference
DATA cc_ccontainer TYPE REF TO cl_gui_custom_container .
*--- Field catalog table
DATA int_fieldcat TYPE lvc_t_fcat.
*--- Layout structure
DATA: ws_layout TYPE lvc_s_layo ,
it_sort type LVC_T_SORT.
form CREATE_ALV_OBJECT .
IF cc_alvgrid IS INITIAL .
----Creating custom container instance
CREATE OBJECT cc_ccontainer
EXPORTING
container_name = ws_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6 .
IF sy-subrc <> 0.
--Exception handling
ENDIF.
----Creating ALV Grid instance
CREATE OBJECT cc_alvgrid
EXPORTING
i_parent = cc_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5 .
IF sy-subrc <> 0.
--Exception handling
Endif.
Endif.
endform. "
form BUILD_FIELDCATALOG .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_LIFNR TEXT-007 C_X C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_NAME1 TEXT-008 ' ' C_35 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_TABNAME TEXT-009 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_FNAME TEXT-010 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_OBJECTID TEXT-011 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_ITEM TEXT-012 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_SLINE TEXT-013 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_VALUE_OLD TEXT-014 ' ' C_10.
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_VALUE_NEW TEXT-015 ' ' C_10
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_UDATE TEXT-016 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_UTIME TEXT-017 ' ' C_10 .
PERFORM FILL_FIELDS_OF_FIELDCATALOG USING
c_it_final_list C_USERNAME TEXT-018 ' ' C_10 .
endform. " BUILD_FIELDCATALOG
form FILL_FIELDS_OF_FIELDCATALOG using p_tab_name
p_field_name
p_header
p_key
p_len.
*--- Field catalog Structure
DATA ls_fieldcat TYPE LVC_S_FCAT.
W_POS = W_POS + 1.
ls_fieldcat-COL_POS = W_POS.
ls_fieldcat-KEY = p_key.
ls_fieldcat-TABNAME = p_tab_name.
ls_fieldcat-FIELDNAME = p_field_name.
ls_fieldcat-SELTEXT = p_header.
ls_fieldcat-COLTEXT = p_header.
ls_fieldcat-OUTPUTLEN = p_len.
APPEND ls_fieldcat TO int_fieldcat.
form BUILD_LAYOUT .
CLEAR ws_layout.
REFRESH I_SLIS_SORT.
*-Set ALV Layout For List
wS_LAYOUT-ZEBRA = C_X.
wS_LAYOUT-GRID_TITLE = 'Scheduling Agreement Changes'.
**Setting The Sort Criteria
LS_SLIS_SORT-FIELDNAME = C_KUNR.
LS_SLIS_SORT-TABNAME = C_I_OUTAB_HDR.
LS_SLIS_SORT-SPOS = C_1.
LS_SLIS_SORT-UP = C_X.
APPEND LS_SLIS_SORT TO I_SLIS_SORT.
LS_SLIS_SORT-FIELDNAME = C_WERKS.
LS_SLIS_SORT-TABNAME = C_I_OUTAB_HDR.
LS_SLIS_SORT-SPOS = 2.
LS_SLIS_SORT-UP = C_X.
APPEND LS_SLIS_SORT TO I_SLIS_SORT.
LS_SLIS_SORT-FIELDNAME = C_VBELN.
LS_SLIS_SORT-TABNAME = C_I_OUTAB_HDR.
LS_SLIS_SORT-SPOS = 3.
LS_SLIS_SORT-SUBTOT = C_X.
LS_SLIS_SORT-UP = C_X.
APPEND LS_SLIS_SORT TO I_SLIS_SORT.
endform. " BUILD_LAYOUT
form BUILD_FINAL_TABLE .
loop at it_cdpos into ws_cdpos.
move:
ws_cdpos-tabname to ws_final_list-tabname,
ws_cdpos-FNAME to ws_final_list-FNAME ,
ws_cdpos-OBJECTID to ws_final_list-OBJECTID ,
ws_cdpos-tabkey to ws_final_list-ITEM ,
ws_cdpos-tabkey to ws_final_list-SLINE ,
ws_cdpos-VALUE_OLD to ws_final_list-VALUE_OLD .
Read table it_ekko into ws_ekko with key ebeln = ws_cdpos-OBJECTID.
If sy-subrc = 0.
ws_final_list-LIFNr = ws_ekko-lifnr.
Read table it_lfa1 into ws_lfa1 with key lifnr = ws_ekko-lifnr.
If sy-subrc = 0.
ws_final_list-name1 = ws_lfa1-name1.
endif.
Endif.
Read table it_cdhdr into ws_cdhdr with key
OBJECTCLAS = ws_cdpos-OBJECTCLAS
OBJECTID = ws_cdpos-OBJECTID
CHANGENR = ws_cdpos-CHANGENR.
If sy-subrc = 0.
ws_final_list-UDATE = ws_cdhdr-UDATE.
ws_final_list-UTIME = ws_cdhdr-UTIME.
ws_final_list-USERNAME = ws_cdhdr-USERNAME.
endif.
Append ws_final_list to it_final_list.
clear : ws_final_list , ws_ekko , ws_lfa1 , ws_cdhdr.
endloop.
endform. " BUILD_FINAL_TABLE
form DISPLAY_DATA .
CALL METHOD cc_alvgrid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
is_layout = ws_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
CHANGING
it_outtab = it_final_list[]
it_fieldcatalog = int_fieldcat
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
*--Exception handling
ELSE .
CALL METHOD cc_alvgrid->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2 .
IF sy-subrc <> 0.
--Exception handling
ENDIF.
ENDIF .
endform. " DIS -
Vendor open items wise ALV Grid Display (FBL1N) report to Excel Sheet
Hi All,
I need vendor wise open items and cleared items in ALV Grid format in excel sheet.
I'm Trying that in T Code FBL1N, After the execution. I had select ALV Grid format like this From the menu bar->Settings-> Switch list.
After that i get ALV Grid format, Then i'm doing export the data to excel sheet. like this From the Menu bar->List->Export->Spread sheet.
That time i'm getting Error Message no. 0K064, Filter criteria, sorting, totals and subtotals are not taken into account.
I want vendor wise sorting totals and subtotals,
How can i over come this Error please let me now.
Thanks,
AmarHi Amar,
Please check the KBA 2083705.
https://websmp230.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3230383337303526
Regards,
Monika -
First try with ALV Grid and Abap Objects
Hi,
this is my first try to write a simple report which just reads a textfile and display it in an ALV Grid. As a basis, I used some examples from SDN, but it did not work as expected
I would like just to use a docking container. I do not need a separate area for the ALV Grid. The report gives no syntax errors, but it just display the report title, nothing else. SAP R/3 Release is 4.7. Below is the source code of the report. Any idea what is missing?
*& Report Z_PLAN_TEXT_UPLOAD *
REPORT z_plan_text_upload.
INCLUDE <icon>.
* Data Declaration
DATA:
gf_dynnr TYPE sy-dynnr,
gf_repid TYPE sy-repid.
DATA:
go_docking_container TYPE REF TO cl_gui_docking_container,
go_alv_grid TYPE REF TO cl_gui_alv_grid.
DATA:
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat LIKE LINE OF gt_fieldcat.
TYPES:
BEGIN OF gy_text_input,
firma(20) TYPE c,
kostenstelle(20) TYPE c,
datenart1(10) TYPE c,
planjahr(10) TYPE c,
* planperiode TYPE co_perio,
planperiode(5) TYPE c,
datenart2(10) TYPE c,
planungposition(10) TYPE c,
* kostenart TYPE koart,
kostenart(10) TYPE c,
* planbetrag TYPE bapicurr_d,
planbetrag(20) TYPE c,
END OF gy_text_input.
DATA:
gt_text_input TYPE TABLE OF gy_text_input,
gs_text_input LIKE LINE OF gt_text_input.
* Local Class Definition
* Local Class Implementation
* Selection-Screen
SELECTION-SCREEN BEGIN OF BLOCK b1
WITH FRAME TITLE text-001.
SKIP.
PARAMETERS:
gp_file TYPE localfile,
gp_head TYPE checkbox DEFAULT 'X'.
SKIP.
PARAMETERS:
gp_gjahr LIKE coep-gjahr,
gp_versn LIKE coep-versn.
SELECTION-SCREEN END OF BLOCK b1.
* Initialization
INITIALIZATION.
DATA:
lf_sapworkdir TYPE string.
CALL METHOD cl_gui_frontend_services=>get_sapgui_workdir
CHANGING
sapworkdir = lf_sapworkdir
EXCEPTIONS
get_sapworkdir_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0 OR lf_sapworkdir = ''.
CALL METHOD cl_gui_frontend_services=>directory_get_current
CHANGING
current_directory = lf_sapworkdir
EXCEPTIONS
directory_get_current_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
CALL METHOD cl_gui_cfw=>flush.
ENDIF."sy-subrc <> 0 OR sapworkdir = ''
gp_file = lf_sapworkdir.
gf_dynnr = sy-dynnr.
gf_repid = sy-repid.
* At Selection-Screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR gp_file.
DATA:
lt_filetable TYPE filetable,
ls_filetable LIKE LINE OF lt_filetable,
lt_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
* EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
* FILE_FILTER =
* INITIAL_DIRECTORY =
* MULTISELECTION =
* WITH_ENCODING =
CHANGING
file_table = lt_filetable
rc = lt_rc
* USER_ACTION =
* FILE_ENCODING =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lt_filetable INDEX 1
INTO
ls_filetable.
gp_file = ls_filetable-filename.
CALL METHOD cl_gui_cfw=>flush.
* Start-Of-Selection
START-OF-SELECTION.
DATA:
lf_filename LIKE filename-fileintern.
lf_filename = gp_file.
CALL FUNCTION 'FILE_READ_AND_CONVERT_SAP_DATA'
EXPORTING
i_filename = lf_filename
i_servertyp = 'PRS '
i_fileformat = 'TXT'
* I_FIELD_SEPERATOR =
i_line_header = gp_head
* IMPORTING
* E_BIN_FILELENGTH =
TABLES
i_tab_receiver = gt_text_input
EXCEPTIONS
file_not_found = 1
close_failed = 2
authorization_failed = 3
open_failed = 4
conversion_failed = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*------ Build the Field Catalog ---------------------------------------*
PERFORM build_fieldcatalog
CHANGING gt_fieldcat.
*------ Create the docking container ----------------------------------*
IF go_docking_container IS INITIAL.
CREATE OBJECT go_docking_container
EXPORTING
* PARENT =
repid = gf_repid
dynnr = gf_dynnr
* SIDE = go_docking_container->DOCK_AT_bottom
* EXTENSION = 200
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
* RATIO =
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
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."go_docking_container IS INITIAL
*------ Create the ALV Grid -------------------------------------------*
IF go_alv_grid IS INITIAL.
CREATE OBJECT go_alv_grid
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = go_docking_container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
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."go_alv_grid is initial
*------ Call ALV Grid -------------------------------------------------*
CALL METHOD go_alv_grid->set_table_for_first_display
* EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
it_outtab = gt_text_input
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form build_fieldcatalog
* text
* <--P_GT_FIELDCAT text
FORM build_fieldcatalog
CHANGING
pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
ls_fcat-fieldname = 'FIRMA' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'Firma' .
ls_fcat-seltext = 'Firma' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'KOSTENSTELLE' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'Kostenstelle' .
ls_fcat-seltext = 'Kostenstelle' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'DATENART1' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Datenart1' .
ls_fcat-seltext = 'Datenart1' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANJAHR' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Planjahr' .
ls_fcat-seltext = 'Planjahr' .
APPEND ls_fcat TO pt_fieldcat .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANPERIODE' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '5' .
ls_fcat-coltext = 'Planperiode' .
ls_fcat-seltext = 'Planperiode' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'DATENART2' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Datenart2' .
ls_fcat-seltext = 'Datenart2' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANUNGSPOSITION' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Planungsposition' .
ls_fcat-seltext = 'Planungsposition' .
APPEND ls_fcat TO pt_fieldcat .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'KOSTENART' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Kostenart' .
ls_fcat-seltext = 'Kostenart' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANBETRAG' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'Planbetrag' .
ls_fcat-seltext = 'Planbetrag' .
APPEND ls_fcat TO pt_fieldcat .
ENDFORM. "build_fieldcatalogI have added some more functionality to my report. The good thing is, the report works as it should.
BUT, I'm not really sure, whether this is a good (correct) design. The report works the following way:
1. Read planning data form text file into internal table
2. Display the internal table
3. Convert the data and display the converted result
4. Post the converted data to the system
5. Display log with messages
The main thing is, I would like to know, do i really need two dynros, to display the two different internal tables or is it possible just to use one ALV-Grid? I was not able to find another solution. Any comment or help to the report is appreciated.
*& Report Z_PLAN_TEXT_UPLOAD_TEST *
REPORT z_plan_text_upload_test.
INCLUDE <icon>.
* Data Declaration
DATA:
gf_okcode TYPE ui_func,
gf_balloghndl TYPE balloghndl.
DATA:
go_docking_container TYPE REF TO cl_gui_docking_container,
go_alv_grid_0100 TYPE REF TO cl_gui_alv_grid,
go_alv_grid_0200 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat LIKE LINE OF gt_fieldcat.
TYPES:
BEGIN OF gy_text_input,
firma(20) TYPE c,
kostenstelle(20) TYPE c,
datenart1(10) TYPE c,
planjahr(10) TYPE c,
* planperiode TYPE co_perio,
planperiode(5) TYPE c,
datenart2(10) TYPE c,
planungsposition(10) TYPE c,
* kostenart TYPE koart,
kostenart(10) TYPE c,
* planbetrag TYPE bapicurr_d,
planbetrag(20) TYPE c,
END OF gy_text_input.
DATA:
gt_text_input TYPE TABLE OF gy_text_input,
gs_text_input LIKE LINE OF gt_text_input.
* Bapi Strukturen
DATA:
gs_headerinfo TYPE bapiplnhdr,
gt_indexstructure TYPE TABLE OF bapiacpstru,
gs_indexstructure LIKE LINE OF gt_indexstructure,
gt_coobject TYPE TABLE OF bapipcpobj,
gs_coobject LIKE LINE OF gt_coobject,
gt_pervalue TYPE TABLE OF bapipcpval,
gs_pervalue LIKE LINE OF gt_pervalue,
gt_return TYPE TABLE OF bapiret2,
gs_return LIKE LINE OF gt_return,
gt_control TYPE TABLE OF bapipcpctrl,
gt_totvalue TYPE TABLE OF bapipcptot.
TYPES:
BEGIN OF gy_bapi_input,
version TYPE versn,
* perio TYPE co_perio,
fisc_year TYPE gjahr,
coobject(10) TYPE c,
cost_elem TYPE kstar,
wkgbtr01 TYPE wkgxxx,
wkgbtr02 TYPE wkgxxx,
wkgbtr03 TYPE wkgxxx,
wkgbtr04 TYPE wkgxxx,
wkgbtr05 TYPE wkgxxx,
wkgbtr06 TYPE wkgxxx,
wkgbtr07 TYPE wkgxxx,
wkgbtr08 TYPE wkgxxx,
wkgbtr09 TYPE wkgxxx,
wkgbtr10 TYPE wkgxxx,
wkgbtr11 TYPE wkgxxx,
wkgbtr12 TYPE wkgxxx,
END OF gy_bapi_input.
DATA:
gt_bapi_input TYPE TABLE OF gy_bapi_input,
gs_bapi_input LIKE LINE OF gt_bapi_input.
* Anwendungs-Log
DATA: gs_balsmsg TYPE bal_s_msg.
* Selection-Screen
SELECTION-SCREEN BEGIN OF BLOCK b1
WITH FRAME TITLE text-001.
PARAMETERS:
gp_file TYPE localfile,
gp_head TYPE checkbox DEFAULT 'X'.
SELECTION-SCREEN SKIP.
PARAMETERS:
gp_kokrs LIKE coep-kokrs,
gp_gjahr LIKE coep-gjahr,
gp_versn LIKE coep-versn,
gp_test AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b1.
* Local Class Definition
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar_0100 FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive,
handle_user_command_0100 FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING
e_ucomm,
handle_toolbar_0200 FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive,
handle_user_command_0200 FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING
e_ucomm.
PRIVATE SECTION.
ENDCLASS. "lcl_event_handler DEFINITION
* Local Class Implementation
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_toolbar_0100.
PERFORM handle_toolbar_0100
USING
e_object.
* e_interactive.
ENDMETHOD. "handle_toolbar_0100
METHOD handle_user_command_0100.
PERFORM handle_user_command_0100
USING
e_ucomm.
ENDMETHOD. "handle_user_command_0100
METHOD handle_toolbar_0200.
PERFORM handle_toolbar_0200
USING
e_object.
* e_interactive.
ENDMETHOD. "handle_toolbar_0100
METHOD handle_user_command_0200.
PERFORM handle_user_command_0200
USING
e_ucomm.
ENDMETHOD. "handle_user_command_0100
ENDCLASS. "lcl_event_handler IMPLEMENTATION
* Initialization
INITIALIZATION.
DATA:
lf_sapworkdir TYPE string.
CALL METHOD cl_gui_frontend_services=>get_sapgui_workdir
CHANGING
sapworkdir = lf_sapworkdir
EXCEPTIONS
get_sapworkdir_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0 OR lf_sapworkdir = ''.
CALL METHOD cl_gui_frontend_services=>directory_get_current
CHANGING
current_directory = lf_sapworkdir
EXCEPTIONS
directory_get_current_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
CALL METHOD cl_gui_cfw=>flush.
ENDIF."sy-subrc <> 0 OR sapworkdir = ''
gp_file = lf_sapworkdir.
* At Selection-Screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR gp_file.
DATA:
lt_filetable TYPE filetable,
ls_filetable LIKE LINE OF lt_filetable,
lt_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
* EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
* FILE_FILTER =
* INITIAL_DIRECTORY =
* MULTISELECTION =
* WITH_ENCODING =
CHANGING
file_table = lt_filetable
rc = lt_rc
* USER_ACTION =
* FILE_ENCODING =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE lt_filetable INDEX 1
INTO
ls_filetable.
gp_file = ls_filetable-filename.
CALL METHOD cl_gui_cfw=>flush.
* Start-Of-Selection
START-OF-SELECTION.
DATA:
lf_filename LIKE filename-fileintern.
PERFORM create_log.
gs_return-type = 'I'.
IF gp_test = 'X'.
gs_return-message = text-010.
ELSE.
gs_return-message = text-020.
ENDIF.
PERFORM add_log_message_free_text
USING
gs_return-type
gs_return-message.
lf_filename = gp_file.
CALL FUNCTION 'FILE_READ_AND_CONVERT_SAP_DATA'
EXPORTING
i_filename = lf_filename
i_servertyp = 'PRS '
i_fileformat = 'TXT'
* I_FIELD_SEPERATOR =
i_line_header = gp_head
* IMPORTING
* E_BIN_FILELENGTH =
TABLES
i_tab_receiver = gt_text_input
EXCEPTIONS
file_not_found = 1
close_failed = 2
authorization_failed = 3
open_failed = 4
conversion_failed = 5
OTHERS = 6.
IF sy-subrc <> 0.
gs_balsmsg-msgty = sy-msgty.
gs_balsmsg-msgid = sy-msgid.
gs_balsmsg-msgno = sy-msgno.
gs_balsmsg-msgv1 = sy-msgv1.
gs_balsmsg-msgv2 = sy-msgv2.
gs_balsmsg-msgv3 = sy-msgv3.
gs_balsmsg-msgv4 = sy-msgv4.
PERFORM add_log_message
USING
gs_balsmsg.
ENDIF.
CALL SCREEN '0100'.
*& Module status_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
*------ Create the docking container ----------------------------------*
IF go_docking_container IS INITIAL.
CREATE OBJECT go_docking_container
EXPORTING
parent = cl_gui_container=>screen0
* repid = gf_repid
* dynnr = gf_dynnr
* SIDE = go_docking_container->DOCK_AT_bottom
* EXTENSION = 200
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 95
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*------ Expand docking container to full screen -------------------*
CALL METHOD go_docking_container->set_extension
EXPORTING
extension = 99999 "full-screen size !!!
EXCEPTIONS
cntl_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.
ENDIF."go_docking_container IS INITIAL
*------ Link docking container to screen ------------------------------*
CALL METHOD go_docking_container->link
EXPORTING
repid = sy-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*------ Build the Field Catalog ---------------------------------------*
PERFORM build_fieldcatalog_input
CHANGING gt_fieldcat.
*------ Create the ALV Grid -------------------------------------------*
IF go_alv_grid_0100 IS INITIAL.
CREATE OBJECT go_alv_grid_0100
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = go_docking_container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
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."go_alv_grid_0100 is initial
*------ Create instance for event handler -----------------------------*
DATA: go_event_handler_0100 TYPE REF TO lcl_event_handler.
CREATE OBJECT go_event_handler_0100.
*------ Register event handler ----------------------------------------*
SET HANDLER go_event_handler_0100->handle_toolbar_0100
FOR go_alv_grid_0100.
SET HANDLER go_event_handler_0100->handle_user_command_0100
FOR go_alv_grid_0100.
*------ Call ALV Grid -------------------------------------------------*
CALL METHOD go_alv_grid_0100->set_table_for_first_display
* EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
it_outtab = gt_text_input
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
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 method 'set_toolbar_interactive' to raise event TOOLBAR.
CALL METHOD go_alv_grid_0100->set_toolbar_interactive.
ENDMODULE. " status_0100 OUTPUT
*& Module status_0200 OUTPUT
* text
MODULE status_0200 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
*------ Create the docking container ----------------------------------*
IF go_docking_container IS INITIAL.
CREATE OBJECT go_docking_container
EXPORTING
parent = cl_gui_container=>screen0
* repid = gf_repid
* dynnr = gf_dynnr
* SIDE = go_docking_container->DOCK_AT_bottom
* EXTENSION = 200
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 95
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*------ Expand docking container to full screen -------------------*
CALL METHOD go_docking_container->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
cntl_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.
ENDIF."go_docking_container IS INITIAL
*------ Link docking container to screen ------------------------------*
CALL METHOD go_docking_container->link
EXPORTING
repid = sy-repid
dynnr = '0200'
* CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*------ Build the Field Catalog---------------------------------------*
PERFORM build_fieldcatalog_bapi_input
CHANGING
gt_fieldcat.
*------ Create the ALV Grid -------------------------------------------*
IF go_alv_grid_0200 IS INITIAL.
CREATE OBJECT go_alv_grid_0200
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = go_docking_container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
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."go_alv_grid_0200 is initial
*------ Create instance for event handler -----------------------------*
DATA: go_event_handler_0200 TYPE REF TO lcl_event_handler.
CREATE OBJECT go_event_handler_0200.
*------ Register event handler ----------------------------------------*
SET HANDLER go_event_handler_0200->handle_toolbar_0200
FOR go_alv_grid_0200.
SET HANDLER go_event_handler_0200->handle_user_command_0200
FOR go_alv_grid_0200.
*------ Call ALV Grid -------------------------------------------------*
CALL METHOD go_alv_grid_0200->set_table_for_first_display
* EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
it_outtab = gt_bapi_input
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
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 method 'set_toolbar_interactive' to raise event TOOLBAR.
CALL METHOD go_alv_grid_0200->set_toolbar_interactive.
CALL METHOD go_alv_grid_0200->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 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.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = go_alv_grid_0200.
ENDMODULE. " status_0200 OUTPUT
*& Module user_command_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gf_okcode.
WHEN 'BACK' OR 'END' OR 'CANC'.
PERFORM exit_program.
WHEN OTHERS.
ENDCASE.
CLEAR gf_okcode.
ENDMODULE. " user_command_0100 INPUT
*& Module user_command_0200 INPUT
* text
MODULE user_command_0200 INPUT.
CASE gf_okcode.
WHEN 'BACK' OR 'END' OR 'CANC'.
PERFORM exit_program.
WHEN OTHERS.
ENDCASE.
CLEAR gf_okcode.
ENDMODULE. " user_command_0200 INPUT
*& Form build_fieldcatalog
* text
* <--P_GT_FIELDCAT text
FORM build_fieldcatalog_input
CHANGING
pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CLEAR pt_fieldcat.
ls_fcat-fieldname = 'FIRMA' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'Firma' .
ls_fcat-seltext = 'Firma' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'KOSTENSTELLE' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'CO-Objekt' .
ls_fcat-seltext = 'CO-Objekt' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'DATENART1' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Datenart1' .
ls_fcat-seltext = 'Datenart1' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANJAHR' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Planjahr' .
ls_fcat-seltext = 'Planjahr' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANPERIODE' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '5' .
ls_fcat-coltext = 'Planperiode' .
ls_fcat-seltext = 'Planperiode' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'DATENART2' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Datenart2' .
ls_fcat-seltext = 'Datenart2' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANUNGSPOSITION' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Planungsposition' .
ls_fcat-seltext = 'Planungsposition' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'KOSTENART' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'Kostenart' .
ls_fcat-seltext = 'Kostenart' .
APPEND ls_fcat TO pt_fieldcat .
ls_fcat-fieldname = 'PLANBETRAG' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'Planbetrag' .
ls_fcat-seltext = 'Planbetrag' .
APPEND ls_fcat TO pt_fieldcat .
ENDFORM. "build_fieldcatalog
*& Form handle_toolbar_0100
* text
* -->P_E_OBJECT text
* -->P_E_INTERACTIVE text
FORM handle_toolbar_0100
USING
po_object TYPE REF TO cl_alv_event_toolbar_set.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'KONV'.
ls_toolbar-quickinfo = 'Konvertieren'.
ls_toolbar-text = 'Konvertieren'.
ls_toolbar-disabled = ' '.
APPEND ls_toolbar TO po_object->mt_toolbar.
ENDFORM. " handle_toolbar_0100
*& Form handle_user_command_0100
* text
* -->P_E_UCOMM text
FORM handle_user_command_0100
USING
pf_ucomm TYPE syucomm.
CASE pf_ucomm.
WHEN 'KONV'.
PERFORM convert_data.
ENDCASE.
ENDFORM. " handle_user_command_0100
*& Form exit_program
* text
* --> p1 text
* <-- p2 text
FORM exit_program.
CALL METHOD go_alv_grid_0100->free.
IF NOT go_alv_grid_0200 IS INITIAL.
CALL METHOD go_alv_grid_0200->free.
ENDIF.
CALL METHOD go_docking_container->free.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
* add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = sy-repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form handle_toolbar_0200
* text
* -->P_E_OBJECT text
* -->P_E_INTERACTIVE text
FORM handle_toolbar_0200
USING
po_object TYPE REF TO cl_alv_event_toolbar_set.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
ls_toolbar-butn_type = 0.
ls_toolbar-function = 'POST'.
ls_toolbar-quickinfo = 'Buchen'.
ls_toolbar-text = 'Buchen'.
ls_toolbar-disabled = ' '.
APPEND ls_toolbar TO po_object->mt_toolbar.
ENDFORM. " handle_toolbar_0200
*& Form handle_user_command_0200
* text
* -->P_E_UCOMM text
FORM handle_user_command_0200
USING
pf_ucomm TYPE syucomm.
CASE pf_ucomm.
WHEN 'POST'.
PERFORM post.
ENDCASE.
ENDFORM. " handle_user_command_0200
*& Form convert_data
* text
* --> p1 text
* <-- p2 text
FORM convert_data.
DATA: lf_perio(3) TYPE n.
LOOP AT gt_text_input INTO gs_text_input.
TRANSLATE gs_text_input-planbetrag USING '. '.
TRANSLATE gs_text_input-planbetrag USING ',.'.
CONDENSE gs_text_input-planbetrag.
gs_bapi_input-version = gp_versn.
gs_bapi_input-fisc_year = gp_gjahr.
gs_bapi_input-coobject = gs_text_input-kostenstelle.
gs_bapi_input-cost_elem = gs_text_input-kostenart.
lf_perio = gs_text_input-planperiode.
CASE lf_perio.
WHEN '001'.
gs_bapi_input-wkgbtr01 = gs_text_input-planbetrag.
WHEN '002'.
gs_bapi_input-wkgbtr02 = gs_text_input-planbetrag.
WHEN '003'.
gs_bapi_input-wkgbtr03 = gs_text_input-planbetrag.
WHEN '004'.
gs_bapi_input-wkgbtr04 = gs_text_input-planbetrag.
WHEN '005'.
gs_bapi_input-wkgbtr05 = gs_text_input-planbetrag.
WHEN '006'.
gs_bapi_input-wkgbtr06 = gs_text_input-planbetrag.
WHEN '007'.
gs_bapi_input-wkgbtr07 = gs_text_input-planbetrag.
WHEN '008'.
gs_bapi_input-wkgbtr08 = gs_text_input-planbetrag.
WHEN '009'.
gs_bapi_input-wkgbtr09 = gs_text_input-planbetrag.
WHEN '010'.
gs_bapi_input-wkgbtr10 = gs_text_input-planbetrag.
WHEN '011'.
gs_bapi_input-wkgbtr11 = gs_text_input-planbetrag.
WHEN '012'.
gs_bapi_input-wkgbtr12 = gs_text_input-planbetrag.
ENDCASE.
COLLECT gs_bapi_input INTO gt_bapi_input.
CLEAR gs_bapi_input.
ENDLOOP. "at gt_text_input
CALL SCREEN 0200.
ENDFORM. " convert_data
*& Form build_fieldcatalog_bapi_input
* text
* <--P_GT_FIELDCAT text
FORM build_fieldcatalog_bapi_input
CHANGING
pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CLEAR pt_fieldcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'VERSION' .
ls_fcat-ref_table = 'BAPIPLNHDR' .
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'FISC_YEAR' .
ls_fcat-ref_table = 'BAPIPLNHDR' .
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'COOBJECT' .
ls_fcat-inttype = 'C' .
ls_fcat-outputlen = '20' .
ls_fcat-coltext = 'CO-Objekt' .
ls_fcat-seltext = 'CO-Objekt' .
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'COST_ELEM' .
ls_fcat-ref_table = 'BAPIPCPVAL' .
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR01'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR02'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR03'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR04'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR05'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR06'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR07'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR08'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR09'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR10'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR11'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
CLEAR ls_fcat.
ls_fcat-fieldname = 'WKGBTR12'.
ls_fcat-ref_table = 'COEP' .
ls_fcat-ref_field = 'WKGBTR'.
APPEND ls_fcat TO pt_fieldcat .
ENDFORM. " build_fieldcatalog_bapi_input
*& Form post
* text
* --> p1 text
* <-- p2 text
FORM post.
DATA:
lf_index(6) TYPE n,
lf_kostl LIKE csks-kostl,
lf_aufnr LIKE aufk-aufnr,
lf_kstar LIKE cska-kstar.
DATA:
lt_csks TYPE TABLE OF csks.
break c5085345.
* Header
gs_headerinfo-co_area = gp_kokrs.
gs_headerinfo-fisc_year = gp_gjahr.
gs_headerinfo-period_from = '001'.
gs_headerinfo-period_to = '012'.
gs_headerinfo-version = gp_versn.
gs_headerinfo-plan_currtype = 'C'.
LOOP AT gt_bapi_input INTO gs_bapi_input.
* Fill index structure
CLEAR gs_indexstructure.
lf_index = sy-tabix.
gs_indexstructure-object_index = lf_index.
gs_indexstructure-value_index = lf_index.
gs_indexstructure-attrib_index = '000000'.
INSERT gs_indexstructure INTO TABLE gt_indexstructure.
* Fill coobject
CLEAR gs_coobject.
gs_coobject-object_index = lf_index.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_bapi_input-coobject
IMPORTING
output = lf_kostl.
SELECT * FROM csks INTO TABLE lt_csks
WHERE
kokrs = gp_kokrs AND
kostl = lf_kostl.
IF sy-subrc = 0.
gs_coobject-costcenter = lf_kostl.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_bapi_input-coobject
IMPORTING
output = lf_aufnr.
CALL FUNCTION 'K_ORDER_READ'
EXPORTING
aufnr = lf_aufnr
EXCEPTIONS
not_found = 1.
IF NOT sy-subrc = 0.
gs_return-type = 'E'.
gs_return-message+0(10) = 'CO-Objekt '.
gs_return-message+10(10) = gs_bapi_input-coobject.
gs_return-message+20(20) = ' existiert nicht.'.
CONDENSE gs_return-message.
PERFORM add_log_message_free_text
USING
gs_return-type
gs_return-message.
EXIT.
ENDIF. "IF NOT sy-subrc = 0
gs_coobject-orderid = lf_aufnr.
ENDIF. "sy-subrc = 0
INSERT gs_coobject INTO TABLE gt_coobject.
* Period value
gs_pervalue-value_index = lf_index.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_bapi_input-cost_elem
IMPORTING
output = lf_kstar.
gs_pervalue-cost_elem = lf_kstar.
gs_pervalue-fix_val_per01 = gs_bapi_input-wkgbtr01.
gs_pervalue-fix_val_per02 = gs_bapi_input-wkgbtr02.
gs_pervalue-fix_val_per03 = gs_bapi_input-wkgbtr03.
gs_pervalue-fix_val_per04 = gs_bapi_input-wkgbtr04.
gs_pervalue-fix_val_per05 = gs_bapi_input-wkgbtr05.
gs_pervalue-fix_val_per06 = gs_bapi_input-wkgbtr06.
gs_pervalue-fix_val_per07 = gs_bapi_input-wkgbtr07.
gs_pervalue-fix_val_per08 = gs_bapi_input-wkgbtr08.
gs_pervalue-fix_val_per09 = gs_bapi_input-wkgbtr09.
gs_pervalue-fix_val_per10 = gs_bapi_input-wkgbtr10.
gs_pervalue-fix_val_per11 = gs_bapi_input-wkgbtr11.
gs_pervalue-fix_val_per12 = gs_bapi_input-wkgbtr12.
INSERT gs_pervalue INTO TABLE gt_pervalue.
ENDLOOP. "at gt_bapi_input
* Buchungsbaustein
CALL FUNCTION 'BAPI_PRIM_COST_CHECK_AND_POST'
EXPORTING
header_info = gs_headerinfo
testrun = gp_test
* DELTA = ' '
TABLES
idx_structure = gt_indexstructure
object = gt_coobject
per_value = gt_pervalue
tot_value = gt_totvalue
contrl = gt_control
return = gt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
LOOP AT gt_return INTO gs_return.
gs_balsmsg-msgty = gs_return-type.
gs_balsmsg-msgid = gs_return-id.
gs_balsmsg-msgno = gs_return-number.
gs_balsmsg-msgv1 = gs_return-message_v1.
gs_balsmsg-msgv2 = gs_return-message_v2.
gs_balsmsg-msgv3 = gs_return-message_v3.
gs_balsmsg-msgv4 = gs_return-message_v4.
PERFORM add_log_message
USING
gs_balsmsg.
ENDLOOP. "AT gt_return
PERFORM show_log.
ENDFORM. " post
*& Form create_log
* text
* --> p1 text
* <-- p2 text
FORM create_log .
DATA: ls_balslog TYPE bal_s_log.
* Einige Verwaltungsdaten
ls_balslog-extnumber = 'ZPLAN010'.
ls_balslog-aluser = sy-uname.
ls_balslog-alprog = sy-repid.
* Create
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = ls_balslog
* IMPORTING
* e_log_handle = gf_balloghndl
EXCEPTIONS
log_header_inconsistent = 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. " create_log
*& Form add_log_message
* text
* -->P_GS_BALSMSG text
FORM add_log_message
USING
ps_balsmsg TYPE bal_s_msg.
break c5085345.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
* I_LOG_HANDLE =
i_s_msg = ps_balsmsg
* IMPORTING
* E_S_MSG_HANDLE =
* E_MSG_WAS_LOGGED =
* E_MSG_WAS_DISPLAYED =
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
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. " add_log_messa
*& Form add_log_message_free_text
* text
* -->P_GS_RETURN_TYPE text
* -->P_GS_RETURN_MESSAGE text
FORM add_log_message_free_text
USING
ps_type
ps_message.
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
* I_LOG_HANDLE =
i_msgty = ps_type
* I_PROBCLASS = '4'
i_text = ps_message
* I_S_CONTEXT =
* I_S_PARAMS =
* IMPORTING
* E_S_MSG_HANDLE =
* E_MSG_WAS_LOGGED =
* E_MSG_WAS_DISPLAYED =
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
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. " add_log_message_free_text
*& Form show_log
* text
* --> p1 text
* <-- p2 text
FORM show_log .
DATA:
l_s_display_profile TYPE bal_s_prof.
* get display profile
CALL FUNCTION 'BAL_DSP_PROFILE_NO_TREE_GET'
IMPORTING
e_s_display_profile = l_s_display_profile
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* use grid for display if wanted
l_s_display_profile-use_grid = 'X'.
* set report to allow saving of variants
l_s_display_profile-disvariant-report = sy-repid.
* when you use also other ALV lists in your report,
* please specify a handle to distinguish between the display
* variants of these different lists, e.g:
l_s_display_profile-disvariant-handle = 'LOG'.
* call display function module
* We do not specify any filter (like I_S_LOG_FILTER, ...,
* I_T_MSG_HANDLE) since we want to display all logs available
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_s_display_profile = l_s_display_profile
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Maybe you are looking for
-
SingleInstanceService not working in windows 7
I have an application which is launched via Java Web Start and makes use of SingleInstanceService to ensure only one instance is running. This is working fine in Windows XP and Windows Vista. But this fails in Windows 7 and launches 2 instances. Some
-
Why are my files not showing up on desktop?
I was running several programs on my macbook air: iChat, iCal, Mail, Word for Mac, Safari, and Finder. In Safari, I would right click on any file (word, powerpoint, pdf, etc) to download it to desktop as I normally would. All goes well until I actual
-
IP Profile steadily decreasing....
Can the Mods please look into this for me? Last Thursday, my broadband speed dropped off for no reason, (possibly bad weather), after months of running fine with an IP profile of around 2.5 Mbps It has been slow for a few days, I checked my IP profil
-
Invoke Web Service in 9i database using UTL_HTTP
I am trying to explore Oracle's UTL_HTTP package to invoke external web service without having to use java stored procedure. I downloaded a demo scripts from OTN web site (http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/
-
Tkprof : 0 user SQL statement in trace file
Hello! Please explain , what is difference of tkprof-converting of user session trace file and an internal/background process ? Get I message "0 user SQL statement in trace file" cause this difference? In my target session I issued : begin sys.dbms_s