How excise invoices are sorted in Excise invoice selection screen (J1ij)

Sir
when I do excise invoice creation in Ji1j for customer depatch, in the excise invoice selection screen , the excise invoices are not sorted properly, i.e excise invoice related to 2011 appearing first and then 2008 is appearing then again 2011 is appearing.
can some one tell me how these excise invoices are sorted?
Jaya Anand

Sir
Not yet. Already   'EI proc' is set as First in firstout only.
But Still , 2008 document is appearing in the middle of 2011 documents. i.e first 4 documents is related to 2011 and 5th document is 2008 and then again 6th document related to 2011 ect...
Can I attach the screen shot in this forum?
Regards
Jaya Anand
Edited by: Jayaanand on Nov 21, 2011 10:19 AM

Similar Messages

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How many push buttons can u place on selection screen application tool bard

    hi
    how many push buttons can u place on selection screen application tool bar
    and what is default function code for that buttons.

    Hi Chaitanya,
    You can place maximum 5 push buttons on Application Toolbar.
    please award the points incase if you are able to get the solution.
    Thanks
    Sivaram

  • How can i put mandatory fields in my selection screen

    I am having Sales Office,Sold to Party,Sales document Number,Sales Group,Date of Creation,Name Of The Person Who Creat and Short Text For Sales Order in my selection scrren.How can i put sales office and sold to party fields manadatoty input fields at selection sceen.

    hi,
    Use obligatory keyword while you are declaring the fields of selection screen.
    Example for the same is :
    Obligatory
    e.g Parameters p_id like vbak-vbeln obligatory
          Select-options s_vbeln for vbak-vbeln obligatory
    I hope this will solve your problem.
    Thanx.

  • How to schedule the background job using current selection screen field val

    Hello Friends,
    How to schedule the background job using current selection screen field values.
    after completion of the job the spool should be sent as a mail to SAP Inbox.
    Is there any way to create the variant dynamically by reading the current selection screen values.
    Thanks,
    Ravi

    Hi,
    To get the variant details you can use teh following FM.
    'RS_VARIANT_CONTENTS'.
    Regards,
    Ankur Parab

  • How to populate f4 values to standard pnp selection screen fields

    Hi Experts,
    my question is how to populate f4 values to standard pnp selection screen field. i am using LDB PNP for a report , it displays several fields with f4 values, i need to remove all the stadard f4 values and want to place my  f4 values in the selection screen

    Hi Venkat,
    To put ur own values in the F4 help of any field...all u have to do is.
    1st fetch all the records that u need to display in F4 help list...in one internal table.
    and then use the function module  'F4IF_INT_TABLE_VALUE_REQUEST'
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield =
    value_org =
    tables
    value_tab =
    return_tab =
    exceptions
    parameter_error = 1
    no_values_found = 2
    others = 3.
    where retfield is the field for which u need to give the F4 help.
    and valu_tab is the internal table in which u have the list of records to be displayed.
    this would do the work...
    I dont have the system in front of me...as soon as i have...will try to send a piece of code, to make ur work easy.
    Till then hope this helps u...all the best
    Regards,
    Radhika

  • How can i set dynamice for week on Selection screen..pls help me..Urgent

    Hi..All
    please Help me .. i am very  confused..
    i need to set a varient for week which is dynamic on selection screen.
    b) Week from current week to current week + 2. (<b>Dynamic selection)</b>how can i set dynamice for week on Selection screen,,
    how can i do this..i am alrady set dynamice variant for Date.. there is option for D.. but in case of week there is a no option.
    pls help me..urgent
    thamks in advance.
    mayukh

    Hi,
    I think the way out is use the dynamic select option while setting up the varinat and use sy-datum to sy-datum+9 which should essentially serve the purpose.
    While saving the variant, for that particular date field check the Selection variable checkbox, then Choose D
    option and then choose current days + or - option from there.
    Rgds,
    HR

  • How to Create a DropDown Box in a Selection Screen.

    Hi,
    I have a question. i.e, How to create a dropdown box in a Selection Screen. Could you please assist me.
    Thanks & Regards
    Sathish Kumar

    hi satish,
    The following can assist u to create a drop down ....
    Drop down list box can be created in a dialog screen(SE51) as well as selection screen.
      The sap list box allows to select a value from the list but we cannot enter our own value in the list box .The value list that will be displayed consists of two
    fields TEXT field of TYPE 80(C) and internal KEY field of TYPE 40(C).
    In screen painter to create a input/output field into list box we use
    'L" as a value for dropdown attribute for the i/o field.
    In screen painter to determine the type of method that will be used to fill the value
    list we use the attribute value list.
    If it is blank  the value list will be filled by the first column of the input help assigned to the screen field.This input help can be defined in the ABAP Dictionary, on screen using SELECT,VALUES screen statements or in event POV (PROCESS ON VALUE-REQUEST ) and the input help that will be passed to the field should consists of 2 columns ,the key column is filled automatically by the system.SAP recommends value list field should be blank.
    or
    The value  can be 'A' meaning that the value list will be filled in the event PBO(PROCESS BEFORE OUTPUT) or before the screen is displayed.In this method we use function module VRM_SET_VALUES to fill the values and pass it to the i/o field.
    If a function code is attached to the list box the selection of a value triggers a PAI
    otherwise PAI will not trigger.
    Example
    Dropdown list boxes
    REPORT DEMO_DYNPRO_DROPDOWN_LISTBOX.
    TYPE-POOLS VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST.
    DATA: WA_SPFLI TYPE SPFLI,
          OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM.
    TABLES DEMOF4HELP.
    NAME = 'DEMOF4HELP-CONNID'.
    CALL SCREEN 100.
    MODULE CANCEL INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE INIT_LISTBOX OUTPUT.
      CLEAR DEMOF4HELP-CONNID.
      SELECT  CONNID CITYFROM CITYTO DEPTIME
        FROM  SPFLI
        INTO  CORRESPONDING FIELDS OF WA_SPFLI
       WHERE  CARRID = DEMOF4HELP-CARRIER2.
        VALUE-KEY  = WA_SPFLI-CONNID.
        WRITE WA_SPFLI-DEPTIME TO VALUE-TEXT
                               USING EDIT MASK '__:__:__'.
        CONCATENATE VALUE-TEXT
                    WA_SPFLI-CITYFROM
                    WA_SPFLI-CITYTO
                    INTO VALUE-TEXT SEPARATED BY SPACE.
        APPEND VALUE TO LIST.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                ID              = NAME
                VALUES          = LIST.
    ENDMODULE.
    MODULE USER_COMMAND_100.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      IF SAVE_OK = 'CARRIER'
         AND NOT DEMOF4HELP-CARRIER2 IS INITIAL.
        LEAVE TO SCREEN 200.
      ELSE.
        SET SCREEN 100.
      ENDIF.
    ENDMODULE.
    MODULE USER_COMMAND_200.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      IF SAVE_OK = 'SELECTED'.
        MESSAGE I888(BCTRAIN) WITH TEXT-001 DEMOF4HELP-CARRIER2
                                            DEMOF4HELP-CONNID.
      ENDIF.
    ENDMODULE.
    Reward if useful.
    Thank you,
    Regards.

  • How to link a search help to a selection screen field

    Hi All,
    I am using field PKWRG from PA0017 table in selection screen. I need F4 help there as in Tcode PA30 . But this field does not have value table or check table. However, it has a search help attached 'TRV_PKWRG' .
    But, I donot know how to assign a search help to a selection screen field. Please help.
    Regards,
    Nibha

    Hello,
    Fetch all the data which from the table which you want to show in the search help and pass the value to the FM
    F4IF_INT_TABLE_VALUE_REQUEST and the selection-screen event must be
    at selection-screen on value request parameter or selection option variable.
    BCALV_TEST_FULLSCREEN
    BCALV_TEST_FULLSCREEN_CALLS
    BCALV_TEST_FULLSCREEN_PRINT
    BCALV_TEST_FULLSCREEN_STATUS
    BCALV_TEST_GRID
    BCALV_TEST_GRID_DRAG_DROP
    BCALV_TEST_GRID_EDITABLE
    BCALV_TEST_GRID_EVENTS
    BCALV_TEST_GRID_INDEX
    BCALV_TEST_GRID_TOOLBAR
    BCALV_TEST_HIERSEQ_LIST
    BCALV_TEST_LIST
    BCALV_TEST_LIST_PRINT
    BCALV_TEST_LIST_STATUS
    BCALV_VERIFY_DTYPES_D0100_F01
    BCSMENUF01
    BDLCOF10
    BDLDVI10
    BDLTREDF

  • How to create Drop down menu in the selection screen

    Hi all,
    How to create Drop down menu in the selection screen.
    Fast answer will be highly rewarded
    Regards
    Bikas

    hi ,
    TYPE-POOLS : vrm.
    TABLES:vbak,vbap.
    DATA : v(80) TYPE c.
    DATA: wa_vbak TYPE vbak,
          it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,
          wa_vbap TYPE vbap,
          it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE.
      DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values ,
            v_count  TYPE i,
            l_value LIKE LINE OF li_list.
    PARAMETERS: p_test(20) AS LISTBOX VISIBLE LENGTH 60 MODIF ID DAT.
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM get_data.
      LOOP AT it_vbak.
        l_value-key =  it_vbak-vbeln .
        l_value-text = it_vbak-vbeln .
        APPEND l_value TO li_list.
      ENDLOOP.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'P_TEST'
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    AT SELECTION-SCREEN ON P_TEST.
      clear : li_list , li_list[].
      SELECT vbeln
             matnr
             meins
             FROM vbap
             INTO CORRESPONDING FIELDS OF TABLE it_vbap
             WHERE vbeln = p_test.
    START-OF-SELECTION.
      SELECT vbeln
             matnr
             meins
             FROM vbap
             INTO CORRESPONDING FIELDS OF TABLE it_vbap
             WHERE vbeln = p_test.
      LOOP AT it_vbap.
        WRITE :/ it_vbap-vbeln, it_vbap-matnr,it_vbap-meins.
      ENDLOOP.
    *&      Form  get_Data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data .
      SELECT  vbeln
              FROM vbak
              INTO  CORRESPONDING FIELDS OF TABLE it_vbak.
    ENDFORM.                    " get_Data
    regards,
    venkat.

  • How to create tcode for modulepool program with selection screen?

    hi,
       How to create tcode for modulepool program with selection screen?
    thanks,
    sagar

    Hi,
    We need to goto SE80.
    In our program we right click on object name and goto create
    -> transaction. Enter the module pool program and screen number and save and activate.
    Or by SE93 also we can create a transaction code for our program.
    Hope ths helps.
    plz reward if useful.
    thanks,
    dhanashri..
    Edited by: Dhanashri Pawar on Jul 22, 2008 8:29 AM

  • In MIGO Excise Invoice Selection screen?

    Hello
    I had created the the PO for excisesable material.When i Go for MIGO for
    receiving the Goods....when check the system will ask me to enter excise Invoice no and
    Excise invoice date. besides that one selection option is there....
    Capture excise Invoice
    Ref Excise Invoice
    Only Part1
    No excise entry
    Bussiness requirement is that.....they want to keep  Only Part1 option....they
    wanted to remove all other options.  how to do that? there is no selction screen in CIN customising
    Regards
    sapman

    Hi,
    one option is remove the ticks for MIGO settings in Excise group customization, but also u can see some other options for that you need to alter the standard Domain's J_1IEXCISE_ACTION fixed values(delete the other options).
    Second option is explore the authorization objects in CIN and try to restrict the use via authorization.
    Note - Altering standard domain is NOT recomended by SAP.
    Cheers,
    Santosh
    Edited by: Santosh (INDIA) on Jul 16, 2008 11:18 AM

  • How  to filter by manager's name using selection screen

    Hi all,
      I am trying to modify the report to filter data from the report based on the manger name given in selection screen. As the manger's name was given in selection screen.. records have to come only of the employee how were working under that entered manager name.
      I am unable to follow this code to modify.. where to add select criteria to filter... please make modify to my code..
      I am pasting my code here, Can any one kindly help for this scenario.
    TABLES: PA0001,  "HR Master Record: Infotype 0001 (Org. Assignment),
            PA0002,
            P0000,
            PA9001,
            PA0007,
            HRP1001, "Infotype 1001 DB Table
            PA0034. "HR Master Record: Infotype 0034 (Corporate Function)
    *Internal table for holding output data
    DATA: IT_PA0002 LIKE PA0002  OCCURS 100 WITH HEADER LINE,
          IT_PA9001 LIKE PA9001  OCCURS 100 WITH HEADER LINE,
          IT_PA0007 LIKE PA0007  OCCURS 100 WITH HEADER LINE,
          IT_PA0034 LIKE PA0034  OCCURS 100 WITH HEADER LINE.
    DATA: IT_RET LIKE BAPIRET2,
          IT_ACT LIKE BAPI_SWHACTOR OCCURS 0,
          IT_STR LIKE BAPI_STRUC OCCURS 0,
          IT_ORG LIKE BAPI_OBJEC OCCURS 0,
          IT_POS LIKE BAPI_OBJEC OCCURS 0,
          IT_SUP LIKE BAPI_OBJEC OCCURS 0,
          IT_FCAT LIKE BAPI_HRAQFIELDDESCRIPTION OCCURS 0,
          IT_FDAT LIKE BAPI_HRFIELDDATA OCCURS 0,
          IT_ORGS TYPE STANDARD TABLE OF BAPI_OBJEC WITH HEADER LINE,
          IT_POSS TYPE STANDARD TABLE OF BAPI_OBJEC WITH HEADER LINE,
          IT_SUPR TYPE STANDARD TABLE OF BAPI_OBJEC WITH HEADER LINE,
          V_DATE  TYPE SY-DATUM,
          IT_T500P LIKE T500P OCCURS 0 WITH HEADER LINE,
          IT_TT500P LIKE T500P OCCURS 0 WITH HEADER LINE,
          IT_T001P LIKE T001P OCCURS 0 WITH HEADER LINE      .
    DATA: IT_PA0001 LIKE PA0001 OCCURS 100 WITH HEADER LINE,
          P_ENDDA LIKE sy-datum.
    DATA: Begin of I_HRE,
            pernr  like  pa0001-pernr,  "Emp Number
            nachn  like  pa0002-nachn,  "Last Name
            vorna  like  pa0002-vorna,  "First Name
            plans  like  BAPI_OBJEC-LONG_TEXT,  "Position
            div_text  like  pa9001-div_text,
            kztim  like  ZKZTIM_VAUES-name,
            stext  like  T591S-STEXT,     "Corporate function text
            werks  like  BAPI_OBJEC-LONG_TEXT,
            btrtl  like  pa0001-btrtl,
            orgeh  like  BAPI_OBJEC-LONG_TEXT,
            kostl  like  pa0001-kostl,
            mstbr  like  pa0001-mstbr,  "Supervisor
          End of I_HRE.
    DATA: I_HR like I_HRE occurs 100 with header line.
    DATA: V_PLANS LIKE PA0001-PLANS,
          V_EMP   LIKE PA0001-PERNR,
          V_KOSTL LIKE PA0001-KOSTL,
          V_SUPER LIKE BAPI_OBJEC-LONG_TEXT,
          V_EMP_POS LIKE BAPI_OBJEC-LONG_TEXT,
          V_SUPER_POS LIKE BAPI_OBJEC-LONG_TEXT,
          V_HEADER TYPE N VALUE 1,
          V_COUNTER TYPE N VALUE 1,
          EMP_INDICATOR TYPE N,
          V_ORGEH LIKE BAPI_OBJEC-LONG_TEXT,
          V_WERKS LIKE BAPI_OBJEC-LONG_TEXT,
          V_KZTIM LIKE ZKZTIM_VAUES-NAME,
          V_STEXT LIKE T591S-STEXT.
      DATA: v_file TYPE string,         "Detail Filename
            v_filerecord(1000),
            f_filerecord(1000),
            drive(3),
            mstbr  like  pa0001-mstbr,  "Supervisor
            count  type n value 0.
    SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_PERNR FOR P0000-PERNR,
                    S_WERKS FOR PA0001-WERKS,
                    S_BTRTL FOR PA0001-BTRTL,
                    S_PERSG FOR PA0001-PERSG,
                    S_ORGEH FOR PA0001-ORGEH,
                    S_DIV   FOR PA9001-DIV_CODE,
                    S_KZTIM FOR PA0007-KZTIM,
                   S_sname for pa0001-sname, " this is to enter name
                                                             " as manager name
                    S_FUNKT FOR PA0034-FUNKT.
    SELECTION-SCREEN END OF BLOCK SELECTION.
    SELECTION-SCREEN BEGIN OF BLOCK SELECTION1 WITH FRAME TITLE TEXT-002.
    PARAMETERS:     P_BEGDA LIKE SY-DATUM DEFAULT sy-datum.
    *                P_ENDDA LIKE SY-DATUM DEFAULT '99991231'.
    SELECTION-SCREEN END OF BLOCK SELECTION1.
    START-OF-SELECTION.
    if P_BEGDA is initial.
      p_begda = sy-datum.
    endif.
    if P_ENDDA is initial.
      p_endda = sy-datum.
    endif.
    if S_PERSG is initial.
    *    S_PERSG-SIGN = 'I'.
    *    S_PERSG-OPTION = 'EQ'.
    *    S_PERSG-LOW = '1'.
    *    APPEND S_PERSG.
    *    S_PERSG-SIGN = 'I'.
    *    S_PERSG-OPTION = 'EQ'.
    *    S_PERSG-LOW = '6'.
    *    APPEND S_PERSG.
        S_PERSG-SIGN = 'I'.
        S_PERSG-OPTION = 'NE'.
        S_PERSG-LOW = '5'.
        APPEND S_PERSG.
    endif.
      SELECT * FROM PA0001 into IT_PA0001
        WHERE PERNR IN S_PERNR
          AND WERKS IN S_WERKS
          AND BTRTL IN S_BTRTL
          AND PERSG IN S_PERSG
          AND ORGEH IN S_ORGEH
          AND BEGDA LE P_BEGDA
          AND ENDDA GE P_ENDDA.
        APPEND IT_PA0001.
      ENDSELECT.
      IF not S_DIV[] is initial.
        SELECT * FROM PA9001 into IT_PA9001
          WHERE DIV_CODE IN S_DIV.
          APPEND IT_PA9001.
        ENDSELECT.
      ENDIF.
      IF not S_KZTIM[] is initial.
        SELECT * FROM PA0007 into IT_PA0007
          WHERE KZTIM IN S_KZTIM.
          APPEND IT_PA0007.
        ENDSELECT.
      ENDIF.
      IF not S_FUNKT[] is initial.
        SELECT * FROM PA0034 into IT_PA0034
          WHERE FUNKT IN S_FUNKT.
          APPEND IT_PA0034.
        ENDSELECT.
      ENDIF.
      SORT IT_PA0001 by SNAME.
      LOOP AT IT_PA0001.
        IF not S_DIV[] is initial.
          READ TABLE IT_PA9001 with key pernr = IT_PA0001-PERNR.
          IF sy-subrc ne 0.
            continue.
          ENDIF.
        ENDIF.
        IF not S_KZTIM[] is initial.
          READ TABLE IT_PA0007 with key pernr = IT_PA0001-PERNR.
          IF sy-subrc ne 0.
            continue.
          ENDIF.
        ENDIF.
        IF not S_FUNKT[] is initial.
          READ TABLE IT_PA0034 with key pernr = IT_PA0001-PERNR.
          IF sy-subrc ne 0.
            continue.
          ENDIF.
        ENDIF.
          V_COUNTER = 1.
                V_EMP = IT_PA0001-PERNR.
                V_KOSTL = IT_PA0001-KOSTL.
    *            WRITE: (10) V_EMP, (20) PA0002-NACHN, (20) PA0002-VORNA.
          WRITE: / SY-VLINE.                   " Left border
            WHILE V_EMP NE ''.
                PERFORM GET_SUPER CHANGING V_EMP V_SUPER
                                    V_EMP_POS.
              if v_emp ne ''.
                  select single * into it_pa0002 from pa0002
                    where pernr = v_emp
                      and begda LE p_begda
                      and endda GE p_endda.
                  IF V_HEADER = 1.
                        PERFORM HEADING.
                    V_HEADER = 0.
                  ENDIF.
                  WRITE:  (10) V_EMP, (17) IT_PA0002-NACHN
                          ,(17) IT_PA0002-VORNA, (40) V_EMP_POS.
                  move v_emp  to  i_hr-pernr.
                  move IT_PA0002-NACHN  to  i_hr-nachn.
                  move IT_PA0002-VORNA  to  i_hr-vorna.
                  move V_EMP_POS  to  i_hr-plans.
                  EMP_INDICATOR = V_COUNTER.
                  IF V_COUNTER = 1.
                    select single * into it_pa9001 from pa9001
                      where pernr = v_emp
                        and begda LE p_begda
                        and endda GE p_endda.
                    select single * into it_pa0007 from pa0007
                      where pernr = v_emp
                        and begda LE p_begda
                        and endda GE p_endda.
                    PERFORM GET_KZTIM_TEXT CHANGING it_pa0007-kztim V_KZTIM.
                    select single * into it_pa0034 from pa0034
                      where pernr = v_emp
                        and begda LE p_begda
                        and endda GE p_endda.
                    PERFORM GET_FUNKT_TEXT CHANGING it_pa0034-funkt v_stext.
                    write: (8) IT_PA9001-DIV_CODE, (17) V_KZTIM,
                           (25) V_STEXT.
                    move  IT_PA9001-DIV_CODE  to  i_hr-div_text.
                    move  v_KZTIM  to  i_hr-kztim.
                  ENDIF.
                  IF V_COUNTER = 0.
                    WRITE: (1) '|'.
                  ENDIF.
                  IF V_COUNTER = 1.
                    PERFORM GET_NAMES.
                    WRITE: (20) V_WERKS, (5) IT_PA0001-BTRTL
                            ,(20) V_ORGEH,(11) V_KOSTL, (3) '|'.
                    V_COUNTER = 0.
                    move  V_WERKS  to  i_hr-werks.
                    move  IT_PA0001-BTRTL  to  i_hr-btrtl.
                    move  V_ORGEH  to  i_hr-orgeh.
                    move  V_KOSTL  to  i_hr-kostl.
                  ENDIF.
                clear it_pa0002.
                refresh it_pa0002.
              endif.
                V_EMP = V_SUPER.
                move V_SUPER to i_hr-mstbr.
                if EMP_INDICATOR EQ 1.
                  append i_hr.
                endif.
                clear i_hr.
            ENDWHILE.
      NEW-LINE.
      CLEAR : V_KZTIM, it_pa9001, it_PA0007.
      ENDLOOP.
    * Check if its a background Job
      IF SY-BATCH NE SPACE.
        perform write_file.     "Output File
      ENDIF.
      ULINE.
    *&      Form  GET_SUPER
    *       This subroutine takes the position number and get the position
    * number that it reports to and then who is holding that position and
    * then the name of the person who is holding that position in order to
    * provide the supervisors name for the person in that position.
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_SUPER CHANGING EMP_SUB EMP_SUPER
                               EMP_SUB_POS  .
      DATA: v_reporto like hrp1001-varyf value space,
            v_holder  like hrp1001-varyf value space,
            v_filled  like hrp1001-varyf value space,
            v_otype   like hrp1001-otype value space,
            v_objid   like hrp1001-objid value space.
      CLEAR: v_reporto, v_holder, v_filled, v_otype, v_objid,
                              EMP_SUB_POS.
      Select single plans
        into v_plans
        from pa0001
            where pernr = emp_sub
              and begda LE p_begda
              and endda GE p_endda.
            CALL FUNCTION 'BAPI_ORGUNITEXT_DATA_GET'
               EXPORTING
                  PLVAR                = '01'
                  OTYPE                = 'S'
                  OBJID                = v_PLANS
                  KEYDATE              = SY-DATUM
                  SCENARIO             = '    '
    *                 EVALPATH             = 0
                  EVALDEPTH            = 0
               IMPORTING
                  RETURN               = IT_RET
               TABLES
    *                 ACTORTAB             = IT_ACT
    *                 STRUCTURALDATA       = IT_STR
                  OBJECTSDATA          = IT_SUP
    *                 FIELDCATALOGUE       = IT_FCAT
    *                 FIELDDATA            = IT_FDAT
            IF SY-SUBRC EQ 0.
              READ TABLE IT_SUP INTO IT_SUPR
                 WITH KEY PLAN_VERS  = '01'
                          OBJECTTYPE = 'S'
                          OBJECT_ID  = v_PLANS.
              IF SY-SUBRC EQ 0.
                MOVE IT_SUPR-LONG_TEXT TO EMP_SUB_POS.
              ENDIF.
            ENDIF.
      Select Single varyf
         into v_reporto
         from hrp1001
            where otype = 'S'
              and objid = v_plans
              and rsign = 'A'
              and relat = '002'
              and begda LE p_begda
              and endda GE p_endda.
      if sy-subrc = 0.
        move v_reporto+0(1) to v_otype.
        move v_reporto+2(8) to v_objid.
        Select single varyf
           into v_holder
           from hrp1001
              where otype = v_otype
                and objid = v_objid
                and rsign = 'A'
                and relat = '008'
              and begda LE p_begda
              and endda GE p_endda.
        if sy-subrc = 0.
          move v_holder+0(1) to v_otype.
          move v_holder+2(8) to v_objid.
          EMP_SUPER = v_objid.
        IF EMP_SUB = EMP_SUPER.
           EMP_SUPER = ''.
        ENDIF.
    *      Select single varyf
    *         into v_filled
    *            from hrp1001
    *               where otype = v_otype
    *                 and objid = v_objid
    *                 and rsign = 'A'
    *                 and relat = '209'.
    *      if sy-subrc = 0.
    *        CLEAR: IT_RET, IT_ACT, IT_STR,  IT_FCAT, IT_FDAT,
    *               IT_SUP, IT_SUPR.
    *        REFRESH: IT_POSS.
    *        move v_filled+0(2) to v_otype.
    *        move v_filled+2(8) to v_objid.
    *        CALL FUNCTION 'BAPI_ORGUNITEXT_DATA_GET'
    *           EXPORTING
    *              PLVAR                = '01'
    *              OTYPE                = v_otype
    *              OBJID                = v_objid
    *              KEYDATE              = V_DATE
    *              SCENARIO             = '    '
    **                 EVALPATH             = 0
    *              EVALDEPTH            = 0
    *           IMPORTING
    *              RETURN               = IT_RET
    *           TABLES
    **                 ACTORTAB             = IT_ACT
    **                 STRUCTURALDATA       = IT_STR
    *              OBJECTSDATA          = IT_SUP
    **                 FIELDCATALOGUE       = IT_FCAT
    **                 FIELDDATA            = IT_FDAT
    *        IF SY-SUBRC EQ 0.
    *          READ TABLE IT_SUP INTO IT_SUPR
    *             WITH KEY PLAN_VERS  = '01'
    *                      OBJECTTYPE = v_otype
    *                      OBJECT_ID  = v_objid.
    *          IF SY-SUBRC EQ 0.
    *            MOVE IT_SUPR-LONG_TEXT TO EMP_SUPER.
    *          ENDIF.
    *        ENDIF.
    *      endif.
        endif.
      endif.
        if sy-subrc <> 0.
           EMP_SUPER = ''.
        endif.
    ENDFORM.                    " GET_SUPER
    *&      Form  HEADING
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM HEADING .
      FORMAT INTENSIFIED OFF.              " Remove any INTENSIFIED
      FORMAT COLOR COL_HEADING INTENSIFIED." Title color
      WRITE:  (10) 'Employee', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position'
                          ,(8) 'Division', (17) 'Management Type'
                          ,(25) 'Corporate Function'
          ,(20) 'Personnel Area', (5) 'PSA'
          ,(20) 'Org. Unit',(11) 'Cost Center',(3) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
              ,(10) 'Supervisor', (17) 'Last Name'
                          ,(17) 'First Name', (40) 'Position', (1) '|'
      ULINE  .                    " Line below titles
        NEW-LINE.
          WRITE: / SY-VLINE.                   " Left border
      FORMAT COLOR OFF.
    ENDFORM.                    " HEADING
    *&      Form  GET_NAMES
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_NAMES .
      CLEAR: IT_RET, IT_ACT, IT_STR, IT_ORG, IT_POS, IT_FCAT, IT_FDAT,
             IT_ORGS, IT_POSS, V_ORGEH, V_WERKS.
      REFRESH: IT_ORGS, IT_POSS.
      MOVE SY-DATUM TO V_DATE.
      CALL FUNCTION 'BAPI_ORGUNITEXT_DATA_GET'
         EXPORTING
            PLVAR                = '01'
            OTYPE                = 'O '
            OBJID                = IT_PA0001-ORGEH
            KEYDATE              = V_DATE
            SCENARIO             = '    '
    *         SCENARIO             = 'MDT1'
    *         EVALPATH             = '0       '
            EVALDEPTH            = 0
         IMPORTING
            RETURN               = IT_RET
         TABLES
    *         ACTORTAB             = IT_ACT
    *         STRUCTURALDATA       = IT_STR
             OBJECTSDATA          = IT_ORG
    *         FIELDCATALOGUE       = IT_FCAT
    *         FIELDDATA            = IT_FDAT
      IF SY-SUBRC EQ 0.
        READ TABLE IT_ORG INTO IT_ORGS
           WITH KEY PLAN_VERS  = '01'
                    OBJECTTYPE = 'O '
                    OBJECT_ID  = IT_PA0001-ORGEH.
        IF SY-SUBRC EQ 0.
          MOVE IT_ORGS-LONG_TEXT TO V_ORGEH.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'HR_TMW_READ_T500P'
        EXPORTING
          PERSA          = IT_PA0001-WERKS
        IMPORTING
          W500P          = IT_T500P
        EXCEPTIONS
          NO_ENTRY_FOUND = 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.
      IF SY-SUBRC EQ 0.
        MOVE IT_T500P-NAME1 TO V_WERKS.
        CLEAR:  IT_T500P.
        REFRESH: IT_T500P.
      ENDIF.
    *  CALL FUNCTION 'HR_TMW_READ_T001P'
    *    EXPORTING
    *      PERSA          = PA0001-WERKS
    *      BTRTL          = PA0001-BTRTL
    *    IMPORTING
    *      W001P          = IT_T001P
    *    EXCEPTIONS
    *      NO_ENTRY_FOUND = 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.
    *  IF SY-SUBRC EQ 0.
    *    MOVE IT_T001P-BTEXT TO IT_HRR05-BTRTL.
    *  ENDIF.
    ENDFORM.                    " GET_NAMES
    *&      Form  GET_KZTIM_TEXT
    *       text
    *      <--P_V_EMP  text
    *      <--P_V_KZTIM  text
    FORM GET_KZTIM_TEXT  CHANGING P_KZTIM_ID
                                  P_KZTIM.
      select single NAME into P_KZTIM from ZKZTIM_VAUES
              where TYPE eq P_KZTIM_ID.
    ENDFORM.                    " GET_KZTIM_TEXT
    *&      Form  GET_FUNKT_TEXT
    *       text
    *      <--P_V_EMP  text
    *      <--P_V_KZTIM  text
    FORM GET_FUNKT_TEXT  CHANGING P_FUNKT_ID
                                  P_STEXT.
      select single STEXT into P_STEXT from T591S
              where SPRSL eq 'EN' and
                    INFTY eq '0034' and
                    SUBTY eq P_FUNKT_ID.
    ENDFORM.                    " GET_KZTIM_TEXT
    *&      Form  write_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM write_file .
    *   Checking the System ID
      if sy-sysid = 'RD1'.
        drive = 'D:\'.
      else.
        drive = 'M:\'.
      endif.
    *  concatenate drive sy-sysid
    *              '\Output\Reports\HR\HR_Public\Emp_Hierarchy'
    *              sy-datum
    *              '.xls' into v_file.
      concatenate drive sy-sysid
                  '\Output\Reports\HR\HR_Public\Emp_Hierarchy.xls'
                  into v_file.
      OPEN DATASET v_file FOR OUTPUT in text mode encoding default.
      concatenate 'Employee'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Division'
                  'Management Type'
                  'Corporate Function'
                  'Personnel Area '
                  'PSA'
                  'Org. Unit'
                  'Cost Center'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                  'Supervisor'
                  'Last Name'
                  'First Name'
                  'Position'
                   into v_filerecord
                   separated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
      transfer v_filerecord to v_file.    "Writing to file
      clear v_filerecord.
      loop at IT_PA0001.
        do.
          if count eq 0.
            read table i_hr with key pernr = IT_PA0001-pernr.
            concatenate i_hr-pernr
                        i_hr-nachn
                        i_hr-vorna
                        i_hr-plans
                        i_hr-div_text
                        i_hr-kztim
                        i_hr-stext
                        i_hr-werks
                        i_hr-btrtl
                        i_hr-orgeh
                        i_hr-kostl
                        into v_filerecord
                        separated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
             mstbr = i_hr-mstbr.
             count = count + 1.
          else.
            read table i_hr with key pernr = mstbr.
            concatenate v_filerecord
                        i_hr-pernr
                        i_hr-nachn
                        i_hr-vorna
                        i_hr-plans
                        into f_filerecord
                        separated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
            v_filerecord = f_filerecord.
            mstbr = i_hr-mstbr.
            clear i_hr.
          endif.
          if mstbr eq space.
            exit.
          endif.
        enddo.
        transfer v_filerecord to v_file.  "Writing to file
        clear: v_filerecord, f_filerecord, count.
      endloop.
      CLOSE DATASET v_file.
    ENDFORM.                    " write_file
    Edited by: Surender Batlanki on Feb 20, 2008 7:50 AM
    Edited by: Surender Batlanki on Feb 20, 2008 7:59 AM
    Edited by: Surender Batlanki on Feb 20, 2008 8:12 AM
    Edited by: Surender Batlanki on Feb 20, 2008 3:16 PM
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 9:26 AM

    Hi Surender,
    In the Perform GET_SUPER, you are getting manager's OBJID. Use this OBJID and from PA0001 get Manger's name.
    While passing data to output table, filter that table by Manager's name and then pass output table for display.
    Hope this helps u.
    <REMOVED BY MODERATOR>
    Regards,
    Preeti
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 9:26 AM

  • How can I add a new field in selection screen for this report

    *& Report  ZGS_BARKODLA_HIZLI_GIRIS
    report  zgs_barkodla_hizli_giris.
    tables: mara,
            mseg,
            mch1,
            *mch1,
            mkpf,
            mchb ,
            makt.
    type-pools: esp1.
    data: i_message_tab  type esp1_message_tab_type,
          wa_message_tab type esp1_message_wa_type ,
          sc_count type i.
    ALV
    type-pools: slis, kkblo.
    data: gs_layout   type slis_layout_alv                     ,
          gt_fldcat   type slis_t_fieldcat_alv with header line,
          gt_header   type slis_t_listheader   with header line,
          gt_sortin   type slis_t_sortinfo_alv with header line,
          g_repid     like sy-repid                            .
    define add-fieldcat.
      gt_fldcat-fieldname     = &1.
      gt_fldcat-ref_tabname   = &2.
      gt_fldcat-seltext_s     = &3.
      gt_fldcat-seltext_m     = &3.
      gt_fldcat-seltext_l     = &3.
      gt_fldcat-reptext_ddic  = &3.
      gt_fldcat-ddictxt       = 'M'.
      append gt_fldcat.
      clear  gt_fldcat.
    end-of-definition.
    types: begin of titab,
            sel   type xfeld,
            matnr type matnr,
            maktx type maktx,
            charg type charg_d,
            menge type menge_d,
            erfmg type erfmg,
           end of titab.
    data : witab type titab.
    data : itab type table of titab.
    data : ok_code type sy-ucomm.
    controls: tc_itab type tableview using screen 0100.
    data: gv_header like bapi2017_gm_head_01,
          gv_code   like bapi2017_gm_code.
    BAPI export parameters
    data: gv_headret type bapi2017_gm_head_ret,
          gv_matdoc  type bapi2017_gm_head_ret-mat_doc,
          gv_matyear type bapi2017_gm_head_ret-doc_year.
    data : lv_objek like inob-objek .
    data : ls_inob  like inob .
    data : imseg type ty_t_mseg.
    data : wmseg type mseg.
    data : answer.
    data : count type i.
    data : v_atinn type atinn.
    BAPI movement details
    data: i_goodsmvt_items type bapi2017_gm_item_create occurs 0
          with header line.
    data: i_return type bapiret2 occurs 0 with header line.
    start-of-selection.
    call function 'CONVERSION_EXIT_ATINN_INPUT'
       exporting
         input  = 'Z_ORAN'
       importing
         output = v_atinn.
      call screen 100.
    *&      Module  status_0100  OUTPUT
    module status_0100 output.
      set pf-status '100'.
      set titlebar '100'.
      mseg-werks = 1000.
      mseg-umwrk = 1000.
    **added
      sc_count = sc_count + 1.
      if sc_count eq 1.
        mseg-bwart = 313.
      endif.
      mkpf-budat = sy-datum.
    **added
      describe table itab lines tc_itab-lines.
    endmodule.                 " status_0100  OUTPUT
    *&      Module  user_command_0100  INPUT
    module user_command_0100 input.
      data field(20).
      data: line_t like sy-index.
      data: lines  like sy-index.
      data line_count like sy-loopc.
      data: begin of cols,
             screen      like screen,
             index       type i,
             selected(1) type c,
             vislength   like icon-oleng,
             invisible(1) type c,
           end   of cols.
      case ok_code.
        when 'DELE'.
          delete itab where sel eq 'X'.
        when 'ENTE'.
          check *mch1-charg is not initial.
          read table itab into witab with key charg = *mch1-charg.
          if not sy-subrc is initial.
            witab-charg = *mch1-charg.
            select single matnr from mch1 into witab-matnr
                               where charg eq witab-charg.
            if not syst-subrc is initial.
              set cursor field '*MCH1-CHARG'.
              message e115(12) with *mch1-charg.
            endif.
            select single maktx from makt into witab-maktx
                               where matnr eq witab-matnr
                                 and spras eq syst-langu.
            witab-erfmg = 1.
            concatenate witab-matnr witab-charg into lv_objek .
            clear ls_inob .
            select single * into ls_inob
                            from inob
                            where objek = lv_objek and
                                  klart = '023'    and
                                  obtab = 'MCH1' .
            select single atflv from ausp into witab-menge
                     where objek = ls_inob-cuobj and
                           klart = '023' .
            append witab to itab.
    **added
            clear *mch1-charg.
    **added
          endif.
        when 'SAVE'.
          if mkpf-budat is initial.
            set cursor field 'MKPF-BUDAT'.
            message e055(00).
          endif.
          if mseg-lgort is initial.
            set cursor field 'MSEG-LGORT'.
            message e055(00).
          endif.
          if mseg-umlgo is initial.
            set cursor field 'MSEG-UMLGO'.
            message e055(00).
          endif.
          if mseg-bwart is initial.
            set cursor field 'MSEG-BWART'.
            message e055(00).
          endif.
          refresh imseg.
          loop at itab into witab.
            move-corresponding witab to wmseg.
            append wmseg to imseg.
          endloop.
          call function 'ZMM_POPUP_WITH_DATA'
            exporting
              imseg  = imseg
            importing
              answer = answer.
          if answer eq 'Y'.
            perform create_goods_movement.
          endif.
        when 'P--'.
          clear ok_code.
          perform paging using 'P--'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P-'.
          clear ok_code.
          perform paging using 'P-'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P+'.
          clear ok_code.
          clear lines.
          perform paging using 'P+'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P++'.
          clear ok_code.
          perform paging using 'P++'.
          set cursor field 'MARA-MATNR' line 1.
        when 'SORA'.
          read table tc_itab-cols into cols with key selected = 'X'.
          if sy-subrc is initial.
            field = cols-screen.
            field = field+5(10).
            sort itab ascending by (field).
          endif.
        when 'SORZ'.
          read table tc_itab-cols into cols with key selected = 'X'.
          if sy-subrc is initial.
            field = cols-screen.
            field = field+5(10).
            sort itab descending by (field).
          endif.
        when 'PRNT'.
          perform write_alv.
      endcase.
    endmodule.                 " user_command_0100  INPUT
    *&      Module  read_table  OUTPUT
    module read_table output.
      mara-matnr = witab-matnr.
      makt-maktx = witab-maktx.
      mch1-charg = witab-charg.
      mseg-menge = witab-menge.
      mseg-erfmg = witab-erfmg.
      line_count = sy-loopc.
    endmodule.                 " read_table  OUTPUT
    *&      Module  write_table  INPUT
    module write_table input.
      witab-matnr = mara-matnr.
      witab-maktx = makt-maktx.
      witab-charg = mch1-charg.
      witab-menge = mseg-menge.
      witab-erfmg = mseg-erfmg.
      modify itab from witab index tc_itab-current_line.
    endmodule.                 " write_table  INPUT
    *&      Module  exit  INPUT
    module exit input.
      leave to screen 0 .
    endmodule.                 " exit  INPUT
    *&      Form  create_goods_movement
    form create_goods_movement .
      clear : gv_header, i_return[], i_goodsmvt_items[].
      gv_header-doc_date = gv_header-pstng_date = mkpf-budat.
      gv_header-pr_uname = sy-uname.
    GM with reference to reservation
      loop at itab into witab.
        i_goodsmvt_items-material   = witab-matnr.
        i_goodsmvt_items-entry_qnt  = witab-erfmg.
        i_goodsmvt_items-entry_uom  = 'ST'.
        i_goodsmvt_items-move_type  = mseg-bwart.
        i_goodsmvt_items-plant      = mseg-werks.
        i_goodsmvt_items-stge_loc   = mseg-lgort.
        i_goodsmvt_items-move_plant = mseg-umwrk.
        i_goodsmvt_items-move_stloc = mseg-umlgo.
        i_goodsmvt_items-batch      = witab-charg.
        append i_goodsmvt_items.
      endloop.
    find BAPI processing transaction
      if gv_code is initial.
        perform determine_bapi_code using mseg-bwart
                                 changing gv_code.
      endif.
      call function 'BAPI_GOODSMVT_CREATE'
        exporting
          goodsmvt_header  = gv_header
          goodsmvt_code    = gv_code
        importing
          goodsmvt_headret = gv_headret
          materialdocument = gv_matdoc
          matdocumentyear  = gv_matyear
        tables
          goodsmvt_item    = i_goodsmvt_items
          return           = i_return[].
    cancel blocking process
      loop at i_return where type eq 'E' or type eq 'A' or type eq 'X'.
        exit.
      endloop.
      if sy-subrc ne 0.
        refresh i_message_tab.
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
        wa_message_tab-msgid = 'M7'..
        wa_message_tab-msgty = 'S'.
        wa_message_tab-msgno = '060'.
        wa_message_tab-msgv1 = gv_matdoc.
        wa_message_tab-msgv2 = ''.
        wa_message_tab-msgv3 = ''.
        wa_message_tab-msgv4 = ''.
        append wa_message_tab to i_message_tab.
      else.
        refresh i_message_tab.
        call function 'BAPI_TRANSACTION_ROLLBACK'.
    write a message as there is an unexpected error.
        loop at i_return.
          wa_message_tab-msgid = i_return-id.
          wa_message_tab-msgty = i_return-type.
          wa_message_tab-msgno = i_return-number.
          wa_message_tab-msgv1 = i_return-message_v1.
          wa_message_tab-msgv2 = i_return-message_v2.
          wa_message_tab-msgv3 = i_return-message_v3.
          wa_message_tab-msgv4 = i_return-message_v4.
          append wa_message_tab to i_message_tab.
        endloop.
      endif.
      call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
        tables
          i_message_tab = i_message_tab.
    endform.                    " create_goods_movement
    *&      Form  determine_bapi_code
    form determine_bapi_code using p_bwart type bwart
    changing p_code type bapi2017_gm_code.
      data: lt_t158b type table of t158b with header line.
      clear p_code.
      select tcode from t158b into corresponding fields of table lt_t158b
      where bwart eq p_bwart.
      loop at lt_t158b.
        select single gmcode from t158g into p_code
        where tcode eq lt_t158b-tcode.
        if sy-subrc is initial.
          exit.
        endif.
      endloop.
    endform. " determine_bapi_code
    *&      Form  paging
    form paging using code.
      data: i type i,
            j type i.
      case code.
        when 'P--'. tc_itab-top_line = 1.
        when 'P-'.
          tc_itab-top_line = tc_itab-top_line - line_count.
          if tc_itab-top_line le 0.
            tc_itab-top_line = 1.
          endif.
        when 'P+'.
          i = tc_itab-top_line +  line_count.
          j = tc_itab-lines -  line_count + 1.
          if j le 0.
            j = 1.
          endif.
          if i le j.
            tc_itab-top_line = i.
          else.
            tc_itab-top_line = j.
          endif.
        when 'P++'.
          tc_itab-top_line = tc_itab-lines - line_count + 1.
          if tc_itab-top_line le 0.
            tc_itab-top_line = 1.
          endif.
      endcase.
    endform.                    " paging
    *&      Form  write_alv
    form write_alv .
      perform find_list_header.
      perform fill_field_cat.
      perform fill_sortinfo.
      g_repid = sy-repid.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
      answer = 'Y'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_buffer_active        = ''
          i_callback_program     = g_repid
          i_save                 = 'A'
        i_callback_top_of_page = 'TOP_OF_PAGE'
          is_layout              = gs_layout
          it_fieldcat            = gt_fldcat[]
         it_sort                = gt_sortin[]
        tables
          t_outtab               = itab[].
    endform.                    " write_alv
         Form  find_list_header
    form find_list_header.
      data : v_datum(10),
             v_datlo(10),
             v_dathi(10),
             v_uzeit(8).
      clear: gt_header, gt_header[].
      gt_header-typ  = 'H'.
      gt_header-info = sy-title.
      append gt_header.
      clear gt_header.
      gt_header-typ  = 'S'.
      gt_header-key  = 'Çal&#305;&#351;t&#305;rma Zaman&#305; : '.
      write syst-datum to v_datum.
      write syst-uzeit to v_uzeit.
      concatenate v_datum '/' v_uzeit into gt_header-info.
      append gt_header.
    endform.                    " find_list_header
         Form  fill_field_cat
    form fill_field_cat.
      refresh gt_fldcat.
      clear   gt_fldcat.
      gt_fldcat-key = 'X'.
      add-fieldcat 'MATNR'  'MARA' ''.
      add-fieldcat 'MAKTX'  'MAKT' ''.
      add-fieldcat 'CHARG'  'MSEG' ''.
      gt_fldcat-do_sum = 'X'.
      add-fieldcat 'MEINS'  'MARA' 'Olcu Birimi '.
      gt_fldcat-do_sum = 'X'.
      add-fieldcat 'ERFMG'  'MSEG' 'Adet'.
    endform.                    " fill_field_cat
         Form  fill_sortinfo
    form fill_sortinfo.
      gt_sortin-up            = 'X'.
      gt_sortin-fieldname     = 'MATNR'.  append gt_sortin.
    endform.                    " fill_sortinfo
         Form  top_of_page                                              *
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          i_logo             = 'ZKUTAS'
          it_list_commentary = gt_header[].
    endform.                    " top_of_page

    HI,
    if it is a normal report program then you can directly create a Selection screen field.
    After the Type-pool you can use Parameters or Select-options to create the selection screen field..
    If it is a Modulpool program then you can create a selection scren field like
    SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
    PARAMETERS: p1(10) TYPE c.
    SELECTION-SCREEN END OF SCREEN 1100.
    defines a selection screens – 1100 – as subscreens.
    The next screen number of screen 100 is 100 (statically-defined).
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      CALL SUBSCREEN area INCLUDING sy-repid number.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      CALL SUBSCREEN area.
      MODULE user_command_0100.
    look at the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
    Regards
    Sudheer

  • How to add customize message on the variable selection screen in the query

    Hi all,
    Can we add an customise message on the variable selection screen in the query? If yes please let me know how it can be achevied?
    Thanks,
    Rani

    Hi Rani,
    I faced a similar issue (for what I understand your request is).
    My requirement for the Variable Screen was to do:
       1) place a link to a ppt file
       2) remove buttons "Save", "Save As...), "Delete"... the standard buttons come when running the Query or WebTempl
    We were using a Web Templ for BI7.0
    I struggled trying to find out how to do it. My conclusions are:
    - WAD, not sure we can accomplish it using a Web Template but i did not "play" a lot with the Web_Template Properties in order to know
    - XHTML, I was told in my post HTML modification was the way, but I have close to nil background in HTML and couold not find the way of accessing the Variable Entry screen
    For instance, I had to remove similar buttons and change some font size from a link on the Web Template (WAD), which was pretty straight forward. In WAD the buttons come with its own icon and to increase the Font size for that link we used XHTML (<font size="2" >). But the heck of the variable screen...well, i just did not get trhough to it to modify it in any way.
    Good luck,
    Definetly in a Query I would say that no.
    alex
    PS: If anyone had a better insight, please feel free to share it.

Maybe you are looking for