HELP WITH SELECTION SCREENS

Dear All,
    I am new to SAP(ABAP) have been given this assignment sort of ....plz help
1.     Write a program to fetch all the sales orders and line items with in a data range.
  Selection screen fields: Sales Order Number
                                       Document type
                                       Sales order date.
  To display in the output report should contain following fields:
1.     Sales Order number
2.     item number
3.     net price
4.     net value
5.     document type
Use Tables :vbak and vbap.

Hi,
Try this out.
REPORT yjjtest MESSAGE-ID zm.
TABLES: vbap, vbak.
DATA: BEGIN OF i_output OCCURS 0,
             vbeln LIKE vbap-vbeln,
             posnr LIKE vbap-posnr,
             netwr LIKE vbap-netwr,
             netpr LIKE vbap-netpr,
             auart LIKE vbak-auart,
           END OF i_output.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
" text-001 as Selection
SELECT-OPTIONS: s_vbeln  FOR vbap-vbeln,
                s_auart  FOR vbak-auart ,
                s_audat  FOR vbak-audat.
SELECTION-SCREEN END OF BLOCK blk1.
START-OF-SELECTION.
  SELECT a~vbeln
                a~posnr
                a~netwr
                a~netpr
                b~auart
                INTO TABLE i_output
                FROM vbap AS a
                INNER JOIN vbak AS b
                ON a~vbeln = b~vbeln
                WHERE    a~vbeln IN s_vbeln
                AND      b~auart IN s_auart
                AND      b~audat IN s_audat.
  IF sy-subrc NE 0.
  MESSAGE e000 WITH text-002. " No data found for the selection criteria
  ENDIF.
  WRITE:/  'Program to fetch all the sales orders and line items'.
  ULINE.
  WRITE:/001 'Sales Order number',
         012 'Item Number',
         025 'Net Price',
         050 'Net Value',
         070 'Document Type'.
  ULINE.
  LOOP AT i_output.
    WRITE:/001 i_output-vbeln,
           012 i_output-posnr,
           025 i_output-netwr,
           050 i_output-netpr,
           070 i_output-auart.
    CLEAR i_output.
  ENDLOOP.
Hope this solves ur query.
Sample output
TEST Program                                                                               
Program to fetch all the sales orders and line items                                                                               
Sales OrderItem Number  Net Price                Net Value           Document Type                                                                               
10000000   000010                       0.00                0.00     ZNOR                  
10000000   000020                       0.00                0.00     ZNOR                  
10000006   000010                       0.00                0.00     ZNOR                  
10000007   000060                       0.00                0.00     ZERO                  
10000007   000020                       0.00                0.00     ZERO                  
10000007   000050                       0.00                0.00     ZERO                  
10000007   000040                       0.00                0.00     ZERO                  
10000007   000030                       0.00                0.00     ZERO                  
10000007   000010                       0.00                0.00     ZERO                  
10000008   000010                  13,825.35            3,675.00     ZERO                  
10000009   000010                       0.00                0.00     ZERO                  
10000010   000010                  47,002.06            2,637.60     ZERO                  
10000011   000010                       0.00                0.00     ZERO                  
10000012   000010                  36,193.40            1,522.01     ZERO                  
10000014   000010                       0.00                0.00     ZERO                  
10000015   000050                       0.00                0.00     ZERO                  
10000015   000010                       0.00                0.00     ZERO                  
10000015   000020                       0.00                0.00     ZERO
Please reward points and clos ethe thread.

