2008 Jul 25 7:30 PM
Hi Guys,
I have a small problem in ALV.
For my report output I have used ALV.
I used two function modules
1) REUSE_ALV_FIELDCATALOG_MERGE
2) REUSE_ALV_GRID_DISPLAY
My output every thing is fine.
My problem here is when I am pressing Back or Up arrow its not going back .Its again coming to the same output screen..
Can you guide me how to go to previous screen..
Thanks & Regards,
Sudheer.
2008 Jul 25 9:43 PM
Hi,
Drop the entire code, wil try to execute in my machine
Regards,
Venkatesh
Hi Guys,
I have a small problem in ALV.
For my report output I have used ALV.
I used two function modules
1) REUSE_ALV_FIELDCATALOG_MERGE
2) REUSE_ALV_GRID_DISPLAY
My output every thing is fine.
My problem here is when I am pressing Back or Up arrow its not going back .Its again coming to the same output screen..
Can you guide me how to go to previous screen..
Thanks & Regards,
Sudheer.
2008 Jul 25 7:32 PM
Hi ,
may be you dont have the GUI status activated in your program
Normaly for alv programs we wil be copying the GUI status from
SAPLKKBL program through the transaction SE41.
So you have to activate the gui status in your program
Then it will be solved.
Regards,
Venkatesh
2008 Jul 25 7:46 PM
2008 Jul 25 7:49 PM
check the sample code. if the problem still there post ur code.
REPORT ztest_alv_color.
TYPE-POOLS: slis.
DATA: BEGIN OF it_flight OCCURS 0,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
color TYPE lvc_t_scol,
END OF it_flight.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
layout TYPE slis_layout_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
DATA: col TYPE lvc_s_scol,
coltab TYPE lvc_t_scol,
color TYPE lvc_s_colo.
color-col = '6'.
color-int = '0'.
color-inv = '0'.
LOOP AT it_flight.
IF it_flight-seatsocc NE it_flight-seatsmax.
col-fname = 'SEATSOCC'.
col-color = color.
APPEND col TO coltab.
CLEAR col.
it_flight-color = coltab.
ENDIF.
MODIFY it_flight.
ENDLOOP.
layout-coltab_fieldname = 'COLOR'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
2008 Jul 25 7:51 PM
Hi ,
Goto SE41 tcode and then give
SAPLKKBL program name
and inthe status give STANDARD_FULLSCREEN
and then there will be button called Status. ( copy status )
after that you need to give your program name and
status name.
after that goto your program activate it.
And after that you need to give a small code
also
Have this
----
*& Form SET_PF_STATUS
&----
text
----
-->EXTAB text
----
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB. "#EC NEEDED
SET PF-STATUS 'ZSTANDARD1'. ENDFORM. "set_pf_status
and
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 = 'SET_PF_STATUS'
Then it will work fine.
regards,
Venkatesh
2008 Jul 25 8:40 PM
Hi Venkatesh I am getting syntax error for this.
there is no peform statement ..
so i have added perform statement like this
PERFORM SET_PF_STATUS
USING
EXTAB.
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM.
still getting error.
can u explain me in detail.
Thanks.....
2008 Jul 25 8:53 PM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
you dont need to use perform statement for that.
you have to use Form implementation with the name you mentioned in the above
but why you need this, Are you adding any extra buttons. if you dont want any buttons then you can use my above code and check .
FORM STATUS using extab type slis_t_extab.
set pf-status 'STANDARD' excluding extab.
ENDFORM.
2008 Jul 25 9:03 PM
Hi Vijay,
I am still getting the same error that the structure introduced by form must be closed by endform..
Any how i will send my code plz check this.
form alvoutput.
type-pools: slis.
data repid type sy-repid.
data: t_previewb type slis_t_fieldcat_alv,
events_b type slis_t_event.
repid = sy-repid.
FORM STATUS using extab type slis_t_extab.
set pf-status 'STANDARD' excluding extab.
ENDFORM.
if pa_fcode eq 'ECSP'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPID
I_INTERNAL_TABNAME = 'T_PREVIEW'
I_STRUCTURE_NAME = 'LFA1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = t_previewb
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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
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 = t_previewb
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = EVENTS_B
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN =
I_SCREEN_START_LINE =
I_SCREEN_END_COLUMN =
I_SCREEN_END_LINE =
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = t_preview
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.
elseif pa_fcode eq 'EVSP'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPID
I_INTERNAL_TABNAME = 'T_PREVIEWV'
I_STRUCTURE_NAME = 'LFA1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = t_previewb
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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
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 = t_previewb
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = EVENTS_B
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN =
I_SCREEN_START_LINE =
I_SCREEN_END_COLUMN ? =
I_SCREEN_END_LINE =
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = t_preview
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.
endif.
endform.
plz check this....
2008 Jul 25 9:10 PM
move this out of main form. this should be out of the form.
FORM STATUS using extab type slis_t_extab.
set pf-status 'STANDARD' excluding extab.
ENDFORM.one more Question why you want PF-status , are you adding any new buttons.
2008 Jul 25 9:37 PM
No Vijay,
I am not using any new buttons.
U can c my code above.
I am getting my output exactly,but when I am trying to click on BACK or UP Arrow symbol it not going back or not going to Exit from the screen.
Thanks & Regards,
Sudheer.
2008 Jul 25 9:08 PM
Hi,
you did a small mistake here
form alvoutput.
type-pools: slis.
data repid type sy-repid.
data: t_previewb type slis_t_fieldcat_alv,
events_b type slis_t_event.
repid = sy-repid.
FORM STATUS using extab type slis_t_extab.
set pf-status 'STANDARD' excluding extab.
ENDFORM.
here how can you write form inside a form
remove this
FORM STATUS using extab type slis_t_extab.
set pf-status 'STANDARD' excluding extab.
ENDFORM.
out and put it some other place.
nested forms are not allowed in SAP
regards,
Venkatesh
2008 Jul 25 9:43 PM
Hi,
Drop the entire code, wil try to execute in my machine
Regards,
Venkatesh
2008 Jul 25 9:54 PM
Hi Venkatesh,
RIght now I have added this PF-STATUS .
I dont know really what happened only the output is coming remaing screen is completely diabled.
I cannot give u the complete code bcoz for this ALV the data is coming from different table and different report programs.
This program is 3000 lines code .
I am really not understanding what to do?
huhhhhhhhhhhhhhh
Edited by: sudheer chowdhary on Jul 26, 2008 2:25 AM
2008 Jul 26 7:58 AM
Hi All,
Is there any solution for this...
My Back and Up Button in not working in ALV's.
Thanks........
2008 Jul 26 8:02 AM
I asked many times but you never responded to that.
why you need the PF-STATUS ? , You have any Custom Buttons in the ALV
otherwise you don't need the PF-STATUS , By Default ALV COmes up with its own status. and did you got a chance to check the Program i mentioned in My post.
you are telling it is not working, but not telling any thing beyond that what you are doing.
2008 Jul 26 8:16 AM
Hi Vijay,
In Fact there is no need of PF-STATUS.
I have desinged an alv report by using the two ALV FM's as I have mentioned .
I have linked this program to a seperate transaction.
When I go to that transaction and execute this I am getting my output correctly.
For coming back out of report output when I am pressing back button its again staying in the same screen.
This is the only problem I am facing...
2008 Jul 26 8:29 AM
Now it is clear.check this and let me know.
you can use user_command , not PF_STATUS &F03
REPORT ztest_alv.
TYPE-POOLS:slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_field LIKE LINE OF it_fieldcat.
DATA: BEGIN OF it_likp OCCURS 0,
vbeln TYPE likp-vbeln,
END OF it_likp.
wa_field-fieldname = 'VBELN'.
wa_field-tabname = 'IT_LIKP'.
wa_field-hotspot = 'X'.
APPEND wa_field TO it_fieldcat.
SELECT vbeln FROM likp
UP TO 10 ROWS
INTO TABLE it_likp.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_likp
EXCEPTIONS
program_error = 1.
*&---------------------------------------------------------------------*
*& Form user_Command
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->UCOMM text
* -->SELFIELD text
*----------------------------------------------------------------------*
FORM user_command USING ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN '&F03'. "<--this is for Back
selfeild-exit = 'X'.
leave to screen 0.
ENDCASE.
ENDFORM. "user_Command
2008 Jul 26 8:40 AM
Hi Vijay,
I have used the same .
Right now its working fine...
Thanks a lot Dude...
But Still I have a question why is the need of using this sy-ucomm.
The ALV Grid control itself should provide these functionalities.
Any way Thanks a lot .
2008 Jul 26 8:42 AM
It will handle when it is executed directly. But in your case you are calling from Transaction, that is not taking you back. So we handled that case.
2008 Jul 26 9:05 AM
2008 Jul 26 9:10 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |