Abap basic list .

My requirement is as below .
For every new sales org /Distribution Channel /Division  Combination of these three . I have to display the basic list .Can some one guide me on this .
Required output
Sales Area: <KONA-VKORG>/ <KONA-VTWEG>/ <KONA-SPART>
Document no   date              Validity date
Thanks in advance
-padma

go through this report
                 TABLES DECLARATION
type-pools: slis.
data: it_fieldcat type slis_t_fieldcat_alv,
       wa_fieldcat like line of it_fieldcat.
tables:vbak,        "Sales Document Header Details
        vbap,        "Sales Document Item Details
        kna1.        "Customer Master Details
                    INTERNAL TABLES DECLARATION
data:begin of it_vbak occurs 0,
     vbeln like vbak-vbeln,     "Sales Document
     erdat like vbak-erdat,     "Date on which the record was created
     erzet like vbak-erzet,     "Entry time
     ernam like vbak-ernam,     "Name of Person who Created the Object
     auart like vbak-auart,    "Sales Document Type
     end of it_vbak.
data: begin of it_vbap occurs 0,
       vbeln like vbap-vbeln,
       posnr like vbap-posnr,
       matnr like vbap-matnr,
       matwa like vbap-matwa,
       matkl like vbap-matkl,
       arktx like vbap-arktx,
       end of it_vbap.
data:begin of it_finaltable occurs 0,
      vbeln like vbak-vbeln,     "Sales Document
      erdat like vbak-erdat,     "Date on which the record was created
      erzet like vbak-erzet,     "Entry time
      ernam like vbak-ernam,     "Name of Person who Created the Object
      auart like vbak-auart,
      posnr like vbap-posnr,
      matnr like vbap-matnr,
      matwa like vbap-matwa,
      matkl like vbap-matkl,
      arktx like vbap-arktx,
      end of it_finaltable.
                          SELECTION-SCREEN
selection-screen begin of block b1.
select-options:s_vbeln for vbak-vbeln.
selection-screen end of block b1.
selection-screen begin of block b2.
select-options:s_erdat for vbak-erdat.
selection-screen end of block b2.
selection-screen begin of block b3.
select-options:s_erzet for vbak-erzet,
               s_ernam for vbak-ernam,
               s_auart for vbak-auart.
selection-screen end of block b3.
             START-OF-SELECTION
start-of-selection.
perform get_vbak.
perform alv_datas.
perform alv_displays.
             END-OF-SELECTION
end-of-selection.
form alv_datas .
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_l = 'SALES DOCUMENT NUMBER'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-seltext_l = 'DATE ENTERED'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'ERZET'.
wa_fieldcat-seltext_l = 'TIME CREATED'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-seltext_l = 'Person Created'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'AUART'.
wa_fieldcat-seltext_l = '----
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'POSNR'.
wa_fieldcat-seltext_l = 'Item Number'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_l = 'Material Number'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'MATKL'.
wa_fieldcat-seltext_l = 'Order Qty'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-seltext_l = 'Order Unit'.
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'POSAR'.
wa_fieldcat-seltext_l = 'Net Qty'.
append wa_fieldcat to it_fieldcat.
endform.                    " ALV_DATAS
*&      Form  GET_VBAK
      text
-->  p1        text
<--  p2        text
form get_vbak .
if not it_vbak is initial.
select vbeln
       erdat
       erzet
       ernam
       auart from vbak
       into table it_vbak
       for all entries in it_vbap
       where vbeln = it_vbap-vbeln.
endif.
endform.
       " GET_VBAK
*&      Form  ALV_DISPALYS
      text
-->  p1        text
<--  p2        text
form alv_displays .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
  I_CALLBACK_PROGRAM                = ' '
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  = I_STRUCTURE_NAME
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      = I_GRID_TITLE
  I_GRID_SETTINGS                   = I_GRID_SETTINGS
  IS_LAYOUT                         = IS_LAYOUT
   it_fieldcat                       = it_fieldcat
  IT_EXCLUDING                      = IT_EXCLUDING
  IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
  IT_SORT                           = IT_SORT
  IT_FILTER                         = IT_FILTER
  IS_SEL_HIDE                       = IS_SEL_HIDE
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        = IS_VARIANT
  IT_EVENTS                         = IT_EVENTS
  IT_EVENT_EXIT                     = IT_EVENT_EXIT
  IS_PRINT                          = IS_PRINT
  IS_REPREP_ID                      = IS_REPREP_ID
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
  IT_HYPERLINK                      = IT_HYPERLINK
  IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
  IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
  IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
  ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER
  tables
    t_outtab                          = it_finaltable
