Display fields based on radiobutton in ALV

hi friends,
I have two radio buttons. Depending upon the radiobutton that is checked only a certain fields should be displayed in the ALVoutput. Could any one help me to solve this issue.
Thanks and regards,
Ramineni

Hi,
    Better to create two internale tables n if check box is checked then display data from first internal table n if not checked then display data from second internal table.
Regards,
Prashant

Similar Messages

  • Need to display fields based on first filed selection

    Hi All
    I am useing Apex 4.1 on 11gr2
    I am building an application that needs to have some fields completed based on the selection of the first file that is a LOV pick list.
    I am using the display condition for the edit of existing records, but now need to be able to create a new record.
    I thought I would have the screen redraw but that also resets the first field.
    Any help would be great.
    Edited by: merph on Oct 12, 2011 3:28 PM
    Sorry guys I found the answer,, getting to like apex ;-)
    Edited by: merph on Oct 12, 2011 3:57 PM

    Silly me it's right there

  • Do not display field in report output using ALV

    Hello friends,
    I have a dilemma here. I sorted my report using a dummy field named asset_dum. now, this is my basis of sub totals but I do not need to show it in the display. Is there a way or an option to do this?

    Hi,
    The problem with NO_OUT is that if the user changes the layout he can see the field and there is nothing in the system that would stop him from displaying the same.
    However TECH field should be useful in your case.
    TECH
    If this field is set, the relevant field is not displayed on the list and cannot be shown interactively. The field is only known in the field catalog. (For example, it must not be specified as a sorting criterion).
    Regards,
    Ravi
    Note : Please close the thread if the issue is resolved and mark all the helpful answers

  • To suppress certain fields based on radiobutton selection

    hi experts,
    I am having the requirement that on selection of presentation server(radio button) i need to suppress some fields like file path and name in application server(radio button) which are mandatory when application server is selected.
    Now my problem is if I leave the fields in application server blank and select presentation server then it is asking to fill in all required fields.
    Here is the code i am using:
    Selection Screen                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t08.
    *FOR APPLICATION SERVER FILE
    PARAMETERS: po_appln RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND upload,
                po_ipath TYPE filepath-pathintern  OBLIGATORY MODIF ID app,
                po_ifile TYPE rlgrap-filename       OBLIGATORY MODIF ID app.
    SELECTION-SCREEN SKIP 1.
    *FOR PRESENTATION SERVER FILE
    PARAMETERS: po_dsktp RADIOBUTTON GROUP rad1,
                po_dfile TYPE rlgrap-filename     OBLIGATORY MODIF ID prn.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM modify_screen.
    form MODIFY_SCREEN .
    *When application server radio button is checked
      LOOP AT SCREEN.
        IF po_appln EQ  'X' AND screen-group1 EQ 'PRN'.
          screen-output = '0'.
          screen-active = '0'.
          screen-input  = '0'.
        ENDIF.
        IF po_appln EQ  'X' AND screen-group1 EQ 'APP'.
          screen-input  = '1'.
        ENDIF.
    *When presentation server radio button is checked
        IF po_dsktp EQ 'X' AND screen-group1 EQ 'APP'.
          screen-output = '0'.
          screen-active = '0'.
          screen-input  = '0'.
        ENDIF.
        IF po_dsktp EQ 'X' AND screen-group1 EQ 'PRN'.
          screen-input  = '1'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    endform.         
    Can some one please help me

    Hi,
    Remove the obligatory extension in the selection-screen. Then the mandatory check will not be done when you select the radio-button.
    To handle the mandatory check of the path and file, do the checking in the event 'AT SELECTION-SCREEN'
    if sscrfields-ucomm = 'ONLI'. (Declare TABLES: SSCRFIELDS in the data declarations)
    if ipath is initial.
    message E001(z...)  with 'Please enter a file path'.
    endif.
    Regards,
    Vidya Chowdhary A.

  • Edit or display field based on authentication

    I am using Apex 4.1
    I have a form that has following fields :
    Name (Display only OR Text - Right now I have set it as Text)
    Location (List)
    Date (Date Picker)
    My problem is..I have a few users who have the Admin Priv.(authentication scheme already set up for it)
    These users should be able to edit and enter Names while rest of users should see their name displayed(done by APP USER variable already)
    My query is how can I make the Name field as Display only(for regular users) and Editable Text(for Admins) using the authentication set up.
    How can I achieve this?
    Any clues and advise will be appreciated.
    Thanks.

    Hi,
    >
    I did give this a try but this uses Apex SSO authentication or no validation at all.
    >
    You have to use the condition that tells you whether the logged in user is Admin or not.
    >
    I have set up few users with Admin privilege for the application and would like only them to be able to edit the filed and enter data while rest of them should only see their own data appear.
    >
    This seems to be rather different from your requirement in OP.
    Are you wanting to filter rows for non-admin users?
    >
    I need to the application to use the set up that I have specified.
    Is there any way I can set the read-only for my set up??
    Or any other alternates ??
    >
    If your objective is to filter rows by logged in user for non-admin users then depending on your db edition, you can use
    a. Virtual Private Database
    b. Mimic VPD through the use of APP_USER or any other means in the Queries.
    Cheers,

  • Download dynamic fields (based on changed layout) from ALV

    Hello All,
    Currently i am displaying 28 firelds in my ALV output.
    I have created my own button for downloading the contents displayed using GUI_DOWNLOAD.
    Say if user changes the layout and say now we have 35 fields in the layout.
    Now when we click the DOWNLOAD button, i want to download these 35 fields instead of 28 fields.
    Can anyone please help me on this...
    Thanks in advance....
    Regards,
    Tarun

    Hi Tarun,
    As the frontend layout is directly connected to this output table, standard excel download would work here (because it already knows which column to display and download).
    But as you want custom solution I think the following might work:
    - get fieldcatalog using GET_FRONTEND_FIELDCATALOG
    - loop through it and check if field is in displayed mode ( NO_OUT ne 'X' ).
    - create (or just copy above entries) to new fieldcatalog table
    - use class CL_ALV_TABLE_CREATE to generate dynamic table with structure of displayed fields only (based on that new fieldcatalog)
    - loop through output table and copy corresponding fields to your dynamic table appending to it
    - download dynamic table using GUI_DOWNLOAD (parameter DATA_TAB here is generic so you can pass any table structure).
    Regards
    Marcin

  • Regarding Selection Screen field making display field  in ALV report

    Hi All,
               In ALV Report,  at runtime how can i make the field as Display Field in selection screen .
    Thks & Regds
    Shailesh

    hii,
    Go to se38 and give the below progra name execute.... check the source code it is very easy to understand.
    1.demo_dynpro_modify_simple
    2.demo_dynpro_modify_screen
    if tou are using grid,u can refer to foll link
    sequencing / choosing fields in report screen at runtime,
    Display the Columns in the grid at run time
    rgrds,
    Shweta

  • How to display F4 values in one field based on other field selection

    Hi All,
    How to hide a UI element (i.e Link to action) highlited for Normal User and display the same to super user.
    Component Name : /SAPSRM/WDC_DODC_SC_GAF_C
    2.Can i know how to display  the entries in supplier field based on Product category selection.
    Right now all the entries are getting displayed in the supplier field.
    I want to display only entries based on Product category.
    Search Help Name : BBP_BUPA_CLL_PARTNER
    Component Name : /SAPSRM/WDC_DODC_SC_I_LIM
    How to enhance the web dynpro component with the filtered values.
    Regards,
    Krish.

    Hi Ashvin,
                 Thanks for the document. In the search help there is a standard FM which is getting executed.
    Can i enhance that FM or should i copy and edit.
    BBP_F4IF_SHLP_EXIT_CLL_PARTNER
    If i creata a Z FM and make changes how to pass that values to my standard Component View UI Element.
    If not then suggest me some alternative.
    Regards,
    Krish

  • How to display f4 help for a field based on value of another field

    Hello All,
    I have 4 fields : Sales Org : VBAK-VKORG, Distrib Channel : RV50A-VTWEG, Div : RV50A-SPART, Sold-to-party : KUAGV-KUNNR.
    The second field depends on the first one, the third on the second one and the fourth on the first field.
    However, when each of the second third and fourth fields' f4 help is displayed, the values are independent of the previous fields. How do I set the f4 help to display values based on the respective fields?
    Regards,
    Mithun

    Please be sure that you are searching the forums before posting. This exact same question was asked just yesterday:
    F4 help to input field
    In particular study the section and the linked help document for ddic search helps export/importing parameters and the requirements for DDic Structure/table usage for the parameter mapping.

  • Drill down capabilities for an alv grid display field using oops concept

    Hi All,
    could anyone help me in how to achieve the drill down capabilities for an alv grid display field using oops concept.
    Thanks & Regards,
    padmasri.

    padmasri,
    Hope your requirement is something like, when you click on a sales order number it should display that order (VA03), in a grid output displayed using set_table_for_first_display.
    you can acheive it using event double click.
    *&            L O C A L  C L A S S E S   -   D E F I N I T O N         *
    class lcl_event_receiver: local class to handle event DOUBLE_CLICK
    CLASS LCL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS:
        HANDLE_DOUBLE_CLICK
            FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                IMPORTING E_ROW E_COLUMN.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *&    L O C A L  C L A S S E S   -   I M P L E M E N T A T I O N       *
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DOUBLE_CLICK.
        PERFORM HANDLE_DOUBLE_CLICK USING E_ROW
                                          E_COLUMN.
      ENDMETHOD.                           "handle_double_click
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    FORM HANDLE_DOUBLE_CLICK USING E_ROW    TYPE LVC_S_ROW
                                   E_COLUMN TYPE LVC_S_COL.
      DATA: LS_DETAIL LIKE LINE OF T_OUTPUT.
          WHEN 'T_OUTPUT'.
            READ TABLE T_OUTPUT   INDEX E_ROW-INDEX INTO LS_DETAIL.
    If clicked on PO Number or PO Item, call ME23
        IF E_COLUMN-FIELDNAME = 'EBELN' OR
           E_COLUMN-FIELDNAME = 'EBELP' .
          SET PARAMETER ID 'BES' FIELD LS_DETAIL-EBELN.
          SET PARAMETER ID 'BSP' FIELD LS_DETAIL-EBELP.
          CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    If clicked on sales order number or item, call VA03
        ELSEIF E_COLUMN-FIELDNAME = 'VBELN' OR
               E_COLUMN-FIELDNAME = 'POSNR'.
          SET PARAMETER ID 'AUN' FIELD LS_DETAIL-VBELN.
          SET PARAMETER ID 'APO' FIELD LS_DETAIL-POSNR.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    Hope this helps

  • Display text fields based on value

    I have a form that has 7 text fields that are to be filled out. I have an ajax process that auto-populates those 7 fields with values based off of the return value of a pop-up dynamic LOV. Is there any way that I can hide the last 5 fields based on a certain value of one of the text fields?
    For example, my fields are:
    P1_Badge (LOV query)
    P1_First_Name
    P1_Last_Name
    P1_Title
    P1_Phone
    P1_Room_No
    P1_Email
    P1_Fax
    The LOV returns a Badge number and populates the rest of the values. But if the Last_Name = 'Smith' then I only want to display Badge, First_Name, and Last_Name and I want to hide the rest of the fields or make them disabled for editing.
    Is this possible without any kind of page submit?
    Thanks,
    Dirk

    Hello,
    Take a look at this page http://apex.oracle.com/pls/otn/f?p=11933:39 it has examples of what you want.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Total Text Display at the end of the ALV

    Hi,
    I want to display the text 'TOTAL' in my ALV at the end of my report.I am pasting my code, So please any one help me in this issue.
    *& Report  ZFIR0011_O2C_TAX_GL_SUMMARY
    REPORT  zfir0011_o2c_tax_gl_summary.
    TYPE-POOLS slis.
    TABLES: faglflexa.
    Column positions to pass to field catalog
    CONSTANTS :  c_pos_1      TYPE sy-cucol       VALUE '1',   " position of the columns
                 c_pos_2      TYPE sy-cucol       VALUE '2',
                 c_pos_3      TYPE sy-cucol       VALUE '3',
                 c_pos_4      TYPE sy-cucol       VALUE '4',
                 c_pos_5      TYPE sy-cucol       VALUE '5'.
    *Field names for Field Catalog
    CONSTANTS : c_h           TYPE c              VALUE 'H',
                c_s           TYPE c              VALUE 'S',
                c_slash       TYPE c              VALUE '/',
                c_colon       TYPE c              VALUE ':',
                c_top_of_page TYPE slis_formname  VALUE 'TOP_OF_PAGE',
                c_top_of_page_split TYPE slis_formname  VALUE 'TOP_OF_PAGE_SPLIT',
                c_txjcd       TYPE slis_fieldname VALUE 'TXJCD',     "Tax Jurisdiction
                c_region      TYPE slis_fieldname VALUE 'STATE',     "State
                c_currb       TYPE slis_fieldname VALUE 'CURR_BAL',  "Current Balance
                c_perch       TYPE slis_fieldname VALUE 'PER_CHNG',  "Period Change
                c_prbal       TYPE slis_fieldname VALUE 'PRI_BALA',  "Prior Balance
                c_total       TYPE slis_fieldname VALUE 'TOTAL'.     "Total
    CONSTANTS : c_table_name  TYPE slis_tabname   VALUE 'IT_FINAL', "For Field Catalog
                c_spras       TYPE spras          VALUE 'E',        "Language
                c_buzei       TYPE c              VALUE '1',
                c_zp          TYPE bset-mwskz     VALUE 'ZP',
                c_zr          TYPE bset-mwskz     VALUE 'ZR'.
    Types Declaration.
    TYPES: BEGIN OF ty_faglflexa,
           ryear TYPE gjahr,
           bukrs TYPE bukrs,
           belnr TYPE belnr_d,                  "Document Number
           poper TYPE poper,                    "Posting Period
           budat TYPE budat,                    "Posting Date
           buzei TYPE buzei,                    "Document line item
           racct TYPE racct,                    "G/L Account no.
           END   OF ty_faglflexa,
           ty_t_faglflexa TYPE STANDARD TABLE OF ty_faglflexa.
    TYPES: BEGIN OF ty_bset,
           belnr TYPE belnr_d,
           buzei TYPE buzei,
           mwskz TYPE mwskz,                    "Tax code
          hkont TYPE hkont,
           shkzg TYPE shkzg,                    "Debit/Credit Indicator
           txjcd TYPE txjcd,                    "Tax Jurisdiction
           h2ste TYPE h2ste,                    "Tax Amount
           h2bas TYPE h2bas_bses,               "Tax Amount
           END   OF ty_bset,
           ty_t_bset TYPE STANDARD TABLE OF ty_bset.
    TYPES: BEGIN OF ty_skat,
           spras TYPE spras,
           ktopl TYPE ktopl,
           saknr TYPE saknr,
           text  TYPE txt20_skat,
           END   OF ty_skat,
           ty_t_skat TYPE STANDARD TABLE OF ty_skat.
    TYPES: BEGIN OF ty_custom,
           geo_state    TYPE char2,
           geo_county   TYPE char3,
           country      TYPE char2,
           description  TYPE char40,
           END   OF ty_custom,
           ty_t_custom TYPE STANDARD TABLE OF ty_custom.
    TYPES : BEGIN OF ty_budat,
             sign     TYPE char_01,
             option   TYPE char2,
             low      TYPE budat,
             high     TYPE budat,
            END OF ty_budat,
            ty_t_budat TYPE STANDARD TABLE OF ty_budat.
    TYPES: BEGIN OF ty_txjcd,
           geo_state  TYPE char2,
           geo_county TYPE char3,
           END   OF ty_txjcd,
           ty_t_txjcd TYPE STANDARD TABLE OF ty_txjcd.
    TYPES: BEGIN OF ty_inter,
           ryear TYPE gjahr,
           bukrs TYPE bukrs,
           txjcd TYPE txjcd,                    "Tax Jurisdiction
           racct TYPE racct,                    "G/L Account no.
           h2ste TYPE h2ste,                    "Tax Amount
           poper TYPE poper,                    "Posting Period
           belnr TYPE belnr_d,                  "Document Number
           shkzg TYPE shkzg,                    "Debit/Credit Indicator
           END   OF ty_inter,
           ty_t_inter TYPE STANDARD TABLE OF ty_inter.
    TYPES: BEGIN OF ty_final,
           txjcd    TYPE bset-txjcd,                     "Tax Jurisdiction
           state    TYPE char40,                         "State
           curr_bal TYPE bset-h2ste,                     "Current Balance
           per_chng TYPE bset-h2ste,                     "Period Change
           pri_bala TYPE bset-h2ste,                     "Prior Balance
           END   OF ty_final,
           ty_t_final TYPE STANDARD TABLE OF ty_final.
    Internal Tables Declaration.
    DATA : it_faglflexa        TYPE ty_t_faglflexa,
           it_bset             TYPE ty_t_bset,
           it_skat             TYPE ty_t_skat,
           it_custom           TYPE ty_t_custom,
           it_txjcd            TYPE ty_t_txjcd,
           it_inter            TYPE ty_t_inter.                 "Intermediate table for storing data
    DATA : it_final            TYPE ty_t_final.                 "#EC NEEDED
    *Fieldcatalogue Internal Table Declaration
    DATA : it_fieldcat         TYPE slis_t_fieldcat_alv,
           wa_fieldcat         TYPE slis_fieldcat_alv,
           it_alv_top_of_page  TYPE slis_t_listheader,
           gs_line             TYPE slis_listheader.
    *Field-symbols and Work Area Declarations
    FIELD-SYMBOLS : <fs_faglflexa>      TYPE ty_faglflexa,
                    <fs_bset>           TYPE ty_bset,
                    <fs_inter>          TYPE ty_inter.
    DATA : wa_faglflexa     TYPE ty_faglflexa,                  "#EC NEEDED
           wa_bset          TYPE ty_bset,
           wa_skat          TYPE ty_skat,
           wa_custom        TYPE ty_custom,
           wa_txjcd         TYPE ty_txjcd,
           wa_inter         TYPE ty_inter,
           wa_final         TYPE ty_final.                      " #EC NEEDED
    Variables Declaration.
    DATA : v_current_year TYPE i,
           v_poper        TYPE poper,
           v_saknr        TYPE saknr,                           "#EC NEEDED
           v_ktopl        TYPE ktopl,
           v_konts        TYPE saknr,
           v_bukrs        TYPE bukrs,
           v_buzei(2)     TYPE n VALUE '0',
           v_sum_val      TYPE h2ste,
           v_sum_val1     TYPE h2ste,
           v_sum_val2     TYPE h2ste,
           v_h2ste        TYPE string,
           v_desc         TYPE char40,
           v_title        TYPE char40,
           v_start_date   TYPE char10.             "Temp Added
    SELECTION-SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_bukrs TYPE faglflexa-rbukrs OBLIGATORY,              " Company Code
                    p_gjahr TYPE faglflexa-gjahr  OBLIGATORY.              " Fiscal Year
    SELECT-OPTIONS: s_budat FOR  faglflexa-budat  OBLIGATORY
                                                  NO-EXTENSION
                                                  NO INTERVALS.
    PARAMETERS:     p_racct TYPE faglflexa-racct  OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN VALIDATIONS.
    *Company Code Validation.
    AT SELECTION-SCREEN ON p_bukrs.
      SELECT SINGLE bukrs INTO v_bukrs
      FROM t001
      WHERE bukrs = p_bukrs.
      IF sy-subrc NE 0.
        MESSAGE text-002 TYPE 'E'.
      ENDIF.
    Fiscal Year Validation. It should not be more than Current.
    AT SELECTION-SCREEN ON p_gjahr.
      v_current_year = sy-datum+0(4).
      IF p_gjahr > v_current_year.
        MESSAGE text-003 TYPE 'E'.
      ENDIF.
    *G/L Account Validation.
    AT SELECTION-SCREEN ON p_racct.
      SELECT SINGLE saknr INTO v_saknr
      FROM skb1
      WHERE saknr EQ p_racct
      AND   bukrs EQ p_bukrs.
      IF sy-subrc EQ 0.
        SELECT SINGLE ktopl FROM t001
        INTO v_ktopl
        WHERE bukrs = p_bukrs.
        SELECT SINGLE konts FROM t030k
        INTO v_konts
        WHERE ktopl = v_ktopl
        AND   konts = v_saknr.
        IF sy-subrc NE 0.
          MESSAGE text-004 TYPE 'E'.
        ENDIF.
      ELSE.
        MESSAGE text-004 TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      PERFORM get_data USING p_bukrs
                             p_gjahr
                             s_budat[]
                             p_racct  CHANGING it_final.
    *Display report in ALV grid
      IF it_final IS NOT INITIAL.
    *Build Top of the page table.
        PERFORM comment_build USING it_skat CHANGING it_alv_top_of_page.
    *Build Field catalog table for ALV
        PERFORM build_field_catalog CHANGING it_fieldcat.
    *Display report
        PERFORM display_alv USING it_final.
      ELSE.
    *No data found for the selection criteria/period.
        MESSAGE text-018 TYPE 'I'.
      ENDIF.
    *&      Form  GET_DATA
          text
         -->P_P_BUKRS  text
         -->P_P_GJAHR  text
         -->P_P_BUDAT  text
         -->P_P_RACCT  text
         <--P_IT_FINAL  text
    FORM get_data  USING    fp_bukrs     TYPE bukrs
                            fp_gjahr     TYPE gjahr
                            fp_budat     TYPE ty_t_budat
                            fp_racct     TYPE racct
                   CHANGING fp_it_final  TYPE ty_t_final.
      DATA : v_date(2)  TYPE c VALUE '01',
             v_month(2) TYPE c VALUE '01',
             v_start_date TYPE datum.
    *concatenate p_gjahr v_month v_date into v_start_date.  " separated by c_slash.
      SELECT ryear
             rbukrs
             belnr                                "Document Number
             poper                                "Posting Period
             budat                                "Posting Date
             buzei                                "Document line item
             racct                                "G/L Account no.
             INTO TABLE it_faglflexa
             FROM faglflexa
             WHERE rbukrs EQ p_bukrs
             AND   gjahr  EQ p_gjahr
             AND   budat  LE s_budat
             AND   racct  EQ p_racct.
    *selecting the Tax Jurisdiction, Tax amount from BSET
      IF it_faglflexa IS NOT INITIAL.
        SELECT belnr
               buzei
               mwskz
               "hkont
               shkzg                                "Debit/Credit Indicator
               txjcd                                "Tax Jurisdicaiton
               h2ste                                "Tax Amount
               h2bas                                "Tax Amount1
               INTO TABLE it_bset
               FROM bset
               FOR ALL ENTRIES IN it_faglflexa
               WHERE belnr EQ it_faglflexa-belnr
               AND   gjahr EQ p_gjahr               "it_faglflexa-ryear
               AND   buzei EQ c_buzei.              "Line item
      ENDIF.
      IF sy-subrc EQ 0.
        SORT it_bset BY txjcd ASCENDING.
      ENDIF.
    *Selecting the G/L Account Long Text from SKAT
      IF it_faglflexa IS NOT INITIAL.
        SELECT  spras                            " Language key
                ktopl                            " Chart of Accounts
                saknr                            " G/L Account Number
                txt20                            " G/L Account Long Text
             INTO TABLE it_skat
             FROM skat
             FOR ALL ENTRIES IN it_faglflexa
             WHERE spras =  c_spras
             AND   saknr =  it_faglflexa-racct.
      ENDIF.
    *Selecting the Description from Custom table
      LOOP AT it_bset ASSIGNING <fs_bset>.
        wa_txjcd-geo_state  = <fs_bset>-txjcd+0(2).
        wa_txjcd-geo_county = <fs_bset>-txjcd+2(3).
        APPEND wa_txjcd TO it_txjcd.
        CLEAR wa_txjcd.
      ENDLOOP.
      IF it_txjcd IS NOT INITIAL.
        SELECT geo_state
               geo_county
               country
               description
        INTO TABLE it_custom
        FROM ztfi_tgl_summary
        FOR ALL ENTRIES IN it_txjcd
        WHERE geo_state  = it_txjcd-geo_state
        AND   geo_county = it_txjcd-geo_county.
      ENDIF.
      LOOP AT it_faglflexa ASSIGNING <fs_faglflexa>.
        MOVE-CORRESPONDING <fs_faglflexa> TO wa_inter.          "#EC ENHOK
    *Read Tax Jurisdiction and Tax Amount from BSET Table.
        READ TABLE it_bset INTO wa_bset WITH KEY belnr =  <fs_faglflexa>-belnr.
        IF sy-subrc EQ 0.
          wa_inter-shkzg = wa_bset-shkzg.
          wa_inter-txjcd = wa_bset-txjcd.
        ENDIF.
    *If BSET-MWSKZ = ZP or ZR then pick H2BAS as Tax Amount.
        IF wa_bset-mwskz = c_zp.
          wa_inter-h2ste = wa_bset-h2bas.
        ELSEIF wa_bset-mwskz = c_zr.
          wa_inter-h2ste = wa_bset-h2bas.
        ELSE.
          wa_inter-h2ste = wa_bset-h2ste.
        ENDIF.
    *Check it is credit entry or debit entry ('H' or 'S').
        IF wa_inter-shkzg EQ 'H'.
          wa_inter-h2ste = wa_inter-h2ste * -1.
        ENDIF.
        APPEND wa_inter TO it_inter.
        CLEAR: wa_inter, wa_bset.
      ENDLOOP.
      IF sy-subrc EQ 0.
        SORT it_inter BY bukrs ryear txjcd ASCENDING.
        DELETE it_inter WHERE txjcd EQ space.
      ENDIF.
      v_poper = s_budat-low+4(2).
      LOOP AT it_inter INTO wa_inter.
    *Read the Text maintained in the custom table based on the GEO_STATE = First two digits of TXJCD
    *and GEO_COUNTY = Next three digits of TXJCD. If this is blank pick based on First two digits of TXJCD.
        READ TABLE it_custom INTO wa_custom WITH KEY geo_state  = wa_bset-txjcd+0(2)
                                                     geo_county = wa_bset-txjcd+2(3).
        IF sy-subrc NE 0.
          READ TABLE it_custom INTO wa_custom WITH KEY geo_state  = wa_bset-txjcd+0(2).
        ENDIF.
        IF sy-subrc = 0.
          wa_final-state = wa_custom-description.
        ENDIF.
        AT NEW txjcd.
          CLEAR: v_sum_val, v_sum_val1, v_sum_val2.
        ENDAT.
      Period Change
        IF wa_inter-poper EQ v_poper.
          v_sum_val1 = v_sum_val1 + wa_inter-h2ste.
        ENDIF.
      Prior Balance
        IF wa_inter-poper LT v_poper.
          v_sum_val2 = v_sum_val2 + wa_inter-h2ste.
        ENDIF.
        AT END OF txjcd.
          wa_final-txjcd    = wa_inter-txjcd.
          wa_final-per_chng = v_sum_val1.                                     "Period change
          wa_final-pri_bala = v_sum_val2.                                     "Prior Balance
          wa_final-curr_bal = v_sum_val1 + v_sum_val2.                        "Current Balance
          APPEND wa_final TO it_final.
          CLEAR wa_final.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  COMMENT_BUILD
          text
         -->P_IT_SKAT  text
         <--P_IT_ALV_TOP_OF_PAGE  text
    FORM comment_build  USING    fp_it_skat            TYPE ty_t_skat
                        CHANGING fp_it_alv_top_of_page TYPE slis_t_listheader.
      DATA: v_budat_low  TYPE c LENGTH 10,
            v_budat_high TYPE c LENGTH 10,
            v_butxt      TYPE butxt.
      CLEAR gs_line.
    *Report Title
      CONCATENATE text-005 p_bukrs INTO v_title SEPARATED BY space.
      gs_line-typ = c_h.
      gs_line-key = ' '.
      gs_line-info = v_title.
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR gs_line.
    *Account Number
      gs_line-typ = c_s.
      gs_line-key = text-006.
      gs_line-info = p_racct.
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR gs_line.
    *G/L Account Description
      READ TABLE it_skat INTO wa_skat WITH KEY ktopl = v_ktopl.
      IF sy-subrc EQ 0.
        v_desc = wa_skat-text.
      ENDIF.
      gs_line-typ = c_s.
      gs_line-key = text-007.
      gs_line-info = v_desc.
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR gs_line.
    *Fiscal Year from selection
      IF NOT p_gjahr IS INITIAL.
        gs_line-info = p_gjahr.
        gs_line-typ   = c_s.
        gs_line-key  = text-008.                                              "Fiscal Year
        APPEND gs_line TO fp_it_alv_top_of_page.
        CLEAR gs_line.
      ENDIF.
    *Posting Date
      CONCATENATE s_budat-low4(2) s_budat-low6(2) s_budat-low+0(4) INTO gs_line-info SEPARATED BY c_slash.
      gs_line-typ   = c_s.
      gs_line-key  = text-009.                                               "Posting Date
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR gs_line.
    *Company Code Description from selection
      IF NOT p_bukrs IS INITIAL.
        SELECT SINGLE butxt FROM t001
        INTO v_butxt WHERE bukrs EQ p_bukrs.
        gs_line-info = v_butxt.
        gs_line-typ  = c_s.
        gs_line-key  = text-010.                                              "Company Code Description
        APPEND gs_line TO fp_it_alv_top_of_page.
        CLEAR gs_line.
      ENDIF.
    Printed Date
      gs_line-typ = c_s.
      gs_line-key = text-011.                                                 "Printed Date
      CONCATENATE  sy-datum+4(2)
                   sy-datum+6(2)
                   sy-datum(4) INTO gs_line-info SEPARATED BY c_slash.        "todays date
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR: gs_line.
    Printing Time
      gs_line-typ = c_s.
      gs_line-key = text-012.                                                 "Printing Time
      gs_line-info = sy-uzeit.
      CONCATENATE  sy-uzeit(2)
                   sy-uzeit+2(2)
                   sy-uzeit+4(2) INTO gs_line-info SEPARATED BY c_colon.      "current time
      APPEND gs_line TO fp_it_alv_top_of_page.
      CLEAR: gs_line.
    ENDFORM.                    " COMMENT_BUILD
    *&      Form  BUILD_FIELD_CATALOG
          text
         <--P_IT_FIELDCAT  text
    FORM build_field_catalog  CHANGING fp_it_fieldcat TYPE slis_t_fieldcat_alv.
    TAX JURISDICTION
      wa_fieldcat-col_pos      = c_pos_1.
      wa_fieldcat-reptext_ddic = text-013.                                    "TAX JURISDICTION
      wa_fieldcat-fieldname    = c_txjcd.
      wa_fieldcat-tabname      = c_table_name.
      wa_fieldcat-outputlen    = '15'.
      APPEND  wa_fieldcat TO fp_it_fieldcat.
      CLEAR : wa_fieldcat.
    STATE
      wa_fieldcat-col_pos      = c_pos_2.
      wa_fieldcat-reptext_ddic = text-014.                                    "STATE
      wa_fieldcat-fieldname    = c_region.
      wa_fieldcat-tabname      = c_table_name.
      wa_fieldcat-outputlen    = '40'.
      APPEND  wa_fieldcat TO fp_it_fieldcat.
      CLEAR : wa_fieldcat.
    CURRENT BALANCE
      wa_fieldcat-col_pos      = c_pos_3.
      wa_fieldcat-reptext_ddic = text-015.                                    "CURRENT BALANCE
      wa_fieldcat-fieldname    = c_currb.
      wa_fieldcat-tabname      = c_table_name.
      wa_fieldcat-do_sum       = 'X'.
      wa_fieldcat-datatype     = 'CURR'.
      wa_fieldcat-outputlen    = '17'.
      APPEND  wa_fieldcat TO fp_it_fieldcat.
      CLEAR : wa_fieldcat.
    PERIOD CHANGE
      wa_fieldcat-col_pos      = c_pos_4.
      wa_fieldcat-reptext_ddic = text-016.                                    "PERIOD CHANGE
      wa_fieldcat-fieldname    = c_perch.
      wa_fieldcat-tabname      = c_table_name.
      wa_fieldcat-do_sum       = 'X'.
      wa_fieldcat-datatype     = 'CURR'.
      wa_fieldcat-outputlen    = '17'.
      APPEND  wa_fieldcat TO fp_it_fieldcat.
      CLEAR : wa_fieldcat.
    PRIOR BALANCE
      wa_fieldcat-col_pos      = c_pos_5.
      wa_fieldcat-reptext_ddic = text-017.                                    "PRIOR BALANCE
      wa_fieldcat-fieldname    = c_prbal.
      wa_fieldcat-tabname      = c_table_name.
      wa_fieldcat-do_sum       = 'X'.
      wa_fieldcat-datatype     = 'CURR'.
      wa_fieldcat-outputlen    = '17'.
      APPEND  wa_fieldcat TO fp_it_fieldcat.
      CLEAR : wa_fieldcat.
    ENDFORM.                    " BUILD_FIELD_CATALOG
    *&      Form  DISPLAY_ALV
          text
         -->P_IT_FINAL  text
    FORM display_alv  USING    fp_it_final TYPE ty_t_final.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      i_callback_top_of_page            = c_top_of_page
       i_callback_html_top_of_page       = c_top_of_page_split
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
         it_fieldcat                       = it_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         i_save                            = 'A'
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = fp_it_final
    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.                    " DISPLAY_ALV
    *&      Form  top_of_page
          Top of the page for ALV
    FORM top_of_page.                                           "#EC CALLED
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_alv_top_of_page
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM. "top_of_page
    *&      Form  top_of_page_split
          text
    FORM top_of_page_split USING r_top TYPE REF TO cl_dd_document."#EC *
      TYPES: BEGIN  OF ty_text,
             text   TYPE sdydo_text_element,
             END    OF ty_text.
      TYPES: BEGIN  OF ty_text1,                        "AAAAAAAA
             text1  TYPE sdydo_text_element,
             END    OF ty_text1.
      DATA: s_tab          TYPE sdydo_text_table,
            c_area         TYPE REF TO cl_dd_area,
            text           TYPE sdydo_text_element,
            c_area1        TYPE REF TO cl_dd_area,             "AAAAAAA
            text1          TYPE sdydo_text_element,
            s_tab1         TYPE sdydo_text_table.
      DATA: it_text        TYPE TABLE OF ty_text,
            wa_text        TYPE ty_text.
      DATA: it_text1       TYPE TABLE OF ty_text1,
            wa_text1       TYPE ty_text1.
      DATA: v_title        TYPE string,
            v_accts_desc   TYPE string,
            v_year         TYPE string,
            v_comp_code    TYPE string,
            v_desc         TYPE char40,
            v_budat        TYPE char10,
            v_budat1       TYPE char10,
            v_butxt        TYPE butxt,
            v_time         TYPE char10,
            v_comma        TYPE c VALUE ','.
      CALL METHOD r_top->initialize_document.
      CALL METHOD r_top->vertical_split
        EXPORTING
          split_area  = r_top
          split_width = '31%'
        IMPORTING
          right_area  = c_area.
      IF sy-subrc EQ 0.
    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *G/L Account Description
      READ TABLE it_skat INTO wa_skat WITH KEY ktopl = v_ktopl.
      IF sy-subrc EQ 0.
        v_desc = wa_skat-text.
      ENDIF.
    *Company code Description
      IF NOT p_bukrs IS INITIAL.
        SELECT SINGLE butxt FROM t001
        INTO v_butxt WHERE bukrs EQ p_bukrs.
      ENDIF.
      CONCATENATE text-005 p_bukrs INTO v_title SEPARATED BY space.
      wa_text1-text1 = v_title.
      APPEND wa_text1 TO it_text1.
      s_tab1 = it_text1.
      CALL METHOD c_area->add_text
        EXPORTING
          text_table   = s_tab1
          fix_lines    = 'X'
          sap_fontsize = cl_dd_document=>large
          sap_emphasis = cl_dd_document=>strong.                           "AAAAAA
      CONCATENATE text-006 p_racct v_comma text-007 v_desc INTO v_accts_desc SEPARATED BY space.
      CONCATENATE s_budat-low4(2) s_budat-low6(2) s_budat-low+0(4) INTO v_budat SEPARATED BY c_slash.
      CONCATENATE text-008 p_gjahr v_comma text-009 v_budat INTO v_year SEPARATED BY space.
      CONCATENATE text-010 v_butxt INTO v_comp_code SEPARATED BY space.
    wa_text-text = v_title.
    APPEND wa_text TO it_text.
      wa_text-text = v_accts_desc.
      APPEND wa_text TO it_text.
      wa_text-text = v_year.
      APPEND wa_text TO it_text.
      wa_text-text = v_comp_code.
      APPEND wa_text TO it_text.
      s_tab = it_text.
      CALL METHOD c_area->add_text
        EXPORTING
          text_table   = s_tab
          fix_lines    = 'X'
          sap_fontsize = cl_dd_document=>medium
          sap_emphasis = cl_dd_document=>medium.
      CALL METHOD r_top->new_line.
      CALL METHOD r_top->new_line.
      CALL METHOD r_top->new_line.
      CALL METHOD r_top->add_gap
        EXPORTING
          width = 0.
      CONCATENATE sy-datum4(2) sy-datum6(2) sy-datum+0(4) INTO v_budat1 SEPARATED BY c_slash.
      CALL METHOD r_top->add_text
        EXPORTING
          text         = text-011
          sap_emphasis = 'STRONG'.
      CALL METHOD r_top->add_gap
        EXPORTING
          width = 1.
      text = v_budat1.
      CALL METHOD r_top->add_text
        EXPORTING
          text = text.
         sap_style = 'KEY'.
      CALL METHOD r_top->new_line.
      CALL METHOD r_top->add_text
        EXPORTING
          text         = text-012
          sap_emphasis = 'STRONG'.
      CALL METHOD r_top->add_gap
        EXPORTING
          width = 1.
      CONCATENATE  sy-uzeit(2)
                   sy-uzeit+2(2)
                   sy-uzeit+4(2) INTO v_time SEPARATED BY c_colon.   "current time
      text = v_time.
      CALL METHOD r_top->add_text
        EXPORTING
          text = text.
         sap_style = 'KEY'.
    ENDFORM.                    "top_of_page_split
    Thanks & Regards,
    Ramana

    Hi,
    try to declare alv layout and in that
    FORM t_layout  USING    i_layout TYPE slis_layout_alv.
    i_layout-colwidth_optimize = 'X'.
      i_layout-zebra  = 'X'.
    p_i_layout-totals_text = 'GRAND TOTAL ='.
    p_i_layout-subtotals_text = 'Sub Total'.
    p_i_layout-DEF_STATUS  = ' '.
    p_i_layout-info_fieldname = 'LINE_COLOR'.
    ENDFORM.                    " T_LAYOUT
    hope this helps you.
    Thanks & Regards,
    Y.R.Prem Kumar

  • Problem in displaying totals based on the Unit of measurement.

    Hi,
    I have Problem in displaying totals based on the Unit of measurement.
    I want to display the total in the output of the alv based on the unit of measurement. for example i have three fields in the output namely
    Matnr           Quantity      UOM
    51                10              EA
    61                10              KG
    71                10              KG
    In the total i should get
                    10         EA
                    20         KG
    Can anyone tell me how to do this?
    The basic req is the exclude the qty with unit EA(each) in the totals.
    Thanks,
    Amit

    H i,
    you can use the collect statement
    to get the proper result
    loop at itab.  ( all the records)
    move all the fields from itab to another
    collect itab1.
    write: itab1-fields, itab1-fields.
    endloop.
    this will solve your problem
    reward points if helpful,
    thanks & regards,
    venkatesh

  • Hot spot for field based on field value

    Hi,
    Im using ALV list to display report. And I have enable hot spot for that field based on field value. For example, If the field has value " 0 " then hotspot should be enabled for that field. If the field has value " 1 " then it should be displayed as normal field without hotspot.
    Can anyone tell me how to do this?
    Thanks,
    Amal

    Hi Amal
    Do this
    In your final internal table
    add a table type
    gi_cellstyles TYPE lvc_t_styl
    Then (while populating output)
    FORM prepare_edit_output.
    * say your field is 'field'
      DATA : lw_stylerow TYPE lvc_s_styl,
             li_styletab TYPE lvc_t_styl.
      IF gw_output-field = '0'.
        CLEAR lw_stylerow.
        lw_stylerow-fieldname = 'FIELD'.
        lw_stylerow-style     = cl_gui_alv_grid=>mc_style_hotspot.
        APPEND lw_stylerow TO li_styletab.
      ELSEIF gw_output-field = '1'.
        CLEAR lw_stylerow.
        lw_stylerow-fieldname = 'FIELD'.
        lw_stylerow-style     = cl_gui_alv_grid=>mc_style_hotspot_no.
        APPEND lw_stylerow TO li_styletab.
      ENDIF.
      INSERT LINES OF li_styletab INTO TABLE gw_output-gi_cellstyles.
    ENDFORM.
    In your layout building
        gw_layout-stylefname = 'GI_CELLSTYLES'.
    Pushpraj

  • Displaying text more than 256 in ALV report

    Hi experts,
                     I have problem while displaying text field in ALV report which has more than 256 characters.
    I'm using CL_SALV_TABLE for displaying alv.while concatenating my internal table holding all the text.but at the time of displying the report it's only displaying 256 characters.
               Can anyone guide me how to display more than 256 characters in ALV output using CL_SALV_TABLE.

    Hi,
    Please find the below code.
    TRY.
          gr_column ?= gr_columns->get_column( columnname = 'MATNR' ).
          gr_column->set_output_length( '300' ).
        CATCH cx_salv_not_found.
        Message : Column definition problem
          MESSAGE e075().
      ENDTRY.
    Edited by: Archana.T on Jun 16, 2010 1:24 PM

Maybe you are looking for