Similar Messages

  • Restricting values F4 help in selection screen-Urgent

    Hi,
    can anyone pls tell how can I ristrict the values for search help in any field in selection screen.
    please tell me the way to hide some values in F4 help in selection screen so that user can not see those data for selection.
    Regards

    i think u can not hide the data.........
    create own f4 help............restrict the data and then pass it the f4 internal table....
    fro exp;;;;;
    types : begin of ty_tab,
              post_code1 like adrc-post_code1,
             end of ty_tab.
      data : it_tab type ty_tab occurs 0.
      data : lt_field type table of dfies,
             lw_field type dfies.
      select post_code1 from adrc into corresponding fields of table it_tab.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
          exporting
            retfield        = 'POST_CODE1'
            dynpprog        = sy-repid
            dynpnr          = sy-dynnr
            dynprofield     = 'LI_LIST1'
            value_org       = 'S'
          tables
            value_tab       = it_tab
         field_tab       = lt_field
          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.
    Regards
    Anbu

  • Submit program with selection screen parameters - getting blank values

    Hi, I'm submitting a program with selection screen parameters. when I pass '000' (I_TPLSCN  )value for Planning Scenario and when this goes to selection screen then I don't see value for Planning scenario as '000'(I_TPLSCN  ) but the value is blank in selection screen. I'm using the below code for this.
    SUBMIT RMCPAMRP WITH MATNR_GL EQ I_MATNR   SIGN 'I'
                      WITH WERKS_GL EQ I_WERKS   SIGN 'I'
                      WITH PLSCN    EQ I_TPLSCN  SIGN 'I'
        via selection-screen        AND RETURN.
    Could anyone please help me how to display value '000' rather than blanks.
    thanks in advance.

    If I_MATNR, I_TPLSCN and I_WERKS are variable then try with
    SUBMIT rmcpamrp
      WITH matnr_gl = i_matnr
      WITH plscn    = i_tplscn
      WITH werks_gl = i_werks
      via selection-screen       
       AND RETURN .
    If I_MATNR, I_TPLSCN and I_WERKS are of type range then try  with
    SUBMIT rmcpamrp
      WITH matnr_gl IN i_matnr
      WITH plscn    IN i_tplscn
      WITH werks_gl IN i_werks
    via selection-screen       
       AND RETURN
    Edited by: Pawan Kesari on Dec 24, 2009 3:33 PM

  • Search help in selection screens for interactive report

    A search help can only be assigned to DB table.
    So my doubt is can it also be used for seletion screens created for an interactive report?
    If yes what is the procedure.. Please give me one example at least...
    waiting for your valuable suggestions.....
    Thanks,
    regards,
    Chinmay

    Hi Chinmay,
    I suppose your requirement is to give search help to selection screen elements.
    Here is the code.
    REPORT  ZSHAIL_F4HELP                           .
    parameters: name(10) type c .
    TYPES: BEGIN OF VALUES,
             CARRID TYPE SPFLI-CARRID,
             CONNID TYPE SPFLI-CONNID,
           END OF VALUES.
    dATA: PROGNAME LIKE SY-REPID,
          DYNNUM   LIKE SY-DYNNR,
          DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
          FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
          VALUES_TAB TYPE TABLE OF VALUES.
    at selection-screen on value-request for name.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
      EXPORTING
        tabname                   = 'DEMOF4HELP'
        fieldname                 = 'CARRIER1'
      SEARCHHELP                = ' '
      SHLPPARAM                 = ' '
       DYNPPROG                  = PROGNAME
       DYNPNR                    = DYNNUM
       DYNPROFIELD               = 'CARRIER'
      STEPL                     = 0
      VALUE                     = ' '
      MULTIPLE_CHOICE           = ' '
      DISPLAY                   = ' '
      SUPPRESS_RECORDLIST       = ' '
      CALLBACK_PROGRAM          = ' '
      CALLBACK_FORM             = ' '
      SELECTION_SCREEN          = ' '
    IMPORTING
      USER_RESET                =
    TABLES
      RETURN_TAB                =
    EXCEPTIONS
       FIELD_NOT_FOUND           = 1
       NO_HELP_FOR_FIELD         = 2
       INCONSISTENT_HELP         = 3
       NO_VALUES_FOUND           = 4
       OTHERS                    = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    AT SELECTION-SCREEN OUTPUT.
    PROGNAME = SY-REPID.
      DYNNUM   = SY-DYNNR.
      CLEAR: FIELD_VALUE, DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'CARRIER'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
    I hope your query is solved.
    If so,please award points.
    Regards,
    Sylendra.

  • 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

  • Hi its urgent...help on selection screen parameters

    Hi all,
    I need help on selection screen parameters.
    requirement is that,
    i am having input fields for material, plant ,start date and end date and a check box and an input field for getting the txt file.
    when i select the checkbox, it should ignore the mandatory fileds in the selection screen.
    and when i get the file input, it should take  the input data material, plant, start date and end date from the flat file and populate the corresponding input fields in selection screen.
    How to do this..
    thanks in advance.

    Hi ..
    While declare the Matnr, Plant etc dont use the OBLIGATORY addition.
    instead of the based on the value of check box validate them .
    AT SELECTION-SCREEN.
      IF c_box = ' '.
       << validate for mandatory fields>>
    endif.
    <b>REWARD IF HELPFUL.</b>

  • Help with SELECT - selecting range of numbers

    Hi,
    I need a help with SELECT statement. I want to select Dates starting from today and ending 30 days back. So the result would be like:
    TRUNC(SYSDATE)
    TRUNC(SYSDATE) - 1
    TRUNC(SYSDATE) - 2
    TRUNC(SYSDATE) - 3
    TRUNC(SYSDATE) - 30I was thinking to simply select truncated SYSDATE in first column, and in second column numbers 0, 1, 2, ... 30. Then I would simply do a difference first column - second column. But how to select such sequence of numbers? I don't want to select each number (date) in separate select statement and then unioning them.
    Does anybody have an idea?
    Thanks for help, Dan

    SQL> select trunc(sysdate) - level + 1 as dt
      2  from dual
      3  connect by level <= 31
      4  ;
    DT
    07/01/2013
    06/01/2013
    05/01/2013
    04/01/2013
    03/01/2013
    02/01/2013
    01/01/2013
    31/12/2012
    30/12/2012
    29/12/2012
    28/12/2012
    27/12/2012
    26/12/2012
    25/12/2012
    24/12/2012
    23/12/2012
    22/12/2012
    21/12/2012
    20/12/2012
    19/12/2012
    DT
    18/12/2012
    17/12/2012
    16/12/2012
    15/12/2012
    14/12/2012
    13/12/2012
    12/12/2012
    11/12/2012
    10/12/2012
    09/12/2012
    08/12/2012
    31 rows selected

  • How to fill internal table with selection screen field.

    Hi all,
    i am new to sap . pls tell me how to fill internal table with selection screen field.

    Hi,
    Please see the example below:-
    I have used both select-options and parameter on the selection-screen.
    Understand the same.
    * type declaration
    TYPES: BEGIN OF t_matnr,
            matnr TYPE matnr,
           END OF t_matnr,
           BEGIN OF t_vbeln,
             vbeln TYPE vbeln,
           END OF t_vbeln.
    * internal table declaration
    DATA : it_mara  TYPE STANDARD TABLE OF t_matnr,
           it_vbeln TYPE STANDARD TABLE OF t_vbeln.
    * workarea declaration
    DATA : wa_mara  TYPE t_matnr,
           wa_vbeln TYPE t_vbeln.
    * selection-screen field
    SELECTION-SCREEN: BEGIN OF BLOCK b1.
    PARAMETERS : p_matnr TYPE matnr.
    SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
    * I am adding parameter value to my internal table
      wa_mara-matnr = p_matnr.
      APPEND wa_mara TO it_mara.
    * I am adding select-options value to an internal table
      LOOP AT s_vbeln.
        wa_vbeln-vbeln =  s_vbeln-low.
        APPEND  wa_vbeln TO  it_vbeln.
      ENDLOOP.
    Regards,
    Ankur Parab

  • How to create a report with selection screen that can run in background

    Sorry to ask these basic questions but I am knew to ABAP Programming.
    To keep it simply, I am attempting to create a report that has a simple parameter driven selections screen with one field.  That field takes in a folder path from the user.  The user executes the report.  The report creates a simply BDC that goes into SE16, gathers data from a table, and exports the results to a text file using the folder path provided.  I created a variant for the folder path field in the selection screen hoping to use it while executing the report in the background.  The report is not exporting the file as it did when run in the foreground for some reason.
    I am wondering what event is triggered when a report is executed in the background.  In the foreground (or when I execute the program via SE38->Execute->With Variant) the user needs to execute the program by hitting the execute button once the variant has populated the folder path field.  It works then, so I am trying to get the same to work in the background.  I am thinking I didn't put the program together correctly to accommodate the running in the background.  How can you create a report that can accept user input via variant into a selection screen and then run in the background?
    Please, any information would be greatly appreciated.
    Thanks you all for reading this!!!

    Ok, finally I understand what you're doing. Initially you lost me with the SE16 reference...
    Not sure what you're trying to achieve overall, but apart from the fact that you cannot export/download a file to a user's PC via background job (unless you have a mapped network share on the server or something like an FTP server on the user's PC, but both are pretty hypothetical scenarios and unlikely to occur).
    Also, the BDC approach to get data via SE16 is pretty awkward. Note that SE16 is guarded by some authorization checks and often users won't have access in production (which might not matter if you intend to always run your program in background via dedicated batch user). However, I have no clue why you wouldn't want to use [open SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_READING.htm] to read the data. You could then save it on the application server or if you really have to get it to the user you can consider e-mailing the file (extracts should be compressed before sending). For the latter you'll find plenty of references here, basically it's the [business communication services|http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/1c5d3aebba4c38e10000000a114084/frameset.htm] that you'd need to look at.

  • Regarding Search help on selection-screen field

    Hi there,
    I am working on custom tables.
    I have a requirement to maintain search pattern on a selection-screen field.
    selection-screen parameter: p_name which is company name filed from Z table.
    By giving a string like Holl* and by  pressing F4 on the field p_name it has to popup a dialogbox having list of company names starting with Holl.
    Thanks in advance.
    -Tulasi

    Hi
    Go through the link given below :
    How to create a search help for my own fields in selection screen
    F4 search help on report selection screen
    also try :
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'VKORG'
    PVALKEY = ' '
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_VKORG'
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'C'
    TABLES
    VALUE_TAB = T_TABLE1
    FIELD_TAB = field_tab
    RETURN_TAB = RET_TAB
    DYNPFLD_MAPPING = DYN_TAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3
    With Regards
    Nikunj shah

  • ABAP Help: Dynamic Selection Screen

    Hi,
    I have a requirement to be able to pick the list of fields in a selection screen. (List processing)
    Similar to SE16 choosing "fields for selection".
    I've debugged SE16 and realized it deletes the report and regenerates a new report with the updated selection screen.
    I could not do the same as it will also delete all the variants users have created in the report.
    Has anyone done something similar before?
    What is the best approach for this scenario?
    Regards,
    Michael Pang

    Hi Michael
    Hoping you have solved your problems with ALVs, I think it may be helpful to inspect FMs <b>"FREE_SELECTIONS_INIT"</b> and <b>"FREE_SELECTIONS_DIALOG"</b> for this issue. They have some <i>Function Module Documentation</i>.
    If you are dealing with logical databases, then only in the INCLUDE program DB<i>ldb</i>SEL of logical database <i>ldb</i>, you can use some selection-screen definition variants as:
    1.SELECTION-SCREEN BEGIN OF VERSION vers TEXT-xxx.
    2.SELECTION-SCREEN END OF VERSION vers.
    3.SELECTION-SCREEN EXCLUDE ... .
    4.SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
    5.SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab.
    6.SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE node.
    7.SELECTION-SCREEN FIELD SELECTION FOR NODE node.
    You can get more info from SAPHelp for these...
    *--Serdar

  • Performance Issue with Selection Screen Values

    Hi,
    I am facing a performance issue(seems like a performance issue ) in my project.
    I have a query with some RKFs and sales area in filters (single value variable which is optional).
    Query is by default  restricted by current month.
    The Cube on which the query operates has around 400,000 records for a month.
    The Cube gets loaded every three hours
    When I run the query with no filters I get the output within 10~15 secs.
    The issue I am facing is that,  when I enter a sales area in my selection screen the query gets stuck in the data selection step. In fact we are facing the same problem if we use one or two other characteristics in our selection screen
    We have aggregates/indexes etc on our cube.
    Has any one faced a similar situation?
    Does any one have any comments on this ?
    Your help will be appreciated. Thanks

    Hi A R,
    Goto RSRT--> Give ur query anme --> Execute =Debug
    --> No a pop up ill come with many check boxes select "Display Aggregates found" option --> now give ur
    selections in variable screen > first it will give the already existing aggregate names> continue> now after displaying all the aggregates it will display the list of objects realted to cube wise> try to copy these objects into notepad> again go with ur drill downs now u'll get the already existing aggregates for this drill down-> it will display the list of objects> copy them to notepad> now sort all the objects related to one cube by deleting duplicate objects in the note pad>goto that Infocube> context>maintain aggregates> create aggregate on the objects u copied into note pad.
    now try to execyte the report... it should work properly with out delays for those selections.
    I hope it helps you...
    Regards,
    Ramki.

  • Issue with selection screen element on At slection scree

    Hi All,
    I am facing an issue with a checkbox which is present within the subscreen of a standard selection screen.
    The issue is that the value of the combobox get toggled by itselfon the event mentioned below. I am unable to find out how this combo box value gets changed by itself on the screen events.I tried clear statemetns etc nothing is helping. I debugged with a watch point on this screen element and found this to happen.It just changes the value of the element to a previously held state.I m trying to clear the combobox but this event puts back the tick mark.How can I stop this.
    AT SELECTION-SCREEN ON COL_FROM.  "COL_FROM is another screen element diffrent from the combobox
    Thanks

    Hi Vighneswaran CE,
    This event corresponds to the PAI module of the COL_FROM field. So, it gets executed each time you press any valid function code on the screen (unless there was an error in a previous field). Nothing abnormal here.
    That's difficult to help you on that topic, you'd better tell us exactly what report it is, where you have added your code (and what code) to change the checkbox, ...
    Best regards,
    Sandra

  • Doubt with selection screen

    Hi all!
    I have to show the inspection lot details (QA32) as per the requirements given in the selection screen.
    In my selection screen , I should have select option for Inspection lot created date(QALS-ENSTEHDAT) and lot created time (QALS-ENTSTEZEIT). I would like to know the lots created from yesterday evening till today morning.
    When I give the values 09.02.2008 to 10.02.2008 for date and 17:30:00 to 10:00:00 for time , it'll obviously intimate that 'From- time is greater than To- time'.Is there any way to relate the From-date to From-time and To-date to To-time in the selection screen , so that my problem will be solved.Please help with possible code.
    Edited by: Jayasri P. on Feb 9, 2008 5:55 AM

    Hi,
    try this.........
    TABLES qals.
    DATA it_qals TYPE TABLE OF qals WITH HEADER LINE.
    SELECT-OPTIONS   s_date  FOR  qals-enstehdat  NO-EXTENSION.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN comment (10)   for field  p_timel.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS       p_timel LIKE qals-entstezeit.
    SELECTION-SCREEN comment 54(2)  for field  p_timeh.
    SELECTION-SCREEN POSITION 60.
    PARAMETERS       p_timeh LIKE qals-entstezeit.
    SELECTION-SCREEN END   OF LINE.
    SELECT *
    FROM   qals
    INTO   TABLE it_qals
    WHERE  enstehdat IN s_date.
    IF sy-subrc IS INITIAL.
      SORT it_qals BY enstehdat entstezeit.
      LOOP AT it_qals WHERE enstehdat EQ s_date-low
                      OR    enstehdat EQ s_date-high.
        CASE it_qals-enstehdat.
          WHEN s_date-low.
            IF it_qals-entstezeit LT p_timel.
              DELETE it_qals.
            ENDIF.
          WHEN s_date-high.
            IF it_qals-entstezeit GT p_timeh.
              DELETE it_qals.
            ENDIF.
        ENDCASE.
      ENDLOOP.
    ENDIF.
    LOOP AT it_qals.
      WRITE : / it_qals-enstehdat ,it_qals-entstezeit.
    ENDLOOP.
    also goto selection text and give descriptionas below..
    P_TIMEH     to
    P_TIMEL     Time
    S_DATE     Date
    Cheers,
    jose.

  • Search help on selection screen.

    I have a selection screen with
    Report name
    Variant name
    Variant fields
    Variant fields is attached to a search help 'Z_Search_variant' and this search help fetches values based on "Report name" "Variant name" on the selection screen.
    I am using
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR Variant_field
    PERFORM f4_help_variant.
    FORM f4_help_variant.
    call function 'F4IF_FIELD_VALUE_REQUEST'
      exporting
       tabname                   = space
       fieldname                 = space
       SEARCHHELP                = 'Z_SEARCH_VARIANT'
      SHLPPARAM                 = 'REPORT'
      DYNPPROG                  = ' '
      DYNPNR                    = ' '
      DYNPROFIELD               = ' '
      STEPL                     = 0
      VALUE                     = Report
      MULTIPLE_CHOICE           = ' '
      DISPLAY                   = ' '
       SUPPRESS_RECORDLIST       = 'X'
       CALLBACK_PROGRAM          = SY-REPID
      CALLBACK_FORM             = ' '
      SELECTION_SCREEN          = ' '
    IMPORTING
      USER_RESET                =
    TABLES
        RETURN_TAB                = return_tab
    EXCEPTIONS
      FIELD_NOT_FOUND           = 1
      NO_HELP_FOR_FIELD         = 2
      INCONSISTENT_HELP         = 3
      NO_VALUES_FOUND           = 4
      OTHERS                    = 5
    How do I pass value to this search help? Currently I do not see this FM allowing this option? Any other options?

    Hi Vinita,
    wat i figured out from your problem is u need how to get values from FM so u can do it in this way..
    READ TABLE it_return INTO wa_return INDEX 1.
      IF sy-subrc = 0.
        wa_output-vkorg = wa_return-fieldval.  
      ENDIF.
      IF wa_output-vkorg IS NOT INITIAL.
        MODIFY it_output FROM wa_output INDEX row_id   * it_output is final ITAB
                  TRANSPORTING vkorg.
      ENDIF.
      CALL METHOD c_alv->refresh_table_display.
      CLEAR: wa_return,it_return[],wa_output.

Maybe you are looking for