exceptions
program_error                     = 1
others                            = 2
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform.                    " ALV_DISPLAYS
reward points if helpful.....

Similar Messages

  • ABAP Query - Sorting Issue in Basic List (SQ03)

    Hi,
        I have developed a ABAP Query. I want to sort some of the fields, for which I need to add some output fields to the sort sequence box in the Basic List page in SQ03/SQ01. But, I am not able to drag and drop the fields directly. Please suggest how can this be done? Thanks in advance.
    Best Regards,
    Tejas Savla

    Hi Abhishek,
    There are three things related to Query.
    1) You have to create the USER GROUP in SQ03.
    2) You have to create the Infoset in SQ02. In this infoset you can write the logic of the program/Query what ever you want to perform.So you can sort the table in the infoset in the program logic.you have to create the output table of the query.
    3) you have to create the Query in SQ01 and you have to associate the User group and infoset . you have to design the layput of the output you want to have.this output fields would be same as you have defined in infoset(step 2).
    hope this will help you.
    thanks
    Tanmaya

  • Hyperlink on field in Basic list of ABAP Query

    Dear All,
    Could somebody tell me, if its possible to have a hyperlink on a field in the Basic list of ABAP Query (SQ01,SQ02).
    Example :- There is a basic list which has the field MARA-MATNR displayed.There should be a hyperlink on this field, such that when the user clicks on it , the transaction MM03 is called.
    Thanking You.
    Ranu

    Hi,
    Loop at itab.
    write:/ itab-matnr hotspot,
              itab-maktx.
    hide: itab-matnr.
    endloop.
    data: c_field(16).
    at line-selection.
      get cursor field c_field.
      if c_field  = 'ITAB-MATNR'.
        check not itab-matnr is initial.
        set parameter id 'MAT' field itab-matnr.
        call transaction 'MM03' and skip first screen.
      endif.
    This is one example to call the transaction.
    If this helps you award points.
    Thanks,
    Deepak.

  • Header & Footer in Basic list of infoset Query.

    Dear Experts,
    In an Infoset Query, I have been trying to make use of the Header & Footer Features (available in the Basic list screen) for quite sometime, but with no success.
    Even though I add these, they do not appear in the list output.
    Please throw some light of knowledge in this regard.
    Regards
    Jogeswara Rao

    The Header & Footer text in the Basic list of Query will only be shown in the "ABAP List". Not sure if you are are looking at the Header & Footer text in SAP List Viewer.

  • ABAP Query --List Width

    Hi,
        I have a requirement for ABAP Query using transaction sq03.
    I have to add a new column and since the field length is char132, when i place the field in "Basic List" tab in Sq03, the field goes to the
    next line.Now, when I execute the output, only the fields in the first line (in Basic List) get displayed. The fields in the second line do not get displayed. Also, I cannot fit the second line fields in the first line as the maximum list width is 254. I need a solution to display the 2nd line fields in output.
    Thanks in advance.
    Regards,
    Tejas Savla

    Hi Teja ,
    what u can do is , change its display length of that field .
    SQ01---> In the change Mode --->basic List ---> Click on the Field --->Down Left u will get options to change display length.
    regards
    Prabhu

  • One basic list to 2 detail list .

    HI Guru,
    Is it possible to see 2 detail list from one basic list at same time in reports .
    Eagerly waiting for your response.
    Regards :
    B.madhu sudhan reddy,
    SAP Abap Tech.

    Hi,
    You cannot create 2 interactive lists from a basic list.When you click on an interactive list you can create another interactive list.
    This is because:-
    from http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba2eb35c111d1829f0000e829fbfe/content.htm
    Creating Detail Lists
    Each time the user executes an action on a list, the runtime environment checks whether there is an event block defined that corresponds to the function code. If there is, SY-LSIND is automatically increased by one, and the relevant event block is executed. Any list output arising during this event block places its data into a new list (list level) with the index SY-LSIND. In order to create a new list level, the GUI status of the basic list must allow user actions, and the relevant event blocks must be defined in the program.
    All lists created during an interactive list event are detail lists. Each interactive list event creates a new detail list. With one ABAP program, you can maintain one basic list and up to 20 detail lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. The user can interact with whichever list is currently displayed.
    The system displays this list after processing the entire processing block of the event keyword or after leaving the processing block due to EXIT or CHECK. By default, the new list overlays the previous list completely. However, you can display a list in a dialog box. If no other dialog status is set in the event block for the detail list, the system uses the status from the previous list level. However, there is no standard page header for detail lists (see below).

  • Basic list in ALV report

    Hi,
    can someone please tell me how/where I can change the sort criteria and displayed columns of the basic list in an ALV report (e.g. S_ALR_87011963)? Our test and development systems seem to have different settings here. No layout has been created or defaulted. I just want the basic list to be the same in both systems. Then the users can create their own layouts as well, but the basic list should be the same.
    Thanks,
    Moly

    Hi, This report seems to be a report painter/writer, Request you to check with your functional consultant and also check transaction GR* (GR51 to GR55 etc,,) to see if something can be changed.
    Thanks,
    Shiva

  • Astericks appearing in place of a particular value in basic list ????

    Hello,
    I am outputting values thru a basic list, but the system is outputting ' *********** ' (Astericks) in place of the value. I have increased the length while outputtin on a basic list but to no avail. What can be the reason?
    Thanks,
    Shehryar Dahar

    hi,
    check whther both field type are identical..check for type..
    thanks
    jaideep
    *reward points for useful answers..

  • A report for MM where basic list will contain the material no and material

    how to develop a report for MM where basic list will contain the material no and material description for the range of material no chosen by user. ...plz help me...how to do this step by step..

    Hi Raja,
    Firstly declare a select-option for material number.
    write a select query specifying the required field and specify a where clause
    as
    WHERE MATNR IN S_MATNR.
    Obviously you will select the records into internal table and so loop that internal table and display the records...
    The records will be displayed on the basic list.
    Hope this will solve your problem.
    Regards,
    Narin Nandivada

  • "ABAP Basics" Book - arithmetic expression error in the sample code

    Hi all,
    I have just started learning ABAP on mini SAP system (NW7.01) by following "ABAP Basics" book.
    This question might be a FAQ, but I have spent a few days searching a right answer without success.
    I appreciate if you could help me on this.
    On the page 162, there is a function module sample, which contains the line as following:
    e_amount = i_km * '0.3'.
    Here l_km (import) is type of i, and e_amount (export) is type of f.
    Though I do not think of any problem with this line, it throws an arithmetic expression error when executed directly for testing as well as when called from a program.
    When I tried a similar thing in a program, it was fine.
    However within a function module it throws this error.
    Thanks in advance.
    Terry

    Like I said before, I do not think any problem about the code itself.
    I suspect some environmental things?
    I should have mentioned SAP mini system NW7.01 is running on Vista Business?
    To be specifc, I receive this message:
    Arithmetic operations are only expected for operands that can be converted to numbers.
    (numeric operands). - (numeric operands). - - - -
    with the following function module:
    [code]
    FUNCTION ZPTB00_CALCULATE_TRAVEL_EXPENS.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_KM) TYPE REF TO  I
    *"  EXPORTING
    *"     VALUE(E_AMOUNT) TYPE REF TO  F
    *"  EXCEPTIONS
    *"      FAILED
    e_amount = i_km * '0.3'.
    IF sy-subrc <> 0.
      RAISE failed.
    ENDIF.
    ENDFUNCTION.
    [/code]

  • LINKING BETWEEN FUNCTION MODULE AND INTERACTIVE NO. OF BASIC LIST

    Dear Mates,
    Iam preparing Z report for BOM display of FG and SFG materials.
    Iam displaying the Basic List using the MAST table. Here i double click on the material no.
    Here iam using the function module :CS_BOM_EXPL_MAT_V2 for fetching the data from STPOX structure ,here i want to link material no. which has been from basic list and the above said function module. 
    Can anybody provide the solution for the above said linking in ALV interactive report.
    Please treat it very urgent as this report is to be presented on high priority.
    Thanks in advance
    Subbu

    Hi
    use the Function module REUSE_ALV_POPUP_TO_SELECT.
    check the below example:
    REPORT ZSR_ALV_INTERACTIVE.
    TABLES : LFA1,EKKO,EKPO.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    DATA : BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    END OF ITAB.
    DATA : BEGIN OF JTAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    END OF JTAB.
    DATA : BEGIN OF KTAB OCCURS 0,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF KTAB.
    TYPE-POOLS : SLIS.
    DATA : REPID LIKE SY-REPID.
    DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
    LFA1_W TYPE SLIS_FIELDCAT_ALV,
    EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKKO_W TYPE SLIS_FIELDCAT_ALV,
    EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKPO_W TYPE SLIS_FIELDCAT_ALV,
    EVENTS_B TYPE SLIS_T_EVENT,
    EVENTS_W TYPE SLIS_ALV_EVENT.
    PERFORM GET_VAL.
    REPID = SY-REPID.
    SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
    *perform val USING USER_COMMAND sel.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    IT_FIELDCAT = LFA1_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = ITAB.
    *& Form GET_VAL
    text this is to put column headings
    FORM GET_VAL.
    LFA1_W-FIELDNAME = 'LIFNR'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'LIFNR'.
    APPEND LFA1_W TO LFA1_B.
    LFA1_W-FIELDNAME = 'NAME1'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'NAME1'.
    APPEND LFA1_W TO LFA1_B.
    EKKO_W-FIELDNAME = 'EBELN'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'EBELN'.
    APPEND EKKO_W TO EKKO_B.
    EKKO_W-FIELDNAME = 'AEDAT'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'AEDAT'.
    APPEND EKKO_W TO EKKO_B.
    EKPO_W-FIELDNAME = 'EBELP'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'EBELP'.
    APPEND EKPO_W TO EKPO_B.
    EKPO_W-FIELDNAME = 'MATNR'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'MATNR'.
    APPEND EKPO_W TO EKPO_B.
    EVENTS_W-NAME = 'USER_COMMAND'.
    EVENTS_W-FORM = 'VAL'.
    APPEND EVENTS_W TO EVENTS_B.
    ENDFORM. "GET_VAL
    *& Form VAL
    text
    -->USER_COMMANtext
    -->SEL text for retrieving data
    FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA : VEN(10) TYPE N,
    PO(10) TYPE N.
    DATA : MAT(10) TYPE C.
    IF SEL-FIELDNAME = 'LIFNR'.
    VEN = SEL-VALUE.
    SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    I_STRUCTURE_NAME = EKKO_B
    IT_FIELDCAT = EKKO_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = JTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'EBELN'.
    PO = SEL-VALUE.
    SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
    I_TITLE = 'ITEM DETAILS'
    I_TABNAME = 'EKPO'
    IT_FIELDCAT = EKPO_B
    I_CALLBACK_PROGRAM = REPID
    IMPORTING
    ES_SELFIELD = SEL
    TABLES
    T_OUTTAB = KTAB.
    ENDIF.
    logic to select a record
    IF SEL-FIELDNAME = 'MATNR'.
    MAT = SEL-VALUE.
    SET PARAMETER ID 'MAT' FIELD MAT.
    CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDFORM. "VAL
    check my example:
    REPORT ZSR_ALV_INTERACTIVE.
    TABLES : LFA1,EKKO,EKPO.
    SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
    DATA : BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    END OF ITAB.
    DATA : BEGIN OF JTAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    END OF JTAB.
    DATA : BEGIN OF KTAB OCCURS 0,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF KTAB.
    TYPE-POOLS : SLIS.
    DATA : REPID LIKE SY-REPID.
    DATA :LFA1_B TYPE SLIS_T_FIELDCAT_ALV,
    LFA1_W TYPE SLIS_FIELDCAT_ALV,
    EKKO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKKO_W TYPE SLIS_FIELDCAT_ALV,
    EKPO_B TYPE SLIS_T_FIELDCAT_ALV,
    EKPO_W TYPE SLIS_FIELDCAT_ALV,
    EVENTS_B TYPE SLIS_T_EVENT,
    EVENTS_W TYPE SLIS_ALV_EVENT.
    PERFORM GET_VAL.
    REPID = SY-REPID.
    SELECT LIFNR NAME1 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN VENDOR.
    *perform val USING USER_COMMAND sel.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    IT_FIELDCAT = LFA1_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = ITAB.
    *& Form GET_VAL
    text this is to put column headings
    FORM GET_VAL.
    LFA1_W-FIELDNAME = 'LIFNR'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'LIFNR'.
    APPEND LFA1_W TO LFA1_B.
    LFA1_W-FIELDNAME = 'NAME1'.
    LFA1_W-REF_TABNAME = 'LFA1'.
    LFA1_W-REF_FIELDNAME = 'NAME1'.
    APPEND LFA1_W TO LFA1_B.
    EKKO_W-FIELDNAME = 'EBELN'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'EBELN'.
    APPEND EKKO_W TO EKKO_B.
    EKKO_W-FIELDNAME = 'AEDAT'.
    EKKO_W-REF_TABNAME = 'EKKO'.
    EKKO_W-REF_FIELDNAME = 'AEDAT'.
    APPEND EKKO_W TO EKKO_B.
    EKPO_W-FIELDNAME = 'EBELP'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'EBELP'.
    APPEND EKPO_W TO EKPO_B.
    EKPO_W-FIELDNAME = 'MATNR'.
    EKPO_W-REF_TABNAME = 'EKPO'.
    EKPO_W-REF_FIELDNAME = 'MATNR'.
    APPEND EKPO_W TO EKPO_B.
    EVENTS_W-NAME = 'USER_COMMAND'.
    EVENTS_W-FORM = 'VAL'.
    APPEND EVENTS_W TO EVENTS_B.
    ENDFORM. "GET_VAL
    *& Form VAL
    text
    -->USER_COMMANtext
    -->SEL text for retrieving data
    FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA : VEN(10) TYPE N,
    PO(10) TYPE N.
    DATA : MAT(10) TYPE C.
    IF SEL-FIELDNAME = 'LIFNR'.
    VEN = SEL-VALUE.
    SELECT EBELN AEDAT FROM EKKO INTO TABLE JTAB WHERE LIFNR = VEN.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = REPID
    I_STRUCTURE_NAME = EKKO_B
    IT_FIELDCAT = EKKO_B
    IT_EVENTS = EVENTS_B
    TABLES
    T_OUTTAB = JTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'EBELN'.
    PO = SEL-VALUE.
    SELECT EBELP MATNR FROM EKPO INTO TABLE KTAB WHERE EBELN = PO.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
    I_TITLE = 'ITEM DETAILS'
    I_TABNAME = 'EKPO'
    IT_FIELDCAT = EKPO_B
    I_CALLBACK_PROGRAM = REPID
    IMPORTING
    ES_SELFIELD = SEL
    TABLES
    T_OUTTAB = KTAB.
    ENDIF.
    logic to select a record
    IF SEL-FIELDNAME = 'MATNR'.
    MAT = SEL-VALUE.
    SET PARAMETER ID 'MAT' FIELD MAT.
    CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDFORM. "VAL

  • Interactive report basic list concept

    Suppose in a basic list i have 7 parallel detail list.i am in basic list is there any way to go directly to 7 th detail list from basiclist or from 1st detail list to 7 th detail list vice-versa.
    plz tell me..i am waiting.. for reply
    thanx
    arya

    Hi...
        Just go through following code.... its for normal interactive reports...
    TYPES : BEGIN OF st_kna1,
    kunnr TYPE kna1-kunnr, "CUSTOMER NUMBER
    name1 TYPE kna1-name1, "CUSTOMER NAME
    END OF st_kna1.
    TYPES : BEGIN OF st_vbak,
    kunnr TYPE kna1-kunnr,
    vbeln TYPE vbak-vbeln, "SALES DOCUMENT NUMBER
    erdat TYPE vbak-erdat, "DATE ON WHICH THE RECORD WAS CREATED
    audat TYPE vbak-audat, "DOCUMENT DATE
    auart TYPE vbak-auart, "SALES DOCUMENT TYPE
    ernam TYPE vbak-ernam, "NAME OF PERSON WHO CREATED THE OBJECT.
    augru TYPE vbak-augru, "ORDER REASON
    END OF st_vbak.
    TYPES : BEGIN OF st_vbap,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr, "SALES DOCUMENT ITEM
    matnr TYPE vbap-matnr, "MATERIAL NUMBER
    charg TYPE vbap-charg, "BATCH NUMBER
    matkl TYPE vbap-matkl, "MATERIAL GROUP
    posar TYPE vbap-posar, "ITEM TYPE
    END OF st_vbap.
    DATA : it_kna1 TYPE STANDARD TABLE OF st_kna1,
    it_vbak TYPE STANDARD TABLE OF st_vbak,
    it_vbap TYPE STANDARD TABLE OF st_vbap,
    wa_kna1 TYPE st_kna1,
    wa_vbak TYPE st_vbak,
    wa_vbap TYPE st_vbap.
    DATA : v_fld(15),
    v_kunnr TYPE kna1-kunnr,
    v_vbeln TYPE vbak-vbeln.
    SELECT-OPTIONS
    PARAMETERS
    SELECT-OPTIONS so_kunnr FOR v_kunnr. "CUSTOMER NUMBER
    PARAMETERS : p_max TYPE i. "NUMBER OF HITS
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM get_customerdata.
    SET PF-STATUS 'MENU1'.
    AT LINE-SELECTION
    AT LINE-SELECTION.
    IF sy-lsind = 1.
    PERFORM get_salesheader.
    ELSEIF sy-lsind = 2.
    PERFORM get_salesitemdata.
    ENDIF.
    AT USER-COMMAND
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'DISP'.
    PERFORM get_salesheader.
    WHEN 'ITEM'.
    PERFORM get_salesitemdata.
    WHEN 'VA03'.
    SET PARAMETER ID 'AUN' FIELD wa_vbak-vbeln.
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    ENDCASE.
    TOP-OF-PAGE
    TOP-OF-PAGE.
    ULINE AT /1(56).
    WRITE : /1 sy-vline ,
    2(15) text-004 COLOR 1 ,
    sy-vline ,
    20(35) text-005 COLOR 1 ,
    sy-vline.
    ULINE AT /1(56).
    TOP-OF-PAGE DURING LINE-SELECTION.
    TOP-OF-PAGE DURING LINE-SELECTION.
    CASE sy-lsind.
    WHEN 1.
    PERFORM get_topofpage1.
    WHEN 2.
    PERFORM get_topofpage2.
    ENDCASE.
    FORM GET_CUSTOMERDATA
    FORM get_customerdata.
    SELECT kunnr name1
    FROM kna1
    INTO TABLE it_kna1
    UP TO p_max ROWS
    WHERE kunnr IN so_kunnr.
    IF sy-subrc EQ 0.
    LOOP AT it_kna1 INTO wa_kna1.
    WRITE : / sy-vline,
    2(15) wa_kna1-kunnr ,
    sy-vline ,
    20 wa_kna1-name1,
    sy-vline.
    HIDE : wa_kna1-kunnr , wa_kna1-name1.
    CLEAR wa_kna1.
    ENDLOOP.
    ULINE AT : /1(56).
    ELSE.
    MESSAGE w000(z50871msg).
    ENDIF.
    ENDFORM. "GET_CUSTOMERDATA
    FORM GET_SALESHEADER
    FORM get_salesheader.
    SET PF-STATUS 'MENU2'.
    GET CURSOR FIELD v_fld VALUE v_kunnr.
    IF v_fld = 'WA_KNA1-KUNNR'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = v_kunnr
    IMPORTING
    output = v_kunnr.
    SELECT kunnr vbeln erdat audat auart ernam augru
    FROM vbak
    INTO TABLE it_vbak
    WHERE kunnr = v_kunnr.
    IF sy-subrc EQ 0.
    LOOP AT it_vbak INTO wa_vbak.
    WRITE : / sy-vline ,
    2(22) wa_vbak-vbeln ,
    sy-vline,
    27(25) wa_vbak-erdat ,
    sy-vline ,
    55(15) wa_vbak-audat ,
    sy-vline ,
    73(15) wa_vbak-auart ,
    sy-vline,
    91(16) wa_vbak-ernam ,
    sy-vline,
    109(13) wa_vbak-augru,
    123 sy-vline.
    HIDE : wa_vbak-vbeln.
    CLEAR wa_vbak.
    ENDLOOP.
    ULINE AT : /1(123).
    ELSE.
    MESSAGE i015(z50871msg).
    ENDIF.
    ELSE.
    MESSAGE i013(z50871msg).
    ENDIF.
    ENDFORM. "GET_SALESHEADER
    FORM GET_SALESITEMDATA
    FORM get_salesitemdata.
    SET PF-STATUS space.
    GET CURSOR FIELD v_fld VALUE v_vbeln.
    IF v_fld = 'WA_VBAK-VBELN'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = v_vbeln
    IMPORTING
    output = v_vbeln.
    SELECT vbeln posnr matnr charg matkl posar
    FROM vbap
    INTO TABLE it_vbap
    WHERE vbeln = v_vbeln.
    LOOP AT it_vbap INTO wa_vbap.
    WRITE : /1 sy-vline,
    2(13) wa_vbap-posnr ,
    sy-vline,
    18(18) wa_vbap-matnr ,
    sy-vline,
    40(13) wa_vbap-charg ,
    sy-vline,
    56(16) wa_vbap-matkl ,
    sy-vline,
    75 wa_vbap-posar,
    112 sy-vline.
    CLEAR wa_vbap.
    ENDLOOP.
    ULINE AT : /1(112).
    ELSE.
    MESSAGE i014(z50871msg).
    ENDIF.
    ENDFORM. "GET_SALESITEMDATA
    FORM GET_TOPOFPAGE1
    FORM get_topofpage1.
    ULINE AT : /1(123).
    WRITE : / sy-vline ,
    2 text-000 ,
    wa_kna1-kunnr ,
    75 text-001 ,
    wa_kna1-name1,
    123 sy-vline.
    ULINE AT : /1(123).
    WRITE : / sy-vline ,
    2(22) text-006 COLOR 1,
    sy-vline,
    27(25) text-007 COLOR 1 ,
    sy-vline ,
    55(15) text-008 COLOR 1 ,
    sy-vline ,
    73(15) text-009 COLOR 1 ,
    sy-vline,
    91(16) text-010 COLOR 1 ,
    sy-vline,
    109(13) text-011 COLOR 1,
    123 sy-vline.
    ULINE AT : /1(123).
    ENDFORM. "GET_TOPOFPAGE1
    FORM GET_TOPOFPAGE2
    FORM get_topofpage2.
    ULINE AT : /1(112).
    WRITE : / sy-vline ,
    2 text-000 ,
    wa_kna1-kunnr ,
    35 text-001 ,
    wa_kna1-name1 ,
    85 text-003 ,
    wa_vbak-vbeln ,
    112 sy-vline.
    ULINE AT : /1(112).
    WRITE : /1 sy-vline,
    2(13) text-012 COLOR 1,
    sy-vline,
    18(18) text-013 COLOR 1 ,
    sy-vline,
    40(13) text-014 COLOR 1 ,
    sy-vline,
    56(16) text-015 COLOR 1 ,
    sy-vline,
    75 text-016 COLOR 1 ,
    112 sy-vline.
    ULINE AT : /1(112).
    ENDFORM. "GET_TOPOFPAGE2
    Thanks,
    Naveen.I

  • SAP Query: Display Selection Fields in the header page of Basic list

    Hello,
    I have to display the selection fields in the header page of the basic list and statistics
    in a SAP Query.
    I know the usage of short names for fields in the header page, but this doesn't work
    for the selection fields.
    How can I display the selection fields in header pages?
    Kind regards
    Thomas

    Try using:
    DATA: wa_lstab TYPE line
    READ LINE sy-index line value INTO wa_lstab
    Thanks,
    SKJ

  • Modifying table by selecting checkboxes  in basic list

    Hi
    I have a basic list whose first two fields are checkboxes.
    I have to select only one checkbox from first list and can have multiple selections in second checkbox.
    In a row only one checkbox can be selected.
    Based on these selections i have to update a table with the other entries of my basic list.
    how do i do it???

    Hi1
    In the transaction cj20n I had been asked to create a checkbox for multi well option which I have created. At the project level as well as the WBS level they want this checkbox which I have created. Now it is required that when chech box is checked, it should validate the remote sump field and populate it with valid location based on the DLS or NTS selection as radiobutton.
    If the checkbox is unchecked, it shld validate the surface location field and populate it,If DLS or NTS selected , it validates the surface loaction  with valid surface location based on DLS or NTS selection.
    The coding for the screens are as follows , but I am not sure if it is correct as it dosent give the desired result.Kindly help me out a sits an urgent work given and help will be hihgly appreciated and rewarded.
    As per the current functionality , if DLS or NTS selected and well ID populated, validate that the well ID adheres to the appropriate formatting.
    This is for screen 600 similary I have done for screen 700 but I am not able to validate still  or get teh result. zzmulti_well is the field for new checkbox option created (multi well).
    MODULE check_0600_zsurflocn INPUT.
    IF proj-zzmulti_well IS  INITIAL.
      IF proj-zzsurflocn IS NOT INITIAL.
        CASE 'X'.
          WHEN proj-zzdls.
            lv_result =  zcl_well=>check_dls_sr( location_id = proj-zzsurflocn ).
            IF lv_result IS INITIAL.
              MESSAGE e003(zwell). " Not a valid DLS surface location
            ENDIF.
          WHEN proj-zznts.
            lv_result =  zcl_well=>check_nts_sr( location_id = proj-zzsurflocn ).
            IF lv_result IS INITIAL.
              MESSAGE e004(zwell). " Not a valid NTS surface location
            ENDIF.
        ENDCASE.
      ENDIF.
    ENDIF.
    ENDMODULE.                 " check_0600_zsurflocn  INPUT
    *&      Module  check_0600_zremsump  INPUT
    Remote sump validation.
    MODULE check_0600_zremsump INPUT.
    IF proj-zzmulti_well IS NOT INITIAL.
      IF proj-zzremsump IS NOT INITIAL.
        CASE 'X'.
          WHEN proj-zzdls.
            lv_result =  zcl_well=>check_dls_sr( location_id = proj-zzremsump ).
            IF lv_result IS INITIAL.
              MESSAGE e005(zwell).  " Not a valid DLS remote sump
            ENDIF.
          WHEN proj-zznts.
            lv_result =  zcl_well=>check_nts_sr( location_id = proj-zzremsump ).
            IF lv_result IS INITIAL.
              MESSAGE e006(zwell).  " Not a valid NTS remote sump
            ENDIF.
        ENDCASE.
      ENDIF.
    ENDIF.
    ENDMODULE.                 " check_0600_zremsump  INPUT
    Kindly help pleaseeee.
    Aarav

  • Check box in basic list

    Hi frieds,
    I wants to display a list of record in basic list and also one chek box for every record.
    Then based on selected check box i want to cancel that record in database means i want to set it's flag. also in application toolbar of basic list display cancel button.
    can  any one gives me code for this.
    Thank you.
    Regards,
    Virat

    Hi
    See the sample example code
    and do accordingly
    TABLES:MARA.
    DATA:BEGIN OF GT_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR,
    END OF GT_MARA,
    GV_CB,
    GV_CBV,
    GV_LINES TYPE I,
    INDEX TYPE I,
    SY_INDEX TYPE I,
    GV_LINES1 TYPE I,
    MATNR LIKE MARA-MATNR.
    SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
    SELECT
    MATNR FROM MARA
    INTO TABLE GT_MARA
    WHERE MATNR IN S_MATNR.
    IF SY-SUBRC = 0.
    DESCRIBE TABLE GT_MARA LINES GV_LINES.
    ENDIF.
    LOOP AT GT_MARA.
    WRITE:/ GV_CB AS CHECKBOX,
    GT_MARA-MATNR.
    ENDLOOP.
    CLEAR GT_MARA.
    WRITE:'Total num of records is ',GV_LINES.
    SET PF-STATUS 'DEL'.
    AT USER-COMMAND.
    IF SY-UCOMM = 'DEL' OR SY-UCOMM = 'PICK'.
    DO 50 TIMES.
    SY_INDEX = SY-INDEX.
    READ LINE SY_INDEX FIELD VALUE GV_CB
    GT_MARA-MATNR INTO MATNR.
    IF GV_CB = 'X'." AND MATNR IS NOT INITIAL.
    LOOP AT GT_MARA." WHERE MATNR = MATNR.
    DELETE GT_MARA.
    CLEAR GT_MARA.
    ENDLOOP.
    delete gt_mara index sy_index.
    ENDIF.
    ENDDO.
    DESCRIBE TABLE GT_MARA LINES GV_LINES1.
    WRITE:'Total num of records is ',GV_LINES1.
    CLEAR:GV_LINES .
    LOOP AT GT_MARA.
    WRITE:/ GT_MARA-MATNR.
    ENDLOOP.
    ENDIF.
    Reward points for useful Answers
    Regards
    Anji

Maybe you are looking for

  • Page numbers in pages

    Dear collegues. I have a 20 page document. I want to start numbering the pages but only on the third page and starting with the page number 24. Is there a way in pages to do that? Thanks for your help.

  • Windows 7 driver for PCI Simple Controller

    I installed the Lenovo Windows 7 Professional upgrade on my R400 (7443-CTO) from Windows XP Professional.  The ThinkVantage tools repeatedly shows I need a driver for the "PCI Simple Controller".  I have been unable to find that driver on the Lenovo

  • How can I detect arrival of data on socket?

    I have written a bean which uses a (client) socket to send data to a socket server program. This works fine. My problem is that I also want the bean to be able to detect the arrival of data on its socket without going into a read loop. From what I ha

  • I need urgent help for the logic

    hi all, Initially, the requirement was to create PO regardless the Purchase Requisition based on the formula If (Open Qty + Current Stock) < Safety Stock ==>> THEN A PO NEEDS TO BE CREATED This is absolutely fine, this created the PO as per the above

  • AP aging Report with Aging Period as parameter

    HI all , It's required from me to make AP aging period report with parameters including Aging periods as parameter so that the user will have list of value with the aging periods avaialable & he should choose from them . Based on that the columns wit