Interactive list
Hi,
I am displaying some list using a write statement with column heading. the list which is displayed is interactive. on double clicking on first list, it goes to next screen and shows second list.
My problem is that i want to set different column heading for both the list, however I am setting column heading for first list by GOTO->TEXT ELEMENTS->LIST HEADINGS. how to do the same for the second list.
regards
vivek
hi vivek
u want separate headings for each page, then use
TOP-OF-PAGE DURING LINE-SELECTION. event under at line-selection .
i will write small code for u.
at line-selection.
case sy-lsind
when 1.
select............
loop at itab.
write : /
hide field name
endloop.
when 2.
select............
loop at itab.
write : /
hide field name
endloop.
TOP-OF-PAGE DURING LINE-SELECTION.
write : / 'something'. (this one appear as secondary list heading)
endcase.
i hope this will solve ur problem
reward points
kiran
Similar Messages
-
What is difference between interactive list and interactive reports?
what is difference between interactive list and interactive reports?
hi check this..
interactive report/list means any input(double click or single click or user command ) on the screen will results a new screen with the corresponding fields....this is upto 20 levels only check this..
report .
start-of-selection.
write:/ 'this is the source list'.
at line-selection .
if sy-lsind = 1 .
write:/ ' this is the 1st list'.
elseif.
if sy-lsind = 2 .
write:/ ' this is the 2 list'.
if sy-lsind = 3 .
write:/ ' this is the 3 list'.
if sy-lsind = 4 .
write:/ ' this is the 4 list'.
if sy-lsind = 5 .
write:/ ' this is the 5 list'.
if sy-lsind = 6 .
write:/ ' this is the 6 list'.
if sy-lsind = 7 .
write:/ ' this is the 7 list'.
if sy-lsind = 8.
write:/ ' this is the 8 list'.
if sy-lsind = 9 .
write:/ ' this is the 9 list'.
if sy-lsind = 10 .
write:/ ' this is the 10 list'.
endif.
regards,
venkat -
How to handle interactive list in alv reports
hi experts.
how to handle interactive list in alv reports.
regards.
subhasisHI Subhasis,
below is the sample code for handling an interactive ALV report, hope this helps you ..
REPORT ZTEST_ALV123.
TYPE-POOLS:SLIS.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF ITAB1.
DATA: IT_LIPS LIKE ITAB1 OCCURS 0 WITH HEADER LINE.
SELECT VBELN
POSNR
FROM VBAP
INTO TABLE ITAB.
IF SY-SUBRC = 0.
SORT ITAB BY VBELN .
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE ITAB1
FROM LIPS
FOR ALL ENTRIES IN ITAB
WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
ENDIF.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
*& Form POPUP
text
-->P_EXTAB text
FORM POPUP USING P_EXTAB TYPE SLIS_T_EXTAB.
"here double click on PFSTATUS and create the status, "activate, before that set PICK for choose(F2).
*- Pf status
SET PF-STATUS 'PFSTATUS'.
ENDFORM. " POPUP
*& Form HANDLE_USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
LOOP AT ITAB1 WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
MOVE-CORRESPONDING ITAB1 TO IT_LIPS.
APPEND IT_LIPS.
ENDLOOP.
PERFORM INTERACTIVE_REPORT.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
*& Form interactive_report
text
FORM INTERACTIVE_REPORT .
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGBEL'.
X_FIELDCAT-SELTEXT_M = 'SO #'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGPOS'.
X_FIELDCAT-SELTEXT_M = 'SO ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 4.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT1
TABLES
T_OUTTAB = IT_LIPS
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " interactive_report
Regards,
Ranjita
null -
Interactive list musing abap query and how to create infoset records
hi,
Can any one suggest how to create interactive list using ABAP Query .And also infosets and ranked list ..thanks in advance
Regards,
Raghu.Hi,
Check this
Re: How to make output of ABAp query interactive(drill down)..?
some info on the ABAP query
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c
hope it helps.
Regards! -
Displaying a document in interactive list-high priority
Hi Experts,
There is already an interactive report which displays the output in classick format.Now, the requirement is ,
when they place the cursor position on a sales document and press a push button, it has to display the document in display mode ie in VA03.
Now my problem is that I am not able to find a function code which captures the sales docu number so that i can use that particular selected doc num. You know that i cannot use Function code 'PICK' since it an interactive list . Now i need another function code(like PICK which captures the dou num) so that i can use this for displaying the document.
Quick replys are appreciated.
Thanks in advance.
Regards,
Praveen.not sure what's ur req...but the kind of displaying the order numbers in basic or sec list and then navigating to change/display tcode of the order is easy using HIDE in AT LINE-SELECTION with combination of
SET PARAMETER ID pid FIELD f. and then
CALL TRANSACTION xyz AND SKIP FIRST SCREEN .
RB. -
Hi All,
Is there any sample program for an interactive list in ALV? I would like to try an interactive ALV list option for one of my reports
ThanksOne more example - ALV Interactive ( two times REUSE_ALV_GRID_DISPLAY )
REPORT ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
MESSAGE-ID ZZ_9838 .
TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
BUKRS LIKE EKKO-BUKRS,
BSART LIKE EKKO-BSART,
LIFNR LIKE EKKO-LIFNR,
END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
WA_EKKO TYPE I_EKKO.
*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
WA_EKPO TYPE I_EKPO .
*variable for Report ID
DATA: V_REPID LIKE SY-REPID .
*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
declaration for events table where user comand or set PF status will
be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
I_VARIANT1 TYPE DISVARIANT,
I_SAVE(1) TYPE C.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCATLOG.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_REPORT.
*& Form BUILD_FIELDCATLOG
Fieldcatalog has all the field details from ekko
FORM BUILD_FIELDCATLOG.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'AEDAT'.
WA_FIELDCAT-SELTEXT_M = 'DATE.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'LIFNR'.
WA_FIELDCAT-NO_OUT = 'X'.
WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "EVENT_CALL
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
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.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form data_retrieval
retreiving values from the database table ekko
FORM DATA_RETRIEVAL.
SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
ENDFORM. "data_retrieval
*& Form bUild_listheader
text
-->I_LISTHEADEtext
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'this is my first alv pgm'.
HLINE-TYP = 'H'.
ENDFORM. "build_listheader
*& Form display_alv_report
text
FORM DISPLAY_ALV_REPORT.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = I_TITLE_EKKO
I_GRID_SETTINGS =
IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'ZLAY1'
I_SAVE = 'A'
is_variant = i_variant
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKKO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "display_alv_report
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
PERFORM BUILD_FIELDCATLOG_EKPO.
PERFORM EVENT_CALL_EKPO.
PERFORM POPULATE_EVENT_EKPO.
PERFORM DATA_RETRIEVAL_EKPO.
PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_EKPO.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_EKPO
text
FORM BUILD_FIELDCATLOG_EKPO.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELP'.
WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MENGE'.
WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-SELTEXT_M = 'UOM'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'NETPR'.
WA_FIELDCAT-SELTEXT_M = 'PRICE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*& Form event_call_ekpo
we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL_EKPO.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "event_call_ekpo
*& Form POPULATE_EVENT
Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT_EKPO.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form TOP_OF_PAGE
text
FORM F_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.
FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.
FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_EKPO
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = I_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKPO
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. -
WHAT ARE EVENTS IN INTERACTIVE LIST ?
WHAT ARE EVENTS IN INTERACTIVE LIST ? IS THERE A DIFFERENCE BETWEEN INTERACTIVE LIST AND INTERACTIVE REPORT ?
BEST REGARDS,
RYANHi
Events in Interactive Report
TOP-OF-PAGE DURING LINE-SELECTION
AT USER-COMMAND.
AT LINE-SELECTION
AT PF-FUNCTION KEY
Report Output is called LIST
Interactive report Output is nothing but Interactive List
<b><REMOVED BY MODERATOR></b>
Regards
Anji
Message was edited by:
Alvaro Tejada Galindo -
How to go back to particular list level in interactive list
Hi
In the interactive list suppose when we are in the 18th list and wanted to go to 5th list, what the best way to do plz explain me with example.
cheers
krishsy-lsind it has got different list levels
at back user command write code
SET USER COMMAND 'BACK'.
it will help u surely
thanx n regards
plz award
keep rockin
vivek -
Plz help interactive list issue-urgent today is the deadline
hi experts ,
i have created an interactive list report .
in which when i click on value of first coloumn it should display another list report .
in my case when i click on the spaces next to the value it should not display the value .
i want when i click on the value like 34 it should display the next list not on the spaces .
to get the value i am using
GET CURSOR FIELD fld VALUE val.
Thanx in advancehi,
check the following code
here i used hide ang get cursor statements
in my prog i will display the next list only on clicking material number
otherwise it will display a message click on material number
modify accordingly
REPORT zp_interactive5 LINE-SIZE 100 LINE-COUNT 10(2).
TABLES: mara, marc, makt.
DATA: wa_mara LIKE mara,
it_mara TYPE TABLE OF mara,
wa_marc LIKE marc,
it_marc TYPE TABLE OF marc,
wa_makt LIKE makt,
it_makt TYPE TABLE OF makt.
DATA: value(20) TYPE c.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
START-OF-SELECTION.
SELECT * FROM mara INTO TABLE it_mara
WHERE matnr IN s_matnr.
LOOP AT it_mara INTO wa_mara.
WRITE: / wa_mara-matnr COLOR COL_KEY INTENSIFIED ON,
wa_mara-ersda COLOR COL_KEY INTENSIFIED ON.
HIDE: wa_mara-matnr.
ENDLOOP.
CLEAR wa_mara-matnr.
AT LINE-SELECTION.
CASE sy-lsind.
WHEN '1'.
GET CURSOR FIELD value.
IF value = 'WA_MARA-MATNR'.
SELECT * FROM marc INTO TABLE it_marc
WHERE matnr = wa_maRA-matnr.
IF it_marc IS INITIAL.
MESSAGE 'NO RECORDS FOUND' TYPE 'I'.
ELSE.
WINDOW STARTING AT 10 l1
ENDING AT 50 l2.
LOOP AT it_marc INTO wa_marc.
WRITE: / wa_marc-matnr COLOR COL_KEY INTENSIFIED ON,
wa_marc-werks COLOR COL_KEY INTENSIFIED ON.
HIDE: wa_marc-matnr.
ENDLOOP.
ENDIF.
ELSE.
MESSAGE 'CLICK ON THE MATERIAL NUMBER' TYPE 'I'.
ENDIF.
WHEN '2'.
GET CURSOR FIELD value.
IF value = 'WA_MARC-MATNR'.
SELECT * FROM makt INTO TABLE it_makt
WHERE matnr = wa_maRC-matnr.
IF it_makt IS INITIAL.
MESSAGE 'NO RECORDS FOUND' TYPE 'I'.
ELSE.
WINDOW STARTING AT 10 l1
ENDING AT 50 l2.
LOOP AT it_makt INTO wa_makt.
WRITE: / wa_makt-matnr COLOR COL_KEY INTENSIFIED ON,
wa_makt-spras COLOR COL_KEY INTENSIFIED ON,
wa_makt-maktx COLOR COL_KEY INTENSIFIED ON.
ENDLOOP.
ENDIF.
CLEAR wa_makt-matnr.
ELSE.
MESSAGE 'CLICK ON THE MATERIAL NUMBER' TYPE 'I'.
ENDIF.
ENDCASE.
TOP-OF-PAGE.
WRITE: 'MATERIAL MASTER DETAILS'.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-lsind.
WHEN '1'.
WRITE: 'PLANT DETIALS'.
WHEN '2'.
WRITE: 'MATERIAL DESCRIPTION'.
ENDCASE.
REWARD IF HELPFUL
PRASANTH -
Hi experts,
Please tell me how to generate Interactive list from ALV.
I have already created interactive list without ALV
( using AT LINE SELECTION)Please refer to the below code.
A very good example with most of the company Standards.
*& Report zalv *
REPORT zalv .
TYPE-POOLS: kkblo,
slis.
TABLES: mara, marc, mard.
DATA: disvariant LIKE disvariant,
eventcat TYPE slis_t_event,
eventcat_ln LIKE LINE OF eventcat,
fieldcat TYPE slis_t_fieldcat_alv,
fieldcat_kkb TYPE kkblo_t_fieldcat,
fieldcat_ln LIKE LINE OF fieldcat,
keyinfo TYPE slis_keyinfo_alv,
layout TYPE slis_layout_alv,
layout_kkb TYPE kkblo_layout,
pgm LIKE sy-repid,
printcat TYPE slis_print_alv,
sortcat TYPE slis_t_sortinfo_alv,
sortcat_ln LIKE LINE OF sortcat,
BEGIN OF coltab OCCURS 50,
fieldname LIKE fieldcat_ln-fieldname,
END OF coltab.
DATA: print TYPE slis_print_alv.
DATA : v_repid TYPE sy-repid.
DATA: BEGIN OF wa OCCURS 0,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
aenam TYPE mara-aenam,
werks TYPE marc-werks,
pstat TYPE marc-pstat,
lfmon TYPE mard-lfmon,
END OF wa.
DATA: itab LIKE TABLE OF wa.
**Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001..
SELECT-OPTIONS: mat_no FOR mara-matnr.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK b1.
* Parameter for list viewer display variant
PARAMETERS: variant LIKE disvariant-variant.
AT SELECTION-SCREEN ON variant.
CHECK NOT variant IS INITIAL.
PERFORM check_variant_existence USING variant 'U'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR variant.
PERFORM f4_display_variant USING variant 'U'.
*Initialization
INITIALIZATION.
v_repid = sy-repid.
*Start of selection
PERFORM check_tcode_authority USING 'SA38'.
START-OF-SELECTION.
SELECT a~matnr a~ersda
a~ernam a~aenam
c~werks c~pstat d~lfmon
INTO TABLE itab
UP TO 10 ROWS
FROM mara AS a
INNER JOIN marc AS c ON a~matnr = c~matnr
INNER JOIN mard AS d ON c~matnr = d~matnr
WHERE a~matnr IN mat_no.
*End of Selection
END-OF-SELECTION.
PERFORM call_list_viewer.
*& Form call_list_viewer
* text
FORM call_list_viewer .
PERFORM build_fieldcat USING:
'MATNR' 'ITAB'
'Material #' 'CHAR' 18 ' ' ' ' ' ' ' ' ' ',
'ERSDA' 'ITAB'
'Date Created' 'CHAR' 10 ' ' ' ' ' ' ' ' ' ',
'ERNAM' 'ITAB'
'Created By' 'CHAR' 10 ' ' ' ' ' ' ' ' ' ',
'AENAM' 'ITAB'
'Changed By' 'CHAR' 10 ' ' ' ' ' ' ' ' ' ',
'WERKS' 'ITAB'
'Plant' 'CHAR' 4 ' ' ' ' ' ' ' ' ' ',
'PSTAT' 'ITAB'
'Status' 'CHAR' 10 ' ' ' ' ' ' ' ' ' ',
'LFMON' 'ITAB'
'Current Period' 'CHAR' 8 ' ' ' ' ' ' ' ' ' '.
PERFORM build_eventcat USING: 'TOP_OF_LIST',
'TOP_OF_PAGE'.
PERFORM list_display TABLES itab.
ENDFORM. "call_list_viewer
* build field catalog entry *
FORM build_fieldcat USING a_fieldname
a_tabname
a_heading
a_datatype
a_outputlen
a_key
a_no_out
a_no_sum
a_do_sum
a_no_zero.
CLEAR fieldcat_ln.
fieldcat_ln-fieldname = a_fieldname.
fieldcat_ln-tabname = a_tabname.
fieldcat_ln-outputlen = a_outputlen.
fieldcat_ln-datatype = a_datatype.
fieldcat_ln-reptext_ddic = a_heading.
fieldcat_ln-key = a_key.
fieldcat_ln-no_out = a_no_out.
fieldcat_ln-no_sum = a_no_sum.
fieldcat_ln-do_sum = a_do_sum.
fieldcat_ln-no_zero = a_no_zero.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. "BUILD_FIELDCAT
* FORM BUILD_EVENTCAT
FORM build_eventcat USING a_event.
eventcat_ln-name = eventcat_ln-form = a_event.
APPEND eventcat_ln TO eventcat.
ENDFORM. "BUILD_EVENTCAT
* call the ABAP list viewer *
FORM list_display TABLES a_output.
pgm = disvariant-report = sy-repid.
disvariant-variant = variant.
* call list viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
* i_callback_pf_status_set = 'SET_PF_STATUS'
it_fieldcat = fieldcat
is_variant = disvariant
is_layout = layout
is_print = print
i_save = 'A'
it_events = eventcat
it_sort = sortcat
* i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = a_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "LIST_DISPLAY
*& Form top_of_page
* text
FORM top_of_page.
PERFORM standard_headings.
PERFORM print_selection_screen TABLES:
mat_no USING 'Material No : ' 18 'N' 1.
ENDFORM. "top_of_page
* FORM CHECK_VARIANT_EXISTENCE
* Verify that a variant on the selection screen exists
FORM check_variant_existence USING varname LIKE disvariant-variant
save TYPE c.
DATA: xdisvar LIKE disvariant.
xdisvar-report = sy-repid.
xdisvar-variant = varname.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = save
CHANGING
cs_variant = xdisvar
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e256(56) WITH varname.
* Anzeigevariante &1 nicht gefunden
ENDIF.
disvariant-report = sy-repid.
disvariant-variant = varname.
ENDFORM. "check_variant_existence
* Form F4_DISPLAY_VARIANT
* F4 help to find a display variant
* varname = name of the dynpro field for which f4 is requested
* save = type of list variant saving
* ' ' = no saving allowed
* 'A' = standard & user specific variants can be saved
* 'U' = only user specific variants can be saved
* 'X' = only standard variants can be saved
FORM f4_display_variant USING varname LIKE disvariant-variant
save TYPE c.
disvariant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = disvariant
i_save = save
IMPORTING
es_variant = disvariant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
varname = disvariant-variant.
ELSE.
MESSAGE s245(56).
* Keine Anzeigevariante(n) vorhanden
ENDIF.
ENDFORM. " F4_DISPLAY_VARIANT
* FORM STANDARD_HEADINGS *
* Print standard page headings for report *
FORM standard_headings.
DATA: start_column TYPE i,
title_len TYPE i,
header_for_80_col(45),
date_time_for_80_col(45),
text_h0(11) VALUE 'Report No. ',
text_h1(5) VALUE 'Date ',
text_h2(6) VALUE 'Page -',
text_h3(7) VALUE 'System ',
text_h4(5) VALUE 'Time ',
text_h5(11) VALUE 'Run By '.
FORMAT INTENSIFIED ON.
CONDENSE syst-title.
IF syst-linsz > 80.
WRITE: / text_h0, "Report No.
12 syst-repid(8),
23 text_h1, "Date
sy-datlo.
title_len = STRLEN( syst-title ) / 2.
start_column = ( syst-linsz / 2 ) - title_len.
IF start_column < 40.
start_column = 40.
ENDIF.
WRITE: AT start_column syst-title.
ELSE.
WRITE: / text_h0, "Report No.
12 syst-repid(8).
start_column = 22.
WRITE syst-title TO header_for_80_col CENTERED.
WRITE: header_for_80_col.
ENDIF.
start_column = syst-linsz - 12.
WRITE: AT start_column text_h2, syst-pagno LEFT-JUSTIFIED.
IF syst-linsz > 80.
WRITE: / text_h3, "System
12 syst-sysid(4),
syst-mandt,
23 text_h4, "Time
syst-timlo.
WRITE: / text_h5, "Run By
12 syst-uname.
ELSE.
WRITE: / text_h3, "System
12 syst-sysid(4),
syst-mandt,
23 text_h1, "Date
syst-datlo.
WRITE: / text_h5, "Run By
12 syst-uname,
23 text_h4, "Time
syst-timlo.
ENDIF.
SKIP.
ENDFORM. "STANDARD_HEADINGS
* FORM PRINT_SELECTION_SCREEN *
* --> SIGN *
* --> OPTION *
* --> LOW *
* --> HIGH *
* --> D_IND *
* --> S_STRING *
FORM print_selection_screen TABLES r_selection TYPE table
USING p_name
p_length TYPE i
p_ind
p_start_col.
DATA: year(4) TYPE c,
month(2) TYPE c,
day(2) TYPE c,
low_date(10) TYPE c,
high_date(10) TYPE c,
offset(80) TYPE c.
DATA: BEGIN OF l_selline,
sign(1) TYPE c,
option(2) TYPE c,
data(200) TYPE c,
END OF l_selline.
DATA: l_string(80) TYPE c,
l_temp(80) TYPE c,
len TYPE i,
len1 TYPE i.
DESCRIBE FIELD p_name LENGTH len IN CHARACTER MODE.
len = len + p_start_col + 2.
LOOP AT r_selection.
IF syst-tabix = 1.
WRITE AT /p_start_col p_name.
ELSE.
len1 = ( STRLEN( l_string ) ).
len = len1 + len + 2.
ENDIF.
MOVE r_selection TO l_selline.
SHIFT l_selline-data LEFT DELETING LEADING '0'.
CLEAR l_string.
CASE l_selline-option.
WHEN 'EQ'.
CONCATENATE l_string '=' INTO l_string.
WHEN 'NE'.
CONCATENATE l_string 'not =' INTO l_string.
WHEN 'LT'.
CONCATENATE l_string '<' INTO l_string.
WHEN 'GT'.
CONCATENATE l_string '>' INTO l_string.
WHEN 'LE'.
CONCATENATE l_string '<=' INTO l_string.
WHEN 'GE'.
CONCATENATE l_string '>=' INTO l_string.
WHEN 'BT'.
CONCATENATE l_string 'between' INTO l_string.
WHEN 'NB'.
CONCATENATE l_string 'not between' INTO l_string.
WHEN 'CP'.
CONCATENATE l_string 'contains pattern' INTO l_string.
WHEN 'NP'.
CONCATENATE l_string 'no pattern' INTO l_string.
ENDCASE.
IF l_selline-sign EQ 'E'.
CONCATENATE 'NOT' l_string INTO l_string SEPARATED BY ' '.
ENDIF.
IF p_ind EQ 'Y'.
MOVE l_selline-data(4) TO year.
MOVE l_selline-data+4(2) TO month.
MOVE l_selline-data+6(2) TO day.
CONCATENATE month '/' day '/' year INTO low_date.
CONCATENATE l_string low_date INTO l_string SEPARATED BY ' '.
IF l_selline-option EQ 'BT' OR l_selline-option EQ 'NB'.
MOVE l_selline-data+p_length(4) TO year.
offset = p_length + 4.
MOVE l_selline-data+offset(2) TO month.
ADD 2 TO offset.
MOVE l_selline-data+offset(2) TO day.
CONCATENATE month '/' day '/' year INTO high_date.
CONCATENATE l_string 'and' high_date INTO l_string SEPARATED
BY ' '.
ENDIF.
ELSE.
MOVE l_selline-data(p_length) TO l_temp.
CONCATENATE l_string l_temp INTO l_string SEPARATED BY ' '.
IF l_selline-option EQ 'BT' OR l_selline-option EQ 'NB'.
MOVE l_selline-data+p_length(p_length) TO l_temp.
CONCATENATE l_string 'and' l_temp INTO l_string SEPARATED
BY ' '.
ENDIF.
ENDIF.
WRITE AT len l_string.
ENDLOOP.
IF syst-subrc <> 0.
WRITE: AT /p_start_col p_name, ' *** ALL ***'.
ENDIF.
ENDFORM. "PRINT_SELECTION_SCREEN
* FORM CHECK_TCODE_AUTHORITY *
* Check User Security Against A SAP Transaction *
* --> a_tcode Transaction Code For Security *
FORM check_tcode_authority USING a_tcode.
* if tcode is not passed, then return ok.
IF NOT a_tcode IS INITIAL.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'"Only People that
EXPORTING " have access to
tcode = a_tcode " Transaction t-tcode
EXCEPTIONS " are ALLOWED to execute
ok = 1 " this Program
not_ok = 2.
IF syst-subrc NE 1.
MESSAGE a999(zz) WITH 'YOU Do Not Have Authority to Execute'.
ENDIF.
ELSE.
MOVE 1 TO syst-subrc.
ENDIF.
ENDFORM. "CHECK_TCODE_AUTHORITY
Shreekant -
Interactive list - field selection
Hi,
I am writen code for interactive list. But I am facing a problem is wherever i click on the row, it is showing the next list. But i dont want it..
when i click on the sales order no. it has to show sales order details in the secondary list.. and when i click on the materail no. it has to show material details in the secondary list..
how can i get it..
plz suggest me..
Thanks & Regards,
Dhanunjay.Hi,
Herewith i am sending the sample report for interactive list report.
REPORT YMS_ALVINTER.
*& tables declaration
TABLES: VBRK,VBRP.
*& type-pools declaration
TYPE-POOLS: SLIS.
*& data declaration
DATA: G_REPID TYPE SY-REPID.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_EVENT TYPE SLIS_ALV_EVENT,
T_EVENT TYPE SLIS_T_EVENT.
DATA: V_VBELN LIKE VBRK-VBELN,
V_MATNR LIKE VBRP-MATNR.
DATA: BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN,
WAERK LIKE VBRK-WAERK,
VKORG LIKE VBRK-VKORG,
FKDAT LIKE VBRK-FKDAT,
BUKRS LIKE VBRK-BUKRS,
NETWR LIKE VBRK-NETWR,
END OF IT_VBRK.
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN LIKE VBRP-VBELN,
POSNR LIKE VBRP-POSNR,
FKIMG LIKE VBRP-FKIMG,
VRKME LIKE VBRP-VRKME,
NETWR LIKE VBRP-NETWR,
MATNR LIKE VBRP-MATNR,
ARKTX LIKE VBRP-ARKTX,
END OF IT_VBRP.
*& selection screen
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
S_FKDAT FOR VBRK-FKDAT,
S_MATNR FOR VBRP-MATNR.
SELECTION-SCREEN END OF BLOCK B.
**INITIALIZATION.
INITIALIZATION.
G_REPID = SY-REPID.
S_FKDAT-LOW = SY-DATUM - 200.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
***AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
IF NOT S_VBELN IS INITIAL.
SELECT SINGLE VBELN FROM VBRK
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ2).
ENDIF.
ENDIF.
IF NOT S_MATNR IS INITIAL.
SELECT SINGLE MATNR FROM MARA
INTO V_MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE E001(ZZ2).
ENDIF.
ENDIF.
***START-OF-SELECTION.
START-OF-SELECTION.
PERFORM GET_DATA_VBRK.
*& Form GET_DATA_VBRK
text
--> p1 text
<-- p2 text
FORM GET_DATA_VBRK .
SELECT VBELN
WAERK
VKORG
FKDAT
BUKRS
NETWR
INTO TABLE IT_VBRK
FROM VBRK
WHERE VBELN IN S_VBELN
AND FKDAT IN S_FKDAT.
ENDFORM. " GET_DATA_VBRK
*& Form GET_DATA_VBRP
text
--> p1 text
<-- p2 text
FORM GET_DATA_VBRP .
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO TABLE IT_VBRP
WHERE VBELN = IT_VBRK-VBELN.
ENDFORM. " GET_DATA_VBRP
***END-OF-SELECTION.
END-OF-SELECTION.
PERFORM EVENT_LIST.
PERFORM GET_FIELD_CATALOG.
PERFORM LIST_DISP .
*& Form list_disp
text
FORM LIST_DISP .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'POPUP'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRK
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. " LIST_DISP
*& Form GET_FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM GET_FIELD_CATALOG .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = G_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.
ENDFORM. " GET_FIELD_CATALOG
*& Form event_list
text
--> p1 text
<-- p2 text
FORM EVENT_LIST .
CLEAR WA_EVENT.
WA_EVENT-NAME = 'USER_COMMAND'.
WA_EVENT-FORM = 'USER_COMMAND'.
APPEND WA_EVENT TO T_EVENT.
CLEAR WA_EVENT.
ENDFORM. " event_list
*& Form user_command
text
-->R_UCOMM text
-->RS_SELFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
PERFORM GET_DATA_VBRP.
PERFORM BUILD_FIELDCATALOG_VBRP .
PERFORM DISPLAY_ALV_VBRP.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATALOG_VBRP
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG_VBRP .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = G_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.
ENDFORM. " BUILD_FIELDCATALOG_VBRP
*& Form DISPLAY_ALV_VBRP
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV_VBRP .
CALL FUNCTION 'REUSE_ALV_GRID_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_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRP
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_VBRP
Thanks,
Sankar M -
21st Interactive list goes to short dump?
Hi,
Why does the 21 st Interactive list goes to short dump?
I know this is due to memory is it correct?
If it is mentioned in the kernal, then where can i find this info?
aRsHi,
Please see this test program
report.
uline.
set user-command'PF08'.
at pf8.uline.
set user-command'PF08'
It is giving short dump of "No further selection list possible"
I need to avoid short dump in this scenario. For avoid this i am writing a C call
if sy-lsind > 21 then resetting to 0.
aRs
(Due to this same kind of logic applied to lot of programs i don't want to change all) -
Transferring data using interactive lists
can anybody explain how to transfer data using interactive list with a good example. points would be rewarded.
regards,
sri.Hi,
If you are using non-alv report..Then
Use HIDE..and then use SET PARAMETER..
Ex..
DATA: ITAB TYPE STANDARD TABLE OF MARA WITH HEADER LINE.
* Get the data.
SELECT * FROM MARA
UP TO 10 ROWS
INTO TABLE ITAB.
* Display
LOOP AT ITAB.
WRITE: / ITAB-MATNR.
HIDE ITAB-MATNR.
ENDLOOP.
AT LINE-SELECTION.
* Go to MM03 when double clicked on the line.
IF SY-UCOMM = 'PICK'.
SET PARAMETER 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.
Thanks
Naren -
AT user command in interactive list(basic) is not calling smartform
Hi,
I am facing a problem, which will be strange for all i think.
in a basic list (not ALV) simple interactive report i am using
a at user-command. my concern is to collect the checked
box in the first output report display and store it into the
internal table and call a smart form when user
enter 'SHOW' command.
the problem is when i am entering a show command and
debugging it, it collects all the checked checkbox in the
internal table and it even call the smartform print popup
window, when i give print or printpreview it leave the
program with out throughing any error.
here is the code.
at user-command.
case sy-ucomm.
when 'SHOW'.
do mline times.
READ LINE SY-INDEX FIELD VALUE itab_item-chkbox.
if itab_item-chkbox eq 'X'.
* write:/ itab_item-banfn,30 itab_item-bnfpo.
perform extract_final_data using itab_item-bnfpo itab_item-banfn.
endif.
enddo.
refresh: itab, itab_ser.
clear: itab, itab_ser.
* move all data to structure (itab) of form .
loop at iitab_wa1.
Move : iitab_wa1-matnr to itab-matnr,
iitab_wa1-meins to itab-meins,
iitab_wa1-ebeln to itab-ebeln,
iitab_wa1-ebelp to itab-ebelp,
iitab_wa1-menge to itab-ktmng,
iitab_wa1-lfdat to itab-eindt,
iitab_wa1-typ to itab-typ.
append itab.
clear itab.
endloop.
* display the selected item in the report screen.
if sy-subrc is initial.
* sorting the table according to RFQ no and item no.
sort itab by ebeln ebelp.
* including sr.no in table itab
clear icnt.
loop at itab.
icnt = icnt + 1.
itab-srno = icnt.
modify itab.
clear itab.
endloop.
* Call the output form.
* YSF_MEDRUCK_RFQ_PR_ser_SAE is in 300
* for pr to rfq material and service in single form.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YSF_MEDRUCK_RFQ_PR_MAT_SAE'
IMPORTING
FM_NAME = V_FM.
CALL FUNCTION '/1BCDWB/SF00000037'
EXPORTING
ser_flg = ser_flag
material = p_mat
services = p_ser
TABLES
itab = itab
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
else.
write: ' Some error has occurred'.
endif.
endcase.
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Aug 22, 2008 6:16 PMhi...
this shouldnt be happening..ne ways.u may try this..
put the smartform calling code in a report porgram and then use submit program and return command.
write this part of code in the report program....you will get all ur variables from stack....
Report y_call_sf.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YSF_MEDRUCK_RFQ_PR_MAT_SAE'
IMPORTING
FM_NAME = V_FM.
CALL FUNCTION v_fm
EXPORTING
ser_flg = (calling_prog)ser_flag --> declare like this fro stack access
material = (calling_prog)p_mat
services = (calling_prog)p_ser
TABLES
itab = (calling_prog)itab
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
else.
write: ' Some error has occurred'.
endif.
calling prog is program from where u r submitting.......
so ur code will look like this....
at user-command.
case sy-ucomm.
when 'SHOW'.
do mline times.
READ LINE SY-INDEX FIELD VALUE itab_item-chkbox.
if itab_item-chkbox eq 'X'.
write:/ itab_item-banfn,30 itab_item-bnfpo.
perform extract_final_data using itab_item-bnfpo itab_item-banfn.
endif.
enddo.
refresh: itab, itab_ser.
clear: itab, itab_ser.
move all data to structure (itab) of form .
loop at iitab_wa1.
Move : iitab_wa1-matnr to itab-matnr,
iitab_wa1-meins to itab-meins,
iitab_wa1-ebeln to itab-ebeln,
iitab_wa1-ebelp to itab-ebelp,
iitab_wa1-menge to itab-ktmng,
iitab_wa1-lfdat to itab-eindt,
iitab_wa1-typ to itab-typ.
append itab.
clear itab.
endloop.
display the selected item in the report screen.
if sy-subrc is initial.
sorting the table according to RFQ no and item no.
sort itab by ebeln ebelp.
including sr.no in table itab
clear icnt.
loop at itab.
icnt = icnt + 1.
itab-srno = icnt.
modify itab.
clear itab.
endloop.
Call the output form.
YSF_MEDRUCK_RFQ_PR_ser_SAE is in 300
for pr to rfq material and service in single form.
submit y_call_sf and return. -->plz check the syntax
endcase. -
Hi all,
In first list i displayed sflight table details.i used this code.if i double click on carrid value i am getting corresponding spfli details in the next list.
AT LINE-SELECTION.
GET CURSOR FIELD fld VALUE val LENGTH len OFFSET off LINE li.
select airpfrom cityfrom countryto cityto from spfli into table it_tab2 where carrid = val.
i want if i double click any where in the line not only in carrid value even in connid or fldate i should get coressponding spfli details..if anybody knows kindly help me.
Thanks in advance.hI
SEE THIS PROGRAM
A Sample Hide & Get Cursor in Interactive Programming
Hide & Get Cursor is used in interactive programming ( in the event AT LINE-selection).
Using Hide in Loop..Endloop, you can get the field name At Line-Select
Event While Double Clicking That Line.
***PROG.BEGIN**************************************************************
*& Report ZPREM_INTERACTIVE *
REPORT zprem_interactive .
TYPES : BEGIN OF ty_test,
code TYPE i,
name(10) TYPE c,
amount TYPE p DECIMALS 2,
END OF ty_test.
DATA : it_test TYPE STANDARD TABLE OF ty_test WITH HEADER LINE INITIAL SIZE 10.
DATA : wa TYPE ty_test,
chk1 TYPE c,
fldname(30), fldval(50).
*set pf-status 'PF01'.
*set titlebar 'PF01'.
INITIALIZATION.
it_test-code = 300.
it_test-name = 'Ramesh'.
it_test-amount = 5500.
APPEND it_test.
wa-code = 207.
wa-name = 'Prem'.
wa-amount = 5000.
APPEND wa TO it_test.
it_test-code = 117.
it_test-name = 'James Bond'.
it_test-amount = 9900.
INSERT it_test INDEX 3.
it_test-code = 217.
it_test-name = 'Sivaraman'.
it_test-amount = 9900.
INSERT it_test INDEX 3.
it_test-code = 201.
it_test-name = 'Saravanan'.
it_test-amount = 1000.
APPEND it_test.
it_test-code = 210.
it_test-name = 'Shanmugam'.
it_test-amount = 6000.
APPEND it_test.
WRITE : / 'Loop Display ( Appended rows ) :-'.
LOOP AT it_test.
WRITE : / chk1 AS CHECKBOX,
sy-tabix, sy-vline, it_test-code, it_test-name, it_test-amount.
HIDE : it_test-code, it_test-name.
ENDLOOP.
SKIP.
END-OF-SELECTION.
CLEAR : it_test-code, it_test-name.
WRITE : / 'this from end of selection'.
*& Form DISP1
text
FORM disp1.
WINDOW STARTING AT 15 10
ENDING AT 80 15.
DO.
CLEAR chk1.
READ LINE sy-index FIELD VALUE chk1.
IF sy-subrc NE 0.
EXIT.
ELSE.
CHECK chk1 NE space.
WRITE : / it_test-code, it_test-name.
MODIFY CURRENT LINE :
FIELD VALUE chk1 FROM ' '
FIELD FORMAT chk1 INPUT OFF.
ENDIF.
ENDDO.
ENDFORM. "DISP1
***line double click ****
AT LINE-SELECTION.
CHECK sy-lsind = 1.
WINDOW STARTING AT 5 4
ENDING AT 85 20.
WRITE: / 'THE USER DOUBLE-CLICKED A LINE IN THE REPORT'.
WRITE: / sy-lisel.
WRITE : / 'Sometime ',it_test-name, ' is good '.
WRITE : / 'Sometime ',it_test-name, ' is bad '.
WRITE : / 'Sometime ',it_test-name, ' is rich '.
WRITE : / 'Sometime ',it_test-name, ' is poor '.
WRITE : / 'Who knows, who is ',it_test-name, ' ? '.
WRITE : /, / 'we can also use this in SELECT statement'.
CLEAR : it_test-code, it_test-name.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ULINE.
SKIP.
SKIP.
WRITE : / 'Below from Get Cursor Field...'.
GET CURSOR FIELD fldname VALUE fldval.
CONDENSE fldname.
CONDENSE fldval.
WRITE : / 'You have clicked ', fldname, ' & its value is ', fldval.
***function key press F6 ****
AT PF06.
PERFORM disp1.
*AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'STOP' OR 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'TESTME'.
PERFORM DISP1.
ENDCASE.
<b>or</b>
*& Report ZTESTDEMO_INTERACTIVE_LIST_2
REPORT ZTESTDEMO_INTERACTIVE_LIST_2.
TABLES: MARA,MARC,MARD.
internal table itab_mara 3 fields matnr, ernam,mtart
DATA: BEGIN OF ITAB_MARA OCCURS 0,
MATNR LIKE MARA-MATNR, " material number
ERNAM LIKE MARA-ERNAM, " name of person who create
MTART LIKE MARA-MTART, " Material Type
END OF ITAB_MARA.
internal table itab_marc 3 fields matnr, werks,lvorm
DATA: BEGIN OF ITAB_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS, " Plant
LVORM LIKE MARC-LVORM, " Flag Material for Deletion at Plant Level
END OF ITAB_MARC.
internal table itab_mard 2 fields
DATA: BEGIN OF ITAB_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT, " Storage Location
END OF ITAB_MARD.
SELECT-OPTIONS: S_MTART FOR MARA-MTART.
INITIALIZATION.
S_MTART-LOW = 'HALB'.
S_MTART-HIGH = 'HAWA'.
S_MTART-OPTION = 'BT'.
APPEND S_MTART.
START-OF-SELECTION.
SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
S_MTART.
PERFORM DISPLAY.
TOP-OF-PAGE.
WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.
FORM DISPLAY.
LOOP AT ITAB_MARA.
WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
HIDE: ITAB_MARA-MATNR.
ENDLOOP.
ENDFORM.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
ITAB_MARA-MATNR.
PERFORM DISPLAY1.
WHEN 2.
SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
ITAB_MARC-MATNR.
PERFORM DISPLAY2.
when 3.
sy-lsind = 0.
ENDCASE.
FORM DISPLAY1.
LOOP AT ITAB_MARC.
WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
HIDE: ITAB_MARC-MATNR.
ENDLOOP.
WRITE:/ SY-LSIND.
ENDFORM.
FORM DISPLAY2.
LOOP AT ITAB_MARD.
WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
ENDLOOP.
WRITE:/ SY-LSIND.
ENDFORM.
<b>REWARD IF USEFULL</b> -
Regarding Interactive list in alv
Hi Experts,
I want to know how to do a inteactive report in alv.
For example: First i will display a alv list. Then when i double click on a field of a line or click on button (Details) by selecting a line , then it will navigate me to the alv list with corresponding records where i clicked previously.
How to use buttons in this case as we r using in simple interactive report.
Can anyone pls help me in creating a simple example for the above???
Thanks
SudhansuHi,
Example for Interactive ALV report.
Please reward if useful.
report zreport no standard page heading
message-id zw.
Type Pools *
type-pools: icon, slis.
Tables *
tables: tvst,
likp,
t30b,
vekp,
zpallettr,
zvantr.
Types *
types:
begin of ty_data,
lgtor like likp-lgtor, " door
vbeln like likp-vbeln, " delivery
wbstk like vbuk-wbstk, " Goods movement status
kostk like vbuk-kostk, " Picking status
posnr like lips-posnr, " item
route like likp-route, " route
wadat like likp-wadat, " goods issue date
lvsta like vbup-lvsta, " warehouse status
packvorschr like vekp-packvorschr, " pack mnemonic
exidv like vekp-exidv, " handling unit
zpallet_no(10), "like zpallettr-zpallet_no, " pallet no
zcount_check like zpallettr-zcount_check," count check flag
zvan_no(10), "like zvantr-zvan_no, " van no
zvan_print like zvantr-zvan_print, " van manifest print
zeod_print like zvantr-zeod_print, " eod manifest print
zzpackclass like vekp-zzpackclass, " package class
zzti like vekp-zzti, " T.I. value
end of ty_data.
Data *
ranges: r_del for likp-vbeln,
r_lgtor for likp-lgtor.
ranges: r_vanno for zvantr-zvan_no,
r_palno for zpallettr-zpallet_no.
data: begin of number_range occurs 0,
mark(1),
id(3),
num(10) type n,
desc like zpalletmd-zdesc,
end of number_range.
data: t_disp_tab type standard table of zpickdisp,
t_data_tab type ty_data occurs 0 with header line,
t_disp_head type standard table of zpickhead.
data: w_numrnge like number_range,
w_number(10) type n.
data: t_likp like likp occurs 0 with header line,
t_lips like lips occurs 0 with header line,
t_vbuk like vbuk occurs 0 with header line,
t_vbup like vbup occurs 0 with header line,
t_vepo like vepo occurs 0 with header line,
t_vekp like vekp occurs 0 with header line,
t_vantr like zvantr occurs 0 with header line,
t_pallettr like zpallettr occurs 0 with header line,
w_likp like likp,
w_lips like lips,
w_vbuk like vbuk,
w_vbup like vbup,
w_vepo like vepo,
w_vekp like vekp.
ALV DATA *****
data:
g_grid type ref to cl_gui_alv_grid,
g_sort type slis_t_sortinfo_alv,
g_custom_container type ref to cl_gui_custom_container,
g_layout type slis_layout_alv,
gt_fieldcat type slis_t_fieldcat_alv,
t_fldcat like line of gt_fieldcat,
g_keyinfo type slis_keyinfo_alv,
gt_events type slis_t_event,
gs_event type slis_alv_event,
w_sy_repid like sy-repid.
data: begin of seltab occurs 0.
include structure rsparams.
data: end of seltab.
SYSTEM GENERATED TABLE CONTROL DATA ********
DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
controls: tc_tabcon type tableview using screen 0100.
LINES OF TABLECONTROL 'TC_TABCON'
data: g_tc_tabcon_lines like sy-loopc.
data: ok_code like sy-ucomm.
Constants *
constants: c_data_class like klah-class value 'DG_DATA',
c_mat_class like rmclf-klart value '001',
c_pack like lips-mtart value 'VERP',
c_a(1) value 'A',
c_b(1) value 'B',
c_c(1) value 'C',
c_yes(1) value 'X',
c_no(1) value ' '.
Selection screen *
standard report select options block
selection-screen begin of block a with frame title text-002.
select-options:
s_wadat for likp-wadat no-extension obligatory. " Goods Issue Date
*parameters: "TR01-
p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
select-options: "TR01+
p_vstel for tvst-vstel. " Shipping Point "TR01+
select-options:
s_lfart for likp-lfart, " Delivery type
s_lgtor for t30b-lgtor, " Door selection
s_exidv for vekp-exidv, " Handling Unit
s_vbeln for likp-vbeln. " Delivery
parameters:
p_exdata as checkbox. " Show extra columns flag
selection-screen end of block a.
van/pallet specific select options block
selection-screen begin of block b with frame title text-001.
select-options:
s_palno for zpallettr-zpallet_no, " no-extension,
s_vanno for zvantr-zvan_no. " no-extension.
selection-screen end of block b.
Value Request Events *
at selection-screen on value-request for s_palno-low.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_pal_nos.
s_palno-low = w_number.
at selection-screen on value-request for s_palno-high.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_pal_nos.
s_palno-high = w_number.
at selection-screen on value-request for s_vanno-low.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_van_nos.
s_vanno-low = w_number.
at selection-screen on value-request for s_vanno-high.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_van_nos.
s_vanno-high = w_number.
At Selection Screen *
at selection-screen.
perform validate_selections.
Initialization *
initialization.
Start of selection *
start-of-selection.
clear all data tables
clear: t_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr,
w_likp,
w_lips,
w_vbuk,
w_vbup,
w_vepo,
w_vekp.
refresh: t_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr.
select data for ALV
due to different input parameters being used, to streamline the data
selection process, different selection methods are required
if not s_vanno is initial
or not s_palno is initial.
if selecting by van/pallet number, need to select the data from the
handling unit upwards to delivery
perform select_data_up.
else.
otherwise the data can be selected from the delivery downwards
perform select_data_down.
endif.
End of selection *
end-of-selection.
call hierarchical ALV display function module
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = 'ZWMR_PICK_STATUS_REPORT'
i_callback_pf_status_set = 'SET_STATUS'
i_callback_user_command =
'USER_COMMAND' "custom gui status form
is_layout = g_layout "user command form
it_fieldcat = gt_fieldcat
it_sort = g_sort
it_events = gt_events
i_tabname_header = 't_disp_head'
i_tabname_item = 't_disp_tab'
i_structure_name_header = 'ZPICKHEAD'
i_structure_name_item = 'ZPICKDISP'
is_keyinfo = g_keyinfo
tables
t_outtab_header = t_disp_head
t_outtab_item = t_disp_tab.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
FORMS *
Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
include zwmr_pick_status_reporto01 .
include zwmr_pick_status_reporti01 .
include zwmr_pick_status_reportf01 .
*& Form select_pal_nos
select pallet numbers for search help
form select_pal_nos.
data: begin of t_palno occurs 0,
zpallet_no like zpallettr-zpallet_no,
end of t_palno.
select all available pallet numbers
select distinct zpallet_no from zpallettr
into corresponding fields of table t_palno.
loop at t_palno.
get pallet id
select single zpallet_id from zpallettr
into number_range-id
where zpallet_no = t_palno-zpallet_no.
get pallet description
select single zdesc from zpalletmd
into number_range-desc
where zpallet_id = number_range-id.
number_range-num = t_palno-zpallet_no.
append to search help table
append number_range.
endloop.
call pop up dialog box
call screen 0100 starting at 5 5.
endform. " select_pal_nos
*& Form select_van_nos
select van numbers for search help
form select_van_nos.
data: begin of t_vanno occurs 0,
zvan_no like zvantr-zvan_no,
end of t_vanno.
select available van numbers
select distinct zvan_no from zvantr
into corresponding fields of table t_vanno.
loop at t_vanno.
select van id
select single zvan_id from zvantr
into number_range-id
where zvan_no = t_vanno-zvan_no.
select van description (maintained in pallet tables)
select single zdesc from zpalletmd
into number_range-desc
where zpallet_id = number_range-id.
number_range-num = t_vanno-zvan_no.
append to search help table
append number_range.
endloop.
call pop up dialog box
call screen 0100 starting at 5 5.
endform. " select_van_nos
*& Form select_data_down
select data if selecting from delivery down
form select_data_down.
select all deliveries from LIKP that fulfill selection criteria
select * from likp into table t_likp
where vbeln in s_vbeln
and vstel eq p_vstel "TR01-
and vstel in p_vstel
and lgtor in s_lgtor
and wadat in s_wadat
and lfart in s_lfart.
if sy-subrc ne 0.
no data found
message i007.
exit.
endif.
if not t_likp[] is initial.
select sales document headers from VBUK
select * from vbuk into table t_vbuk
for all entries in t_likp
where vbeln eq t_likp-vbeln.
select all relevant delivery items from LIPS
select * from lips into table t_lips
for all entries in t_likp
where vbeln eq t_likp-vbeln
and pstyv ne 'ZPAC'
and pstyv ne 'ZGDP' "TR02+
and lfimg gt 0. "TR01+
endif.
if not t_lips[] is initial.
select all sales document line items from VBUP
select * from vbup into table t_vbup
for all entries in t_lips
where vbeln eq t_lips-vbeln
and posnr = t_lips-posnr.
select corresponding handling unit ID's (venum)
TR03 Replace start
select * from vepo appending corresponding fields of table t_vepo
for all entries in t_lips
where vbeln = t_lips-vbeln
and posnr = t_lips-posnr
and matnr = t_lips-matnr
and charg = t_lips-charg.
select * from vepo
inner join vekp on vepovenum = vekpvenum
appending corresponding fields of table t_vepo
for all entries in t_lips
where vepo~vbeln = t_lips-vbeln
and vepo~posnr = t_lips-posnr
and vepo~matnr = t_lips-matnr
and vepo~charg = t_lips-charg
and vekp~exidv in s_exidv.
TR03 Replace end
endif.
build process table
perform move_to_table.
endform. "select_data_down
*& Form select_data_up
select data if selecting from van/pallet up
form select_data_up.
if not s_vanno is initial.
if van then select van numbers and hence pallet numbers
select * from zvantr into table t_vantr
where zvan_no in s_vanno.
and vstel eq p_vstel."TR01-
if not t_vantr[] is initial.
select * from zpallettr into table t_pallettr
for all entries in t_vantr
where zpallet_no eq t_vantr-zpallet_no.
and vstel eq p_vstel."TR01-
endif.
else.
otherwise can get pallet numbers directly
select * from zpallettr into table t_pallettr
where zpallet_no in s_palno.
and vstel eq p_vstel."TR01-
endif.
if not t_pallettr[] is initial.
from the pallet nos. we can select the handling units
select * from vekp into table t_vekp
for all entries in t_pallettr
where exidv eq t_pallettr-exidv
and exidv ne space
and exidv in s_exidv "TR03+
and ( exida = 'E' "TR01+
or exida = 'F' ). "TR01+
endif.
if not t_vekp[] is initial.
build vbeln range from t_vekp.
loop at t_vekp.
r_del-sign = 'I'.
r_del-option = 'EQ'.
r_del-low = t_vekp-vpobjkey.
append r_del.
endloop.
select all deliveries from LIKP that correspond to HU's
select * from likp into table t_likp
where vbeln in r_del
and wadat in s_wadat
and lfart in s_lfart.
endif.
if not t_likp[] is initial.
select sales document headers from VBUK
select * from vbuk into table t_vbuk
for all entries in t_likp
where vbeln eq t_likp-vbeln.
select all relevant delivery items from LIPS
select * from lips into table t_lips
for all entries in t_likp
where vbeln eq t_likp-vbeln
and pstyv ne 'ZPAC'
and pstyv ne 'ZGDP' "TR02+
and lfimg gt 0. "TR01+
endif.
if not t_lips[] is initial.
select all sales document line items from VBUP
select * from vbup into table t_vbup
for all entries in t_lips
where vbeln eq t_lips-vbeln
and posnr = t_lips-posnr.
select corresponding handling unit ID's (venum)
select * from vepo appending corresponding fields of table t_vepo
for all entries in t_lips
where vbeln = t_lips-vbeln
and posnr = t_lips-posnr
and matnr = t_lips-matnr
and charg = t_lips-charg.
endif.
build process table
perform move_to_table.
endform. "select_data_up
*& Form move_to_table
move data to processing table
form move_to_table.
loop at t_vepo.
clear t_data_tab.
delivery lines.
clear w_lips.
read table t_lips with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr
into w_lips.
move-corresponding w_lips to t_data_tab.
sales document line items
clear w_vbup.
read table t_vbup with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr
into w_vbup.
if w_vbup-kosta = space. "TR01-
not relevant for picking
delete t_vepo. "TR01-
continue. "TR01-
else. "TR01-
move-corresponding w_vbup to t_data_tab.
endif. "TR01-
sales doc header
clear w_vbuk.
read table t_vbuk with key vbeln = t_vepo-vbeln
into w_vbuk.
move-corresponding w_vbuk to t_data_tab.
delivery header
clear w_likp.
read table t_likp with key vbeln = t_vepo-vbeln
into w_likp.
move-corresponding w_likp to t_data_tab.
select handling unit info using vepo entry
clear w_vekp.
if t_vekp[] is initial.
select single * from vekp into w_vekp
where venum = t_vepo-venum.
else.
read table t_vekp with key venum = t_vepo-venum
into w_vekp.
if sy-subrc ne 0.
select single * from vekp into w_vekp
where venum = t_vepo-venum.
endif.
endif.
move-corresponding w_vekp to t_data_tab.
select pallet / van load information
select single zpallet_no zcount_check from zpallettr
into (t_data_tab-zpallet_no,
t_data_tab-zcount_check)
where exidv eq w_vekp-exidv.
if not t_data_tab-zpallet_no in s_palno. "TR01+
continue. "TR01+
endif. "TR01+
if sy-subrc = 0.
select single zvan_no zvan_print zeod_print from zvantr
into (t_data_tab-zvan_no,
t_data_tab-zvan_print,
t_data_tab-zeod_print)
where zpallet_no eq t_data_tab-zpallet_no.
if not t_data_tab-zvan_no in s_vanno. "TR01+
continue. "TR01+
endif. "TR01+
endif.
append t_data_tab.
endloop.
*-----> TR01+ start
If the delivery has yet to be packed, then need to include in report
Thus delete t_lips here and if any entries left after looping through
t_vepo, these will also need to be added to t_data_tab
if the selection is by handling unit though we do not want these"TR03+
if s_exidv is initial. "TR03+
loop at t_vepo.
read table t_lips with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr.
if sy-subrc = 0.
delete t_lips index sy-tabix.
endif.
endloop.
if not t_lips[] is initial.
move any unpacked items to the data table
perform move_lips_to_table.
endif.
endif. "TR03+
*<---- TR01+ End
get relevant status icons
perform select_icons.
prepare ALV data
perform prepare_alv.
endform. " select_data
*& Form select_icons
select icons for display and move data to display table
form select_icons.
data: w_disp_tab like zpickdisp,
w_disp_head like zpickhead,
w_color like zpickdisp-color,
ov_icon like zpickdisp-ov_icon,
gi_icon like zpickdisp-gi_icon,
to_icon like zpickdisp-to_icon,
lp_icon like zpickdisp-lp_icon,
pc_icon like zpickdisp-pc_icon,
lv_icon like zpickdisp-lv_icon,
vm_icon like zpickdisp-vm_icon,
em_icon like zpickdisp-em_icon,
t_ovst_tab like t_disp_tab with header line.
constants: c_col1(3) value 'C10',
c_col2(3) value 'C20'.
sort t_data_tab by lgtor vbeln.
w_color = c_col2.
loop at t_data_tab.
at new lgtor.
fill ALV header table
clear w_disp_head.
w_disp_head-lgtor = t_data_tab-lgtor.
append w_disp_head to t_disp_head.
endat.
goods issue status & overall amber/green only
case t_data_tab-wbstk.
when c_c.
move icon_green_light to gi_icon.
move icon_green_light to ov_icon.
when others.
move icon_red_light to gi_icon.
move icon_yellow_light to ov_icon.
endcase.
transfer order status
case t_data_tab-lvsta.
when c_a.
move icon_red_light to to_icon.
when c_b.
move icon_yellow_light to to_icon.
when c_c.
move icon_green_light to to_icon.
when space.
write N/A
to_icon = 'N/A'.
endcase.
loaded to pallet status
if not t_data_tab-zpallet_no is initial.
move icon_green_light to lp_icon.
else.
move icon_red_light to lp_icon.
endif.
pallet count status
if not t_data_tab-zcount_check is initial.
move icon_green_light to pc_icon.
else.
move icon_red_light to pc_icon.
endif.
loaded to van status
if not t_data_tab-zvan_no is initial.
move icon_green_light to lv_icon.
else.
move icon_red_light to lv_icon.
endif.
van manifest status
if not t_data_tab-zvan_print is initial.
move icon_green_light to vm_icon.
else.
move icon_red_light to vm_icon.
endif.
end of day manifest status
if not t_data_tab-zeod_print is initial.
move icon_green_light to em_icon.
else.
move icon_red_light to em_icon.
endif.
move working data table to display table
move-corresponding t_data_tab to w_disp_tab.
w_disp_tab-ov_icon = ov_icon.
w_disp_tab-gi_icon = gi_icon.
w_disp_tab-to_icon = to_icon.
w_disp_tab-lp_icon = lp_icon.
w_disp_tab-pc_icon = pc_icon.
w_disp_tab-lv_icon = lv_icon.
w_disp_tab-vm_icon = vm_icon.
w_disp_tab-em_icon = em_icon.
w_disp_tab-color = w_color.
fill N/A values for initial fields for display
if w_disp_tab-packvorschr is initial.
w_disp_tab-packvorschr = 'N/A'.
endif.
if w_disp_tab-exidv is initial.
w_disp_tab-exidv = 'N/A'.
endif.
if w_disp_tab-zpallet_no is initial.
write 'N/A' to w_disp_tab-zpallet_no.
endif.
if w_disp_tab-zvan_no is initial.
write 'N/A' to w_disp_tab-zvan_no.
endif.
display different color for new doc number
at end of vbeln.
if w_color = c_col1.
w_color = c_col2.
elseif w_color = c_col2.
w_color = c_col1.
endif.
endat.
append w_disp_tab to t_disp_tab.
clear w_disp_tab.
endloop.
we have all the icons in display but need to check the overall status
as this refers to the line items
green and amber statuses already set and use the same criteria as the
goods issue status unless detected as red here
data: ov_stat_red(1).
clear w_disp_tab.
sort t_disp_tab by vbeln.
loop at t_disp_tab into w_disp_tab.
at new vbeln.
check all line items for delivery
loop at t_data_tab where vbeln = w_disp_tab-vbeln.
if t_data_tab-lvsta = c_a.
set overall status to red
ov_stat_red = c_yes.
exit.
else.
leave green/amber status icon as previosly determined
endif.
endloop.
if ov_stat_red = c_yes.
set overall status to red for all items in that delivery
clear ov_stat_red.
move icon_red_light to w_disp_tab-ov_icon.
modify t_disp_tab from w_disp_tab transporting ov_icon
where vbeln = w_disp_tab-vbeln.
endif.
endat.
endloop.
endform. " select_icons
*& Form fill_layout
fill ALV layout parameters
form fill_layout.
clear g_layout.
g_layout-colwidth_optimize = c_yes. " column width optimisation
g_layout-zebra = space. " alternate line colors
g_layout-box_fieldname = 'MARK'. " checkbox fieldname
g_layout-info_fieldname = 'COLOR'. " highlight row indicator
g_layout-no_vline = space. " vertical line
g_layout-key_hotspot = space. " hotspot field
g_layout-f2code = 'PICK'. " F2 ok_code
g_layout-numc_sum = c_yes. " sum numc fields
g_layout-box_tabname = 't_disp_head'. " checkbox table name
g_layout-expand_fieldname = 'EXPAND'. " expand field name
endform. " fill_layout
*& Form fill_sort
fill ALV sort table
form fill_sort.
data: w_g_sort type slis_sortinfo_alv.
w_g_sort-spos = 1.
w_g_sort-fieldname = 'LGTOR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 2.
w_g_sort-fieldname = 'VBELN'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 3.
w_g_sort-fieldname = 'POSNR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 4.
w_g_sort-fieldname = 'WADAT'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
endform. " fill_sort
*& Form fill_fieldcat
Fill field category structure for ALV
form fill_fieldcat.
clear t_fldcat.
create field catalogue for header table
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZWMR_PICK_STATUS_REPORT'
i_internal_tabname = 't_disp_head'
i_structure_name = 'ZPICKHEAD'
i_client_never_display = c_yes
changing
ct_fieldcat = gt_fieldcat[].
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ceate field catalogue for items table
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZWMR_PICK_STATUS_REPORT'
i_internal_tabname = 't_disp_tab'
i_structure_name = 'ZPICKDISP'
i_client_never_display = c_yes
changing
ct_fieldcat = gt_fieldcat[].
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
modify field catalogue for this report
set no display flag if not requested on selection screen
if p_exdata ne c_yes.
t_fldcat-no_out = c_yes.
modify gt_fieldcat from t_fldcat transporting no_out
where fieldname eq 'PACKVORSCHR'
or fieldname eq 'EXIDV'
or fieldname eq 'ZPALLET_NO'
or fieldname eq 'ZVAN_NO'
or fieldname eq 'ZZPACKCLASS'
or fieldname eq 'ZZTI'.
endif.
set no display flag for item level LGTOR field
t_fldcat-no_out = c_yes.
modify gt_fieldcat from t_fldcat transporting no_out
where fieldname eq 'LGTOR'
and tabname eq 't_disp_tab'.
prevent display of technical fields
t_fldcat-tech = c_yes.
modify gt_fieldcat from t_fldcat transporting tech
where fieldname eq 'EXPAND'
or fieldname eq 'SELKZ'.
set vbeln as key
t_fldcat-key = c_yes.
modify gt_fieldcat from t_fldcat transporting key
where fieldname eq 'VBELN'.
prevent scrolling for info fields
t_fldcat-fix_column = c_yes.
modify gt_fieldcat from t_fldcat transporting fix_column
where fieldname eq 'VBELN'.
endform. " fill_fieldcat
*& Form prepare_ALV
Fill ALV parameters
form prepare_alv.
fill ALV key info
g_keyinfo-header01 = 'LGTOR'.
g_keyinfo-item01 = 'LGTOR'.
fill ALV events
gs_event-name = 'TOP_OF_PAGE'.
gs_event-form = 'TOP_OF_PAGE'.
append gs_event to gt_events.
fill ALV sort table
perform fill_sort.
fill ALV layout structure
perform fill_layout.
fill ALV field category
perform fill_fieldcat.
endform. " prepare_ALV
*& Form user_command
form called on user command from ALV list
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
data: index type i,
w_disp_head like line of t_disp_head,
w_door like likp-lgtor.
clear r_lgtor. refresh r_lgtor.
case r_ucomm.
when 'PICK'. " Double click line
when 'VANM'. " Van Manifest button
read the header table where has been selected
loop at t_disp_head into w_disp_head where mark = c_yes.
r_lgtor-sign = 'I'.
r_lgtor-option = 'EQ'.
r_lgtor-low = w_disp_head-lgtor.
append r_lgtor.
endloop.
print the van manifest
perform print_van_manifest tables r_lgtor.
when 'EODM'. " EOD Manifest button
read the header table where has been selected
loop at t_disp_head into w_disp_head where mark = c_yes.
r_lgtor-sign = 'I'.
r_lgtor-option = 'EQ'.
r_lgtor-low = w_disp_head-lgtor.
append r_lgtor.
endloop.
print the end of day manifest
perform print_eod_manifest tables r_lgtor.
when 'REFR'. "Refresh
refresh display
w_sy_repid = sy-repid.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = w_sy_repid
tables
selection_table = seltab.
exceptions
not_found = 1
no_report
Maybe you are looking for
-
Trying to understand the basic concept of object oriented programming.
I am trying to understand the basic concept of object oriented programming. Object - a region of storage that define is defined by both state/behavior. ( An object is the actual thing that behavior affects.) State - Represented by a set of variables
-
EXS 'send to sampler' question.
OK so I've started doing remixes where I'm bringing all the audio into a project and using the new logic 9 'send to sampler' to chop up the beats etc. This is all great, but I also want these new sampler instruments to appear in my main EXS library s
-
So , I did not read that you cannot order more than 2 ipads. I ordered 3. One has been shipped. The third one is preparing for shipment. The second one , is still processing and hasnt been debited from the credit card. So has anyone experienced this
-
Phone is stuck on "Dual Core" Screen.
My phone is stuck on the "Dual Core" screen. It will not turn on or off. I've tried rebooting, had no luck. Was able to get to a FastBoot screen, but only tells me my phone is locked, then goes back to the "Dual Core" screen again. Help!
-
When will the htc one m8 get Android lollipop?
I really do want lollipop for my htc one m8 for certain apps and just having the latest update for android for the best support from users and company's.