Regarding selection screen output

hi,
i have created ALV report by using selection screen.in this i have displayed kunnr field from kna1 table.
but it is showing someextra zero's and then code now i want to display only code not extra zero.here below i am giving example:----
sap code
00001562
but i want like this....
sap code
1562.
thanx/regards,
vaneet thakur

TABLES : VBRK,KNA1.
TYPE-POOLS : SLIS.
DATA : T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
       L_FIELDCAT TYPE SLIS_FIELDCAT_ALV, "DECLARATION OF FIELDCAT FOR OUTPUT DISPLAY
       T_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : BEGIN OF ITAB OCCURS 0,
       VBELN LIKE VBRK-VBELN, "PO NUMBER
       VTEG LIKE VBRK-VTWEG,   "DC
       SPART LIKE VBRK-SPART, "DIVISION
       FKDAT LIKE VBRK-FKDAT, "DATE
       KUNRG LIKE VBRK-KUNRG, "CUSTOMER PLANT
       WERKS LIKE VBRK-WAERK, "SITE
       VKORG LIKE VBRK-VKORG, "SALE ORGANIZATION
       NAME1 LIKE KNA1-NAME1,
       ORT01 LIKE KNA1-ORT01,
       END OF ITAB.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS :   SITE FOR VBRK-WAERK.
SELECT-OPTIONS :   PCODE FOR VBRK-KUNRG.
*SELECT-OPTIONS :   INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS :   S_ORG FOR VBRK-VKORG OBLIGATORY.
SELECT-OPTIONS :   DC  FOR VBRK-VTWEG OBLIGATORY.
SELECT-OPTIONS :   DIVISION FOR VBRK-SPART obligatory.
*SELECT-OPTIONS :   PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET.
SELECTION-SCREEN : BEGIN OF BLOCK VANEET1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS :   INVOICE FOR VBRK-VBELN.
SELECT-OPTIONS :   PO_DATE FOR VBRK-FKDAT.
SELECTION-SCREEN : END OF BLOCK VANEET1.
*PERFORM TOP-OF-PAGE.
PERFORM FETCH-DATA.
*PERFORM DISP_DATA.
PERFORM T_FIELDCAT.
PERFORM REUSE_ALV.
**&      Form  TOP-OF-PAGE
      text
-->  p1        text
<--  p2        text
*FORM TOP-OF-PAGE .
*FORMAT COLOR 3 INTENSIFIED OFF.
*FORMAT COLOR 5 INTENSIFIED OFF.
*write : /48(120) 'NAHAR RETAIL LTD'.
*FORMAT COLOR 3 INTENSIFIED OFF.
*write : /48(120) 'FOCAL POINT'.
*FORMAT COLOR 6 INTENSIFIED OFF.
*write : /48(120) 'LUDHIANA'.
*write : / sy-uline.
*format color 4.
**WRITE: /1(20) 'INVOICENO',
       25(15) 'SAP CODE',
       55(15) 'PARTYNAME',
       100(50) 'LOCATION'.
      format color 7 INTENSIFIED ON.
*ENDFORM.                    " TOP-OF-PAGE
*&      Form  FETCH-DATA
      text
-->  p1        text
<--  p2        text
FORM FETCH-DATA .
REFRESH ITAB.
SELECT AVBELN AKUNRG AFKDAT AWAERK BNAME1 BORT01 INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBRK AS A INNER JOIN KNA1 AS B
ON AKUNRG = BKUNNR
WHERE
A~VBELN IN INVOICE
and
A~FKDAT IN PO_DATE
and
B~KUNNR IN PCODE
GROUP BY AVBELN AKUNRG BNAME1 BORT01 AFKDAT AWAERK.
SORT ITAB ascending BY  VBELN.
*ENDSELECT.
ENDFORM.                    " FETCH-DATA
**&      Form  DISP_DATA
      text
-->  p1        text
<--  p2        text
*FORM DISP_DATA .
*loop at itab.
*write :/1(18) itab-VBELN,
       27(5) ITAB-KUNRG,
       55(25) ITAB-NAME1,
       100(50) ITAB-ORT01.
