Regarding BACK button in ALV OO ABAP
Hi ,
I have created two screens with containers, first screen displays records in ALV grid and when user selects one or more records and clicks on release button (which i have created ), it should update the database field and displays the status report on the next screen.
I have also done another functionality i.e., when user double clicks on a particular record, it should call the change order transaction(IW32).
Now, the problem is when i select few records and click on release and after the status report i.e.,the secon screen is getting displayed.after coming back to the first screen if i double click on the record, it is going to the respective transaction(IW32).but when i click 'BACK' button in IW32,it is not going back at one click.i need to press so many times.then it is coming back to the first screen.
Can anybody help me how to go back at one click.
Hi,
i thing the problem is in you internal table where you are selecting the record its still keeping the old selected record. you should refresh your internal table after first selection and than select for calling transaction.
Atul
Similar Messages
-
Dear All,
i have redefined the functionality of back button in ALV list display calling the FM popup_to_confirm....... but the problem is that the pop up is being generated twice in the program. can this be made to one.
regards
abhihi praveen,
You can check the value of sy-lsind on the click of back button and set its value to the previous list.
so what i mean to say is forcefully change the value of sy-lsind on click of back button to (sy-lsind - 1)
,this will take you to its parent list.
Hope this is helpful to you.
Abhishek. -
What is the constant name for Change layout Button in ALV Grid ABAP Objects
Dear All,
I have one query please help me.
what is the constant name for Change layout Button in ALV Grid ABAP Objects.
With Rgds,
BabuHalo Vinod,
The consant name is cl_gui_alv_grid=>mc_fc_current_variant.
Regards
Arshad -
Problem in Back Button in ALV report
Hi Team,
I have created a report which has a selection screen. Based on the input I am showing an ALV OO grid in my custom screen 0100. Now In the system toolbar on my 0100 screen I have enabled back, up and exit button. On click of which I am wrting 'LEAVE TO SCREEN 0. '
But it doesn't take me to the selection screen. Rather it throws me out of the transaction. Can anybody
suggest me a command so that when I click on back button it will take to the selection screen.
Thanks,
MainakHi,
Go through given program it is very usefull for you,
***Correct your program as follows...
PROGRAM rsolett1 MESSAGE-ID sy.
TYPE-POOLS: slis.
data: repid like sy-repid.
DATA: w_fieldcat TYPE slis_fieldcat_alv,
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: w_listheader TYPE slis_listheader,
t_listheader TYPE slis_t_listheader.
DATA: BEGIN OF t_output OCCURS 0,
slno TYPE char10,
name TYPE char10,
lino TYPE char10,
prof TYPE char10,
addr TYPE char10,
fanm TYPE char10,
plbu TYPE char10,
END OF t_output.
w_fieldcat-col_pos = 1.
w_fieldcat-fieldname = 'SLNO'.
w_fieldcat-seltext_m = 'SERIAL NUMBER'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 2.
w_fieldcat-fieldname = 'NAME'.
w_fieldcat-seltext_m = 'NAME'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 3.
w_fieldcat-fieldname = 'LINO'.
w_fieldcat-seltext_m = 'LICENCE NUMBER'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 4.
w_fieldcat-fieldname = 'PROF'.
w_fieldcat-seltext_m = 'PROFESSION'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 5.
w_fieldcat-fieldname = 'ADDR'.
w_fieldcat-seltext_m = 'ADDRESS'.
w_fieldcat-do_sum = 'X'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 6.
w_fieldcat-fieldname = 'FANM'.
w_fieldcat-seltext_m = 'FATHER NAME'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
w_fieldcat-col_pos = 7.
w_fieldcat-fieldname = 'PLBU'.
w_fieldcat-seltext_m = 'PLACE OF BUSSINESS'.
APPEND w_fieldcat TO t_fieldcat.
CLEAR w_fieldcat.
*PUPULATING TOP-OF-PAGE.
w_listheader-typ = 'H'.
w_listheader-info = 'FORMA'.
APPEND w_listheader TO t_listheader.
CLEAR w_listheader.
repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = ' '
i_callback_top_of_page = 'SUB_TOP_OF_PAGE'
it_fieldcat = t_fieldcat
i_default = 'X'
TABLES
t_outtab = t_output.
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZPFSTATUS'.
ENDFORM.
Edited by: Ganesh Modhave on Aug 12, 2008 1:06 PM
Thanks&Regards,
Naresh kumar -
Problem with back button in alv o/p
Hi guys,
I am using Grid display to display a data. but when i am clicking on back button on o/p the o/p is displaying duplicate records for the first o/p. i,e it is displaying multiple records, again clicking on back it displaying extended o/p with more duplicate data...Hi
Check did u refreshed the internal that u displayed.
And also check grid control is initial or not
Data: g_cust_container TYPE REF TO cl_gui_custom_container,
g_cust_grid TYPE REF TO cl_gui_alv_grid.
**Create Container ALV Grid
IF g_cust_grid IS INITIAL.
Create Control Container for Grid
CREATE OBJECT g_cust_container
EXPORTING
container_name = g_container.
IF sy-subrc <> 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = sy-repid
txt2 = sy-subrc
txt1 = text-m02. "The control could not be created.
ENDIF.
CREATE OBJECT g_cust_grid
EXPORTING
i_parent = g_cust_container.
ENDIF.
CALL METHOD g_cust_grid->refresh_table_display.
Regards,
Raghu. -
Hi All,
I have developed ALV report using grid layout.The user wanted that when he execute the report and click on refresh button the report data gets refreshed as report output is based on Z table and same Z table is updating through RFC interface continously.So this functionality is working for me but problem is that after click refresh 2 to 3 times then to come back to selection screen he has to click back button same number of times as refresh button click.
Could anybody help how I can come back to selection screen on single click after click refresh button.
Thanks&Regards,
SachinHi Sachin,
This is what Madhukar meant
On refresh button I am again fetching data and calling fieldcatlog and displaying report.
Do not call the fieldcatalog and function module again.
Get the new data into your internal table in user command event &
Just add refresh = 'X' in your user command event.
For example
FORM f_user_command USING UCOMM LIKE SY-UCOMM v_selfld TYPE slis_selfield.
if sy-ucomm = 'REF'.
PERFORM get_data.
selfld-refresh = u2018Xu2019.
endif.
ENDFORM.
Kesav -
Customised Back button in ALV loses selection screen parameters
Hi,
In my ALV output, the user interacts with the output. I had to program my own back button in the pf-status so that when the user hit back they didnt return to the original alv output. (if that makes sense)
I use LEAVE TO TRANSACTION 'ZZZZ' (user_command form) but the problem is that i lose all the selection parameters that the user has entered.
I have tried everything.........set screen 0, leave screen etc..........and searched the forum but cant find the answer.
Anyone know what i need i do..........
Cheers..........try submit ...
submit the report of ZZZZ tcode... with the selection parameters of your existing report....
e.g.
SUBMIT zbbp_sc_arch_initial_upload
VIA SELECTION-SCREEN
WITH p_r01 EQ p_r01
WITH p_r02 EQ p_r02
WITH p_mode EQ p_mode. -
Hi,
I created a custom refresh button in alv. However when user clicks on this, it opens the refreshed data in a new window. When i click on back, it takes me to the previous window having my original data. I want that it should take me to the main selection screen and not the previous screen.
Please help.
I am using ALV GRID DISPLAY.form USER_Command
case ok_code.
when 'BACK'.
call selection-screen '1000'. " or whatever ur selection-screen no. is , for standard it will b 1000
endcase.
endform. -
Back button in ALV oops with two screens
hi,
i have created the ALV report using oops concept. have kept the selection screen say 1000 and two more screens say 9001 and 9002.
when i click on back from 9002 screen it should go to 9001.Hello Sankumar
I assume your 2nd screen (9002) displays detailed data based on a selection of the first screen (9001).
Example: first ALV displays customers -> select single customer via double-clicking -> display sales orders on 2nd ALV
Furthermore, I assume you trigger the second screen within your event handler method. If this is the case then I regard this as bad design which is bound to cause problems.
Within the event handler method just store the required selection (e.g. customer number) and trigger PAI using:
CALL METHOD cl_gui_cfw=>set_new_ok_code( ok_code = 'DISPLAY_DETAILS' ).
This trigger PAI of your first screen with a defined ok-code (= 'DISPLAY_DETAILS' ).
Now you may call a FORM routine DISPLAY_DETAILS where you make the call to your second screen.
This allows you to use the normal PAI logic to switch back and forth between multiple screens.
Regards
Uwe -
Hi All,
Iam in the BP_HEAD overview screen there i have a navigation link which takes me to BP_HEAD of the particular BP selected.
Now when i try to come back to BP_HEAD overview screen the data in some of the assignement blocks(Z) is not refreshed.
These carrry the data of the BP that was being called.
Any hints /pointersHi Rajesh,
Could you please more specific about your question. What data is not refreshed, are you changing the data in the second view and first view data is lost..?
Are the Z-Assignment blocks got through AET..? if so, all AET fields get the data from BOL, so does takes care of refreshing automatically.
-satish -
Blank screen while pressing "Cancel" or "Back" button in Portal
Hi Experts,
We have a peculiar problem.
The user is trying to access time levelling report (which is a
iView) in MSS.
The user is getting the output of the report. When the user tries to press "back button" from the output screen (which is a SAP Transaction iView) the user is getting blank screen insted of report input screen.
Please suggest me some hints to resolve this.
Thanks
AbdulI was calling details screen( screen called from ALV) using call screen in double click event. I changed this to SET SCREEN 110.LEAVE SCREEN. Now my back button in ALV screen started working as expected.
Thanks for your answers.
Joby -
Problem with ALV Grid Display screen Back Button
Dear Friends ,
I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
Please Suggest if i have to take care of something else.
I want my Selection Screen when i press Back on my Display Screen.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
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 = I_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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
Thanks and Regards,
AshwiniHi Vijay ,
No i dont have any write statement in my proggram.
Here it is
REPORT ZRMMPD01A NO STANDARD PAGE HEADING.
TABLES : EQUI,SER03,MKPF,OBJK.
TYPE-POOLS : SLIS.
DATA IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
DATA IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
DATA IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
DATA : BEGIN OF IT_DISPLAY OCCURS 0,
MATNR LIKE EQUI-MATNR,
SERNR LIKE EQUI-SERNR,
BWART LIKE SER03-BWART,
WERK LIKE SER03-WERK,
CHARGE LIKE SER03-CHARGE,
LAGERORT LIKE SER03-LAGERORT,
MBLNR LIKE SER03-MBLNR,
MJAHR LIKE SER03-MJAHR,
ZEILE LIKE SER03-ZEILE,
BUDAT LIKE MKPF-BUDAT,
BKTXT LIKE MKPF-BKTXT,
USNAM LIKE MKPF-USNAM,
XBLNR LIKE MKPF-XBLNR,
END OF IT_DISPLAY.
DATA : WA_DISPLAY LIKE IT_DISPLAY.
DATA IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
START-OF-SELECTION.
*Fetch Data.
PERFORM GET_DATA.
*Fill Display Fields.
PERFORM FILL_TABLE.
*Segregate data according to radio button selection.
PERFORM SELECT_CONDITION.
*Fill The Feild catalog.
PERFORM FIELD_CATALOG.
*Display Output.
PERFORM OUTPUT_DISPLAY..
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA.
SELECT * FROM EQUI INTO TABLE IT_EQUI
WHERE MATNR IN S_MATNR
AND SERNR IN S_SERNR.
SELECT * FROM OBJK INTO TABLE IT_OBJK
FOR ALL ENTRIES IN IT_EQUI
WHERE EQUNR = IT_EQUI-EQUNR.
SELECT * FROM SER03 INTO TABLE IT_SER03
FOR ALL ENTRIES IN IT_OBJK
WHERE OBKNR = IT_OBJK-OBKNR
AND MBLNR IN S_MBLNR
AND BWART IN S_BWART
AND WERK IN S_WERK
AND LAGERORT IN S_LAGET.
SELECT * FROM MKPF INTO TABLE IT_MKPF
FOR ALL ENTRIES IN IT_SER03
WHERE MBLNR = IT_SER03-MBLNR
AND BUDAT IN S_BUDAT
AND XBLNR IN S_XBLNR.
ENDFORM. " GET_DATA
*& Form FILL_TABLE
text
--> p1 text
<-- p2 text
FORM FILL_TABLE.
LOOP AT IT_EQUI.
LOOP AT IT_OBJK.
IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
SKIP.
ELSE.
READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
IF SY-SUBRC = 0.
WA_DISPLAY-MATNR = IT_EQUI-MATNR.
WA_DISPLAY-SERNR = IT_EQUI-SERNR.
WA_DISPLAY-BWART = IT_SER03-BWART.
WA_DISPLAY-WERK = IT_SER03-WERK.
WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
IF SY-SUBRC = 0.
WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
WA_DISPLAY-USNAM = IT_MKPF-USNAM.
WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
ENDIF.
ENDIF.
ENDIF.
IF NOT WA_DISPLAY IS INITIAL.
APPEND WA_DISPLAY TO IT_DISPLAY.
CLEAR WA_DISPLAY.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. " FILL_TABLE
*& Form FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM FIELD_CATALOG.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MATNR'.
FIELDCAT-SELTEXT_M = 'Material Number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'SERNR'.
FIELDCAT-SELTEXT_M = 'Serial number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MBLNR'.
FIELDCAT-SELTEXT_L = 'Number of material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BWART'.
FIELDCAT-SELTEXT_M = 'Movement type'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'WERK'.
FIELDCAT-SELTEXT_M = 'Plant'.
FIELDCAT-OUTPUTLEN = 5.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'CHARGE'.
FIELDCAT-SELTEXT_M = 'Batch number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'LAGERORT'.
FIELDCAT-SELTEXT_M = 'Storage Location'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MJAHR'.
FIELDCAT-SELTEXT_M = 'Material doc. year'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'ZEILE'.
FIELDCAT-SELTEXT_L = 'Item in material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BUDAT'.
FIELDCAT-SELTEXT_L = 'Posting date in the document'.
FIELDCAT-OUTPUTLEN = 10.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BKTXT'.
FIELDCAT-SELTEXT_L = 'Document header text'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'USNAM'.
FIELDCAT-SELTEXT_M = 'User name'.
FIELDCAT-OUTPUTLEN = 15.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'XBLNR'.
FIELDCAT-SELTEXT_L = 'Reference document number'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. " FIELD_CATALOG
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT_DISPLAY.
IF R1 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_DISPLAY
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ELSEIF R2 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ENDIF.
ENDFORM. " DISPLAY_OUTPUT
*& Form SELECT_CONDITION
text
--> p1 text
<-- p2 text
FORM SELECT_CONDITION.
IF R2 = 'X'.
CLEAR WA_DISPLAY.
SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
IF SY-SUBRC = 0.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY.
IF WA_DISPLAY IS INITIAL.
WA_DISPLAY = IT_DISPLAY.
ENDIF.
LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
AND SERNR = WA_DISPLAY-SERNR.
IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
WA_DISPLAY = IT_DISPLAY.
ELSE.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
APPEND WA_DISPLAY TO IT_TEMP.
CLEAR WA_DISPLAY.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM IT_TEMP.
IF NOT IT_TEMP[] IS INITIAL.
IT_FINAL[] = IT_TEMP[].
ENDIF.
ENDIF.
ENDFORM. " SELECT_CONDITION
Regards,
Ashwini -
ALV problems, trying to click Back button, Filtering, download (Excel)
Hi
When I try to click Back button, Filtering or download (Excel) on ALV grid this dumps appear:
Runtime Error MOVE_TO_LIT_NOTALLOWED_NODATA
Error analysis
The program tried to assign a new value to the field "<L_BOX>" even though
it is protected against changes.
The following objects are protected:
- Character or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions
and methods
- Untyped field symbols to which a field has not yet been assigned
using ASSIGN
- TABLES parameters if the corresponding actual parameter is protected
against changes
- USING reference parameters and CHANGING parameters for FORMs if
the actual parameter for this is protected against changes
- Field symbols if the field assigned using ASSIGN or ASSIGNING
is protected against changes
- External write accesses to READ-ONLY attributes
- Key components of lines in internal tables of the type HASHED or
SORTED TABLE
SORTED TABLE.
Line SourceCde
681 * set/unset <box> of all items
682 if l_ucomm eq '&SAL' or l_ucomm eq '&ALL'.
683 if l_ucomm eq '&SAL'.
684 loop at t_outtab.
685 l_tabix = l_tabix + 1.
->>> <l_box> = ' '.
687 modify t_outtab index l_tabix.
688 endloop.
689 endif.
690 if l_ucomm eq '&ALL'.
691 loop at t_outtab.
692 l_tabix = l_tabix + 1.
693 <l_box> = 'X'.
694 modify t_outtab index l_tabix.
695 endloop.
696 endif.
What I must check on my ALV settings:
ch_alv_layout-zebra = 'X'.
ch_alv_layout-box_fieldname = 'SELE'.
ch_alv_layout-box_tabname = v_nametab.
ch_alv_layout-reprep = 'X'.
ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ch_alv_layout
it_fieldcat = ch_alv_fieldcat
it_sort = ch_alv_sortinfo
i_save = 'X'
it_events = ch_slis_event
TABLES
t_outtab = p_control
EXCEPTIONS
program_error = 1
OTHERS = 2.
Thanks in advance.ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
try commenting the above values.and also check the Fieldcatlog.
Check the issue similar issue was resolve by checking catalog and layout:
[ALV Issue solution|Re: Problem when export ALV.]
Regards,
Gurpreet -
Problem with the back button in the Alv ouput
i have refresh button in output of my alv report when i click on this it is getting refreshed ,now the problem is with the back button after refresh whn i click on back button it is not going to selection screen , i have to click the back button thrice to come out to the selection screen ,if have refreshed the ouput screen twice .
if i dont refresh the back button is working fine , So i have used "call to selection screen 1000" it coming to selection screen without any problem but in selection screen on clicking on back button it is again going back to output screen ,So please suggest what has to be done here .Hi Brahmananda,
Please try to understand the flow of program and the screen navigation
the click of BACK button triggers PAI and (to the best of my knowledge) you might have called the ALV screen number without any checks ( may be) so it is again taking to the ALV.
try using
in PAI
module exit at exit-command
in program
module exit
case ok_code
when 'BACK'.
LEAVE PROGRAM ( or any thing that you want it to be )
endcase
endmodule
regards
Ramchander rao.K -
Back button issue in ALV Grid(Factory method)
Hi All,
I have displayed a report using factory method(CL_SALV_TABLE).In that i have added buttons in application bar too.So when clicking on refresh button ALV should display again with latest number of records,that is working fine but when clicking on back button it should go to selection screen instead of that it is going a step back and displaying previous list of grid and then back and then selection screen.
Can any one help me how to directly go to input selection screen instead of going step back...
Regards,
RamHI,
Use this syntax (CALL SELECTION-SCREEN 1000)...Try this one
regards,
balaji
Maybe you are looking for
-
IPod won't show up on itunes or mac, freezes, and doesn't play bought songs
Okay i have four issues with my iPod 1. It won't show up on iTunes or on Mac desktop 2. When i plug it into the USB port it freezes and say 'Do Not Disconnect'. It will not come out of this 3. Every single song i have bought won't play on my iPod. Th
-
Hello to all! I wanted to know if somebody can help me with costs of OPM. I am working in a test instance and I will make inventory transactions: Purchase receptions, Transfer among werehauses, inventory adjustments. As well as, to report in WIP of p
-
How to connect i phone to i pad?
How do I connect my i phone to my i pad?
-
Adjusting second monitor brightness?
I'm currently playing around with a dual-monitor setup with my laptop and a crappy dell monitor, using xinerama : $ xrandr --output LVDS1 --mode 1280x800 --output VGA1 --mode 1280x1024 --right-of LVDS1 The only thing is that when I set the brightness
-
Why I get CRC error when copying outlook.ost file?
My workstation is using NTFS, Outlook 2007 with Exchange 2007 server. My outlook.ost file is 1.7GB. As my Outlook runs into problem, I tried to copy the outlook.ost file to another location for repair, but I keep getting CRC errors and the file was n