End-of-page problem
Hi experts,
In this simple report,why iam not able to get the end-of-page?I have few details in the end-of-page,and i want to get it in <b>Every page.</b>Where iam doing wrong?
REPORT Z_ISSUE_SLIP_WH
MESSAGE-ID ZM
LINE-SIZE 80
LINE-COUNT 60(14)
NO STANDARD PAGE HEADING.
TABLES: MKPF,
MSEG,
AFIH,
AFPO,
AUFK,
EQKT,
KNVV,
AFKO,
IHPA.
DATA: BEGIN OF T_HDR OCCURS 0,
MBLNR LIKE MKPF-MBLNR,
BUDAT LIKE MKPF-BUDAT,
END OF T_HDR.
DATA: BEGIN OF T_DET OCCURS 0,
AUFNR LIKE AUFK-AUFNR,
RSNUM LIKE AFKO-RSNUM,
REVNR LIKE AFIH-REVNR,
EQUNR LIKE AFIH-EQUNR,
ABLAD LIKE MSEG-ABLAD,
EQKTX LIKE EQKT-EQKTX,
VKBUR LIKE KNVV-VKBUR,
BDTER LIKE RESB-BDTER,
ERNAM LIKE AUFK-ERNAM,
GSTRI LIKE AFKO-GSTRI,
GAMNG LIKE AFKO-GAMNG,
GMEIN LIKE AFKO-GMEIN,
END OF T_DET.
DATA: G_DET LIKE T_DET OCCURS 0 WITH HEADER LINE.
DATA: G_ABLAD LIKE RESB-ABLAD.
SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BUDAT LIKE BKPF-BUDAT.
SELECTION-SCREEN END OF BLOCK A1.
START-OF-SELECTION.
PERFORM COLLECT_DATA.
*& Form COLLECT_DATA
* text
FORM COLLECT_DATA.
SELECT AUFNR RSNUM EQUNR ABLAD FROM MSEG INTO CORRESPONDING
FIELDS OF TABLE T_DET WHERE MBLNR BETWEEN '4900001587' AND
'4900004930'.
ELSE.
MESSAGE S000(ZM) WITH 'No data found for this selection !'.
EXIT.
ENDIF.
LOOP AT T_DET.
SELECT SINGLE * FROM AFIH WHERE AUFNR = T_DET-AUFNR.
IF SY-SUBRC = 0.
T_DET-REVNR = AFIH-REVNR.
MODIFY T_DET.
ENDIF.
SELECT SINGLE * FROM EQKT WHERE EQUNR = T_DET-EQUNR.
IF SY-SUBRC = 0.
T_DET-EQKTX = EQKT-EQKTX.
MODIFY T_DET.
ENDIF.
SELECT SINGLE * FROM AUFK WHERE AUFNR = T_DET-AUFNR.
SELECT SINGLE * FROM IHPA WHERE OBJNR = AUFK-OBJNR.
SELECT SINGLE * FROM KNVV WHERE KUNNR = IHPA-PARNR.
IF SY-SUBRC = 0.
T_DET-VKBUR = KNVV-VKBUR.
MODIFY T_DET.
ENDIF.
SELECT SINGLE * FROM AUFK WHERE AUFNR = T_DET-AUFNR.
IF SY-SUBRC = 0.
T_DET-ERNAM = AUFK-ERNAM.
MODIFY T_DET.
ENDIF.
SELECT SINGLE * FROM AFKO WHERE AUFNR = T_DET-AUFNR.
IF SY-SUBRC = 0.
T_DET-GSTRI = AFKO-GSTRI.
T_DET-GAMNG = AFKO-GAMNG.
T_DET-GMEIN = AFKO-GMEIN.
MODIFY T_DET.
ENDIF.
ENDLOOP.
SORT T_DET.
LOOP AT T_DET INTO G_DET.
COLLECT G_DET.
ENDLOOP.
REFRESH T_DET.
T_DET[] = G_DET[].
DELETE T_DET WHERE ABLAD EQ SPACE.
SORT T_DET BY ABLAD.
DATA: G_ABLAD LIKE MSEG-ABLAD.
LOOP AT T_DET.
ON CHANGE OF T_DET-ABLAD.
NEW-PAGE.
G_ABLAD = T_DET-ABLAD.
WRITE:/1(10) T_DET-AUFNR,
* 14(20) T_DET-EQKTX,
14(20) T_DET-ABLAD,
36(4) T_DET-VKBUR,
43(12) T_DET-ERNAM,
54(10) T_DET-GSTRI,
66(5) T_DET-GAMNG,
75(3) T_DET-GMEIN.
ENDON.
ENDLOOP.
ENDFORM. "COLLECT_DATA
<b>TOP-OF-PAGE.</b>
DATA: G_PAGNO LIKE SY-PAGNO.
ADD 1 TO G_PAGNO.
ON CHANGE OF G_ABLAD.
G_PAGNO = 1.
ENDON.
WRITE:/1(66) TEXT-010 CENTERED, 62 SY-UZEIT, 73 SY-DATUM DD/MM/YY,
/1(66) TEXT-015 CENTERED, 80 G_PAGNO RIGHT-JUSTIFIED.
SKIP.
WRITE:/ 'Revision', 25 ':',SPACE, T_DET-ABLAD.
SKIP 2.
WRITE :/1(10) 'Srvc.Order',
14(20) 'Site/Block/Lift',
36(4) 'Dept',
43(12) 'Superv',
54(10) 'GI Date',
66(5) 'Qty',
75(3) 'Um'.
WRITE :/1(80) SY-ULINE.
<b>END-OF-PAGE.</b>
WRITE :/1(80) SY-ULINE.
WRITE:/40 SY-VLINE.
WRITE:/2 'Approved By : ',
40 SY-VLINE,
42 'Issued By : '.
WRITE:/16(20) SY-ULINE,
40 SY-VLINE,
54(22) SY-ULINE.
ULINE.
WRITE:/ TEXT-016.
ULINE.
WRITE:/ 'Recvd By : ',
'EF No. : ',
'Initial : ',
'Date :'.
ULINE.
In LOOP-ENDLOOP you can code this before you trigger end of page event -
Data: C_CNT TYPE I.
C_CNT = SY-LINCT - SY-LINNO - 2.
(In your case you will deduct no of lines you have reserved for end of page instead of 2)
IF C_CNT > 0.
skip c_cnt.
ENDIF.
Also make sure if C_CNT = SY-LINCT - Total no of lines reserved for End of page, then you reset C_CNT. As in this case new page will be triggered automatically.
Similar Messages
-
Hi,
I have a problem in end of page event.
while if the value changes for a particular field of internal table , new new page should trigger with header and footer which are in top and end of page event.
while in loop of internal table.
i have given like at new field.
new-page.
endat.
first its working fine but when field changes its not displaying end of page values for new page.
but only at the last. its displaying.
Thansks,
Vijayjust see this SAP help documentation of new-page.
NEW-PAGE.
Extras:
1. ... NO-TITLE
2. ... WITH-TITLE
3. ... NO-HEADING
4. ... WITH-HEADING
5. ... LINE-COUNT lin
6. ... LINE-SIZE col
7. ... NO-TOPOFPAGE
8. ... PRINT ON ...
9. ... PRINT ON ... (obsolete additions)
10. ... PRINT OFF
Effect
Starts a new page during list processing.
Terminates the current page and continues output on a new page.
Notes
NEW-PAGE does not generate blank pages, it ignores pages containing no output.
NEW-PAGE increments the page counter (the system field SY-PAGNO).
<b>The event END-OF-PAGE is not processed.</b>
To start a new page depending on the number of unused lines remaining on the current page, use the RESERVE statement.
so try to use reserve statement( if it suits you ).
regards
shiba dutta -
End of Page event not triggering in ALV report
Hello,
I am developing an ALV report using REUSE_ALV_LIST_DISPLAY. Whatever I write in top_of_page, it will be displayed in the header portion of the output.
But I want to display some footer text at the end of the page. The problem I am facing is, the WRITE statements within end_of_page are not displayed when the report is run.
I have populated the i_events as follows :
FORM f_events CHANGING p_i_events TYPE slis_t_event.
CONSTANTS : l_c_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
l_c_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
DATA : l_wa_event TYPE slis_alv_event.
Returns table of possible events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_i_events.
To append internal table holding event names with event 'TOP OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE l_c_top_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
To append internal table holding event names with event 'END OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_end_of_page.
IF sy-subrc = 0.
MOVE l_c_end_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
ENDFORM. "f_events
Regds
RajeshHi have a look at the following code, and change ur code for end of page accordingly. this will resolve ur problem.
This is a basic ALV with the followings:-
- Page Heading
- Page No
- Sub-Total
- Grand Total
REPORT ZALV.
TYPE-POOLS: SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: BEGIN OF ITAB,
FIELD1(5) TYPE C,
FIELD2(5) TYPE C,
FIELD3(5) TYPE P DECIMALS 2,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB_FIELDCAT.
Print Parameters
PARAMETERS:
P_PRINT AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
P_RESERV TYPE I. "NO OF FOOTER LINE
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD USING GS_PRINT. "Print PARAMETERS
START-OF-SELECTION.
TEST DATA
MOVE 'TEST1' TO ITAB1-FIELD1.
MOVE 'TEST1' TO ITAB1-FIELD2.
MOVE '10.00' TO ITAB1-FIELD3.
APPEND ITAB1.
MOVE 'TEST2' TO ITAB1-FIELD1.
MOVE 'TEST2' TO ITAB1-FIELD2.
MOVE '20.00' TO ITAB1-FIELD3.
APPEND ITAB1.
DO 50 TIMES.
APPEND ITAB1.
ENDDO.
END-OF-SELECTION.
PERFORM BUILD.
PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
PERFORM COMMENT_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
PERFORM CALL_ALV.
FORM BUILD.
DATA FIELD CATALOG
Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD1'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
*FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
FIELDCAT_LN-KEY = ' '. "SUBTOTAL KEY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD2'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-NO_OUT = 'X'.
FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD3'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
FIELDCAT_LN-REF_TABNAME = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM.
FORM CALL_ALV.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.
HEADER FORM
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM.
FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: GS_LINE TYPE SLIS_LISTHEADER.
CLEAR GS_LINE.
GS_LINE-TYP = 'H'.
GS_LINE-INFO = 'HEADER 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'S'.
GS_LINE-KEY = 'STATUS 1'.
GS_LINE-INFO = 'INFO 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
GS_LINE-KEY = 'STATUS 2'.
GS_LINE-INFO = 'INFO 2'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
ENDFORM.
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
ENDFORM.
FORM END_OF_PAGE.
WRITE at (sy-linsz) sy-pagno CENTERED.
ENDFORM.
PRINT SETTINGS
FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
LS_PRINT-PRINT = P_PRINT. "PRINT IMMEDIATE
LS_PRINT-NO_PRINT_SELINFOS = P_NOSINF. "NO SELECTION INFO
LS_PRINT-NO_COVERPAGE = P_NOCOVE. "NO COVER PAGE
LS_PRINT-NO_NEW_PAGE = P_NONEWP.
LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
LS_PRINT-RESERVE_LINES = P_RESERV.
ENDFORM.
*END OF ZALV PROGRAM
Satish -
END OF PAGE IN BLOCK ALV : PLZ HELP
Hi experts.
I have a requirement to display top-of-page end-of-page end-of-list in block alv but the problem is that end-of-page is not getting triggered instead top-of-page is getting triggered twice.
Below is the code for your reference :
REPORT zbhr_workers_comp_report
LINE-COUNT 60(4)
LINE-SIZE 999
NO STANDARD PAGE HEADING
MESSAGE-ID zmhr.
*//// This is how event table is getting populated:*
FORM events_get1 CHANGING t1_events TYPE slis_t_event.
DATA:ls1_events TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
et_events = t1_events.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE c_form_top_of_page TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_page.
IF sy-subrc = 0.
MOVE c_form_end_of_page TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_list.
IF sy-subrc = 0.
MOVE c_form_end_of_list TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
ENDFORM. " EVENTS_GET1
FORM : TOP_OF_PAGE
FORM top_of_page.
WRITE : /45 text-020, 65(5) text-021 , 71(11) v_begda, 84(3) text-022 , 89(11) v_endda.
ENDFORM. "TOP_OF_PAGE
FORM : end_of_page
FORM end_of_page.
DATA: lv_process TYPE i.
CLEAR: lv_process.
LOOP AT t_final_temp INTO w_final_temp where customer = t_final-customer.
lv_process = lv_process + 1.
ENDLOOP.
*RESERVE 3 LINES.
WRITE: /4 'Number of read Record : '(023), v_total_read.
WRITE: /4 'Number of processed Record : '(024), lv_process.
ENDFORM. "end_of_page
FORM : end_of_list
FORM end_of_list .
v_total_process = LINES( t_final[] ).
WRITE: /4 'Total sum of all processed data: '(029), v_total_process.
ENDFORM. "end_of_list
*****Displaying the block alv.
FORM display_output .
To restrict the display of sel info and list info.
st_print-no_print_selinfos = 'X'.
st_print-no_print_listinfos = 'X'.
st_print-reserve_lines = 2. " Lines reserved for end of page
Initialize ALV Block List
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
Append the ALV Block list with table t_final.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w1_layout
it_fieldcat = t1_fieldcat
i_tabname = 'T_FINAL'
it_events = t1_events
it_sort = t_sort
TABLES
t_outtab = t_final
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
Append the ALV Block list with table t_msg_display.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w2_layout
it_fieldcat = t2_fieldcat
i_tabname = 'T_MSG_DISPLAY'
it_events = t2_events
TABLES
t_outtab = t_msg_display
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
is_print = st_print
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_OUTPUT
Above is the core logic which I have used for displaying top-of-page end-of-page and end-of-list in block alv.
Please Help
Regards
Arvind.Hi
MOVE 'TOP_OF_PAGE' TO ls1_events-form.
what is thie c_form_top_of_page instead write as above ,i hope it will work
Regards
Pavan -
Java.lang.ClassCastException in end user page
Hi,
When I click on any of the link in the end user page (it launches a process using processLaunch.jsp) i'm getting the below error. I've no clue as whats going on, can someone please help me.
java.lang.ClassCastException
at com.waveset.security.authn.LoginModule.addAdminGroupPrincipalRefs(LoginModule.java:529)
at com.waveset.security.authn.LoginModule.getSubject(LoginModule.java:487)
at com.waveset.security.authn.LoginModule.getSubject(LoginModule.java:509)
at com.waveset.server.AuthCache.getCache(AuthCache.java:158)
at com.waveset.server.AuthCache.loadCache(AuthCache.java:119)
at com.waveset.server.InitAdminCacheThread.initAdminCache(InitAdminCacheThread.java:91)
at com.waveset.server.InitAdminCacheThread.run(InitAdminCacheThread.java:69)
Thanks!What exactly are you clicking on in the end user page? Your problem could be a number of things. You can get this error when the xml in a file it is referencing is not properly formed. e.g if you had not properly closed a tag in a config file.
-
Accessing Work Items assigned to other users from end user page
Hello Experts,
We are using Sun IDM 6.0 SP1 at our client place. Most of the applications integrated with IDM are manually provisioned, in the sense, once after all the necessary approvals are received the request will be assigned to a group of provisioners, they will manually connect to the requested application and create the account in native system. There are more than 100 such provisioners in the organization.
Current design is to assign a work item to all the provisioners (like Multi approval) and once a provisioner assigns the request to himself then the corresponding work item will be taken out from other provisioners approval queue. These provisioners login to end user page of Sun IDM to access their approval queue as only the end user page is SSO enabled.
Because of the large number of requests in the system (more than 50k) and each request having 100 work items, the number of work items in the system is huge and thus the performance of the system is very poor so we are working to change the design to bring down the number of work items in the system.
Customer is not convinced to have a dedicated person who can get all these work items in his queue and assign it to the appropriate provisioner, they are looking to have a solution something similar to the current one in which all the provisioner can see all the requests in the system and they can pick from it and assign to them.
So we are thinking to create a generic id in the system and assign all the work items to that id, and make changes to the “end user work items list” file so that all the provisioner can see the work items that are assigned to them as well as that generic id.
But for some reason I’m not getting the work items assigned to other users in the end users page. I have tried assigning all the capabilities to logged in user and tried some code changes in “end user work item list” page.
Please share if you have any sample code which can list the work items assigned to other users in end user page. Also please let me know if there is any better alternate to this problem.Hi,
There is a option to find and get other user's workitems. Please check the attestation and remediation tab. Use the form portion from attestation page and add it in the Work item list form. This will enable to the user to search for another user's workiteams and assign it to him/her manually. (The user needs to be assigned proper admin rights)
To get all the workitems, in the system, you will need to query the repository for all the workitems.... but not sure it will be a good idea in your case as the volume is very high.
Hope it helps
Regards
Arjun -
Home, end, av pag and re pag keys are not working properly
Home, end, av pag, re pag and directional keys are not working properly. Home key instead of going to the beginning of the page, it goes to the end, and av pag, re pag and the directional keys are working only when te cursor is in 'text mode' like if going to write. the problem appears after refreshing to the last version.
Try hitting '''F7'''.
http://kb.mozillazine.org/Accessibility.browsewithcaret -
END-OF-PAGE not displayed in the last page of the classical report.
Hi all..
The END-OF-PAGE is not displayed in the last page of the classical report.
SY-LINCT value is 30.
Lines displayed in the report per page is 24.
[3 for TOP-OF-PAGE and 3 for END-OF-PAGE]
My Internal table has 6942 records.
It comes 289 pages with 24 records in a page and 290 th page with 6 records.
The END-OF-PAGE is not coming for the 290 th page.
Please help.
Thank You.
Karthi M R.There are multiple links in SDN on this subject; Please search,
end-of-page -
End-of-page event in alv report
Hi all,
I want to create end-of-page in alv report i have used event also
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' * "
EXPORTING *
i_callback_program = sy-repid * "
i_callback_user_command = 'USER_COMMAND' * "
i_callback_top_of_page = 'TOP_OF_PAGE' * "
I_STRUCTURE_NAME = * "
it_fieldcat = fcat[] * "
it_events = it_event[] * "
TABLES
t_outtab = gtbl_pohead * "
EXCEPTIONS
program_error = 1 * "
OTHERS = 2 "
FORM end_of_page. *
DATA: listwidth TYPE i, *
ld_pagepos(10) TYPE c, *
ld_page(10) TYPE c. *
WRITE: sy-uline(50). "
SKIP 3.
WRITE:/40 'Page No',sy-pagno. "
ENDFORM. "END_OF_PAGE "hi
Search in SDN.You can find the solution for this.Before posting please search in SDN.
You have to use this FM 'REUSE_ALV_EVENTS_GET'
[End-Of-Page|http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm]
[Endo Of Page|http://www.sdn.sap.com/irj/scn/advancedsearch?query=alvend-of-pageevent+] -
Hi ,
have been working on a ALV report using the class SALV cl_salv_hierseq_table
I am facing few issues pertaining to two things:
1. Displaying some subtotal text along with the subtotals.
Example refer the standard demo example: SALV_DEMO_HIERSEQ_FORM_EVENTS
Now instead of A 17 and A26 I would like to show text like Subtotal for the Carrid.for subtotals and grand totals
Like Subtotal for A 17 is : XXXXXXX
GrandTotal is : YYYYYY
2. We have a page break and a new page for every purchasing group as in the standard example SALV_DEMO_HIERSEQ_FORM_EVENTS for CARRID.
I need to display some variable values as number of documents ,total number of records etc at the end of each CARRID group before a new page starts for the next CARRID.Please note i do not want it on every page.it should only be diaplyed at the end of page whose next page would be for next CARRID.[basically at end of every carrid]Example:after displaying all details for AA need to display the number of records for that carrid at the end of the page[as page break is based on CARRID]/
Thanks
Jyotsnaat end of page event, for CL_SALV_EVENTS_HIERSEQ, has some useful parameters allowing to know where you are at the time of event
parameter VALUE is of type CL_SALV_FORM which contains public attribute IF_SALV_FORM~ACCDESCRIPTION; you can slo get contents of it
about text of total/subtotal, this is normally set in the layout -
Urgent regarding Display fields in ALV End of Page
Hi,
I am displaying the output using ALV List Display. Output of the report is displayed in different pages based on a particular delivery address. I have to display some of the fields (Delivery address) of the final internal table in the end of page. I need to trigger this end of page in alv based on the selection of radio buttons also.
Its very urgent. Respond immediately.
Thanks
GeetaRefer the follwoing code:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_html_end_of_list = 'END_OF_LIST_HTML'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
*& Form end_of_list_html
* output at the end of the list - not in printed output *
FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
DATA: ls_text TYPE sdydo_text_element,
l_grid TYPE REF TO cl_gui_alv_grid,
f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
ls_text = 'Footer title'.
* adds and icon (red triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.
* adds test (via variable)
CALL METHOD end->add_text
EXPORTING
text = ls_text
sap_emphasis = 'strong'.
* adds new line (start new line)
CALL METHOD end->new_line.
* display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Bold text'
sap_emphasis = 'strong'.
* adds new line (start new line)
CALL METHOD end->new_line.
* display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'Normal text'.
* adds new line (start new line)
CALL METHOD end->new_line.
* display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Yellow triangle'
sap_emphasis = 'strong'.
* adds and icon (yellow triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'ICON_LED_YELLOW'.
* display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'More text'.
*set height of this section
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 14.
ENDFORM. "end_of_list_html. -
How doi print Any variable at the end of page in ALV report?
Hi,
Anyone can tell me that How do i print Any variable at the end of page in ALV report?
Exmale: at the ende of alv report i want to print total no of employee who has taken house loan or education loan.Hi,
Go through these links
Thread in sdn regarding FOOTER IN ALV
[ALV FOOTER;
Wiki in sdn regarding HEADER AND FOOTER IN ALV
[https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP%20Objects%20-%20ALV%20Model%20-%20Using%20Header%20and%20Footer]
Header and Footer in ALV
[http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm]
Hope this helps.
Thank you,
Pavan. -
How to Display Page Numbers in ALV Report HTML End of page Event
hai Gurus
Greetings
Please tell me how to get current page noumber and total number of pages in ALV Report (in HTML End of Page Event)
i tried with sy-pagno system field but it is not working
so please guide me
Thanks
Rameshcheck below code....
*Work area for Layout
gf_layout type slis_layout_alv,
*Work area for HEADER FOOTER
gf_header type slis_listheader,
*Work area for Field catalogue
gf_fieldcat type slis_fieldcat_alv.
it_top_page type slis_t_listheader,
*Internal table for Field catalogue
it_fcat type slis_t_fieldcat_alv.
perform:fill_layout,
prepare_header,
field_catlog,
display_report.
Form fill_layout
form fill_layout .
gf_layout-colwidth_optimize = 'X'.
endform. " fill_layout
Form field_catlog
form field_catlog .
data : lf_fcat type line of slis_t_fieldcat_alv,
l_cnt type i.
clear : lf_fcat, l_cnt.
Employee Number
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPLID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-003.
append lf_fcat to it_fcat.
clear lf_fcat.
*Last Name
add 1 to l_cnt.
lf_fcat-fieldname = 'USERNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-004.
append lf_fcat to it_fcat.
*First Name
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-005.
append lf_fcat to it_fcat.
*Known As
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPSTATUS'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-006.
append lf_fcat to it_fcat.
clear lf_fcat.
*System UserID
add 1 to l_cnt.
lf_fcat-fieldname = 'COSTCENTER'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-007.
append lf_fcat to it_fcat.
clear lf_fcat.
*EMail ID
add 1 to l_cnt.
lf_fcat-fieldname = 'DEPTDESC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-008.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employment Status
add 1 to l_cnt.
lf_fcat-fieldname = 'LOC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-009.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area
add 1 to l_cnt.
lf_fcat-fieldname = 'TITLE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-010.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area Text
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'HDATE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-011.
append lf_fcat to it_fcat.
clear lf_fcat.
*Country Grouping text
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-012.
append lf_fcat to it_fcat.
clear lf_fcat.
*Cost Center
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-013.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employee Group
add 1 to l_cnt.
lf_fcat-fieldname = 'MGMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-014.
append lf_fcat to it_fcat.
clear lf_fcat.
*Organizational Unit
add 1 to l_cnt.
lf_fcat-fieldname = 'DIV'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-015.
append lf_fcat to it_fcat.
clear lf_fcat.
*Supervisor
add 1 to l_cnt.
lf_fcat-fieldname = 'BUSUNIT'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-016.
append lf_fcat to it_fcat.
clear lf_fcat.
endform. " field_catlog
Form display_report
form display_report .
data : l_repid type sy-repid.
clear l_repid.
l_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = l_repid
is_layout = gf_layout
it_fieldcat = it_fcat
i_callback_top_of_page = 'TOP-OF-PAGE'
tables
t_outtab = it_employee
exceptions
program_error = 1
others = 2.
endform. " display_report
Form PREPARE_HEADER
form prepare_header.
data:l_header1(20),
l_header2(60).
data:l_header3(20),
l_header4(60).
l_header1 = 'Met Life Census Data'.
l_header2+40(8) = 'Run Date'.
write sy-datum to l_header2+50(10).
header
gf_header-typ = 'S'.
gf_header-key = l_header1.
gf_header-info = l_header2.
append gf_header to it_top_page.
clear gf_header.
endform. " PREPARE_HEADER
form top-of-page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = it_top_page.
endform. "TOP-OF-PAGE
*& Form end_of_list_html
output at the end of the list - not in printed output *
FORM END_OF_LIST_HTML USING END TYPE REF TO CL_DD_DOCUMENT.
DATA: LS_TEXT TYPE SDYDO_TEXT_ELEMENT,
L_GRID TYPE REF TO CL_GUI_ALV_GRID,
F(14) TYPE C VALUE 'SET_ROW_HEIGHT'.
LS_TEXT+0(20) = 'Total Employees'.
LS_TEXT+40(10) = g_count.
CALL METHOD END->ADD_TEXT
EXPORTING
TEXT = LS_TEXT
SAP_EMPHASIS = 'STRONG'.
*adds new line (start new line)
CALL METHOD END->NEW_LINE.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 10.
ENDFORM. -
Runtime Error while Displaying End of Page in ALV
Hi,
This is the Code i have written.. The top of page is printing when i comment the end of page in the program (BOLD FORMAT)..But when Uncomment the End of page Code this is going to Short dump..and the Runtime Error is..
A PERFORM was used to call the routine "END_OF_LIST" of the program "ZPROGRAM
This routine contains exactly 0 formal parameters, but the current
call contains 1 actual parameters.
*& Form DISPLAY_ALV_VBAP
FORM DISPLAY_ALV_VBAP .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE1'
I_CALLBACK_HTML_END_OF_LIST = 'END_OF_LIST'
I_GRID_TITLE = 'THIS IS LAST'
IS_LAYOUT = WA_LAYO
IT_FIELDCAT = I_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP
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_VBAP
*& Form top_of_page1
text
FORM TOP_OF_PAGE1.
DATA:IT_LISTHEAD2 TYPE SLIS_T_LISTHEADER.
DATA:WA_LISTHEAD2 TYPE SLIS_LISTHEADER.
WA_LISTHEAD2-TYP = 'H'.
WA_LISTHEAD2-INFO = 'THIS IS TOP OF PAGE FOR SECOND LIST'.
APPEND WA_LISTHEAD2 TO IT_LISTHEAD2.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEAD2
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page1
*& Form end_of_list
text
FORM END_OF_LIST.
DATA:IT_LISTHEAD1 TYPE SLIS_T_LISTHEADER.
DATA:WA_LISTHEAD1 TYPE SLIS_LISTHEADER.
WA_LISTHEAD1-TYP = 'H'.
WA_LISTHEAD1-INFO = 'THIS IS END OF PAGE FOR SECOND LIST'.
APPEND WA_LISTHEAD1 TO IT_LISTHEAD1.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEAD1
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID = 'X'
ENDFORM.Hi
The "END_OF_LIST" event is not called as you have called it.
First capture END_OF_LIST as an event in your events table.
Then use it.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE1'
I_CALLBACK_HTML_END_OF_LIST = 'END_OF_LIST' <----- Wrong
I_GRID_TITLE = 'THIS IS LAST'
IS_LAYOUT = WA_LAYO
IT_FIELDCAT = I_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP
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_VBAP
Build an events table like this :
FORM build_events.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE gt_events WITH KEY name = slis_ev_end_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE 'END_OF_PAGE' TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
READ TABLE gt_events WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
MOVE 'END_OF_LIST' TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
ENDFORM.
And then use the END_OF_list form as you have defined.
Hope that helps.
Cheers
Ravish -
End of page in ALV Grid Report
Dear ABAPres,
I have developed ALV report using the Function module 'REUSE_ALV_GRID_DISPLAY'.
I want to display the End of Page.How can i achiev this.Please help me in this.
Thanks & Regards,
ashok.Hi ,
See below code....
REPORT zcssd_sales_hours_pend2.
TYPE-POOLS : slis.
*****Tables Used in the Report************************
TABLES : vbak,
tvak,
tvlk,
likp,
vbep,
t001w,
kna1.
*****Global Data Declarations*************************
DATA: i_fieldcat TYPE slis_t_fieldcat_alv ,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: tbl_fieldcat1 TYPE slis_t_fieldcat_alv ,
st_fieldcat1 TYPE slis_fieldcat_alv.
DATA: w_layout TYPE slis_layout_alv.
DATA: st_layout1 TYPE slis_layout_alv,
v_header TYPE slis_t_listheader,
v_header1 TYPE slis_t_listheader,
v_header2 TYPE slis_t_listheader,
v_events TYPE slis_t_event.
DATA: gt_sort TYPE slis_t_sortinfo_alv.
DATA: i_events TYPE slis_t_event,
i_event_exit TYPE slis_t_event_exit.
DATA: w_events LIKE LINE OF i_events,
w_event_exit LIKE LINE OF i_event_exit.
DATA: i_list_comments TYPE slis_t_listheader.
DATA: w_list_comments LIKE LINE OF i_list_comments.
DATA: w_print TYPE slis_print_alv.
DATA: gs_sort TYPE slis_sortinfo_alv.
*DATA : BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*****Declaration of Internal Tables****************
TYPES : BEGIN OF ty_vbap_vbak,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
matkl TYPE vbap-matkl,
zmeng TYPE vbap-zmeng,
meins TYPE vbap-meins,
spart TYPE vbap-spart,
netwr TYPE vbap-netwr,
kwmeng TYPE vbap-kwmeng,
werks TYPE vbap-werks,
route TYPE vbap-route,
netpr TYPE vbap-netpr,
kpein TYPE vbap-kpein,
kmein TYPE vbap-kmein,
auart TYPE vbak-auart,
lifsk TYPE vbak-lifsk,
netwr1 TYPE vbak-netwr,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
spart1 TYPE vbak-spart,
vdatu TYPE vbak-vdatu,
kunnr TYPE vbak-kunnr,
END OF ty_vbap_vbak.
DATA : i_vbap_vbak1 TYPE STANDARD TABLE OF ty_vbap_vbak.
DATA : w_vbap_vbak1 LIKE LINE OF i_vbap_vbak1.
DATA : i_vbap_vbak2 TYPE STANDARD TABLE OF ty_vbap_vbak.
DATA : w_vbap_vbak2 LIKE LINE OF i_vbap_vbak2.
TYPES : BEGIN OF ty_knvv,
kunnr TYPE knvv-kunnr,
vkorg TYPE knvv-vkorg,
vtweg TYPE knvv-vtweg,
spart TYPE knvv-spart,
bzirk TYPE knvv-bzirk,
name1 TYPE kna1-name1,
END OF ty_knvv.
DATA : i_knvv1 TYPE STANDARD TABLE OF ty_knvv.
DATA : w_knvv1 LIKE LINE OF i_knvv1.
DATA : i_knvv2 TYPE STANDARD TABLE OF ty_knvv.
DATA : w_knvv2 LIKE LINE OF i_knvv2.
TYPES : BEGIN OF ty_likp,
vbeln TYPE likp-vbeln,
lfart TYPE likp-lfart,
lddat TYPE likp-lddat,
vbtyp TYPE likp-vbtyp,
kunnr TYPE likp-kunnr,
anzpk TYPE likp-anzpk,
netwr TYPE likp-netwr,
werks TYPE likp-werks.
TYPES : END OF ty_likp.
DATA : i_likp TYPE STANDARD TABLE OF ty_likp.
DATA : w_likp LIKE LINE OF i_likp.
DATA : i_t171t TYPE STANDARD TABLE OF t171t.
DATA : w_t171t LIKE LINE OF i_t171t.
TYPES : BEGIN OF ty_lips,
vbeln TYPE lips-vbeln,
posnr TYPE lips-posnr,
matnr TYPE lips-matnr,
matkl TYPE lips-matkl,
werks TYPE lips-werks,
lfimg TYPE lips-lfimg,
netwr TYPE lips-netwr.
TYPES : END OF ty_lips.
DATA : i_lips TYPE STANDARD TABLE OF ty_lips.
DATA : w_lips LIKE LINE OF i_lips.
TYPES : BEGIN OF ty_likp_lips,
vbeln TYPE likp-vbeln,
vkorg TYPE likp-vkorg,
lfart TYPE likp-lfart,
lddat TYPE likp-lddat,
vbtyp TYPE likp-vbtyp,
kunnr TYPE likp-kunnr,
anzpk TYPE likp-anzpk,
netwr TYPE likp-netwr,
werks TYPE likp-werks,
posnr TYPE lips-posnr,
matnr TYPE lips-matnr,
matkl TYPE lips-matkl,
lipswerks TYPE lips-werks,
lfimg TYPE lips-lfimg,
vrkme TYPE lips-vrkme,
vgbel TYPE lips-vgbel,
vtweg TYPE lips-vtweg,
spart TYPE lips-spart,
lipsnetwr TYPE lips-netwr.
TYPES : END OF ty_likp_lips.
DATA : i_likp_lips TYPE STANDARD TABLE OF ty_likp_lips.
DATA : w_likp_lips LIKE LINE OF i_likp_lips.
DATA : i_likp_lips1 TYPE STANDARD TABLE OF ty_likp_lips.
DATA : w_likp_lips1 LIKE LINE OF i_likp_lips1.
TYPES : BEGIN OF ty_vbup,
vbeln TYPE vbup-vbeln,
posnr TYPE vbup-posnr,
lfsta TYPE vbup-lfsta,
wbsta TYPE vbup-wbsta,
END OF ty_vbup.
TYPES : BEGIN OF ty_vbup1,
vbeln TYPE vbup-vbeln,
posnr TYPE vbup-posnr,
lfgsa TYPE vbup-lfgsa,
wbsta TYPE vbup-wbsta,
END OF ty_vbup1.
DATA : i_vbup TYPE STANDARD TABLE OF ty_vbup.
DATA : w_vbup LIKE LINE OF i_vbup.
DATA : i_vbup1 TYPE STANDARD TABLE OF ty_vbup1.
DATA : w_vbup1 LIKE LINE OF i_vbup1.
TYPES : BEGIN OF ty_output,
vbeln TYPE likp-vbeln,
vkorg TYPE likp-vkorg,
lfart TYPE likp-lfart,
lddat TYPE likp-lddat,
vbtyp TYPE likp-vbtyp,
kunnr TYPE likp-kunnr,
anzpk TYPE likp-anzpk,
netwr TYPE likp-netwr,
werks TYPE likp-werks,
posnr TYPE lips-posnr,
matnr TYPE lips-matnr,
matkl TYPE lips-matkl,
lipswerks TYPE lips-werks,
lfimg TYPE lips-lfimg,
vrkme TYPE lips-vrkme,
vgbel TYPE lips-vgbel,
vtweg TYPE lips-vtweg,
spart TYPE lips-spart,
lipsnetwr TYPE lips-netwr,
lfsta TYPE vbup-lfsta,
wbsta TYPE vbup-wbsta,
END OF ty_output.
DATA : i_output TYPE STANDARD TABLE OF ty_output.
DATA : w_output LIKE LINE OF i_output.
DATA : i_output1 TYPE STANDARD TABLE OF ty_output.
DATA : w_output1 LIKE LINE OF i_output1.
TYPES : BEGIN OF ty_vbfa,
vbelv TYPE vbfa-vbelv,
posnv TYPE vbfa-posnv,
vbeln TYPE vbfa-vbeln,
posnn TYPE vbfa-posnn,
vbtyp_n TYPE vbfa-vbtyp_n,
rfmng TYPE vbfa-rfmng,
RFWRT TYPE VBFA-RFWRT,
vbtyp_v TYPE vbfa-vbtyp_v,
END OF ty_vbfa.
DATA : i_vbfa TYPE STANDARD TABLE OF ty_vbfa.
DATA : w_vbfa LIKE LINE OF i_vbfa.
TYPES : BEGIN OF ty_vbfa1,
vbelv TYPE vbfa-vbelv,
posnv TYPE vbfa-posnv,
vbeln TYPE vbfa-vbeln,
posnn TYPE vbfa-posnn,
rfmng TYPE vbfa-rfmng,
rfwrt TYPE vbfa-rfwrt,
END OF ty_vbfa1.
DATA : i_vbfa1 TYPE STANDARD TABLE OF ty_vbfa1.
DATA : w_vbfa1 LIKE LINE OF i_vbfa1.
TYPES: BEGIN OF ty_vbrk_vbrp,
vbeln TYPE vbrk-vbeln,
fkart TYPE vbrk-fkart,
fktyp TYPE vbrk-fktyp,
vbtyp TYPE vbrk-vbtyp,
waerk TYPE vbrk-waerk,
netwr TYPE vbrk-netwr,
posnr TYPE vbrp-posnr,
fkimg TYPE vbrp-fkimg,
vrkme TYPE vbrp-vrkme,
umvkz TYPE vbrp-umvkz,
umvkn TYPE vbrp-umvkn,
netwr1 TYPE vbrp-netwr,
END OF ty_vbrk_vbrp.
DATA : i_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp.
DATA : w_vbrk_vbrp LIKE LINE OF i_vbrk_vbrp.
TYPES : BEGIN OF ty_vbep,
vbeln TYPE vbep-vbeln,
posnr TYPE vbep-posnr,
wmeng TYPE vbep-wmeng,
lddat TYPE vbep-lddat,
END OF ty_vbep.
DATA : i_vbep TYPE STANDARD TABLE OF ty_vbep.
DATA : w_vbep LIKE LINE OF i_vbep.
TYPES : BEGIN OF ty_vbep_vbup,
vbeln TYPE vbep-vbeln,
posnr TYPE vbep-posnr,
wmeng TYPE vbep-wmeng,
lddat TYPE vbep-lddat,
lfgsa TYPE vbup-lfgsa,
wbsta TYPE vbup-wbsta,
END OF ty_vbep_vbup.
DATA : i_vbep_vbup TYPE STANDARD TABLE OF ty_vbep_vbup.
DATA : w_vbep_vbup LIKE LINE OF i_vbep_vbup.
TYPES : BEGIN OF ty_makt,
matnr TYPE mara-matnr,
maktx TYPE makt-maktx,
END OF ty_makt.
DATA : i_makt TYPE STANDARD TABLE OF ty_makt.
DATA : w_makt LIKE LINE OF i_makt.
TYPES : BEGIN OF ty_final,
lddat TYPE likp-lddat,
werks TYPE vbap-werks,
bzirk TYPE knvv-bzirk,
bztxt TYPE t171t-bztxt,
kunnr TYPE vbak-kunnr,
name1 TYPE kna1-name1,
vbeln TYPE likp-vbeln,
wbsta TYPE vbup-wbsta,
text(25) TYPE c,
lfgsa TYPE vbup-lfgsa,
kwmeng TYPE vbap-kwmeng,
netwr TYPE likp-netwr,
order TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE mara-matnr,
netwr1 TYPE vbak-netwr,
kwmeng1 TYPE vbap-kwmeng,
kwmeng2 TYPE vbap-kwmeng,
route TYPE vbap-route,
lifsk TYPE vbak-lifsk,
vdatu TYPE vbak-vdatu,
END OF ty_final.
DATA : i_final TYPE STANDARD TABLE OF ty_final.
DATA : w_final LIKE LINE OF i_final.
DATA : i_final1 TYPE STANDARD TABLE OF ty_final.
DATA : w_final1 LIKE LINE OF i_final1.
TYPES : BEGIN OF ty_final2,
lddat TYPE likp-lddat,
werks TYPE vbap-werks,
bzirk TYPE knvv-bzirk,
bztxt TYPE t171t-bztxt,
kunnr TYPE vbak-kunnr,
name1 TYPE kna1-name1,
vbeln TYPE likp-vbeln,
wbsta TYPE vbup-wbsta,
text(25) TYPE c,
lfgsa TYPE vbup-lfgsa,
kwmeng TYPE vbap-kwmeng,
netwr TYPE likp-netwr,
order TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE mara-matnr,
netwr1 TYPE vbak-netwr,
kwmeng1 TYPE vbap-kwmeng,
kwmeng2 TYPE vbap-kwmeng,
vdatu TYPE vbak-vdatu,
maktx TYPE makt-maktx,
END OF ty_final2.
DATA : i_final2 TYPE STANDARD TABLE OF ty_final2.
DATA : w_final2 LIKE LINE OF i_final2.
DATA : i_conwa TYPE STANDARD TABLE OF vbco6 WITH HEADER LINE.
DATA : i_vbfa_tab TYPE STANDARD TABLE OF vbfa WITH HEADER LINE.
DATA : opt TYPE ctu_params.
DATA : v_vbeln TYPE vbak-vbeln.
DATA : w_vbeln TYPE vbak-vbeln.
DATA : v_repid TYPE sy-repid.
DATA : v_netwr TYPE vbak-netwr.
DATA : v_kwmeng TYPE vbap-kwmeng.
DATA : v_netwr1 TYPE vbak-netwr.
DATA : v_kwmeng1 TYPE vbap-kwmeng.
DATA : v_time(60) TYPE c.
DATA : v_plant(60) TYPE c.
DATA : v_date(60) TYPE c.
DATA : v_lfart(60) TYPE c.
DATA : v_auart(60) TYPE c.
DATA : v_mod(2) TYPE c.
DATA : name(10).
DATA : v_indexes TYPE sy-index.
DATA : v_text(40) TYPE c.
DATA : v_total TYPE p DECIMALS 2.
DATA : v_total1(60) TYPE c.
DATA : v_totqt TYPE p DECIMALS 2.
****Constants Declaration********************************
CONSTANTS : c_wbstaa TYPE vbup-wbsta VALUE 'A',
c_wbstab TYPE vbup-wbsta VALUE 'B',
c_wbstac TYPE vbup-wbsta VALUE 'C',
c_lfartlf TYPE likp-lfart VALUE 'LF',
c_lfartlr TYPE likp-lfart VALUE 'LR',
c_lfartlo TYPE likp-lfart VALUE 'LO',
c_lfartzlo TYPE likp-lfart VALUE 'ZLO',
c_lfgsaa TYPE vbup-lfgsa VALUE 'A',
c_lfgsab TYPE vbup-lfgsa VALUE 'B',
c_vbtyp_nj TYPE vbfa-vbtyp_n VALUE 'J',
c_vbtyp_nt TYPE vbfa-vbtyp_n VALUE 'T',
c_vbtyp_nm TYPE vbfa-vbtyp_n VALUE 'M',
c_vbtyp_vh TYPE vbfa-vbtyp_v VALUE 'H',
c_1100 TYPE t001w-werks VALUE '1100',
c_1101 TYPE t001w-werks VALUE '1101'.
****Selection Screen Declaration*************************
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE title.
SELECT-OPTIONS : s_werks FOR t001w-werks OBLIGATORY.
SELECT-OPTIONS : s_lddat FOR likp-lddat.
SELECT-OPTIONS : s_auat FOR vbak-auart DEFAULT 'OR'.
SELECT-OPTIONS : s_lfat FOR likp-lfart DEFAULT 'LF'.
SELECT-OPTIONS : s_vbeln FOR vbep-vbeln NO-DISPLAY.
SELECT-OPTIONS : s_posnr FOR vbep-posnr NO-DISPLAY.
SELECTION-SCREEN : END OF BLOCK b1.
****Initialization***************************************
INITIALIZATION.
v_repid = sy-repid.
title = 'Selection Screen Options'.
s_werks-sign = 'I'.
s_werks-option = 'EQ'.
s_werks-low = c_1100.
s_werks-high = c_1101.
APPEND s_werks.
CALL FUNCTION 'OIUREP_MONTH_FIRST_LAST'
EXPORTING
i_date = sy-datum
IMPORTING
e_first_day = s_lddat-low
e_last_day = s_lddat-high.
s_lddat-sign = 'I'.
s_lddat-option = 'EQ'.
APPEND s_lddat TO s_lddat.
****At selection screen on field*************************
AT SELECTION-SCREEN ON s_werks.
SELECT SINGLE * FROM t001w WHERE werks IN s_werks.
IF sy-subrc <> 0.
MESSAGE 'Please enter correct Plant' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_lddat.
AT SELECTION-SCREEN ON s_auat.
SELECT SINGLE * FROM tvak WHERE auart IN s_auat.
IF sy-subrc <> 0.
MESSAGE 'Please enter correct Sales Doc Type' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON s_lfat.
SELECT SINGLE * FROM tvlk WHERE lfart IN s_lfat.
IF sy-subrc <> 0.
MESSAGE 'Please enter correct Delv Doc Type' TYPE 'E'.
ENDIF.
****Start selection of data from tables based on cond****
PERFORM SALESORDER_HEADER_ITEM.
PERFORM CUSTOMER_SALESDATA.
START-OF-SELECTION.
PERFORM delivery_header_item.
PERFORM salesdocument_itemstatus.
PERFORM salesdocument_schedulelinedata.
PERFORM salesdocument_itemstatus_lfgsa.
PERFORM sales_district.
PERFORM delivery_salesdocument_wbsta.
PERFORM salesdocumentflow.
PERFORM billingdoc_header_item.
PERFORM salesorder_header_item2.
PERFORM customer_salesdata1.
PERFORM delivery_output.
PERFORM salesdoc_shdlnitem_itemstatus.
PERFORM salesorder_header_item1.
PERFORM customer_salesdata2.
PERFORM salesorder_output.
PERFORM material_descriptions.
PERFORM final_output.
END-OF-SELECTION.
****Fieldcatalog Routine for ALVGRID******************
PERFORM fieldcatalog.
****Event Routine for ALVGRID*************************
PERFORM build_header CHANGING v_header v_header1.
PERFORM build_events CHANGING v_events.
PERFORM print_build.
****Layout Routine for ALVGRID************************
PERFORM layout_build.
****Grid_display Routine for ALVGRID******************
PERFORM grid_display.
*& Form fieldcatalog
text
--> p1 text
<-- p2 text
FORM fieldcatalog .
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'LDDAT'.
wa_fieldcat-seltext_m = 'Loading Dt'.
wa_fieldcat-key = ' '. "SUBTOTAL KEY
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-seltext_m = 'Plant'.
wa_fieldcat-key = ' '. "SUBTOTAL KEY
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'BZIRK'.
wa_fieldcat-seltext_m = 'Sales Dist'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'BZTXT'.
wa_fieldcat-seltext_m = 'Name of Dist'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'KUNNR'.
wa_fieldcat-seltext_m = 'Customer No.'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-seltext_m = 'Customer Name'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_m = 'Delivery No.'.
wa_fieldcat-key = ' '. "SUBTOTAL KEY
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'WBSTA'.
wa_fieldcat-seltext_m = 'Delv Status'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'TEXT'.
wa_fieldcat-seltext_m = 'Status Desc'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'KWMENG'.
wa_fieldcat-seltext_m = 'Delivery Qty'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'NETWR'.
wa_fieldcat-seltext_m = 'Delv Net Value'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'ORDER'.
wa_fieldcat-seltext_m = 'Sales Order'.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'KWMENG1'.
wa_fieldcat-seltext_m = 'Order Qty'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'NETWR1'.
wa_fieldcat-seltext_m = 'Sales Net Value'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'LIFSK'.
wa_fieldcat-seltext_m = 'Delv Block'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'ROUTE'.
wa_fieldcat-seltext_m = 'Route'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'I_FINAL1'.
wa_fieldcat-fieldname = 'VDATU'.
wa_fieldcat-seltext_m = 'Req Delivery Dt'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
CLEAR gs_sort.
gs_sort-fieldname = 'LDDAT'.
gs_sort-spos = 1.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
ENDFORM. " fieldcatalog
*& Form print_build
text
--> p1 text
<-- p2 text
FORM print_build .
w_print-no_print_listinfos = 'X'.
ENDFORM. " print_build
*& Form layout_build
text
--> p1 text
<-- p2 text
FORM layout_build .
w_layout-zebra = 'X'.
w_layout-no_vline = ''.
w_layout-colwidth_optimize = 'X'.
w_layout-detail_popup = 'X'.
w_layout-detail_initial_lines = 'X'.
w_layout-detail_titlebar = 'Detail Title Bar'.
ENDFORM. " layout_build
*& Form GRID_DISPLAY
text
FORM grid_display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'PROCESS_USER_COMMANDS'
is_layout = w_layout
it_fieldcat = i_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
it_events = v_events
is_print = w_print
TABLES
t_outtab = i_final1
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "GRID_DISPLAY
*& Form END_OF_LIST
FORM top_of_list.
ENDFORM. "TOP_OF_LIST
*& Form PROCESS_USER_COMMANDS
text
-->SYST-UCOMM text
-->SELFIELD text
FORM process_user_commands USING syst-ucomm LIKE syst-ucomm
selfield TYPE slis_selfield.
CASE syst-ucomm.
WHEN '&IC1'.
IF selfield-sel_tab_field = 'I_FINAL1-VBELN'.
w_vbeln = selfield-value.
SET PARAMETER ID: 'VL' FIELD w_vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ELSEIF selfield-sel_tab_field = 'I_FINAL1-ORDER'.
v_vbeln = selfield-value.
SET PARAMETER ID: 'AUN' FIELD v_vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ELSE.
READ TABLE i_final1 INTO w_final1 INDEX selfield-tabindex.
IF w_final1-vbeln <> ' '.
LOOP AT i_final INTO w_final WHERE vbeln = w_final1-vbeln.
READ TABLE i_makt INTO w_makt WITH KEY matnr = w_final-matnr .
IF sy-subrc = 0.
MOVE : w_final TO w_final2.
MOVE : w_makt-maktx TO w_final2-maktx.
APPEND w_final2 TO i_final2.
ELSE.
MOVE : w_final TO w_final2.
MOVE : ' ' TO w_final2-maktx.
APPEND w_final2 TO i_final2.
ENDIF.
ENDLOOP.
CLEAR w_makt.
ELSE.
LOOP AT i_final INTO w_final WHERE order = w_final1-order.
READ TABLE i_makt INTO w_makt WITH KEY matnr = w_final-matnr .
IF sy-subrc = 0.
MOVE : w_final TO w_final2.
MOVE : w_makt-maktx TO w_final2-maktx.
APPEND w_final2 TO i_final2.
ELSE.
MOVE : w_final TO w_final2.
MOVE : ' ' TO w_final2-maktx.
APPEND w_final2 TO i_final2.
ENDIF.
ENDLOOP.
CLEAR w_makt.
ENDIF.
PERFORM fieldcatalog1 USING selfield .
PERFORM event_build.
PERFORM layout_build1.
PERFORM grid_display1.
ENDIF.
ENDCASE.
ENDFORM. " PROCESS_USER_COMMANDS
*& Form fieldcatalog1
text
--> p1 text
<-- p2 text
FORM fieldcatalog1 USING r_selfield TYPE slis_selfield.
REFRESH tbl_fieldcat1.
READ TABLE i_final1 INTO w_final1 INDEX r_selfield-tabindex.
IF w_final1-vbeln <> ' '.
PERFORM write_fieldcat1 USING 'POSNR' 'I_FINAL2' 'Item Number' ' ' 2 ' ' ' '
PERFORM write_fieldcat1 USING 'MATNR' 'I_FINAL2' 'Material Number' ' ' 3 ' ' ' '
PERFORM write_fieldcat1 USING 'MAKTX' 'I_FINAL2' 'Material Description' ' ' 4 ' ' ' '
PERFORM write_fieldcat1 USING 'KWMENG' 'I_FINAL2' 'Delivery Qty' ' ' 7 ' ' ' '
PERFORM write_fieldcat1 USING 'NETWR' 'I_FINAL2' 'Delv Net Value' ' ' 8 ' ' ' '
ELSE.
PERFORM write_fieldcat1 USING 'POSNR' 'I_FINAL2' 'Item Number' ' ' 2 ' ' ' '
PERFORM write_fieldcat1 USING 'MATNR' 'I_FINAL2' 'Material Number' ' ' 3 ' ' ' '
PERFORM write_fieldcat1 USING 'MAKTX' 'I_FINAL2' 'Material Description' ' ' 4 ' ' ' '
PERFORM write_fieldcat1 USING 'KWMENG2' 'I_FINAL2' 'Sales Order Qty' ' ' 9 ' ' ' '
PERFORM write_fieldcat1 USING 'NETWR1' 'I_FINAL2' 'Net Value' ' ' 10 ' ' ' '
ENDIF.
ENDFORM. " fieldcatalog1
*& Form write_fieldcat1
text
-->NAME text
-->TAB text
-->ST text
-->KEY text
-->POS text
-->LENGTH text
-->ICON text
-->HOT text
FORM write_fieldcat1 USING name tab st key pos length icon hot.
st_fieldcat1-fieldname = name.
st_fieldcat1-tabname = tab.
st_fieldcat1-seltext_m = st.
st_fieldcat1-key = key.
st_fieldcat1-col_pos = pos.
st_fieldcat1-outputlen = length.
st_fieldcat1-icon = icon.
st_fieldcat1-do_sum = hot.
APPEND st_fieldcat1 TO tbl_fieldcat1.
CLEAR st_fieldcat1.
ENDFORM. " WRITE_FIELDCAT
*& Form GRID_DISPLAY1
text
--> p1 text
<-- p2 text
FORM grid_display1 .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = tbl_fieldcat1
is_layout = st_layout1
it_events = i_events[]
TABLES
t_outtab = i_final2
EXCEPTIONS
program_error = 1
OTHERS = 2.
REFRESH i_final2.
ENDFORM. " GRID_DISPLAY1
*& Form LAYOUT_BUILD1
text
FORM layout_build1 .
st_layout1-zebra = 'X'.
st_layout1-no_vline = ''.
st_layout1-colwidth_optimize = 'X'.
st_layout1-detail_popup = 'X'.
st_layout1-detail_initial_lines = 'X'.
st_layout1-detail_titlebar = 'Detail Title Bar'.
ENDFORM. " layout_build
*& Form salesdocument_itemstatus
text
--> p1 text
<-- p2 text
FORM salesdocument_itemstatus .
CLEAR i_vbup.
REFRESH i_vbup.
v_indexes = 10.
v_text = 'Processing... Sales Doc Item'.
PERFORM progress_ind.
IF NOT i_likp_lips[] IS INITIAL.
SELECT vbeln
posnr
lfsta
wbsta
FROM vbup INTO TABLE i_vbup
FOR ALL ENTRIES IN i_likp_lips
WHERE vbeln = i_likp_lips-vbeln
AND posnr = i_likp_lips-posnr
AND wbsta IN (c_wbstaa, c_wbstab, c_wbstac).
ENDIF.
SORT i_vbup BY vbeln posnr.
ENDFORM. " salesdocument_itemstatus
*& Form delivery_header_item
text
--> p1 text
<-- p2 text
FORM delivery_header_item .
CLEAR i_likp_lips.
REFRESH i_likp_lips.
v_indexes = 1.
v_text = 'Processing.. Delivery'.
PERFORM progress_ind.
selected data from delivery header and delivery iten based on loading date and plant
based on document types LF LR LO ZLO.
SELECT a~vbeln
a~vkorg
a~lfart
a~lddat
a~vbtyp
a~kunnr
a~anzpk
a~netwr
a~werks
b~posnr
b~matnr
b~matkl
b~werks
b~lfimg
b~vrkme
b~vgbel
b~vtweg
b~spart
b~netwr
INTO TABLE i_likp_lips
FROM likp AS a INNER JOIN lips AS b
ON avbeln = bvbeln
WHERE a~lfart IN s_lfat
AND a~lddat IN s_lddat
AND b~werks IN s_werks.
%_HINTS ORACLE 'index("Z05" "Z05LFART" "Z05LDDAT")'.
DELETE i_likp_lips WHERE lfart NOT IN s_lfat
OR lddat NOT IN s_lddat
OR lipswerks NOT IN s_werks.
SORT i_likp_lips BY vbeln posnr.
ENDFORM. " delivery_header_item
*& Form SalesDocument_ScheduleLineData
text
--> p1 text
<-- p2 text
FORM salesdocument_schedulelinedata .
CLEAR i_vbep.
REFRESH i_vbep.
v_indexes = 15.
v_text = 'Processing.. Sales Doc Sch Line Data'.
PERFORM progress_ind.
*SELECTED from table vbep based on loading date, this selection will fetch all
*the open sales orders.
SELECT vbeln
posnr
wmeng
lddat
FROM vbep
INTO TABLE i_vbep
WHERE vbeln in s_vbeln
and posnr in s_posnr
and lddat IN s_lddat.
DELETE I_VBEP WHERE LDDAT NOT IN S_LDDAT.
SORT i_vbep BY vbeln posnr.
ENDFORM. " SalesDocument_ScheduleLineData
*& Form salesdocument_itemstatus_lfgsa
text
--> p1 text
<-- p2 text
FORM salesdocument_itemstatus_lfgsa .
CLEAR i_vbup1.
REFRESH i_vbup1.
v_indexes = 20.
v_text = 'Processing... Sales Doc Item'.
PERFORM progress_ind.
selected from vbup for all entries of vbep based on respective salesorder and item number
and lfgsa status equals to A AND B.
IF NOT i_vbep[] IS INITIAL.
SELECT vbeln posnr lfgsa wbsta FROM vbup INTO TABLE i_vbup1 FOR ALL ENTRIES IN i_vbep
WHERE vbeln = i_vbep-vbeln
AND posnr = i_vbep-posnr
AND LFGSA IN (C_LFGSAA, C_LFGSAB).
%_HINTS ORACLE 'index("ZS1" "ZS1~LFGSA")'.
ENDIF.
DELETE i_vbup1 WHERE lfgsa <> c_lfgsaa AND lfgsa <> c_lfgsab.
SORT i_vbup1 BY vbeln posnr.
ENDFORM. " salesdocument_itemstatus_lfgsa
*& Form billingdoc_header_item
text
--> p1 text
<-- p2 text
FORM billingdoc_header_item .
CLEAR i_vbrk_vbrp.
REFRESH i_vbrk_vbrp.
v_indexes = 40.
v_text = 'Processing... Billing'.
PERFORM progress_ind.
*SELECTED INVOICE DETAILS FROM VBRK AND VBRP .
IF NOT I_VBFA1[] IS INITIAL.
SELECT AVBELN AFKART AFKTYP AVBTYP AWAERK ANETWR
BPOSNR BFKIMG BVRKME BUMVKZ BUMVKN BNETWR
INTO TABLE I_VBRK_VBRP FROM VBRK AS A INNER
JOIN VBRP AS B ON AVBELN = BVBELN FOR ALL ENTRIES IN I_VBFA1
WHERE A~VBELN = I_VBFA1-VBELN AND
B~POSNR = I_VBFA1-POSNN.
ENDIF.
SORT I_VBRK_VBRP BY VBELN POSNR VRKME.
ENDFORM. " billingdoc_header_item
*& Form sales_district
text
--> p1 text
<-- p2 text
FORM sales_district .
CLEAR i_t171t.
REFRESH i_t171t.
v_indexes = 22.
v_text = 'Processing... Sales District'.
PERFORM progress_ind.
*TO SELECT THE SALES DISTRICT FROM I171T.
SELECT * FROM t171t INTO TABLE i_t171t WHERE spras = 'EN'.
ENDFORM. " sales_district
*& Form Material_Descriptions
text
--> p1 text
<-- p2 text
FORM material_descriptions .
DATA : i_fin TYPE STANDARD TABLE OF ty_final WITH HEADER LINE.
CLEAR i_makt.
REFRESH i_makt.
PERFORM progress_ind.
i_fin[] = i_final[].
SORT i_fin BY matnr.
DELETE ADJACENT DUPLICATES FROM i_fin COMPARING matnr.
THIS STATEMENT IS USED TO SELECT MATERIAL DESCRIPTIONS BASED ON THE MATERIAL NUMBERS
PRESENT IN THE FINAL INTERNAL TABLE.
IF NOT i_fin[] IS INITIAL.
SELECT matnr maktx FROM makt INTO TABLE i_makt FOR ALL ENTRIES IN i_fin WHERE spras = 'EN'
AND matnr = i_fin-matnr.
ENDIF.
SORT i_makt BY matnr.
ENDFORM. " Material_Descriptions
*& Form delivery_salesdocument_wbsta
text
--> p1 text
<-- p2 text
This routine will helps us to combine delivery data and sales document item status
FORM delivery_salesdocument_wbsta .
CLEAR i_output.
REFRESH i_output.
v_indexes = 30.
v_text = 'Processing... Open Delivery'.
PERFORM progress_ind.
LOOP AT i_likp_lips INTO w_likp_lips.
READ TABLE i_vbup INTO w_vbup WITH KEY vbeln = w_likp_lips-vbeln
posnr = w_likp_lips-posnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING w_likp_lips TO w_output.
MOVE : w_vbup-lfsta TO w_output-lfsta.
MOVE : w_vbup-wbsta TO w_output-wbsta.
APPEND w_output TO i_output.
ENDIF.
ENDLOOP.
SORT i_output BY vbeln posnr.
ENDFORM. " delivery_salesdocument_wbsta
*& Form salesdocumentflow
text
--> p1 text
<-- p2 text
FORM salesdocumentflow .
CLEAR i_vbfa.
REFRESH i_vbfa.
CLEAR i_vbfa1.
REFRESH i_vbfa1.
v_indexes = 35.
v_text = 'Processing... Sales Doc Flow'.
PERFORM progress_ind.
THIS STATEMENT IS USED TO SELECT THE ORDER NUMBERS BASED ON DELIVERY NUMBERS
FROM SALES DOCUMENT FLOW TABLE.
IF NOT I_OUTPUT[] IS INITIAL.
SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG VBTYP_V INTO TABLE I_VBFA FROM VBFA
FOR ALL ENTRIES IN I_OUTPUT WHERE VBELN = I_OUTPUT-VBELN
AND POSNN = I_OUTPUT-POSNR
AND VBTYP_N IN (C_VBTYP_NJ, C_VBTYP_NT).
SELECT VBELV POSNV VBELN POSNN RFMNG RFWRT FROM VBFA INTO TABLE I_VBFA1 FOR ALL ENTRIES IN
I_OUTPUT WHERE VBELV = I_OUTPUT-VBELN
AND POSNV = I_OUTPUT-POSNR
AND VBTYP_N = C_VBTYP_NM.
ENDIF.
SORT I_VBFA BY VBELN POSNN.
SORT I_VBFA1 BY VBELN POSNN.
ENDFORM. " salesdocumentflow
*& Form salesdoc_shdlnitem_itemstatus
text
--> p1 text
<-- p2 text
FORM salesdoc_shdlnitem_itemstatus .
CLEAR i_vbep_vbup.
REFRESH i_vbep_vbup.
v_indexes = 70.
v_text = 'Processing... Order'.
PERFORM progress_ind.
*TO COMBINE THE VBUP DATA WITH STATUS OF LFGSA EQ TO A AND B WITH
*DATA OF VBEP , WHERE WE GET DATA OF VBEP BASED ON LOADING DATE
IF NOT i_vbup1 IS INITIAL.
LOOP AT i_vbup1 INTO w_vbup1.
READ TABLE i_vbep INTO w_vbep WITH KEY vbeln = w_vbup1-vbeln
posnr = w_vbup1-posnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE : w_vbep-vbeln TO w_vbep_vbup-vbeln,
w_vbep-posnr TO w_vbep_vbup-posnr,
w_vbep-wmeng TO w_vbep_vbup-wmeng,
w_vbep-lddat TO w_vbep_vbup-lddat,
w_vbup1-lfgsa TO w_vbep_vbup-lfgsa,
w_vbup1-wbsta TO w_vbep_vbup-wbsta.
APPEND w_vbep_vbup TO i_vbep_vbup.
ENDIF.
ENDLOOP.
ENDIF.
SORT i_vbep_vbup BY vbeln posnr.
DELETE ADJACENT DUPLICATES FROM i_vbep_vbup COMPARING vbeln posnr.
ENDFORM. " salesdoc_shdlnitem_itemstatus
*& Form delivery_output
text
--> p1 text
<-- p2 text
*This routine will give us all the deliveries which are open or closed with
*there respective delivered quantity and amount etc.
FORM delivery_output .
CLEAR i_final.
REFRESH i_final.
v_indexes = 65.
v_text = 'Processing... Deliver'.
PERFORM progress_ind.
IF NOT i_output[] IS INITIAL.
LOOP AT i_output INTO w_output.
REFRESH i_vbfa_tab.
IF W_OUTPUT-LFART = C_LFARTLF OR W_OUTPUT-LFART = C_LFARTLO OR W_OUTPUT-LFART = C_LFARTZLO.
READ TABLE I_VBFA INTO W_VBFA WITH KEY VBELN = W_OUTPUT-VBELN
POSNN = W_OUTPUT-POSNR BINARY SEARCH .
ELSEIF W_OUTPUT-LFART = C_LFARTLR.
IF W_OUTPUT-VBTYP = 'J'.
READ TABLE I_VBFA INTO W_VBFA WITH KEY VBELN = W_OUTPUT-VBELN
POSNN = W_OUTPUT-POSNR BINARY SEARCH.
ELSE.
READ TABLE I_VBFA INTO W_VBFA WITH KEY VBELN = W_OUTPUT-VBELN
POSNN = W_OUTPUT-POSNR
Maybe you are looking for
-
Allocating an item as a resource in Project 2010
Hello I am trying to construct a Master Project Program using a resource pool. The sub projects are various manufacturing programs using common resources. Some of the resources I want to use are materials, specifically key production areas of a fixed
-
Why os x doesn't recognize internet addresses starting with "wsytd"
There seems to be an increasing number of web addresses that are not recognised, I'm using safari and my OS X Lion software is current. I am a complete novice and not very familier with mac problems, anybody knows why evey time I try to use a downloa
-
Lightroom and Sony NEX5 raw files. How can I make them work together?
Hi All Just got a Sony NEX5. My version of Lightroom 2 doesn't support its RAW files. Can someone let me know what to download or do I need to buy Lightroom 3 upgrade? Thanks
-
REP-1213 Fld 'Fld Name' references col 'Col Name' @ freq below its group
I have a report with a repeating frame. The report was working fine until I decided to do some more 'tweaking'. I somehow lost the repeating frame. I went ahead and added a new repeating frame and I'm now getting the following error: "REP-1213: Field
-
HOST command in Forms9.0.4 versions with 10g
Hi, We are currently running forms6i(character based) on a unix m/c . While trying to upgrade to forms9i (web based) , we find that the HOST command used to call shell script is not wrking and also it doen't shows any errors during compilation or run