*endloop.
*ENDFORM.                    " DISP_DATA
*&      Form  T_FIELDCAT
      text
-->  p1        text
<--  p2        text
FORM T_FIELDCAT .
PERFORM fill_field USING 'VBELN' 'PO NO'.
  PERFORM fill_field USING 'KUNRG' 'CUSTOMER PLANT'.
  PERFORM fill_field USING 'NAME1' 'PARTY NAME'.
  PERFORM fill_field USING 'ORT01' 'LOCATION'.
PERFORM fill_field USING 'BASME' 'UOM'.
PERFORM SELECTION_WIDTH.
ENDFORM.                    " T_FIELDCAT
*&      Form  fill_field
      text
     -->P_0267   text
     -->P_0268   text
FORM fill_field  USING   p_fieldname
                          p_seltext.
L_FIELDCAT-FIELDNAME = p_fieldname.
L_FIELDCAT-TABNAME   = 'ITAB'.
L_FIELDCAT-SELTEXT_M = p_seltext.
L_FIELDCAT-OUTPUTLEN = 10.
APPEND L_FIELDCAT TO T_FIELDCAT.
CLEAR L_FIELDCAT.
ENDFORM.                    " fill_field
*&      Form  REUSE_ALV
      text
-->  p1        text
<--  p2        text
FORM REUSE_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
  I_CALLBACK_PROGRAM                = ' '
  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                         = T_LAYOUT
   IT_FIELDCAT                       = T_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
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  IR_SALV_FULLSCREEN_ADAPTER        =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = ITAB
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.
ENDFORM.                    " REUSE_ALV
*&      Form  SELECTION_WIDTH
      text
-->  p1        text
<--  p2        text
FORM SELECTION_WIDTH .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = itab-kunrg
IMPORTING
   OUTPUT        = itab-kunrg

