Printout from screen painter

Hi,
From the ABAP program am getting the input and fetch the value from the table and passing to Screen painter by 'call screen' command. The screen have some standard formats, again I have to give some input value and validate against already fetch the value from the table. If the validation is correct means I have to print the screen as displaying in the screen.
But when I click the print icon at the output screen I can get the printout of  input screen of the ABAP program.
How can I print the output from  screen painter?
My program is as blow:
Parameters:
               pr_wrk like vbrp-werks obligatory,
               pr_vbl like vbrk-vbeln obligatory,
               pr_mat like vbrp-matnr obligatory,
               pr_lsz(10) type n.
select ..... from vbrk
      where vkorg eq pr_wrk
      and   vbeln eq pr_vbl.
select ....
compute
call screen 103
module user_command_0103 input.
  line_count = sy-loopc.
  data : ok_code like sy-ucomm.
  case ok_code.
    when 'PRINT'.
      call function 'GET_PRINT_PARAMETERS'
        exporting
          destination            = 'LOCL'
          copies                 = count
          list_name              = 'TEST'
          list_text              = 'PDI OS'
          immediately            = 'X'
          release                = 'X'
          new_list_id            = 'X'
          expiration             = days
          line_size              = 70
          line_count             = 55
          layout                 = 'X_65_80'
          sap_cover_page         = 'X'
          cover_page             = 'X'
          receiver               = 'SAP*'
          department             = 'System'
          sap_object             = 'RS'
          ar_object              = 'TEST'
          archive_id             = 'XX'
          archive_info           = 'III'
          archive_text           = 'Description'
          no_dialog              = ' '
        importing
          out_parameters         = params
          out_archive_parameters = arparams
          valid                  = valid.
      if valid <> space.
        submit zpdi_report using selection-set 'DATA' to sap-spool
          spool parameters params
          archive parameters arparams
          without spool dynpro.
      endif.
Kindly help me.
Regards,
S. John

Assuming the call to 'GET_PRINT_PARAMETERS' is successful (you did not check the return code), then you need to use
IF VALID EQ 'X'.

