How to haveour own titles/captions in selection screen & in column headings

we have SAP B1 2005 A, MS SQL 2005
though i am new to MSSQL/T-SQL programming, purely through lot of trials & errors i have learnt & managed to develop many reports/queries !
but, i am facing some problems : how to have our own captions/title for the options in selection screen & aso in reports/queries column headings.
e.g. :
for Customer Aging analysis, i would like to accept a set of 3 parameters (aging days) from the user. where the user may enter the values 30, 60 & 90 OR any other values.
i have the following codes for this purpose (considering my question's (over) size, only small portions of my program are given below)
declare @mdue1 int,
           @mdue2 int,
            @mdue3 int
set @mdue1 = [%1]
set @mdue2 = [%2]
set @mdue3 = [%3]
but, in the selection screen, the system displays "%1 Debit Amount   Greater than" as the caption & 0.00 as the default value. the same is the case for the other two parameters [%2] & [%3] also.
i tried defining the variable @mdue1 as smallint & also tinyint, but the result is the same.
how to have our own captions/title for the options in selection screen instead of the ones displayed by t-sql based on our SELECT statement.
how to have our own column headings, dynamically defined/coined using variables instead of hard coded columns headings (within quotes).
e.g. in the select statement, instead of defining a column as '<= 30 Days' = T0.due_1
i would like to get the number of days from the user, who may enter 30 or 40 or whatever.
i would like to display the value that the user entered in the column heading using a variable say @mcol1
declare @mcol1 varchar(10)
set @mcol1 = '<= 'convert(varchar(10), @mdue1)' Days'
SELECT T0.CardCode,@mcol1 = T0.due_1 from #CustAging T0
but, this ends up in error.
i have already searched the net for ebooks, articles, etc. for a solution to this problem, but till now, i could not find any addressing these problems.
i have just registered in this forum with a hope to get a solution. thanks a lot in advance.
Thanks & Regards,
Raghu Iyer
Place : Vapi, Gujarat, India

thanks a lot, lstvan.
i think, it i a good "trick" worth trying out.
well, i will now mark this question as answered, but still, if anyone has a direct solution "problem", please do share with us.
i am able to write queries (in fact, full fledged programs) in T-SQL & getting the desired output and for such a trivial thing i do not want to go for an add-on SDK module. but, considering the limitations of T-SQL and the complex requirements of real business world, i think, we have to go the .net way only.
regarding add-ons, i heard that add-ons will slow down SAP B1. is it true ?
Thanks & Regards,
Raghu iyer

Similar Messages

  • How can i set a Title to Parameters(Selection-Screen)?

    Hi,
    i have a Selection-Screen with two Parameters. Both Parameters should be have an Title.
    But how can I set a Title two this Parameters? Is there existing any options????
    For example, the Parameters "I_WRBTR" and "I_NBDOCS" needs two Title´s.
    Every Parameter must have a title, but how can I realize this???
    *I have know only a title for "IWRBTR" but i need also a title for "I_NBDOCS"*_.
    DATA: FIELD_BUKRS(10).
    SELECTION-SCREEN BEGIN OF SCREEN 0100.
      SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
         SELECT-OPTIONS SEL_BUKR FOR FIELD_BUKRS OBLIGATORY.
         SELECTION-SCREEN BEGIN OF LINE, COMMENT (25) text-005 FOR FIELD IWRBTR_, POSITION 33.
             PARAMETERS: I_WRBTR(10),
                                      I_NBDOCS(3).
         SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN END OF SCREEN 0100.
    Thanks for Helps.
    ETN

    Hi,
    try this short example:
    DATA: FIELD_BUKRS(10).
    SELECTION-SCREEN BEGIN OF BLOCK BLOCK WITH FRAME TITLE T_BLOCK.
    SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE T_BLOCK1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (29) T_SEL_BU.
    SELECT-OPTIONS SEL_BUKR FOR FIELD_BUKRS OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BLOCK1.
    SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE T_BLOCK2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (32) T_WRBTR.
    PARAMETERS: I_WRBTR(10).
    SELECTION-SCREEN COMMENT 50(15) T_NBDOCS.
    PARAMETERS: I_NBDOCS(3).
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BLOCK2.
    SELECTION-SCREEN END OF BLOCK BLOCK.
    INITIALIZATION.
      T_BLOCK  = 'parameter'.
      T_BLOCK1 = '1. parameter'.
      T_BLOCK2 = '2. parameter'.
      T_SEL_BU = 'Buchungskreis'.
      T_WRBTR  = 'Parameter wrbtr'.
      T_NBDOCS = 'Parameter nbdocs'.
    Regards, Dieter

  • How to hide the title caption of the column

    Hi friends,
    Can i hide the title caption of a column in a matrix. In my matrix there is only one column. i need to display its like a list box. Any one know how to hide the title caption of the column
    Thanks

    Hi Muna,
    this is a c# code how you clear the title from a column:
    ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxUID").Specific)).Columns.Item("ColUID").TitleObject.Caption = "";
    lg David

  • Title in a selection-screen

    Hi.
    How i can insert a title in this selection-screen:
    SELECTION-SCREEN BEGIN OF BLOCK 2  WITH FRAME TITLE modifica.
    PARAMETERS: manual RADIOBUTTON GROUP modf  DEFAULT 'X',
                fichero RADIOBUTTON GROUP modf.
    SELECTION-SCREEN END OF BLOCK 2.
    thanks.

    http://help.sap.com/saphelp_nw04/helpdata/en/e4/2adbec449911d1949c0000e8353423/content.htm
    Eg.
    SELECTION-SCREEN BEGIN OF BLOCK BL_1 WITH FRAME TITLE TEXT-000.
    SELECTION-SCREEN BEGIN OF BLOCK BL_7.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN END OF BLOCK BL_7.
    SELECTION-SCREEN BEGIN OF BLOCK BL_2 WITH FRAME TITLE TEXT-001.
    PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
    R2 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK BL_2.
    SELECTION-SCREEN END OF BLOCK BL_1.
    The plant selection screen.
    SELECTION-SCREEN BEGIN OF SCREEN 1111.
    SELECTION-SCREEN BEGIN OF BLOCK BL_4 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS S_WERKS FOR MARC-WERKS NO INTERVALS.
    SELECTION-SCREEN INCLUDE : SELECT-OPTIONS S_MATNR.
    SELECTION-SCREEN END OF BLOCK BL_4.
    SELECTION-SCREEN END OF SCREEN 1111.
    *The sales selection screen.
    SELECTION-SCREEN BEGIN OF SCREEN 2222.
    SELECTION-SCREEN BEGIN OF BLOCK BL_5 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS S_VKORG FOR MVKE-VKORG NO INTERVALS.
    SELECTION-SCREEN INCLUDE : SELECT-OPTIONS S_MATNR.
    SELECTION-SCREEN END OF BLOCK BL_5.
    SELECTION-SCREEN END OF SCREEN 2222.
    START-OF-SELECTION.
    IF R1 = 'X'.
    CALL SELECTION-SCREEN 1111.
    ELSEIF R2 = 'X'.
    CALL SELECTION-SCREEN 2222.
    ENDIF.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
    reward  points  if it is usefull ..
    Girish

  • How to create Option Boxes IN A SELECTION SCREEN

    How to create Option Boxes IN A SELECTION SCREEN.
    Thanks!

    Hi Rajesh,
    The following explanation gives clear picture of what is mean of check box and radio button with coding.....................
    <b>CHECK BOX :</b>
    AS CHECKBOX [USER-COMMAND fcode]
    Effect:
    This addition specifies that the input field in the first position of the selection screen is displayed as a checkbox, with the corresponding description next to it on the right. The checkbox is selected if the value of para is "X" or r "x". Otherwise, it is not selected.
    The parameter must be created with the type c and length 1. An explicit length len is not permitted. If the addition TYPE is used, this can only be followed by the generic type c or a non-generic data type of type c and length 1.
    The addition USER-COMMAND can be used to assign a function code fcode to the parameter. The function code fcode must be directly specified and may have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects the checkbox on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.
    Notes
    If the TYPE addition is used to make a reference to a data type in the ABAP Dictionary of type CHAR and length 1, and for which t the valid values in the domain are defined as "X" and " ", the parameter is automatically displayed as a checkbox on the selection screen.
    If the addition USER-COMMAND is specified without the addition AS CHECKBOX, and the parameter is of type c with length 1, it is also displayed as a checkbox.
    The addition USER-COMMAND can, for example, be used for screen modifications with the addition MODIF ID (see example).
    <b>Coding :</b>
    PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p1(10) TYPE c,
                p2(10) TYPE c,
                p3(10) TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS: p4(10) TYPE c MODIF ID bl2,
                p5(10) TYPE c MODIF ID bl2,
                p6(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.
    <b>RADIO BUTTON COMMAND :</b>
    RADIOBUTTON GROUP group [USER-COMMAND fcode]
    Effect:
    This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.
    group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.
    The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type c and length 1.
    In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".
    The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.
    Note:
    It is recommended to define the radio buttons of a radio button group directly underneath each other. If the selection screen also contains other elements, it is recommended to define each radio button group within a block surrounded by a frame.
    <b>CODING :</b>
    tables : mkpf,mseg,ekko.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1,
                c as checkbox.
    SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND UC1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    write :/ p_werks,
           / s_ebeln.
    AT SELECTION-SCREEN OUTPUT .
    LOOP AT SCREEN .
    IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.
    SCREEN-INPUT = 0.
    SCREEN-REQUIRED = 1.
    clear s_ebeln[].
    clear p_werks.
    MODIFY SCREEN.
    ENDIF.
    IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
    SCREEN-INPUT = 0.
    SCREEN-REQUIRED = 1.
    clear s_ebeln[].
    clear p_werks.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    Let me knwo if any doubts.
    <b>Reward with points if it helpful</b>
    Regards,
    Vijay

  • How to pass a default value in selection screen of logical database pnpce

    Dear All,
    Can any one tell me how to pass a default value in selection screen of logical database pnpce .
    Regards
    Rakesh Singh

    Hi Rakesh,
    Go to SE36 (logical database Builder).First enter PNPCE in Logical Database and press documentation,here you will get the details of exactly what is PNPCE and how it works.After that select selections in subojects in se36 only and enter display ,there you have the include from where you acn get the idea.
    Regards,
    Rahul

  • How to Improve the performance in Variable Selection Screen.

    Hi,
    In Query Level we have Variable " User entry Defalt Valu". User want select particular value when he press "F4" it's take hours time how to improve the performance in Varaible Selection Screen.
    Thanks in Advance.
    Regards,
    Venkat.

    Dear Venkat.
    You please try the following steps:
    1. Say the InfoObject is 0EMPLOYEE against which you have created the variable, which user is trying to select value against, when they execute the report.
    2. Goto RSA1-> InfoObject tab-> Select InfoObject 0EMPLOYEE.
    3. Selcet the following options:
       Query Execution Filter Val. Selectn  -  'Only Posted Value for Navigation'
       Filter Value Repr. At Query Exec. -      'Selector Box Without Values'
    Please let me know if there is any more issue. Feel free to raise further concern
    Thnx,
    Sukdev K

  • How to provide F4 help in a selection screen

    Hi..
       How to provide F4 help in a selection screen for a particular field  using  
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'.
    Thanks in Advance.
    Regards
    Raj Kumar

      AT SELECTION SCREEN
    at selection-screen on value-request for s_contr-low.
    Get contract (low value)
      perform get_contract changing s_contr-low.
    form get_contract  changing p_contr .
      types: begin of ty_ycontract,
               ycontract type xchcontract-ycontract,
               lifnr     type xchcontract-lifnr,
               ycontdate type xchcontract-ycontdate,
               ycont_end_dt type xchcontract-ycont_end_dt ,
             end of ty_ycontract.
      data: ds_returntab   type ddshretval,
            dt_returntab   type table of ddshretval,
            dl_fieldname     type dfies-fieldname.
      data: dt_ycontract type table of ty_ycontract.
      select ycontract lifnr ycontdate ycont_end_dt
        from xchcontract
        into table dt_ycontract.
      if sy-subrc = 0.
        clear dl_fieldname.
        dl_fieldname = 'YCONTRACT'.
        call function 'F4IF_INT_TABLE_VALUE_REQUEST'
          exporting
            retfield        = dl_fieldname
            value_org       = 'S'
          tables
            value_tab       = dt_ycontract
            return_tab      = dt_returntab
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc = 0.
          clear ds_returntab.
          read table dt_returntab into ds_returntab index 1.
          if sy-subrc = 0.
            p_contr = ds_returntab-fieldval.
          endif.
        endif.
      endif.
    endform.

  • How to Remove the underline from the selection screen parameter

    How to remove the underline from a selection screen parameter ?

    >
    Anoop Menon wrote:
    > hi Avinash,
    >
    > I am not able to understand the use of the 'comment line properly.
    >
    > The last part of the statement which says modif id is confusing.
    >
    > Please clarify..... I am unable to activate my code when I put the selection screen commebnt statement.
    Use this and update it to your requierement !
    SELECTION-SCREEN begin of line.
    SELECTION-SCREEN COMMENT 1(30) comm.
    PARAMETERS test(1) type c.
      SELECTION-SCREEN end of line.
    INITIALIZATION.
      comm = 'test'.

  • How to add profit center in fbl5n selection screen

    how to add profit center in fbl5n selection screen
    and
    it is save to copy  ddf from sap to cus
    wll it affect anything else

    When you are on selection screen of FBL5N, press (Shift + F4) DYNAMIC SELECTIONS, there you will see a Dynamic selection screen along with your normal FBL5N selection screen, you will find Profit Centre ther, if you don't find Profit Centre in Dynamic Selection Screen you can add the same from the list on the left, search for profit centre, place your cursor on Profit centre and press the Arrow Button(Copy Selected) on top of the list. Now you will find Prfit Centre in Dynamic selection screen, fill the field with values and press save, that's it.....
    Reward points if useful, get back in case of query...
    Cheers!!!

  • How to disable a pushbutton created in selection screen.

    How to disable a pushbutton created in selection screen.

    you can make it invisible during runtime.
    At the event,  AT SELECTION-SCREEN OUTPUT. you can turn attributes on and off for screen elements.  In this case, invisible = 1, makes the element invisible, 0 makes is visible.
    here is a short sample.
    report zrich_0001.
    parameters: p_check type c.
    selection-screen pushbutton 40(20) gocfg
                         user-command gocfg.
    at selection-screen output.
      loop at screen.
        if screen-name = 'GOCFG'.
          screen-invisible = '1'.
          modify screen.
        endif.
      endloop.
    Regards,
    Rich Heilman

  • How can we use list box on selection screen

    hi, howe can we use list box on selection screen and how can we populate the dat ainto the list box and how can we retrive data based on list box from ther database.
    thanks in advance
    raju

    Use the VRM_SET_VALUES function module.
    DATA: list              TYPE vrm_values,
          value             LIKE LINE OF list.
               AT SELECTION SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      name = 'P_OBJECT'.
      CLEAR list.
      REFRESH list.
      CLEAR value.
      value-key = '1'.
      value-text = 'Development Class'.
      APPEND value TO list.
      CLEAR value.
      value-key = '2'.
      value-text = 'Program'.
      APPEND value TO list.
      CLEAR value.
      value-key = '3'.
      value-text = 'Function Module'.
      APPEND value TO list.
      CLEAR value.
      value-key = '4'.
      value-text = 'Database Table'.
      APPEND value TO list.
      CLEAR value.
      value-key = '5'.
      value-text = 'Structure'.
      APPEND value TO list.
      CLEAR value.
      value-key = '6'.
      value-text = 'View'.
      APPEND value TO list.
      CLEAR value.
      value-key = '7'.
      value-text = 'Data Element'.
      APPEND value TO list.
      CLEAR value.
      value-key = '8'.
      value-text = 'Table Type'.
      APPEND value TO list.
      CLEAR value.
      value-key = '9'.
      value-text = 'Class / Interface'.
      APPEND value TO list.
      CLEAR value.
      value-key = '10'.
      value-text = 'Type Group'.
      APPEND value TO list.
      CLEAR value.
      value-key = '11'.
      value-text = 'Domain'.
      APPEND value TO list.
      CLEAR value.
      value-key = '12'.
      value-text = 'Search Help'.
      APPEND value TO list.
      CLEAR value.
      value-key = '13'.
      value-text = 'Lock Object'.
      APPEND value TO list.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = name
          values          = list
        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.

  • How to add program documentation icon on selection screen

    Hi All,
    Please let me know how to add  program documentation icon on selection screen.
    Thanks
    Jog

    THis is pretty straight forward, in se38, enter program name, click change.  Now click Go To, Documentation.  Enter the documentation on this screen, save and activate, now run the program,  the icon will be there.
    REgards,
    Rich Heilman

  • How to put a value in a selection screen parameter

    how do i forcefully put a value to a field in the selection screen.
    i mean during runtime.
    and it's a parameter not a selection-option.
    thanks

    Hi,
    Check this sample code.It can help you.Basically you need to use 'DYNP_VALUES_READ' in at selection-screen on value-request for s_posnr-low.
    tables : vbap.         " Sales Document: Item Data
                         Constant Declaration                                      *
    CONSTANTS:
      C_X TYPE C VALUE 'X'.     " Translate to Uppercase
                         Variable Declaration                                      *
    Variable for Table index
      data v_sytabix like sy-tabix.
    Variable for Program name
      data L_NAME LIKE SYST-REPID.
    Range for getting values form selection screen
    DATA: BEGIN OF range1 OCCURS 0,
             SIGN(1),
             OPTION(2),
             LOW  LIKE vbap-vbeln,
             high like vbap-vbeln,
          END OF range1.
    Internal table for Report output
      data: begin of i_vbap occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of i_vbap.
    Internal table for output to the F4 help
      data: begin of I_DISPLAY occurs 0,
              vbeln like vbap-vbeln,            " Sales Document
              posnr like vbap-posnr,            " Sales Document item
            end of I_DISPLAY.
    Internal table for return value form function module
      DATA: BEGIN OF I_RETURNVAL OCCURS 0.
              INCLUDE STRUCTURE DDSHRETVAL.     " Interface Structure Search
      DATA: END OF I_RETURNVAL.
    Internal table for F4 help field heading
      DATA: I_FIELDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.
    Internal table for getting screen values from selection screen
      data L_SCR_FIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME title text-001.
      select-options:
            S_VBELN for vbap-vbeln no intervals,
            S_POSNR for vbap-posnr no intervals.
    SELECTION-SCREEN end OF BLOCK B1.
    at selection-screen on value-request for s_posnr-low.
      clear: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      refresh: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
      L_NAME = SYST-REPID.
      MOVE 'S_VBELN-LOW' TO L_SCR_FIELDS-FIELDNAME.
      APPEND L_SCR_FIELDS.
    Call the Function module DYNP_VALUES_READ to get the values form
    selection screen
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME                         = L_NAME
          DYNUMB                         = SYST-DYNNR
          TRANSLATE_TO_UPPER             = C_X         " X
        TABLES
          DYNPFIELDS                     = L_SCR_FIELDS
       EXCEPTIONS
         INVALID_ABAPWORKAREA           = 1
         INVALID_DYNPROFIELD            = 2
         INVALID_DYNPRONAME             = 3
         INVALID_DYNPRONUMMER           = 4
         INVALID_REQUEST                = 5
         NO_FIELDDESCRIPTION            = 6
         INVALID_PARAMETER              = 7
         UNDEFIND_ERROR                 = 8
         DOUBLE_CONVERSION              = 9
         STEPL_NOT_FOUND                = 10
         OTHERS                         = 11
      IF SY-SUBRC eq 0.
        LOOP AT L_SCR_FIELDS.
          range1-sign = 'I'.
          range1-option = 'EQ'.
          range1-low = L_SCR_FIELDS-FIELDVALUE.
          range1-high = space.
          append range1.
        ENDLOOP.
      ENDIF.
    F4 help Field headings
      I_FIELDTAB-TABNAME = 'I_DISPLAY'.
      I_FIELDTAB-FIELDNAME = 'VBELN'.
      I_FIELDTAB-POSITION = '1'.
      I_FIELDTAB-OUTPUTLEN = '10'.
      I_FIELDTAB-INTTYPE = 'C'.
      I_FIELDTAB-INTLEN = '10'.
      APPEND I_FIELDTAB.
      I_FIELDTAB-FIELDNAME = 'POSNR'.
      I_FIELDTAB-POSITION = '2'.
      I_FIELDTAB-OFFSET = '10'.
      I_FIELDTAB-OUTPUTLEN = '6'.
      I_FIELDTAB-INTTYPE = 'N'.
      I_FIELDTAB-INTLEN = '6'.
      APPEND I_FIELDTAB.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                   into table i_display
                   where vbeln in range1.
    Call the function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD               = 'POSNR'
          WINDOW_TITLE           = 'Line Item'
          VALUE_ORG              = 'S'
          MULTIPLE_CHOICE        = C_X           " (for muliple selection)
        TABLES
          VALUE_TAB              = I_DISPLAY
          FIELD_TAB              = I_FIELDTAB
          RETURN_TAB             = I_RETURNVAL
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 2
          OTHERS                 = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
    Star for For single values
      READ TABLE I_RETURNVAL INDEX 1.
       S_POSNR-LOW = I_RETURNVAL-FIELDVAL.
    End for the single values
    Start For multiple selection
       loop at i_returnval.
         s_posnr-sign = 'I'.
         s_posnr-option = 'EQ'.
         s_posnr-low = I_RETURNVAL-FIELDVAL.
         append s_posnr.
       endloop.
       sort s_posnr.
       read table s_posnr index 1.
    End for multiple selection
      ENDIF.
                         Start-of-selection                                        *
    start-of-selection.
    Retrieve sales document, Sales document item from table Sales
    Document: Item Data(VBAP).
    Primary keys used for selection: VBELN
      select vbeln posnr from vbap
                        into table i_vbap
                        where vbeln in s_vbeln
                          and posnr in s_posnr.
    if the above selection is successful continue the process else exit *
    form the report
      if sy-subrc ne 0.
       message e002 with 'No data to display'.
      endif.
    end-of-selection.
      if not i_vbap[] is initial.
        loop at i_vbap.
          write:/ i_vbap-vbeln, i_vbap-posnr.
        endloop.
      endif.

  • How to put drop down box in selection screen

    Hi all,
    I have to create a selection screen.
    in that i have to use a drop down box for the text box.
    how to do that.
    thanking u.
    with regards,
    giri.

    HI
    Check thi ssample code -
    REPORT ZTESTPRG.
    TYPE-POOLS: VRM.
    DATA: NAME TYPE VRM_ID,
    LIST TYPE VRM_VALUES,
    VALUE LIKE LINE OF LIST.
    PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'PS_PARM'.
    VALUE-KEY = '1'.
    VALUE-TEXT = 'LINE 1'.
    APPEND VALUE TO LIST. VALUE-KEY = '2'.
    VALUE-TEXT = 'LINE 2'.
    APPEND VALUE TO LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    START-OF-SELECTION.
    WRITE: / 'PARAMETER:', PS_PARM.
    Hope this helps.
    OR
    You can use the F4 function module or use a List box
    see the sample codes
    See the following ex:
    TYPES: BEGIN OF TY_MBLNR,
    MBLNR LIKE MKPF-MBLNR,
    END OF TY_MBLNR.
    DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
    data: it_ret like ddshretval occurs 0 with header line.
    At selection-screen on value-request for s_mat-low.
    Select MBLNR from mkpf into table it_mblnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'MBLNR'
    PVALKEY = ' '
    DYNPPROG = ' '
    DYNPNR = ' '
    DYNPROFIELD = ' '
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    VALUE_TAB = IT_MBLNR
    FIELD_TAB =
    RETURN_TAB = IT_RET
    DYNPFLD_MAPPING =
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF SY-SUBRC = 0.
    read table it_ret index 1.
    move it_ret-fieldval to S_mat-low.
    ENDIF.
    Go through the test program.
    REPORT Ztest_HELP .
    TABLES : MARA.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_MATNR(10) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR TYPE MATNR,
    END OF ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
    SELECT MATNR
    FROM MARA
    INTO TABLE ITAB
    UP TO 10 ROWS.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'MATERIAL NUMBER'
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_MATNR'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = ITAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3.
    LIST BOX
    Input : p_char = 'J'.
    Press: enter
    List Box of Month = January, June , July.
    REPORT ZLIST_VALUES.
    TYPE-POOLS vrm.
    tables:
    spfli.
    parameters: p_char type c.
    parameters:
    p_month(12) as listbox visible length 20,
    p_year as listbox visible length 20 .
    DATA:
    t_table TYPE STANDARD TABLE OF vrm_value,
    t_table1 TYPE STANDARD TABLE OF vrm_value,
    vrm_values1 LIKE LINE OF t_table.
    DATA:
    t_year TYPE STANDARD TABLE OF vrm_value.
    data: w_year(4) type n value '2000'.
    at selection-screen output.
    vrm_values1-key = 'a'.
    vrm_values1-text = 'January'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'p'.
    vrm_values1-text = 'February'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'q'.
    vrm_values1-text = 'March'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'r'.
    vrm_values1-text = 'April'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 's'.
    vrm_values1-text = 'May'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 't'.
    vrm_values1-text = 'June'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'u'.
    vrm_values1-text = 'July'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'v'.
    vrm_values1-text = 'August'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'w'.
    vrm_values1-text = 'September'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'x'.
    vrm_values1-text = 'October'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'y'.
    vrm_values1-text = 'November'.
    APPEND vrm_values1 TO t_table.
    vrm_values1-key = 'z'.
    vrm_values1-text = 'December'.
    APPEND vrm_values1 TO t_table.
    t_table1[] = t_table.
    delete t_table1 where text+0(1) <> p_char.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    id = 'p_month'
    values = t_table1
    EXCEPTIONS
    ID_ILLEGAL_NAME = 1
    OTHERS = 2.
    do 10 times.
    add 1 to w_year.
    vrm_values1-key = sy-index.
    vrm_values1-text = w_year.
    APPEND vrm_values1 TO t_year.
    enddo.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    id = 'p_year'
    values = t_year
    EXCEPTIONS
    ID_ILLEGAL_NAME = 1
    OTHERS = 2.
    start-of-selection.
    write: p_month.

Maybe you are looking for

  • Inventory Aging Data, Duplication in SAP B1 8.81

    Hello Everyone, I have been working on Inventory Aging Report creation and has been facing with a problem. The data seems to get duplicated when i execute the report. I have attached the screen shot below for your reference. I have taken the followin

  • Shortest path to re-enable iTunes Match on Mac?

    I like to check out what's popular in ITMS around the world, but when switching stores, iTunes Match is disabled. Currently, what I have to do to re-enable it is the following: 1. Click Sign In 2. Log In 3. Told I have to switch (back) to USA, click

  • Trans QA12  ERROR:DYNPRO_NOT_FOUND

    I create quality notification by using trans qm01 then I assign task to it and release both (notification and the task)  I can see and work on the task (i.e. change its status to complete) through trans qm02 . but when I want to work on the task usin

  • I somehow got two sets of groups in my contact list, how do I remove the duplicate groups?

    I somehow got two sets of groups in mt contact list, how do I remove the double groups.

  • Closing data connection

    My program connects to a SQL database that I connect to on port 23 because outgoing connections to port 3306 are blocked from work. In my Database class I have this: public static Connection sqlConnection ()         Connection connection = null;