Similar Messages

  • AT SELECTION-SCREEN OUTPUT.

    Hi All,
    I have a selection screen which i need to influence before it is shown in the screen after the transaction is executed.
    I want the user to influence one of the fields in selection screen by an user exit.So if in the user exit the parameter is set by the user ,then only that particular field should be enabled or else it should be disabled.
    I know i can use AT SELECTION-SCREEN OUTPUT.
    but i am not sure that i can influence it with an user exit.
    Could anybody let me know the logic or code to write this.
    It would be very much help full.
    Regards,
    Priya.

    Hi Priya,
    you can make properly for loop at screen. with modify screen..
    it applied for enabled or disabled screen proceed.
    thx,
    s.suresh

  • At selection screen output dialog

    how i can make
    i have customer i want when i click enter to get the description.
    the program is dialog , i get always err,and when i put in PBO or PAI.

    Hi Little ,
      What i understand is that you are working on a report and not a module pool.
    If it is a report then you will first have to modify the selection screen , go to SE51 , put in the program name and the screen number ( which is generally 1000) , on the screen add a new I/O box which is for Output only let it be KNA1-NAME1 .
    Now you need to write the code in the event AT SELECTION-SCREEN OUTPUT .
    Here is the sample code for the same
    tables : kna1.
    parameter : kunnr type kna1-kunnr.
    at selection-screen output.
    if not kunnr is initial.
      select single name1 into kna1-name1
        from kna1
        where kunnr =  kunnr.
    endif.
    Hope this helps.
    Regards
    Arun

  • At selection screen output problem

    Hi all,
    I am trying to make a few fields disabled based on the selection of a radio button. I have done it in dialog programming, but in report its not working. Please tell me where i have gone wrong. My code:
    * Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER : rb_dwld RADIOBUTTON GROUP radi DEFAULT 'X',
                rb_upld RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    SELECT-OPTIONS : so_cctrl FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                             sc1 NO INTERVALS OBLIGATORY,
                     so_cusno FOR /dceur/z_crdtlmt-dealer MODIF ID sc1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS : so_ctrl1 FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                             sc2 NO INTERVALS OBLIGATORY.
    PARAMETER pa_fname TYPE rlgrap-filename MODIF ID sc2.
    SELECTION-SCREEN END OF BLOCK b3.

    Hi,
    Please check the below code.
    This is one of my requirement.
    * Creation of two blocks with parameter fields for create and update
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETER p_create LIKE rlgrap-filename MODIF ID crt.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETER p_update LIKE rlgrap-filename MODIF ID upt.
    SELECTION-SCREEN: END OF BLOCK b2.
    * Making one parameter field active at a time
    AT SELECTION-SCREEN OUTPUT.
      IF rb_crt = 'X'.                              "CREATE BUTTON IS SELECTED
        PERFORM hide_rb_options.
        CLEAR p_create.
      ELSE.                                         "UPDATE BUTTON IS SELECTED
        PERFORM hide_rb_options.
        CLEAR p_update.
      ENDIF.
    *&      Form  hide_rb_options
    FORM hide_rb_options .
      IF rb_crt = 'X'    .
        LOOP AT SCREEN.
          CASE screen-group1.
            WHEN 'CRT'.
              screen-active = 1.
              MODIFY SCREEN.
            WHEN 'UPT'.
              screen-active = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          CASE screen-group1.
            WHEN 'UPT'.
              screen-active = 1.
              MODIFY SCREEN.
            WHEN 'CRT'.
              screen-active = 0.
              MODIFY SCREEN.
          ENDCASE.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " hide_rb_options
    May it helps you.
    Regards.
    DS.

  • At Selection-screen output event

    Hi
    can any one give me some examples for at selection-screen output event
    with regards
    nagaraj
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Nov 8, 2011 12:13 PM

    Thanks Benedict
    Creating Module %_S_KOSTL and write our own logic to bring the parameter id value of Cost center from User profiles is NOT possible in program RM06BF00,  screen 1000.
    We can do that in Copied program of RM06BF00 ..which is the very last option.
    I wanted to do that with User-exits or BADI or Enhancement spot etc...which i Couldn't do it so far...
    The alternate might be Zprog and Ztcode or an SNOTE..
    if you ALL think its NOT possible with User-exits or BADI or Enhancement spot or SNOTE etc..Then i will close this Thread...
    Please let me know ASAP...
    Thanks
    Govi

  • AT SELECTION-SCREEN OUTPUT not working!

    Hi,
    I am useing the statement AT SELECTION-SCREEN OUTPUT to disable some input fields based on a check box(PR_FILE).however when I execute the program the changes on the screen are not reflected!I have written the AT SELECTION-SCREEN OUTPUT stmt immediately after SELECTION-SCREEN stmt .
    Defination for the screen elements is  as  follows:
    SELECT-OPTIONS s_plants FOR  ls_selected_plant-plant
                                                         NO INTERVALS.
    SELECTION-SCREEN BEGIN OF BLOCK filesel WITH FRAME TITLE text-012.
    PARAMETERS pr_file TYPE xfeld .
    PARAMETER : pr_path LIKE rlgrap-filename .
    SELECTION-SCREEN END OF BLOCK filesel.
    AT SELECTION-SCREEN OUTPUT.
      IF pr_file = 'X'.
        LOOP AT SCREEN.
          IF screen-name = 's_plants'.
            screen-input    = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-name = 'pr_path'.
            screen-input    = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Can anybody suggest what wrong i have done??

    You need to use the User Command for the checkbox and the Modificaiton ID (Group) for the fields.
    Try like this:
    TABLES: VBRP.
    SELECT-OPTIONS S_PLANTS FOR VBRP-WERKS NO INTERVALS MODIF ID GP1.
    SELECTION-SCREEN BEGIN OF BLOCK FILESEL WITH FRAME TITLE TEXT-012.
    PARAMETERS PR_FILE TYPE XFELD USER-COMMAND USR1.
    PARAMETER : PR_PATH LIKE RLGRAP-FILENAME MODIF ID GP2 .
    SELECTION-SCREEN END OF BLOCK FILESEL.
    AT SELECTION-SCREEN OUTPUT.
        IF PR_FILE = 'X'.
          LOOP AT SCREEN.
            if screen-group1 = 'GP1'.
              SCREEN-active = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ELSE.
          LOOP AT SCREEN.
            IF SCREEN-group1 = 'GP2'.
              SCREEN-active = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ENDIF.
    Regards,
    Naimesh Patel

  • At selection- screen output issue

    Hi,
    I have a issue regarding at selection-screen output event with radio buttons, 
    Fields are like,
    Block B1
      RB1
    Block B2
    RB2
       field 1 (Check box)
       field 2 (Check box)
    User can select one radio button at a time. If the user clicks on radio button RB1 then fields under Block B2 will be disabled. If user click on RB2 field 1 and fields 2 will be input enabled. Could you please give the solution asap
    Note: Radio buttons are in different selection screen blocks.

    Check this code -
    *SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME.
    *PARAMETERS:
    *Pi1 TYPE C  RADIOBUTTON GROUP G1 DEFAULT 'X',
    *Pi2 TYPE CHAR25,
    *Pi3 TYPE C  RADIOBUTTON GROUP G1,
    *Pi4 TYPE CHAR25.
    *SELECTION-SCREEN END OF BLOCK B.
    *PARAMETERS check AS CHECKBOX.
    *PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
    *SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    *PARAMETERS: ip1(10) TYPE c,
               ip2(10) TYPE c,
               ip3(10) TYPE c.
    *SELECTION-SCREEN END OF BLOCK b1.
    *SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    *PARAMETERS: ip4(10) TYPE c MODIF ID bl2,
               ip5(10) TYPE c MODIF ID bl2,
               ip6(10) TYPE c MODIF ID bl2.
    *SELECTION-SCREEN END OF BLOCK b2.
    *AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
       IF show_all <> 'X' AND
          screen-group1 = 'BL2'.
          screen-active = '0'.
       ENDIF.
       MODIFY SCREEN.
    ENDLOOP.
    Regards,
    Amit Khare
    reward all helpful replies.

  • At selection-screen output probelm

    Hi ,
    I am using 4 parameters in the selection screen . I am entering data in the 3 input fields. Then I am doing concatenate 3 fileds data into the 4 th field in the event AT SELECTION-SCREEN OUTPUT, bur my problem is  When ever i click ENTER , then only 4th field is updating. With out ENTER key , Is it possible update 4th filed.
    regards,
    ramajay reddy

    Hi,
    This is not possible without a user action on the screen, unless your fields are drop down lists, check box or radiobutton respectively, Reason is that the SAP Screen processing will not trigger the PAI event unless there is a user action on the screen like pushing a button, radiobutton , checkbox or selecting a value from a dropdown list. And hence PBO will not get triggered either. Thus entering value in input fields and pressing the tab key is not enough. The user must press 'Enter' if the PAI--PBO should be triggered.
    Pressing 'Enter' is much more user friendly and convinient than adding a button/radiobutton/checkbox on the selection screen to update other fields on the selection screen as in your scenario.
    regards,
    Advait

  • At selection screen output not responding

    Hi ppl,
    I've 4 selection options in my screen. however I just need user to insert only 1 of the 4 for searching. Therefore i included 4 radio buttons. when user select <i>rbf</i>, <i>sfileno</i> will activer and other 3 will be grayed out, when user select <i>rbi</i>, <i>sidnum</i> will active and other will not be active and so forth. You can see the codes below.
    However, during the program running, I found out when i select <i>rbf,</i> the other select options fields - <i>sfileno</i>, <i>sidnum</i> n <i>scompsno</i> are not inactive/grayed. It is the same when I seledt the other radio button. I just seem that i receive no response from the program. What have i done wrong here. please help. TQ
    SELECTION-SCREEN BEGIN OF BLOCK frm1 WITH FRAME TITLE text-t01 .
    SELECT-OPTIONS : sfileno FOR zlic_masterdb-nofailpermohonan modif id f01
                      sidnum FOR zcustomer-idnumber modif id i01,
                      sconame FOR zcustomer-contactname modif id n01,
                      scompsno FOR zcom_compdhdr-compsno modif id c01.
    PARAMETERS: rbf RADIOBUTTON GROUP g1 ,
    rbi RADIOBUTTON GROUP g1,
    rbn RADIOBUTTON GROUP g1,
    rbc RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END   OF BLOCK frm1.
    INITIALIZATION.
    sfileno = '00001'.
                     AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
      CHECK SCREEN-GROUP1 = 'f01' OR
    SCREEN-GROUP1 = 'i01' OR
    SCREEN-GROUP1 = 'n01' OR
    SCREEN-GROUP1 = 'c01'.
    IF rbf = 'X'.
      IF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbi = 'X'.
      IF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbn = 'X'.
      IF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ELSEIF rbc = 'X'.
      IF SCREEN-GROUP1 EQ 'c01'.
        SCREEN-ACTIVE = 1.
      ELSEIF SCREEN-GROUP1 EQ 'f01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'n01'.
        SCREEN-ACTIVE = 0.
      ELSEIF SCREEN-GROUP1 EQ 'i01'.
        SCREEN-ACTIVE = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
    continue.
    ENDLOOP.

    hi Enzo
    Check my sample code
    TABLES: eban,
            SSCRFIELDS.
    SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',
              rad2 RADIOBUTTON GROUP rad .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,
               p_matnr TYPE eban-matnr MODIF ID g1,
               sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,
               str_loc TYPE eban-lgort MODIF ID g4.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.
    SELECTION-SCREEN END OF SCREEN 100.
    name = 'FETCH'.
    title = 'Test Report'.
    CALL SELECTION-SCREEN '100'.
    TYPE-POOLS slis.
    * declaration of internal tables and work areas to be used
    DATA: BEGIN OF it_pr OCCURS 0,
          banfn TYPE eban-banfn,
          bnfpo TYPE eban-bnfpo,
          loekz TYPE eban-loekz,
          statu TYPE eban-statu,
          ekgrp TYPE eban-ekgrp,
          matnr TYPE eban-matnr,
          werks TYPE eban-werks,
          lgort TYPE eban-lgort,
          preis TYPE eban-preis,
          peinh TYPE eban-peinh,
          END OF it_pr.
    DATA: BEGIN OF it_mat OCCURS 0,
          matnr TYPE eban-matnr,
          END OF it_mat.
    *DATA:BEGIN OF ITAB1 OCCURS 0,
      DATA: l_answer.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat LIKE LINE OF it_fieldcat,
          it_event TYPE slis_t_event,
          wa_event TYPE slis_alv_event.
    * declaration of variables to be used
    DATA: r_ucomm TYPE sy-ucomm,
          mat_no TYPE eban-matnr,
          len TYPE i VALUE 1,
          count TYPE i VALUE IS INITIAL,
          iflag TYPE i VALUE IS INITIAL,
          iflag1 TYPE i VALUE 0.
    DATA :pr_id TYPE sy-repid,
    rt_extab TYPE slis_t_extab.
    INITIALIZATION.
      pr_id = sy-repid.
    probably it would sol;ve ur problem
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • At selection screen output problem when a field is obligatory

    Hi All,
    I have two radiobuttons on the selection screen and when I select first radiobutton one screen should display and the other should not be displayed and vice-versa. It is working fine if I do not have a mandatory field.I am pasting my code here.Can anyone please help me how to handle this situation when we have some mandatory fields on one of these screens.
    TABLES : mara,marc.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,
                 p_meth2 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK matnr WITH FRAME TITLE text-002.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1 obligatory.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .
    SELECTION-SCREEN END OF BLOCK matnr.
    SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-003.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.
    SELECTION-SCREEN END OF BLOCK file.
    SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : p_date TYPE datuv.
    SELECTION-SCREEN END OF BLOCK date.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    CASE screen-group1.
    WHEN 'M1'.
    IF p_meth1 = 'X'.
    screen-active = 1.
    ENDIF.
    IF p_meth2 = 'X'.
    screen-active = 0.
    ENDIF.
    WHEN 'M2'.
    IF p_meth2 = 'X'.
    screen-active = 1.
    ELSE.
    screen-active = 0.
    ENDIF.
    IF p_meth1 = 'X'.
    screen-active = 0.
    ENDIF.
    ENDCASE.
    MODIFY SCREEN.
    ENDLOOP.
    Thanks in advance
    Sandeep

    Obligatory fields with your requirement will not work, reason : The GUI checks obligatory fields before passing the control back to the program (i.e Before triggering the PAI )
    If you check for empty fields and give appropriate error message in the PAI, the program will not allow you to switch to the other radio button until you fill something in the fields because the moment you select a radiobutton, it will validate the field and issue the error message.
    So it is like a catch 22 situation.
    All you can really do is to check see which radio button is clicked and then do your processing. Also make sure to assign a user command to the radiobutton and query it in the AT SELECTION SCREEN and based on the radiobutton selected, decide which fields should be validated.
    " Additon...
    INITIALIZATION  " Default values
    p_meth1 = 'X'.
    AT SELECTION-SCREEN.  " General PAI
    if p_meth1 EQ 'X'.
    "validate fields for meth1.
    elseif p_meth2 EQ 'X'.
    " validate fields for meth2.
    endif.
    regards,
    Advait

  • Selection screen changes at selection screen output

    Hi all,
    I have to make my one block in selection scren invisible based on a particular condition.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_status FOR g_status NO INTERVALS.
    PARAMETERS    :  p_trans(3) TYPE c,
                     p_hub(3) TYPE c.
    SELECT-OPTIONS:  s_auart  FOR g_auart.
    PARAMETERS:      p_buyt(1) TYPE c.
    SELECT-OPTIONS:
                     s_order  FOR g_vbeln,
                     s_zzhrt  FOR g_zzhrtosec,
                     s_vbeln1 FOR g_vbeln1,
                     s_dccode FOR g_dccode NO INTERVALS,
                     s_pgi   FOR g_pgi.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS    : p_c1 AS CHECKBOX USER-COMMAND cmd.
    SELECT-OPTIONS: s_list FOR g_list NO INTERVALS MODIF ID sc1.
    SELECTION-SCREEN END OF BLOCK blk2 .
    SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME TITLE text-003.
    PARAMETERS    :  p_c2 AS CHECKBOX USER-COMMAND cmd2.
    SELECT-OPTIONS:  s_mail FOR g_mail NO INTERVALS MODIF ID sc2.
    PARAMETERS:   p_accld LIKE g_saknr DEFAULT '1342009999' MODIF ID sc2
                                                          OBLIGATORY,
                  p_accit LIKE g_saknr DEFAULT '1365009999' MODIF ID sc2
                                                          OBLIGATORY,
                  p_opacc LIKE g_saknr DEFAULT '346100XX99' MODIF ID sc2
                                                          OBLIGATORY,
                  p_lmacc LIKE g_saknr DEFAULT '1393009999' MODIF ID sc2
                                                          OBLIGATORY,
                  p_lmopa LIKE g_saknr DEFAULT '3471009999' MODIF ID sc2
                                                          OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk3.
    The block 3 'blk3' should be made invisible based on a condition.
    I have tried loop at screen-name but its not working.
    Kindly advice.
    Thanks and Regards,
    Divya

    Hi Divya,
    Check the below code.
    tables: pa0000, pa0001.
    parameters: p_chk1 as checkbox user-command rusr,
    p_chk2 as checkbox user-command rusr,
    p_chk3 as checkbox user-command rusr,
    p_chk4 as checkbox user-command rusr,
    p_chk5 as checkbox user-command rusr.
    selection-screen: begin of block blk1 with frame.
    select-options: s_pernr for pa0000-pernr modif id ABC,
    s_stat2 for pa0000-stat2 modif id DEF,
    s_werks for pa0001-werks modif id GHI,
    s_persg for pa0001-persg modif id JKL,
    s_persk for pa0001-persk modif id MNO.
    selection-screen: end of block blk1.
    AT SELECTION-SCREEN output.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'ABC'.
    IF p_chk1 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'DEF'.
    IF p_chk2 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'GHI'.
    IF p_chk3 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'JKL'.
    IF p_chk4 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'MNO'.
    IF p_chk5 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    *Note
    *Titles for check boxes and select options
    *P_CHK1 Personal Number
    *P_CHK2 Employment Status
    *P_CHK3 Personnel Area
    *P_CHK4 Employee Group
    *P_CHK5 Employee Sub group
    *S_PERNR Personal Number
    *S_PERSG Employee Group
    *S_PERSK Employee Sub group
    *S_STAT2 Employment Status
    *S_WERKS Personnel Area

  • AT SELECTION-SCREE / AT SELECTION-SCREEN OUTPUT

    Hi,
    I have 3 check boxes in my selection-screen. My requirement is if I check any one checkbox  out of 3 checkboxes on my selection-screen other two checkboxes should disable ( I mean not editable). Can anybody suggest how to do this. If possible please send me a piece of code.
    SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE TEXT-001.
    PARAMETERS: CH_ONE   AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK ONE.
    SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE TEXT-002.
    PARAMETERS: CH_TWO   AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK TWO.
    SELECTION-SCREEN BEGIN OF BLOCK THREE WITH FRAME TITLE TEXT-003.
    PARAMETERS: CH_THREE   AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK THREE.
    Thanks and Regards,
    Surya.

    do this way ..
    SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME TITLE TEXT-001.
    PARAMETERS: CH_ONE AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK ONE.
    SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE TEXT-002.
    PARAMETERS: CH_TWO AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK TWO.
    SELECTION-SCREEN BEGIN OF BLOCK THREE WITH FRAME TITLE TEXT-003.
    PARAMETERS: CH_THREE AS CHECKBOX .
    SELECTION-SCREEN END OF BLOCK THREE.
    AT SELECTION-SCREEN OUTPUT.
    IF CH_ONE = 'X'.
    LOOP AT SCREEN.
    IF ( SCREEN-NAME  = 'CH_TWO' ) OR ( SCREEN-NAME = 'CH_THREE' ).
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF CH_TWO = 'X'.
    LOOP AT SCREEN.
    IF ( SCREEN-NAME  = 'CH_ONE' ) OR ( SCREEN-NAME = 'CH_THREE' ).
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF CH_THREE = 'X'.
    LOOP AT SCREEN.
    IF ( SCREEN-NAME  = 'CH_TWO' ) OR ( SCREEN-NAME = 'CH_ONE' ).
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.

  • Event at selection-screen output

    Hi all,
    we have common include for all the reports. Now i need to add few selects to all screens based upon some conditions.so i added the seletions to the common include. Based upon some conditions ,i need to activate or deactivate these selections. this can be done at the event at seleciton-screen output. so i did that but few programs are giging dump as these programs already have the above mentioned event(ie at selection-screen output) now how to solve this issue.
    Please suggest me .
    Thanks
    Jaffer Vali shaik

    Hi Jaffer,
    The conditions to display the additional selection, are they based on user input data? If not, you could try to put the logic in the initialization event. Check the 'where-used list' to see whether all programs accessing this common include already has initialization event or not.
    If the display for selection are based on other selection criteria, then you need to evaluate the common include. Based on your project standard, does the include should have events processing in it? If yes, maybe the few programs that cause shortdump should move their logic to this common include (using the SY-REPID condition).
    Regards,
    Dewi

  • Logic for Selection screen output

    Hi All,
    I have 2  blocks on my selection screen
    First block has 3 radio buttons(a, b,c) and second block has 5 check boxes. When i select radio button 'C' 2 checks boxes of 2nd block  should be activated (enabled).if RB 'C' is not selected those 2 chck boxes should be in disabled position. an any one help me in this regard.(logic)
    Thanks in advance
    P.D .Rao

    Please check the below code:
    REPORT  ypra_sample56.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
    PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
               p_r2 RADIOBUTTON GROUP rg1,
               p_r3 RADIOBUTTON GROUP rg1.
    SELECTION-SCREEN END OF BLOCK a1.
    SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
    PARAMETER: p_c1 TYPE c AS CHECKBOX,
               p_c2 TYPE c AS CHECKBOX,
               p_c3 TYPE c AS CHECKBOX,
               p_c4 TYPE c AS CHECKBOX,
               p_c5 TYPE c AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK a2.
               INITIALIZATION
    INITIALIZATION.
      PERFORM enable_fields.
               AT SELECTION SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      PERFORM sel_screen_output.
    *&      Form  sel_screen_output
          Selection screen Output
    FORM sel_screen_output.
      IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
        PERFORM enable_fields.
      ENDIF.
      IF p_r3 EQ 'X'.
        LOOP AT SCREEN.
          IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
            screen-active = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sel_screen_output
    *&      Form  enable_fields
          enable fields in selection screen
    FORM enable_fields .
      IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
        LOOP AT SCREEN.
          IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
            screen-active = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " disable_fields
    Use  screen-input = '1' to enable and screen-input = '0' to disable the checkbox. And if u want to totally make that field disappear from screen use screen-active = '1' and '0'.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • Selection icons destroyed by AT SELECTION SCREEN OUTPUT

    Hello
    I have a following code excerpt:
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'CUSTORDS' OR
           screen-name = 'TRNSORDS' OR
           screen-name = 'REASONCD'.      
          screen-input = '1'.
        ELSEIF ( screen-group1 = 'ONE'
                 AND custords = set_x ) OR
               ( screen-group1 = 'TWO'
                 AND trnsords = set_x ).
          screen-input = '1'.
        ELSE.
          screen-input = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    The problem is, that when user gives special selection criteria for select-option field, the icon which appears to the left ('=', '>', etc) next to the affected select-option field inherits the screen-group from the select-option and the coding sets screen-input = 1 for this icon thus destroying it. Instead of an icon a text appears, just like this: '@20\QSelect: Equal to@'.
    How can this behavoiur be prevented ?

    Add screen-group3 ne 'OPU' to the elseif statement:
    ELSEIF ( screen-group1 = 'ONE' and screen-group3 ne 'OPU'
    AND custords = set_x ) OR
    ( screen-group1 = 'TWO' and screen-group3 ne 'OPU'
    AND trnsords = set_x ).
    Regards
    Sridhar

Maybe you are looking for

  • Can I share my iTunes library with other user accounts on my computer?

    My kids have their own user accounts on my laptop. Can I share my iTunes music with them? If so, how? If not, can they import their own music from cd's without opening a store account? Anything else I need to know? I appreciate any help you can give!

  • Cannot delete unwanted layer. Unwanted layer previews even though it's off...

    My question relates to InDesign 5.0.3 and Acrobat Pro 9.0.0 When Exporting a PDF I am selecting Export Layers and choosing "Visible and Printable Layers" to export. I'm not using distiller as I want to keep some layers intact so I can make one layer

  • OO concept

    Hi,      I am new to oo concept in abap any plz send me the material to my mail <[email protected]>

  • Demoting 2003 domain controllers

    Hi Guys, We have been running in a mixed mode domain for a while now (2003 and 2008r2) and I have been given the go-ahead to demote the 2003 DC's. Now before I demote them I want to be sure that these servers are being used for anything, i.e ldap ser

  • .idea & .psdx file icons not supported in Bridge?

    I was wondering when bridge would support .idea & .psdx file icons.  I use bridge to browse my files and it would make life easier to have the icons supported.  You would thing something like that would have been thought of.  Does anyone know if that