Skip to Content

Error In Calling a screen from ALV Display


Hello Experts,

I have the following requirement,

I have to display the report using 'REUSE_ALV_GRID_DISPLAY'. After displaying the ALV , the ALV screen must have a button say 'B1', which i have done by creating a GUI. In ALV the fisrt column is a checkbox column, so whenever i select few rows by selecting the check box and click on that button it lead to new screen on which few messages will be written. For this i have created a form and gave that form in the FM as below,

i_callback_user_command = 'f_Form1'.

I have also created a new screen.

My Problem is whenever i select a checkbox and click on the button it is leadin to the new screen and even the title is getting displayed,but my messages that i write there are not getting displayed, furthur the function key in the screen used for back is also not working. I have coded the form as below,

FORM f_Form1 USING p_ucomm TYPE sy-ucomm rs_selfield TYPE slis_selfield.


CASE p_ucomm.
WHEN 'B1'.
DATA ref TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref.


CALL METHOD ref->check_changed_data.


LOOP AT gt_output INTO wa_output WHERE chkbox = 'X'.
MOVE-CORRESPONDING wa_output TO wa_create.
APPEND wa_create TO gt_create.
ENDLOOP.

IF gt_create IS NOT INITIAL.

CALL FUNCTION 'FM TO CREATE ORDER' ---> This is a customized FM to create order which is working fine
TABLES
t_flthdr = gt_create.

SET SCREEN 9001.
CALL SCREEN 9001.

LOOP AT gt_create INTO wa_create.
IF wa_create-zfltcd IS INITIAL.
WRITE: /'Creation is successful for order no:', wa_create-ZSRORD.
ELSEIF wa_create-zfltcd IS NOT INITIAL.
WRITE: /'Creation of is not successful'.
ENDIF.
ENDLOOP.


ELSEIF gt_create IS INITIAL.
MESSAGE e018(xxx) DISPLAY LIKE 'I'. --> This message will indicate to select a checkbox if user has not selected any.
ENDIF.

ENDCASE.

ENDFORM.

And in the PAI of the screen i have coded like this,Even this function key is also not working, I want the screen to leave to the previous page.

CASE sy-ucomm.
WHEN 'FC_BACK'.
LEAVE SCREEN.
ENDCASE.

Can you please guide me in rectifying these issues. Your immediate response is highly appreciated and am very thankful to you😊

Thanks and regards,

Satish Kumar Balasubramanian.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 09, 2014 at 04:58 AM

    Where are you writing your messages?

    You should write your message in the PBO of screen 9000 if you want it to appear there. Hope its done that way.

    Also just comment the set screen statement.

    call screen 9000.

    in the PBO of 9000, write the code to display your message

    In the PAI.

    when 'BACK'.

    leave to screen 0.

    will take you to the previous screen.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 05:06 AM

    Hi Satish,

    To display your custom message in the screen 9001, put your message coding into the PBO of the screen 9001.

    Make sure you have activated the SET PF-STATUS if not then

    For BACK button, uncomment the SET PF-STATUS, and actiavte it in PBO of 9001 also make sure you have put the FC_BACK under Function keys Standard toolbar .

    To come back to screen 900, write the code in PAI of 9001 as you have done like,

    IF sy-ucomm EQ 'FC_BACK'.

    LEAVE TO SCREEN 0.

    ENDIF.

    Debug your code and see whether the control is reaching to the message statement or not and also check the sy-ucomm value for back button click.

    Hope will resolve your issue.

    regards

    Syed

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2014 at 04:40 AM

    Hi Sathish,

    Can you check the modified data like below.

    IF REF_GRID IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = REF_GRID.
    ENDIF.

    IF NOT REF_GRID IS INITIAL.
    ***** To check whether the ALV Grid is Modified
    ***** And also to Modify the internal table based on Modification in ALV
    CALL METHOD REF_GRID->CHECK_CHANGED_DATA
    IMPORTING
    E_VALID = L_VALID.
    ENDIF.

    Also to go back write a code

    SET SCREEN 0.
    LEAVE PROGRAM.

    Arivazhagan S

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.