Gui Status Basic List
Hello,
I have a seleccion screen and after the user inputs the values i make a select and with that i make a list using the function Display_Basic_List. What i want to know is how i can change the gui status when the list shows up.
Thanks,
Ricardo
This may give you some idea.
data: fieldtab like dfies occurs 0 with header line.
* Field Catalog
data: begin of imarafc occurs 0,
fieldtext(50) type c,
end of imarafc.
* Data
data: begin of imaradt occurs 0.
include structure mara.
data: check(1) type c.
data: end of imaradt.
* Selected Records
data: begin of iseltab occurs 0.
include structure mara.
data: end of iseltab.
data: iconbutton(20) type c.
select-options: s_matnr for mara-matnr.
start-of-selection.
* Get Data
select * into corresponding fields of table imaradt
from mara
where matnr in s_matnr.
* Get the field table for table
call function 'GET_FIELDTAB'
exporting
langu = sy-langu
tabname = 'MARA'
withtext = 'X'
tables
fieldtab = fieldtab
exceptions
others = 1.
* Build field labels into field catalog
loop at fieldtab.
clear imarafc.
imarafc-fieldtext = fieldtab-fieldtext.
append imarafc.
endloop.
<b>* Build button 2
write icon_display as icon to iconbutton.
concatenate iconbutton 'Display' into iconbutton
separated by space.</b>
* Throw ALV
call function 'DISPLAY_BASIC_LIST'
exporting
basic_list_title = 'This is the title'
file_name = 'TEST'
head_line1 = 'This is heading 1'
head_line2 = 'This is heading 2'
* HEAD_LINE3 = ' '
* HEAD_LINE4 = ' '
foot_note1 = 'This is foot 1'
foot_note2 = 'This is foot 2'
* FOOT_NOTE3 = ' '
* LAY_OUT = 0
<b> dyn_pushbutton_text1 = 'Hey' " Buttons
dyn_pushbutton_text2 = iconbutton</b>
* DYN_PUSHBUTTON_TEXT3 =
* DYN_PUSHBUTTON_TEXT4 =
* DYN_PUSHBUTTON_TEXT5 =
* DYN_PUSHBUTTON_TEXT6 =
* DATA_STRUCTURE = ' '
current_report = 'ZRICH_0001' " Save Display Variant
* LIST_LEVEL = ' '
* ADDITIONAL_OPTIONS = ' '
* WORD_DOCUMENT =
* APPLICATION =
* OLDVALUES = ' '
* NO_ALV_GRID = 'X'
alv_marker = 'CHECK' " Selection field
* IMPORTING
* RETURN_CODE =
tables
data_tab = imaradt " Data
fieldname_tab = imarafc " Column Headings
select_tab = iseltab " Selected Rows
* ERROR_TAB =
* RECEIVERS =
* EXCEPTIONS
* DOWNLOAD_PROBLEM = 1
* NO_DATA_TAB_ENTRIES = 2
* TABLE_MISMATCH = 3
* PRINT_PROBLEMS = 4
* OTHERS = 5
<b> case sy-ucomm.
when 'BUT1'.
write:/ 'Button 1 was pressed'.
when 'BUT2'.
write:/ 'Button 2 was pressed'.
endcase.</b>
Regards,
RIch Heilman
Similar Messages
-
ALV grid to list processing and GUI status
Hi,
In a customized program the report output is in ALV grid which is interactive. On selecting a record and pressing SAVE button a BAPI runs in background. In order to display BAPI error message the leave to list-processing has been used. But GUI status is not working in list display and can not exit or go back from here to main selection screen.
when try to see program name & screen no it displays
Program - SAPLKKBL
Menu - STANDARD_FULLSCREEN
pls advise how to go back from list to main screen or ALV output.
thanks
anyaHi Anya,
As per my understanding, this is your prog flow:
*Main ALV Display.
*Select record.
*Click on Button SAVE.
*Handle Event.
*Call BAPI for processing based on selection.
Now at this point why dont you colect the error messages from the BAPI, and display it in a POP-UP ALV display?
You need not e very much worried about the PF status and all. Also this POP-UP will be placed on the MAIN ALV. So when you close the POP-UP it will come back to the main ALV.
By this when you press the BACK button of the main ALV, it will take you back to the selection scree.
Please let me know if i am missing something.
ags -
Report program with detail list and GUI status.
Hi,
I am working on type 1 program (report) and want to use detail lists.
I want to use a GUI status and want to use AT LINE-SELECTION. But AT LINE-SELECTION does not work when I use a GUI status.
How do I achieve this?
Thanks.Hi
In the secondary windows, it is not possible to have GUI Status.
If you need like that, you should go for ALV Reports.
Here, You can have GUI Status only in the selection-screen as below..
REPORT zak014 LINE-SIZE 60 LINE-COUNT 20(2).
TABLES: sscrfields.
* Appliction Tool Bar Elements
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
* Selection Screen
PARAMETERS: matnr TYPE matnr.
INITIALIZATION.
sscrfields-functxt_01 = 'TEST1'.
sscrfields-functxt_02 = 'TEST2'.
START-OF-SELECTION.
WRITE:/20 'CLICK HERE TO NAVIGATE'.
AT LINE-SELECTION.
WINDOW STARTING AT 5 5
ENDING AT 50 18.
CASE sy-lsind.
WHEN 1.
WRITE:/ 'This is First window'.
WHEN 2.
WRITE:/ 'This is second'.
ENDCASE.
TOP-OF-PAGE.
WRITE:/5 'LINE SELECTION'. -
Gui status (AT USER-COMMAND) trigger at first
Hello all,
I wrote a basic list shown below.
In it , AT USER-COMMAND and AT LINE-SELECTION events are used all.
when i double click on line in the list, I think the at line-selection should be trigger at first. but in fact ,the AT USER-COMMAND trigger.
and the sy-ucomm get the first button value in the GUI-STATUS BAR(There's only one button on it).
how can i solve it .
any answers should be appreciated.
START-OF-SELECTION.
SET PF-STATUS 'ZSATMM24F1'.
write : \ 'aaaaaaaaaaaa'
write : \ 'aaaaaaaaaaaa'
write : \ 'aaaaaaaaaaaa'
write : \ 'aaaaaaaaaaaa'
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'TO_a'.
PERFORM to_a.
ENDCASE.
AT LINE-SELECTION.
write : 'test'.
best regards,
daniel.Please make sure to add the fcode PICK to the F2 function code in your gui status and try again.
Regards,
Rich Heilman -
Hi
I want to set a button in basic list of a transaction,not an ALV.
I don't want to see the button in the detail list. How should i set this and where. Ideally where should pf-status be set in ?.
Answers will be rewarded.
Thanks
Varun Mathur
Edited by: Varun Mathur on Feb 12, 2008 7:42 AMHI,
check this program. in this the basic list has the gui and not the detail list...here the detail list is done using alv..dont worry abt that.
report z_banks1_rp1.
TABLE
tables : zacc_master2.
TYPE-POOLS
type-pools slis.
*INTERNAL TABLE
data : itab like zacc_master2 occurs 0 with header line.
data : itab1 like zacc_master2 occurs 0 with header line.
DATA
data : gt_fcat type slis_t_fieldcat_alv,
fcat like line of gt_fcat.
data : check type c length 1,
wa type c length 20.
select * from zacc_master2 into table itab.
write : ' ACCOUNT NUMBER' intensified color 3.
loop at itab.
write: / check as checkbox, itab-zaccno.
endloop.
hide : itab.
START OF SELECTION
start-of-selection.
set pf-status 'ZMBANKS1'.
AT LINE SELECTION
at line-selection.
AT USER-COMMAND
at user-command.
case sy-ucomm.
when 'SUBMIT'.
do.
read line sy-index field value check itab-zaccno into wa.
if sy-subrc <> 0.
exit.
elseif check = 'X'.
read table itab with key zaccno = wa.
if sy-subrc eq 0.
move-corresponding itab to itab1.
append itab1.
endif.
endif.
enddo.
CALLING SUB-ROUTINE
perform fieldcatalog.
CALLING FUNCTION MODULE
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
it_fieldcat = gt_fcat[]
tables
t_outtab = itab1.
when 'BACK'.
call screen 0002.
*WHEN 'BACK1'.
*CALL SCREEN 0002.
endcase.
SUB ROUTINE DECLARATION
form fieldcatalog.
fcat-seltext_l = 'ACCOUNT NUMBER'.
fcat-fieldname = 'ZACCNO'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'CUSTOMER ID'.
fcat-fieldname = 'ZCUSTID'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT TYPE'.
fcat-fieldname = 'ZACCTYPE'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT BALANCE'.
fcat-fieldname = 'ZBAL'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'ACCOUNT CREATED DATE'.
fcat-fieldname = 'ZACCDATE'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
fcat-seltext_l = 'STATUS'.
fcat-fieldname = 'ZSTAT'.
fcat-tabname = 'ITAB1'.
append fcat to gt_fcat.
endform.
Please reward if it is helpful.
regards,
sri -
Output screen basic list buttons
Hi frnds,
what are the steps to create buttons in the application toolbar in our output screen.
like i m getting sales header data in my basic list so in the output i m having a button which i press then i will get sales item details.
so can anyone help me how to create that button there in the ouput screen.
regards,
sanjayHi,
You can copy the GUI STATUS STANDARD of the program SAPLKKBL in SE41 and create a new one..
in that add a button in the application toolbar section..
Then use call back pf status parameter to pass the subroutine to display the gui status..
Then use call back subroutine parameter in the alv function module to give the subroutine name..
check this example for using double click to get the item details.
TYPE-POOLS: slis.
DATA: BEGIN OF itab1 OCCURS 0,
vbeln TYPE vbeln,
bstnk TYPE vbak-bstnk,
erdat TYPE vbak-erdat,
kunnr TYPE vbak-kunnr,
END OF itab1.
DATA: BEGIN OF itab2 OCCURS 0,
vbeln TYPE vbeln,
matnr TYPE vbap-matnr,
netpr TYPE vbap-netpr,
kwmeng TYPE vbap-kwmeng,
END OF itab2.
DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
* Get the fieldcatalog1
PERFORM get_fieldcat1.
* Get the fieldcatalog2
PERFORM get_fieldcat2.
SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
INTO TABLE itab1
FROM vbak.
IF NOT itab1[] IS INITIAL.
SELECT vbeln matnr netpr kwmeng UP TO 10 ROWS
INTO TABLE itab2
FROM vbap
FOR ALL ENTRIES IN itab1
WHERE vbeln = itab1-vbeln.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'DISPLAY_DETAIL'
it_fieldcat = t_fieldcatalog1
TABLES
t_outtab = itab1.
* FORM display_detail *
* --> UCOMM *
* --> SELFIELD *
FORM display_detail USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA: itab2_temp LIKE itab2 OCCURS 0 WITH HEADER LINE.
IF ucomm = '&IC1'.
READ TABLE itab1 INDEX selfield-tabindex.
IF sy-subrc = 0.
LOOP AT itab2 WHERE vbeln = itab1-vbeln.
MOVE itab2 TO itab2_temp.
APPEND itab2_temp.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = t_fieldcatalog2
TABLES
t_outtab = itab2_temp.
ENDIF.
ENDIF.
ENDFORM.
* FORM GET_FIELDCAT1 *
FORM get_fieldcat1.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-hotspot = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'BSTNK'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'BSTNK'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'ERDAT'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'KUNNR'.
APPEND s_fieldcatalog TO t_fieldcatalog1.
CLEAR s_fieldcatalog.
ENDFORM.
* FORM GET_FIELDCAT2 *
FORM get_fieldcat2.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'VBELN'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'MATNR'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'NETPR'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KWMENG'.
s_fieldcatalog-tabname = 'ITAB2'.
s_fieldcatalog-rollname = 'KWMENG'.
APPEND s_fieldcatalog TO t_fieldcatalog2.
CLEAR s_fieldcatalog.
ENDFORM.
Thanks
Naren -
ALV List Display With a Pushbutton in the basic list
i have displayed the po details in teh basic list. I have used the double clicking functionality. It worked well. Now instead of double clicking, i will place the cursor on the po and click a push button. then it should show the other details.
Can anyone please guide me how to create the pushbuttons on the basic list ?Hi,
You create your own GUI status.Pass the name of GUI status to FM REUSE_ALV_GRID_DISPLAY.
e.g.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
CALLBACKPF_STATUS_SET = 'PF'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = text-020
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = it_basic
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.
FORM PF.
SET PF_STATUS 'P1'.
ENDFORM.
On pressing that button go to secondary list. -
One basic list to 2 detail list .
HI Guru,
Is it possible to see 2 detail list from one basic list at same time in reports .
Eagerly waiting for your response.
Regards :
B.madhu sudhan reddy,
SAP Abap Tech.Hi,
You cannot create 2 interactive lists from a basic list.When you click on an interactive list you can create another interactive list.
This is because:-
from http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba2eb35c111d1829f0000e829fbfe/content.htm
Creating Detail Lists
Each time the user executes an action on a list, the runtime environment checks whether there is an event block defined that corresponds to the function code. If there is, SY-LSIND is automatically increased by one, and the relevant event block is executed. Any list output arising during this event block places its data into a new list (list level) with the index SY-LSIND. In order to create a new list level, the GUI status of the basic list must allow user actions, and the relevant event blocks must be defined in the program.
All lists created during an interactive list event are detail lists. Each interactive list event creates a new detail list. With one ABAP program, you can maintain one basic list and up to 20 detail lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. The user can interact with whichever list is currently displayed.
The system displays this list after processing the entire processing block of the event keyword or after leaving the processing block due to EXIT or CHECK. By default, the new list overlays the previous list completely. However, you can display a list in a dialog box. If no other dialog status is set in the event block for the detail list, the system uses the status from the previous list level. However, there is no standard page header for detail lists (see below). -
How to get GUI Status(Push Buttons) in ALV Report
Hi Friends
I have a requirement in a way that:
Once selection-screen was processed,an ALV report has to come and above the ALV List,I need a custom GUI Status(4 Push Button) with Push Buttons Logic.
Once I had clicks on thesse push button,I need to display one more ALV List and above this List,again I need a custom GUI Status(2 Push Buttons) with Push Buttons Logic.
Can anyone throw some light how we can achieve this.
Thanks for your cooperation!
Regards,
Madisettydata: rt_extab type slis_t_extab,
g_ucomm like sy-ucomm ,
g_selfield type slis_selfield.
form alv_display .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMM'
it_fieldcat = it_fldcat
tables
t_outtab = it_final1
perform pf_status using rt_extab.
perform user_comm using g_ucomm g_selfield .
endform.
form pf_status using p_rt_extab.
set pf-status 'PF_STATUS' excluding p_rt_extab.
endform.
form user_comm using p_ucomm like sy-ucomm
p_selfield type slis_selfield.
data: l_row type i.
case p_ucomm.
when 'DISPLAY_PO'.
loop at it_final1 into wa_final1.
if wa_final1-sel eq 'X' .
l_row = l_row + 1.
endif.
if l_row gt 1.
message e004.
endif.
clear wa_final1.
endloop.
p_selfield-fieldname = 'SEL'.
read table it_final1 into wa_final1 index p_selfield-tabindex .
set parameter id 'BES' field wa_final1-ebeln.
call transaction 'ME23N'.
endcase.
endform.
*create user interface for gui status by double clicking on 'PF_STATUS'.
*Check the above sample code . -
Interactive report basic list concept
Suppose in a basic list i have 7 parallel detail list.i am in basic list is there any way to go directly to 7 th detail list from basiclist or from 1st detail list to 7 th detail list vice-versa.
plz tell me..i am waiting.. for reply
thanx
aryaHi...
Just go through following code.... its for normal interactive reports...
TYPES : BEGIN OF st_kna1,
kunnr TYPE kna1-kunnr, "CUSTOMER NUMBER
name1 TYPE kna1-name1, "CUSTOMER NAME
END OF st_kna1.
TYPES : BEGIN OF st_vbak,
kunnr TYPE kna1-kunnr,
vbeln TYPE vbak-vbeln, "SALES DOCUMENT NUMBER
erdat TYPE vbak-erdat, "DATE ON WHICH THE RECORD WAS CREATED
audat TYPE vbak-audat, "DOCUMENT DATE
auart TYPE vbak-auart, "SALES DOCUMENT TYPE
ernam TYPE vbak-ernam, "NAME OF PERSON WHO CREATED THE OBJECT.
augru TYPE vbak-augru, "ORDER REASON
END OF st_vbak.
TYPES : BEGIN OF st_vbap,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr, "SALES DOCUMENT ITEM
matnr TYPE vbap-matnr, "MATERIAL NUMBER
charg TYPE vbap-charg, "BATCH NUMBER
matkl TYPE vbap-matkl, "MATERIAL GROUP
posar TYPE vbap-posar, "ITEM TYPE
END OF st_vbap.
DATA : it_kna1 TYPE STANDARD TABLE OF st_kna1,
it_vbak TYPE STANDARD TABLE OF st_vbak,
it_vbap TYPE STANDARD TABLE OF st_vbap,
wa_kna1 TYPE st_kna1,
wa_vbak TYPE st_vbak,
wa_vbap TYPE st_vbap.
DATA : v_fld(15),
v_kunnr TYPE kna1-kunnr,
v_vbeln TYPE vbak-vbeln.
SELECT-OPTIONS
PARAMETERS
SELECT-OPTIONS so_kunnr FOR v_kunnr. "CUSTOMER NUMBER
PARAMETERS : p_max TYPE i. "NUMBER OF HITS
START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_customerdata.
SET PF-STATUS 'MENU1'.
AT LINE-SELECTION
AT LINE-SELECTION.
IF sy-lsind = 1.
PERFORM get_salesheader.
ELSEIF sy-lsind = 2.
PERFORM get_salesitemdata.
ENDIF.
AT USER-COMMAND
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'DISP'.
PERFORM get_salesheader.
WHEN 'ITEM'.
PERFORM get_salesitemdata.
WHEN 'VA03'.
SET PARAMETER ID 'AUN' FIELD wa_vbak-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
TOP-OF-PAGE
TOP-OF-PAGE.
ULINE AT /1(56).
WRITE : /1 sy-vline ,
2(15) text-004 COLOR 1 ,
sy-vline ,
20(35) text-005 COLOR 1 ,
sy-vline.
ULINE AT /1(56).
TOP-OF-PAGE DURING LINE-SELECTION.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-lsind.
WHEN 1.
PERFORM get_topofpage1.
WHEN 2.
PERFORM get_topofpage2.
ENDCASE.
FORM GET_CUSTOMERDATA
FORM get_customerdata.
SELECT kunnr name1
FROM kna1
INTO TABLE it_kna1
UP TO p_max ROWS
WHERE kunnr IN so_kunnr.
IF sy-subrc EQ 0.
LOOP AT it_kna1 INTO wa_kna1.
WRITE : / sy-vline,
2(15) wa_kna1-kunnr ,
sy-vline ,
20 wa_kna1-name1,
sy-vline.
HIDE : wa_kna1-kunnr , wa_kna1-name1.
CLEAR wa_kna1.
ENDLOOP.
ULINE AT : /1(56).
ELSE.
MESSAGE w000(z50871msg).
ENDIF.
ENDFORM. "GET_CUSTOMERDATA
FORM GET_SALESHEADER
FORM get_salesheader.
SET PF-STATUS 'MENU2'.
GET CURSOR FIELD v_fld VALUE v_kunnr.
IF v_fld = 'WA_KNA1-KUNNR'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kunnr
IMPORTING
output = v_kunnr.
SELECT kunnr vbeln erdat audat auart ernam augru
FROM vbak
INTO TABLE it_vbak
WHERE kunnr = v_kunnr.
IF sy-subrc EQ 0.
LOOP AT it_vbak INTO wa_vbak.
WRITE : / sy-vline ,
2(22) wa_vbak-vbeln ,
sy-vline,
27(25) wa_vbak-erdat ,
sy-vline ,
55(15) wa_vbak-audat ,
sy-vline ,
73(15) wa_vbak-auart ,
sy-vline,
91(16) wa_vbak-ernam ,
sy-vline,
109(13) wa_vbak-augru,
123 sy-vline.
HIDE : wa_vbak-vbeln.
CLEAR wa_vbak.
ENDLOOP.
ULINE AT : /1(123).
ELSE.
MESSAGE i015(z50871msg).
ENDIF.
ELSE.
MESSAGE i013(z50871msg).
ENDIF.
ENDFORM. "GET_SALESHEADER
FORM GET_SALESITEMDATA
FORM get_salesitemdata.
SET PF-STATUS space.
GET CURSOR FIELD v_fld VALUE v_vbeln.
IF v_fld = 'WA_VBAK-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_vbeln
IMPORTING
output = v_vbeln.
SELECT vbeln posnr matnr charg matkl posar
FROM vbap
INTO TABLE it_vbap
WHERE vbeln = v_vbeln.
LOOP AT it_vbap INTO wa_vbap.
WRITE : /1 sy-vline,
2(13) wa_vbap-posnr ,
sy-vline,
18(18) wa_vbap-matnr ,
sy-vline,
40(13) wa_vbap-charg ,
sy-vline,
56(16) wa_vbap-matkl ,
sy-vline,
75 wa_vbap-posar,
112 sy-vline.
CLEAR wa_vbap.
ENDLOOP.
ULINE AT : /1(112).
ELSE.
MESSAGE i014(z50871msg).
ENDIF.
ENDFORM. "GET_SALESITEMDATA
FORM GET_TOPOFPAGE1
FORM get_topofpage1.
ULINE AT : /1(123).
WRITE : / sy-vline ,
2 text-000 ,
wa_kna1-kunnr ,
75 text-001 ,
wa_kna1-name1,
123 sy-vline.
ULINE AT : /1(123).
WRITE : / sy-vline ,
2(22) text-006 COLOR 1,
sy-vline,
27(25) text-007 COLOR 1 ,
sy-vline ,
55(15) text-008 COLOR 1 ,
sy-vline ,
73(15) text-009 COLOR 1 ,
sy-vline,
91(16) text-010 COLOR 1 ,
sy-vline,
109(13) text-011 COLOR 1,
123 sy-vline.
ULINE AT : /1(123).
ENDFORM. "GET_TOPOFPAGE1
FORM GET_TOPOFPAGE2
FORM get_topofpage2.
ULINE AT : /1(112).
WRITE : / sy-vline ,
2 text-000 ,
wa_kna1-kunnr ,
35 text-001 ,
wa_kna1-name1 ,
85 text-003 ,
wa_vbak-vbeln ,
112 sy-vline.
ULINE AT : /1(112).
WRITE : /1 sy-vline,
2(13) text-012 COLOR 1,
sy-vline,
18(18) text-013 COLOR 1 ,
sy-vline,
40(13) text-014 COLOR 1 ,
sy-vline,
56(16) text-015 COLOR 1 ,
sy-vline,
75 text-016 COLOR 1 ,
112 sy-vline.
ULINE AT : /1(112).
ENDFORM. "GET_TOPOFPAGE2
Thanks,
Naveen.I -
Hi frieds,
I wants to display a list of record in basic list and also one chek box for every record.
Then based on selected check box i want to cancel that record in database means i want to set it's flag. also in application toolbar of basic list display cancel button.
can any one gives me code for this.
Thank you.
Regards,
ViratHi
See the sample example code
and do accordingly
TABLES:MARA.
DATA:BEGIN OF GT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF GT_MARA,
GV_CB,
GV_CBV,
GV_LINES TYPE I,
INDEX TYPE I,
SY_INDEX TYPE I,
GV_LINES1 TYPE I,
MATNR LIKE MARA-MATNR.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT
MATNR FROM MARA
INTO TABLE GT_MARA
WHERE MATNR IN S_MATNR.
IF SY-SUBRC = 0.
DESCRIBE TABLE GT_MARA LINES GV_LINES.
ENDIF.
LOOP AT GT_MARA.
WRITE:/ GV_CB AS CHECKBOX,
GT_MARA-MATNR.
ENDLOOP.
CLEAR GT_MARA.
WRITE:'Total num of records is ',GV_LINES.
SET PF-STATUS 'DEL'.
AT USER-COMMAND.
IF SY-UCOMM = 'DEL' OR SY-UCOMM = 'PICK'.
DO 50 TIMES.
SY_INDEX = SY-INDEX.
READ LINE SY_INDEX FIELD VALUE GV_CB
GT_MARA-MATNR INTO MATNR.
IF GV_CB = 'X'." AND MATNR IS NOT INITIAL.
LOOP AT GT_MARA." WHERE MATNR = MATNR.
DELETE GT_MARA.
CLEAR GT_MARA.
ENDLOOP.
delete gt_mara index sy_index.
ENDIF.
ENDDO.
DESCRIBE TABLE GT_MARA LINES GV_LINES1.
WRITE:'Total num of records is ',GV_LINES1.
CLEAR:GV_LINES .
LOOP AT GT_MARA.
WRITE:/ GT_MARA-MATNR.
ENDLOOP.
ENDIF.
Reward points for useful Answers
Regards
Anji -
Hi,
I had created GUI status for output list in one report. its status is active in program but in report output this created status is not activated (Menu bar, application toolbar). Has anybody face this kind of problem before?
Regards,
Diliphi,
use command
SET GUI-STATUS 'menu1' -> double click on menu1 ->select menu bar radio button from available radio buttons -> click on expand butt0n -> select required buttons n give function codes n select user-command optionfor those buttons ->activate -> back ->activate the report prgm.
i think in our case you didn't activated the menu painter screen. check it once n dont forget to assign f.code n to give user-command after giving static text for buttons that u will use in prgm.
if helpful reward some points.
with regards,
suresh babu aluri. -
Hai i copied standard gui status in my alv report.
i hav req. to do..when i click on exit(%EX) and cancel(RW)it should appear pop-up window..with two buttons "do u want to exit". if yes..should exit the report and if no..continue with current screen.
i have 6 secondary lists..should i write the code in all the 6 ucomm(s) or only once is needed.?
plz give me code for this.??hai check my code...i added like this. its not working
FORM usecomm USING ucomm LIKE sy-ucomm fields TYPE slis_selfield.
case sy-ucomm.
when '%EX' OR 'RW'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'EXIT'
DIAGNOSE_OBJECT = ' '
text_question = 'Do u want to exit?'
TEXT_BUTTON_1 = 'Ja'(001)
ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Nein'(002)
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IMPORTING
ANSWER =
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 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.
endcase.
CASE ucomm.
WHEN '&IC1'.
IF fields-fieldname = 'SALES_OFF'.
READ TABLE tbl_basic_list INDEX fields-tabindex.
SELECT vkgrp FROM s707
INTO TABLE tbl_first_list
FOR ALL ENTRIES IN tbl_basic_list
WHERE vkbur EQ tbl_basic_list-vkbur
AND vkbur EQ fields-value.
SELECT bezei FROM tvgrt INTO CORRESPONDING FIELDS OF TABLE
tbl_first_list WHERE vkgrp = tbl_first_list-vkgrp AND
spras = sy-langu.
SELECT avkgrp bbezei INTO CORRESPONDING FIELDS OF TABLE
tbl_first_list FROM s707 AS a INNER JOIN tvgrt AS b
ON avkgrp = bvkgrp
WHERE b~spras = sy-langu
AND a~vkbur = fields-value.
DELETE ADJACENT DUPLICATES FROM tbl_first_list.
APPEND tbl_first_list.
IF NOT tbl_first_list IS INITIAL.
LOOP AT tbl_first_list.
CONCATENATE tbl_first_list-vkgrp '-'
tbl_first_list-bezei INTO
tbl_first_list-sgroup
SEPARATED BY space.
concatenate tbl_first_list-vkgrp+0(1)
tbl_first_list-vkgrp+2(1) into
tbl_first_list-sort.
MODIFY tbl_first_list INDEX sy-tabix.
ENDLOOP.
ENDIF.
ELSE.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = repid
txt1 = sy-subrc
txt2 = 'No data found!'
TXT3 = ' '
TXT4 = ' '
ENDIF.
PERFORM fcat_first_list.
PERFORM fieldcat_sort USING gs_sort[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USECOMM1'
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 = layout
it_fieldcat = fcat1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gs_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = events1[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = tbl_first_list
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.
CASE sy-subrc.
WHEN '1'.
MESSAGE s000.
WHEN OTHERS.
MESSAGE s001.
ENDCASE.
ENDIF.
ENDCASE.
ENDFORM.
Make corrections...it's not working here -
Refresh Classical report/basic list
Hi,
I have created a classical report/basic list where user can select check boxes and adjacent rows should be deleted. But after the action, I wish to refresh the report and remove the selected lines from displaying.
Please let me know how to achieve this.
Thanks in advance.
NitinHi Nitin,
Check the following program.
Here on pressing the delete push button(FCODE: DELETE) it will delete all
rows which has adjacent checkboxes checked.
REPORT ztest_list_processing NO STANDARD PAGE HEADING .
TYPES: BEGIN OF ty_tab,
delete,
f1(3) TYPE c,
f2(3) TYPE c,
f3(3) TYPE c,
END OF ty_tab.
DATA: it_tab TYPE TABLE OF ty_tab,
wa_tab TYPE ty_tab.
DATA: w_delete TYPE c,
w_lines TYPE i,
w_ind TYPE i.
wa_tab-f1 = '111'.
wa_tab-f2 = 'ABC'.
wa_tab-f3 = '123'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '222'.
wa_tab-f2 = 'DEF'.
wa_tab-f3 = '456'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '333'.
wa_tab-f2 = 'GHI'.
wa_tab-f3 = '789'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '444'.
wa_tab-f2 = 'JKL'.
wa_tab-f3 = '987'.
APPEND wa_tab TO it_tab.
wa_tab-f1 = '555'.
wa_tab-f2 = 'MNO'.
wa_tab-f3 = '654'.
APPEND wa_tab TO it_tab.
SET PF-STATUS '100'. "Contains Delete button
PERFORM print_output.
"Logic which you can implement
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'DELETE'.
DESCRIBE TABLE it_tab LINES w_lines.
DO w_lines TIMES. "To read all rows
CLEAR: wa_tab.
READ LINE w_ind FIELD VALUE wa_tab-delete
wa_tab-f1. "Getting the values
IF wa_tab-delete EQ 'X'. "Delete when check box is 'X'
DELETE it_tab WHERE f1 = wa_tab-f1.
ENDIF.
ADD 1 TO w_ind."Index for next line
ENDDO.
IF it_tab IS INITIAL.
WRITE: / 'There are no data in the table'.
ELSE.
PERFORM print_output. "Reprint the updated data(like refreshing)
ENDIF.
"Modified the existing Back button in standard Toolbar so that on
"pressin the back button it will come to program and not to
"previous displayed list
WHEN '&BACK'.
LEAVE SCREEN.
ENDCASE.
*& Form print_output
* text
* --> p1 text
* <-- p2 text
FORM print_output.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-delete AS CHECKBOX INPUT ON, "Display as checkbox
wa_tab-f1,
wa_tab-f2,
wa_tab-f3.
IF sy-tabix EQ 1.
w_ind = sy-linno. "Get the line position of first row
ENDIF.
ENDLOOP.
Hope this helps you.
Regards,
Manoj Kumar P -
Listbox-Output possible in application toolbar of GUI-status ?
Hi all,
does anybody know, if (and how) it is possible to integrate a listbox element to chose values from in the toolbar of a GUI-status?
Thanks in advance
Andreas FlügelHello Andreas,
No, it is not possible to have a list box on the application toolbar. And I'm sure about it
Regards,
Anand Mandalika.
Maybe you are looking for
-
Book no longer visible in Projects tab of Inspector - How do I get it back?
Something happened in a Time Machine backup and although the project I was working on is still visible in the "project tab" of Inspector, the book I designed and printed two days ago is no longer visible. I also had a folder with the photos I was usi
-
Migrate oracle 9i to essbase 6.5
Hi all, I want to migrate from oracle to essbase.what are the steps need for this?
-
Problem signing up for Cloud trial...
I signed up for the 30 day trial of Oracle's cloud service, but after almost 2 hours I still haven't received the required email to complete the process. I can sign in and see that the database was initialized, but still no email. I tried to get some
-
Hello, am using the following script to parse OCSP Logs(ADCS), which is resulting fine. but am not satisfied with the speed of parsing - any one can help me to make it quick or other alternative way. on Error resume Next Set objFS = CreateObject("Scr
-
Enabling Digial I/O Module on Audigy
I am sorta suprised that there is not more documentation on enabling Digital I/O on the Audigy 2 besides where to plug it in on the card? I recently purchased a set of surround sound head phones that have coaxial and optical inputs so I purchased the