Similar Messages

  • How to show screen design in .srf (from Screen Painter) using SDK?

    How to show screen design in .srf (from Screen Painter) using SDK?

    You need to use the LoadBatchActions method of the Application object to load .SRF files.
    John.

  • How to delete invisible fields from screen painter SE51?

    Dear all,
    How to delete/remove invisible fields from screen painter SE51?
    Thanks.

    HI,
    just go to screen painter-->layout in change mode.
    the invisible fields will be looking faded
    click on that and press the DEL button.
    that will be deleted.
    <b><REMOVED BY MODERATOR></b>
    vivekanand
    Message was edited by:
            Alvaro Tejada Galindo

  • How to enter values in ztable from screen painter

    Hi guys,
    I have a scenario,where i have to enter values in ztable for the values entered in  screen painter.The screen painter is supposedly having 10 columns. i enter the value in the grid(table) and when i save, the records have to be inserted into ztable created by me. how to go through the problem. kindly help in  giving a flow for the problem .If anybody has gone through this scenario please help out.
    Thankx in advance
    Regards
    Navin

    if ur entering one record at a time from sreen to table then
    u have to use ,
    in pai module of the screen u have to code,
    case sy-ucomm.
    when 'SAVE'.
    ztable-roll = ztable-roll.
    ztable-name = ztable-name.
    insert ztable/modify ztable.
    ENDCASE.
    if ur screen is having a table control
    then u have to create a loop inside a module.
    like
    loop at tabcontrol_name
    module insert_data.
    endloop.
    and in the doubleclked module,
    move-corresponding ztable to ztable.
    insert ztable.
    Note : in both cases u have selected input fields as from
    table/dictionary in the screen.
    Regards

  • Call alv from screen painter

    hello all expert,
    i have requirement display alv report in screen painter. select options and report display on same screen.
    iam taking custom control for display alv report .but when i click on button alv not displayed in custom control.
    plz help me anyone /
    there is no hurry.
    Thanks in advance,
       sandeep.
    Edited by: Thomas Zloch on Jan 22, 2011 1:00 PM - urgency reduced

    Thanks for reply ,
    now i write my code in  pbo and pbi event but report not displayed yet.
    now this is the code.
    *& Report  ZTEST_SCREEN1                                               *
    REPORT  ZTEST_SCREEN1                           .
    DATA :
      gr_EBELN TYPE RANGE OF EKKO-EBELN,
      grs_EBELN LIKE LINE OF gr_EBELN.
    DATA:
      gs_fieldcatalog TYPE lvc_s_fcat OCCURS 0,
      gv_fcat LIKE LINE OF gs_fieldcatalog,
      gs_layout TYPE lvc_s_layo.
    TYPES :
      BEGIN OF gty_item,
        mandt LIKE EKKO-mandt,
        EBELN LIKE EKKO-EBELN,
        lifnr LIKE EKKO-lifnr,
        matnr LIKE EKPO-matnr,
       desc_text LIKE zEKPO-desc_text,
      END OF gty_item,
      BEGIN OF gty_EKKO,
        mandt LIKE EKKO-mandt,
        EBELN LIKE EKKO-EBELN,
        lifnr LIKE EKKO-lifnr,
      END OF gty_EKKO,
      BEGIN OF gty_EKPO,
        EBELN LIKE EKPO-EBELN,
        matnr LIKE EKPO-matnr,
      END OF gty_EKPO.
    DATA :
      gs_item TYPE gty_item,
      gt_item TYPE TABLE OF gty_item.
    DATA :
      gs_EKKO TYPE gty_EKKO,
      gt_EKKO TYPE TABLE OF gty_EKKO,
      gs_EKPO TYPE gty_EKPO,
      gt_EKPO TYPE TABLE OF gty_EKPO.
    DATA :
      g_Container TYPE scrfname VALUE 'CC_CONTAINER_GRID',
      g_Custom_Container TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      g_Grid TYPE REF TO CL_GUI_ALV_GRID.
    DATA :
      OK_CODE LIKE sy-ucomm,
      SAVE_OK LIKE sy-ucomm.
    START-OF-SELECTION.
    call screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN'.
      SET TITLEBAR 'TITLE'.
      IF g_Custom_Container IS INITIAL.
    "Create CONTAINER object with reference to container name in the screen
        CREATE OBJECT g_Custom_Container EXPORTING CONTAINER_NAME =
        g_Container.
        " Create GRID object with reference to parent name
        CREATE OBJECT g_Grid EXPORTING I_PARENT = g_Custom_Container.
        PERFORM u_prepare_fieldcatalog.
        gs_layout-ZEBRA = 'X'.
        "gs_layout-edit = 'X'. " Makes all Grid editable
        " SET_TABLE_FOR_FIRST_DISPLAY
        CALL METHOD g_Grid->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
            is_layout = gs_layout
          CHANGING
            it_fieldcatalog = gs_fieldcatalog
            IT_OUTTAB = gt_item. " Data
      ELSE.
        CALL METHOD g_Grid->REFRESH_TABLE_DISPLAY.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
        WHEN 'EXIT' OR 'BACK' OR 'CNCL'.
          LEAVE PROGRAM.
        WHEN 'LIST'.
          PERFORM u_filter_EKKO.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  u_filter_EKKO
          text
    -->  p1        text
    <--  p2        text
    FORM u_filter_EKKO .
         REFRESH gt_EKKO.
      Define Range Criteria
      grs_EBELN-SIGN   = 'I'.
      grs_EBELN-OPTION = 'EQ'.
    grs_EBELN-low    = '6000000004'.
    grs_EBELN-high   = ekko-ebeln.
      APPEND grs_EBELN to gr_EBELN.
    CHECK gr_EBELN[] IS NOT INITIAL.
      SELECT mandt EBELN kunnr
        FROM EKKO INTO TABLE gt_EKKO
        WHERE EBELN IN gr_EBELN.
      CHECK gt_EKKO[] IS NOT INITIAL.
      SELECT EBELN matnr
        FROM EKPO INTO TABLE gt_EKPO
        FOR ALL ENTRIES IN gt_EKKO
        WHERE EBELN EQ gt_EKKO-EBELN.
      IF gt_EKKO[] IS NOT INITIAL.
        LOOP AT gt_EKPO INTO gs_EKPO.
          READ TABLE gt_EKKO INTO gs_EKKO WITH KEY EBELN = gs_EKPO-EBELN.
          gs_item-mandt = gs_EKKO-mandt.
          gs_item-EBELN = gs_EKKO-EBELN.
          APPEND gs_item TO gt_item.
          CLEAR gs_item.
          CLEAR gs_EKKO.
          CLEAR gs_EKPO.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " u_filter_EKKO
    FORM U_PREPARE_FIELDCATALOG .
      CLEAR gv_fcat.
      gv_fcat-fieldname = 'MANDT'.
      gv_fcat-tabname = 'EKPO'.
      gv_fcat-col_pos = 0.
      gv_fcat-coltext = 'MANDT'.
      gv_fcat-no_out = 'X'. " Do not Display Column
      INSERT gv_fcat INTO TABLE gs_fieldcatalog.
      CLEAR gv_fcat.
      gv_fcat-fieldname = 'EBELN'.
      gv_fcat-tabname = 'EKPO'.
      gv_fcat-col_pos = 1.
      gv_fcat-coltext = 'EBELN'.
      INSERT gv_fcat INTO TABLE gs_fieldcatalog.
      CLEAR gv_fcat.
      gv_fcat-fieldname = 'ERDAT'.
      gv_fcat-tabname = 'EKPO'.
      gv_fcat-col_pos = 2.
      gv_fcat-coltext = 'ERDAT'.
      INSERT gv_fcat INTO TABLE gs_fieldcatalog.
      CLEAR gv_fcat.
      gv_fcat-fieldname = 'KUNNR'.
      gv_fcat-tabname = 'EKPO'.
      gv_fcat-col_pos = 3.
      gv_fcat-coltext = 'KUNNR'.
      INSERT gv_fcat INTO TABLE gs_fieldcatalog.
      CLEAR gv_fcat.
      gv_fcat-fieldname = 'MATNR'.
      gv_fcat-tabname = 'EKPO'.
      gv_fcat-col_pos = 5.
      gv_fcat-coltext = 'MATNR'.
      INSERT gv_fcat INTO TABLE gs_fieldcatalog.
    ENDFORM. " U_PREPARE_FIELDCATALOG

  • How to add a search help on a screen field from screen painter

    Hi,
    I would like to add an existing Search Help on a screen field in Screen painter.
    Of course it's possible to just click on th screen field and in the property box, I just have to set the name of teh search help.
    The problem is that I need the screen field to be grey and user musn't be able to change the field value if he doens't use the search help.
    I'm not allowed to modify the existing search help or to built it on my own from source code, I must use the existing one.
    Do you have an idea on how to do so?
    Regards,
    Morgan

    Dropdown Box:
    In the screen painter for that field goto properties -> Dropdown ->select listbox.
    Option 1:
    Instead let that field be in change mode and if user enters any wrong entry which is not there in the table give a error messgae.
      CHAIN.
        FIELD addr1_data-country.
        MODULE modify_screenfields1.
      ENDCHAIN.
    MODULE modify_screenfields1 INPUT.
      CASE sy-ucomm.
        WHEN 'ENTER' OR 'EXECUTE'.
          IF NOT addr1_data-country IS INITIAL.
            SELECT SINGLE landx FROM t005t INTO lws_landx WHERE
                                          land1 = addr1_data-country
                                      AND spras = 'EN'.
            IF sy-subrc <> 0.
              MESSAGE e000(zo_spa) WITH text-022.  " Invalid Country code
            ELSE.
              t005t-landx = lws_landx.
            ENDIF.
          ELSE.
            CLEAR: t005t-landx.
          ENDIF.
       ENDCASE.
    ENDMODULE.                 " modify_screenfields1  INPUT
    Option 2: Other than if u want the way u like, let that field be greyed out. don't attach the search help.
    In the PROCESS ON VALUE-REQUEST.
      FIELD addr1_data-region MODULE region_pov.
    MODULE region_pov INPUT.
    Using the F4IF_INT_TABLE_VALUE_REQUEST table value request show the search help.
    also make that field input enabled.
    ENDMODULE.                 " region_pov  INPUT
    I think this will solve ur problem.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • Problem in creating selection screen from screen painter

    hi ,
          i am working with screens i have created a screen and in that wehn i click report button it has to ask for select options for dates.from there i will write a select quesry based on selection dates ...how to call a selection screen from screen.i created an include and in that include i used select options.but it is showing error message .guide me how to do it ?

    Hi..
    Here for your problem,
    I have created a button with function code 'CLICK' in screen no 1000.
    when I click on the button I am capturing the ok_code and displaying the selection screen.
    ok_code = sy-ucomm.
    case:ok_code.
    when 'CLICK'.
             SELECTION-SCREEN BEGIN OF SCREEN 500 TITLE title.
             SELECT-OPTIONS: P_DATE for sy-datum.
             SELECTION-SCREEN END OF SCREEN 500.
    title = 'Input Date'.
    CALL SELECTION-SCREEN '0500'.
    endcase.
    You can also have them as subscreen by providing the required parameters in the selection screen.
    Hope this solves your problem.
    Warm Regards,
    Bhuvaneswari.

  • Copy screens from screen painter

    Hi guys,
    I was just wondering if there was a way to copy screens from one program to the other?
    Me and a colleague are working on the same project, but since we can't both work in the same program at the same time, we have devided the work. But we will be working in a different program, and making screens in a different program.
    So, if we want to merge the two programms into one, we will have to add all the screens. So, is there a way to just copy them?
    Best regards.

    create different program and create screens in that program.
    now to merge them go to se51, choose copy form status button on top of screen  and give ur program name and screen no and copy them to target program and screen.
    now you can use that screen by calling in that program with call screen statement.
    reward if useful

  • No responce from Graphical Screen Painter - Exiting

    Hi,
    I am facing problem in a TCP/IP connection. While testing the connection EU_SCRP_WIN32, It shows the connection test OK. But after that it shows a screen saying "Starting layout editor program..."  After that it shows a error screen saying " No responce from Graphical Screen Painter - Exiting."
    I have installed SAPGUI patch 9. The file gnetx.exe is also there in Path C:\Program Files\SAP\FrontEnd\SAPgui.
    Please suggest.
    Thanks in advance,
    Suresh

    Hi
    Error "gnetx.exe: no response from graphical screen painter - exiting"
    basically occurs when we have RFC problem.
    Some causes for this erros are incorrect or missing RFC definitions of the RFC destination EU_SCRP_WN32.
    Thats why connection test is failing in that. Check all the RFC destinations and definitions properly through SM59 tcode.
    Also keep in mind that the graphical layout editor cannot be operated through a firewall (f.e: between the SAP and the customer system).
    Please, check SAP Note 101971 regarding all the possible causes for problems with the RFC link setup.
    Also check SAP Note 204910 which can help you to fix the error.
    Hope this helps.
    Kind Regards

  • Passing the values from selection screen to screen painter

    Hello Friends,
    I'm making one report program in which im calling  one screen which i have designed, in my selection screen there is a select option for customer  tht accepts value range now i want to select all the customers entered in select options and pass these values in screen(screen painter).
    pls guide me how this can be done.
    Regards,
    Sunny

    Screen painter is a tool in ABAP dev workbench used to create the screens using the
    T-code SE51. In the screen painter, you can define the following interface elements with their associated attributes.
    1. Input/Output Fields
    2. Field Names
    3. Checkboxes
    4. Radio Buttons
    5. Group Boxes
    6. Sub screens.
    7. Pushbuttons with No Fixed Position
    Create a Z program in tcode SE38.
    Go to transaction SE51.
    Enter the created program name and screen number.
    Click on flowlogic tab. 
    Uncomment the statement u201C MODULE STATUS_0100 u201C. 
    CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'DISPLAY'.
          SELECT SINGLE Fileds to selsct
               INTO (interanl table or tablename-fileds)
          WHERE Condition.    WHEN 'CLEAR'.
          CLEAR table.
      ENDCASE.
    ENDMODULE.

  • No response from Graphical Screen painter-Exiting

    Hi All,
    I am having a hard time getting the GUI of the screen painter. It displays the above message and also says * EU_SCRP_WN32 : timeout during allocate /CPIC_CALL : "ThSAPCMRCV'*
    Any idea how to troubleshoot?
    Regards,
    Sagar.

    Hi,
    I was getting the same error.
    The problem could be because of two reasons,
    1. SAPGUI Logon Pad :- Install the latest SAPGUI 700 .
    2. It could be the network problem. Consult with your network team.
    regards,
    mahantesh

  • Selecting Cell from Choosefromlist - Screen Painter

    Hi ...
    I've used screen painter for my form. In the preview mode, everything seems to be ok, I have my column matrix editable with choosefromlist. But when I run the add-on, I can't even select a cell. I've also tried creating the matrix through coding but still, I can't select a cell. Anyone knows what could be the problem?
    Thanks!
    Loren

    Hi Loren Flores,
    Actually you are not adding the row to your matrix, thats why you are not able to select a cell.
    Add the row to your matrix on Form Load event.
    and also on the lost focus of the column, add a new row in next line.
    on form Load---
    oMatrix.AddRow(1, 1);
    on lost focus--
    if (pVal.ItemUID == "Mtrx" && pVal.ColUID == "COL1")
                        if (pVal.Row >= oMatrix.RowCount)
                            if (pVal.Row == 1)
                                oEditText = (SAPbouiCOM.EditText)oMatrix.Columns.Item("COL1").Cells.Item(pVal.Row).Specific;
                                string sr = oEditText.String;
                                if (oEditText.String != "")
                                    oMatrix.AddRow(1, oMatrix.RowCount);
                                if (oMatrix.RowCount > 2)
                                    return;
                            else
                                oEditText = (SAPbouiCOM.EditText)oMatrix.Columns.Item("COL1").Cells.Item(pVal.Row).Specific;
                                string sr = oEditText.String;
                                if (oEditText.String != "")
                                    oMatrix.AddRow(1, pVal.Row);

  • Connecting a Screen Painter From to a Menu

    I have created a form using the screen painter.
    I have created  a new menu entry for this form.
    I have added the screen painter form into my solution.
    I am catching the new menu item click.
    what i do not have is the code to activate the form.

    Try this code Dror
    If (pVal.MenuUID = "U_xxx") And (pVal.BeforeAction = True) Then
    Dim oXmlDoc As Xml.XmlDocument
            oXmlDoc = New Xml.XmlDocument
            Dim sPath As String
            sPath = IO.Directory.GetParent(System.Windows.Forms.Application.StartupPath).ToString
            Try ' If there's no file then the looding will fail
                oXmlDoc.Load(sPath & "\" & "FileName")
            Catch ' Loading  failed
                SBO_Application.MessageBox( " File not found")
                End
            End Try
            SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
                oForm = SBO_Application.Forms.Item("FileUid")
            oForm.Visible = True
      End If
    Selin

  • How to create a drop down box and text box in screen painter?

    Hi i am totally new to this concept of screen painter..please can any tell me
    how to create drop down box in screen painter?
    How to create or display default date and time values?
    How to create text box for giving comments?
    How to store the records that we are entering in a table?
    Please can any one send me the procedure for creating all these its very urgent useful information will be surely rewarded.

    Hi,
    Check all these.
    1.how to create drop down box in screen painter?
    To get Drop Drown Box on screen .
    Follow these steps.
    1.
    Go to T.Code SE51 and Select Laypout for the Screen.
    2.
    Double click on the field for which u want Dropdown box.
    3.
    Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box or ListBox with key . Better to to select first one.
    4.
    Save and Activate ur screen .
    5.
    Enter the following piece of code in the PBO of the screen.(Change for ur requirement).
    6.
    The following code should be written under PROCESS BEFORE EVENT in the MODULE.
    TYPE-POOLS :vrm.
    DATA:
      i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
      w_natio LIKE LINE OF i_natio.
    DATA:
    BEGIN OF i_t005t OCCURS 0,
        land1 TYPE t005t-land1,
        natio TYPE t005t-natio,
    END OF i_t005t.
    IF i_t005t[] IS INITIAL.
      SELECT land1 natio
         FROM t005t
           INTO TABLE i_t005t
       WHERE spras = sy-langu.
      IF sy-subrc = 0.
      LOOP AT i_t005t .
          w_natio-key = i_t005t-land1.
          w_natio-text = i_t005t-natio.
          APPEND w_natio TO i_natio.
          CLEAR w_natio.
      ENDLOOP.
      ENDIF.
    ENDIF.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
                          id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
                    values = i_natio
    EXCEPTIONS
       id_illegal_name = 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.
    2.1.How to create or display default date and time values?
    1.
    create input field for DATE and TIME on screen.ex. DATE1 and TIME1 are screen field names .
    2.
    Just assign SY-DATUM to DATE1 and SY-UZEIT to TIME1 under PROCESS BEFORE EVENT.
    3.How to create text box for giving comments?
    1.
    Define one variable in the TOP include with type STRING means Global variable.
    2.
    Create one input field by giving screen field name which u have defined in the above step.
    4.How to store the records that we are entering in a table?
    For this case.. Create one table control. you can select one record and create record in the Z table by pressing button on Application toolbar..
    Check the following steps to handle Table control.
    1).
    U should take one variable in your internal table or in structure which
    is used for table control fields
    ex :
    data :
    begin of itab occurs 0 ,
        mark type c , "This is to select the record.
        matnr like mara-matnr ,
        matkl like mara-matkl,
        maktx like makt-maktx,
    end of itab .
    Controls: TABC types TABLEVIEW using screen 100.
    2).
    This mark variable should be given in Table control properties.
    follow the path
    double click on the table control-->attributes .->select
    w/SelColumn and in that itab-mark. Check in the figure.
    [Table control properties screen|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
    3).
    After that. Take this example.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL tabc
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    LOOP AT ITAB.
       Module read_table_control.
    ENDLOOP.
    module user_command_0100.
    In this Module read_table_control, You should write the following code
    MODULE read_table_control INPUT.
    MODIFY itab INDEX tabc-current_line."( This will update the
    "ITAB table MARK field with 'X ' whatever we have selected
    "on table control.)
    ENDMODULE.
    4)
    If you want to Delete some of the records from Table control
    follow this code …Create one pushbutton and give Fucnction code to that
    and write below code
    CASE OKCODE.
    WHEN 'CREATE'.
    LOOP AT itab WHERE mark = 'X'.
    "Use UPDATE statement to create new record.
    ENDLOOP.
    ENDCASE.
    I hope that you will get something.
    Regards,
    Venkat.O

  • How to insert tabstrip control in module pool screen painter

    Hi all!
    plz tell e how to use tabstrip control in module pool screen painter.Also plz give me an example program using tabstrip control.

    To insert tabstrip just open layout of screen and press on the tabstrip button there .
    Use this souce code further to activate it .
    CONTROLS tabstrip TYPE TABSTRIP.
    DATA: okcode TYPE sy-ucomm,
    dynnr TYPE sy-dynnr,
    flag type flag,
    active like tabstrip-activetab .
    call SCREEN 100.
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    data: lv_okcode type syucomm.
    lv_okcode = okcode.
    clear okcode.
    case lv_okcode.
    WHEN 'TAB1'.
    dynnr = '0110'.
    WHEN 'TAB2'.
    dynnr = '0120'.
    WHEN 'TAB3'.
    dynnr = '0130'.
    WHEN 'TAB4'.
    dynnr = '0140'.
    WHEN 'TAB5'.
    "check authorization, if authorization fails
    flag = 'X'. "set the global flag
    active = 'TAB1'. "store active tab in global variable
    dynnr = '0110'. "set the screen number
    WHEN 'BACK' or 'EXIT'.
    leave program.
    ENDCASE.
    IF lv_okcode(3) = 'TAB'.
    tabstrip-activetab = lv_okcode.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
    IF tabstrip-activetab IS INITIAL OR
    dynnr IS INITIAL.
    tabstrip-activetab = 'TAB1'.
    dynnr = '0110'.
    ENDIF.
    "set the activetab explicilty here
    if flag eq 'X'. "from authorization failure
    tabstrip-activetab = active. "'TAB1'
    clear flag.
    endif.
    ENDMODULE. " STATUS_0100 OUTPUT

Maybe you are looking for