How to access screen field in pai event

Hi All,
I have created a custom screen it has the field say matnr selected from the dictionay.NOw  how will I should access this field in PAI event module?
Thanks in advance
Mahesh

just declare the same variable in your abap editor as per your layout field name.
suppose in your layout input field name is matnr just declare
data : matnr like mara-matnr.
in pai module if you are using matnr it will give you the screen data.
like
module pai input.
if matnr ne '1000'.
message 'Error matnr is not 1000' type 'E'.
endif.
endmodule.
reagards
shiba dutta

Similar Messages

  • How to access screen field value in a module pool programming?

    Hi Experts,
       I have create a module pool program SAPMYDLG. It contains two screens 100 and 200.
       The first screen contains Employee_ID field. This field is not a dictionary field.
       In the second screen 200, I want to access the value of Employee_ID field from first screen.
       For this I created a global variable v_empid in TOP include.
       Then in the PAI of the screen 100 I have assigned the screen field value to global variable.
       v_empid = Employee_ID.
       But this gives an error saying " Field  Employee_ID not defined".
       What am I doing wrong? How can I access the screen field value?
    Thanks
    Gopal

    Hi,
    Employee_ID field also must u define in the top include when u define that 100 screen and 200 screen will access.
    regards,
    muralii

  • How do I define Field-Catalog and Event-Catalog in OOPs ALV

    Hi All,
    This is the piece of the code on which I'm working upon. This program is giving an exception "No Field-Catalog Found". 
    I'm new to OOPs ALV. Could anybody please tell me how to define the field-catalog and event-catalog in this.
    module PBO output.
          IF g_custom_container IS INITIAL.
              CREATE OBJECT g_custom_container EXPORTING CONTAINER_NAME = 'CCCONTAINER'.
              CREATE OBJECT g_grid             EXPORTING I_PARENT       = g_custom_container.
          CALL METHOD g_grid->set_table_for_first_display
              EXPORTING I_STRUCTURE_NAME = 'IT_MATERIAL'
                        is_layout = layout
              CHANGING IT_OUTTAB         = gt_it_material.
          ENDIF.
      endmodule.
    Regards,
    Saurabh

    hi,
    chk this sampl ceode.
    TYPE-POOLS: slis.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    TABLES : zmpets_shipactiv, zmpets_chargebk, zmpets_shiphdr.
    DATA : BEGIN OF int_crb OCCURS 0,
           sel TYPE char1,
           icon TYPE icon_d,
           pernr LIKE zmpets_cil-pernr,
           vorna LIKE pa0002-vorna,
           movreason LIKE zmpets_shiphdr-movreason,
           shipdocnum LIKE zmpets_chargebk-shipdocnum,
           createdon LIKE zmpets_chargebk-createdon,
           chargeamount LIKE zmpets_chargebk-chargeamount,
           version LIKE zmpets_shipactiv-version,
           activity LIKE zmpets_shipactiv-activity,
           vendor LIKE zmpets_shiphdr-vendor,
          smtp_addr LIKE adr6-smtp_addr,
           empperid LIKE zmpets_167doc-empperid,
           celltab TYPE lvc_t_styl,
           END OF int_crb.
    DATA : int_crb_ver LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_crb_mail LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_shipactiv LIKE zmpets_shipactiv OCCURS 0 WITH HEADER LINE.
    DATA: gt_fieldcatalog TYPE lvc_t_fcat.
    DATA : wf_flag TYPE i.
    DATA : wf_res TYPE c.
    DATA : wf_tabix TYPE sy-tabix.
    DATA: BEGIN OF int_sin OCCURS 0,
          shipdocnum LIKE zmpets_chargebk-shipdocnum,
            shipdocnum LIKE zmpets_shipactiv-petsdocnumber,
          END OF int_sin.
    DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng  LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA l_num(3).
    DATA: ok_code            LIKE          sy-ucomm,
          w_repid            LIKE          sy-repid,
          wl_sno             TYPE          i         VALUE 0,
          w_max              TYPE          i         VALUE 100,
          wf_layout          TYPE          lvc_s_layo,
          cont_on_main       TYPE          scrfname   VALUE  'GRID_CONTROL',
          cont_on_dialog     TYPE          scrfname   VALUE 'GRID_CONTROL',
          grid1              TYPE          REF TO cl_gui_alv_grid,
          grid2              TYPE          REF TO cl_gui_alv_grid,
          custom_container1  TYPE          REF TO cl_gui_custom_container,
          custom_container2  TYPE          REF TO cl_gui_custom_container,
          event_receiver     TYPE          REF TO lcl_event_receiver,
          lt_exclude         TYPE          ui_functions,
          ls_celltab         TYPE          lvc_s_styl,
          lt_celltab         TYPE          lvc_t_styl.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-001.
    PARAMETERS : p_cash AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b3.
    PERFORM fieldcatalog_init USING gt_fieldcatalog[].
    Selection-Screen----
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    SELECT-OPTIONS:s_chdate FOR zmpets_chargebk-createdon,
                   s_pernr FOR zmpets_shiphdr-pernr,
                   s_mvrsn FOR zmpets_shiphdr-movreason,
                   s_sin FOR zmpets_chargebk-shipdocnum NO INTERVALS
    NO-EXTENSION.
    SELECTION-SCREEN  END OF BLOCK b1.
    PERFORM f_clear_fields.
    CALL SCREEN 100.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA: ls_toolbar  TYPE stb_button.
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
    new button -
        MOVE 'PROCESSED' TO ls_toolbar-function.
        MOVE icon_execute_object TO ls_toolbar-icon.
        MOVE 'Process the Record'(110) TO ls_toolbar-quickinfo.
        MOVE ' Process '(200) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
      METHOD handle_user_command.
    § 3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'PROCESSED'.
            CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
                     EXPORTING
                      defaultoption        = 'N'
      textline1     = 'Do you want to process the selected documents?'
              TEXTLINE2            = ' '
                       titel                = 'Process Documents'
              START_COLUMN         = 25
              START_ROW            = 6
              CANCEL_DISPLAY       = 'X'
                    IMPORTING
                      answer               = wf_res.
    *--IF THE USER CONFIRMS 'YES',
            IF wf_res = 'J'.
              PERFORM f_modify_activity.
              CALL METHOD grid1->refresh_table_display.
           PERFORM SENDINGMAIL.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    MODULE pbo_100 OUTPUT
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      w_repid = sy-repid.
      IF custom_container1 IS INITIAL.
    *get the data from charge back table
        PERFORM select_table_chb.
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container1
            EXPORTING
                container_name = cont_on_main
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = w_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
                  EXPORTING i_parent = custom_container1.
    Set a titlebar for the grid control
        wf_layout-grid_title = 'Charge Back'(100).
    allow to select multiple lines
        wf_layout-sel_mode = 'C'.
        wf_layout-stylefname = 'CELLTAB'.
    Exclude all edit functions in this example since we do not need them:
        PERFORM exclude_tb_functions CHANGING lt_exclude.
        CALL METHOD grid1->set_table_for_first_display
                   EXPORTING
                I_BUFFER_ACTIVE               =
                I_CONSISTENCY_CHECK           =
                I_STRUCTURE_NAME              =
                IS_VARIANT                    =
                I_SAVE                        =
                I_DEFAULT                     = 'X'
                     is_layout                     = wf_layout
                IS_PRINT                      =
                IT_SPECIAL_GROUPS             =
                  it_toolbar_excluding          = lt_exclude
                IT_HYPERLINK                  =
                IT_ALV_GRAPHICS               =
              CHANGING
                it_outtab                     = int_crb[]
                it_fieldcatalog               = gt_fieldcatalog.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR grid1.
        SET HANDLER event_receiver->handle_toolbar FOR grid1.
        CALL METHOD grid1->set_toolbar_interactive.
      ENDIF.                               "IF grid1 IS INITIAL
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                    "pbo_100 OUTPUT
    MODULE pai_100 INPUT
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM f_clear_fields.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
        WHEN 'BACK'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "pai_100 INPUT
    **&      Form  select_table_chb
          text
    FORM select_table_chb.
      IF p_cash = 'X'.
    *Consider the pending documents also.
    *get the documents which are not processed yet,
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna
         zmpets_shiphdrmovreason zmpets_chargebkshipdocnum
         zmpets_chargebkcreatedon zmpets_chargebkchargeamount
         zmpets_shipactivversion zmpets_shipactivactivity
    zmpets_shiphdr~vendor
       adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
               ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
         ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                    JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                 JOIN zmpets_167doc
                 ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_shipactiv~doctype = '06'
                        zmpets_shipactiv~activity NE '30'
                      ZMPETS_CHARGEBK~CREATEDON IN s_chdate
                      AND ZMPETS_SHIPHDR~pernr IN s_pernr
                      AND ZMPETS_SHIPHDR~MOVREASON IN s_mvrsn
                      AND ZMPETS_CHARGEBK~SHIPDOCNUM IN s_sin
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Pending Documents Available.'.
          MESSAGE s196(zm050).
        ELSE.
          LOOP AT int_crb_ver.
    *Not yet processed. set to red
            int_crb_ver-icon = '@0A@'.
            MODIFY int_crb_ver.
          ENDLOOP.
          PERFORM f_filter_data_pending.
        ENDIF.
      ELSE.
    *Get the document details from pa0002,zmpets_shipactiv,ZMPETS_CHARGEBK
    *table.
    *Consider document type as '01'  during the selection.
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna zmpets_shiphdr~movreason
        zmpets_chargebkshipdocnum zmpets_chargebkcreatedon
    zmpets_chargebkchargeamount zmpets_shipactivversion
    zmpets_shipactivactivity zmpets_shiphdrvendor
    *adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
                 ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
           ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                     JOIN zmpets_167doc
                     ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_chargebk~createdon IN s_chdate
                           AND zmpets_shiphdr~pernr IN s_pernr
                           AND zmpets_shiphdr~movreason IN s_mvrsn
                           AND zmpets_chargebk~shipdocnum IN s_sin
                          AND zmpets_shipactiv~activity NE '30'
                           AND zmpets_shipactiv~doctype = '06'
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Charge Back Documents Available.'.
          MESSAGE s201(zm050).
        ELSE.
          PERFORM f_filter_data.
        ENDIF.
      ENDIF.
    ENDFORM.                    "select_table_chb
    *&      Form  UPDATE_RECORDS
          text
    -->  p1        text
    <--  p2        text
    FORM update_records TABLES p_et_index_rows
                                    STRUCTURE lvc_s_row.
      DATA: ls_selected_line LIKE lvc_s_row,
              lf_row_index TYPE lvc_index.
      LOOP AT p_et_index_rows INTO ls_selected_line.
        lf_row_index = ls_selected_line-index.
      ENDLOOP.
    ENDFORM.                    " UPDATE_RECORDS
    **&      Form  fieldcatalog_init
          text
         -->P_GT_FIELDCATALOG[]  text
    FORM fieldcatalog_init  USING lt_fieldcatalog TYPE lvc_t_fcat.
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SEL'.
      ls_fieldcatalog-tabname  = 'INT_CRB'.
      ls_fieldcatalog-datatype = 'C'.
      ls_fieldcatalog-col_pos  = 1.
      ls_fieldcatalog-edit     = 'X'.
      ls_fieldcatalog-reptext  = 'Select for Processing'.
      ls_fieldcatalog-coltext  = 'Select for Processing'.
      ls_fieldcatalog-seltext  = 'Select for Processing'.
      ls_fieldcatalog-tooltip  = 'Select for Processing'.
      ls_fieldcatalog-checkbox = 'X'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'ICON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'CHAR'.
      ls_fieldcatalog-col_pos    = 2.
      ls_fieldcatalog-intlen     = '4'.
      ls_fieldcatalog-reptext   =  'Status'.
      ls_fieldcatalog-coltext   =  'Status'.
      ls_fieldcatalog-seltext   =  'Status'.
      ls_fieldcatalog-tooltip   =  'Status'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'PERNR'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-col_pos   = 2.
      ls_fieldcatalog-intlen    = '8'.
      ls_fieldcatalog-reptext   =  'Employee Number'.
      ls_fieldcatalog-coltext   =  'Employee Number'.
      ls_fieldcatalog-seltext   =  'Employee Number'.
      ls_fieldcatalog-tooltip   =  'Employee Number'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'VORNA'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  3 .
      ls_fieldcatalog-datatype   = 'CHAR'.
      ls_fieldcatalog-outputlen      = '20'.
      ls_fieldcatalog-reptext    = 'Employee Name'.
      ls_fieldcatalog-coltext    = 'Employee Name'.
      ls_fieldcatalog-seltext    = 'Employee Name'.
      ls_fieldcatalog-tooltip    = 'Employee Name'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'MOVREASON'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  4.
      ls_fieldcatalog-datatype   = 'NUMC'.
      ls_fieldcatalog-outputlen  = '10'.
      ls_fieldcatalog-reptext    = 'Move Reason'.
      ls_fieldcatalog-coltext    = 'Move Reason'.
      ls_fieldcatalog-seltext    = 'Move Reason'.
      ls_fieldcatalog-tooltip    = 'Move Reason'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SHIPDOCNUM'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-outputlen = '10'.
      ls_fieldcatalog-col_pos   =  5.
      ls_fieldcatalog-reptext   = 'Shipping Document Number'.
      ls_fieldcatalog-coltext   = 'Shipping Document Number'.
      ls_fieldcatalog-seltext   = 'Shipping Document Number'.
      ls_fieldcatalog-tooltip   = 'Shipping Document Number'.
    ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CREATEDON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 6.
      ls_fieldcatalog-datatype  = 'DATS'.
      ls_fieldcatalog-outputlen = '8'.
      ls_fieldcatalog-reptext   = 'Created On'.
      ls_fieldcatalog-coltext   = 'Created On'.
      ls_fieldcatalog-seltext   = 'Created On'.
      ls_fieldcatalog-tooltip   = 'Created On'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CHARGEAMOUNT'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 7.
      ls_fieldcatalog-datatype  = 'CURR'.
      ls_fieldcatalog-outputlen = '13'.
      ls_fieldcatalog-reptext   = 'Charge Back Amount'.
      ls_fieldcatalog-coltext   = 'Charge Back Amount'.
      ls_fieldcatalog-seltext   = 'Charge Back Amount'.
      ls_fieldcatalog-tooltip   = 'Charge Back Amount'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  f_modify_activity
    Modify the activity to 79 in zmpets_shipaciv table.
    -->  p1        text
    <--  p2        text
    FORM f_modify_activity .
      REFRESH int_crb_mail.
      int_crb_mail[] = int_crb[].
    *All the document number which is to be processed is stored in
    *the internel table 'INT_SIN'.
      LOOP AT int_crb INTO int_crb.
        IF int_crb-sel ='X'.
          MOVE int_crb-shipdocnum TO int_sin.
          APPEND int_sin.
          CLEAR int_sin.
    *Removing the processed documents.
          DELETE int_crb.
        ENDIF.
        CLEAR int_crb.
      ENDLOOP.
    *Get the details from shipactiv table.
      IF int_sin[] IS NOT INITIAL.
        SELECT * FROM zmpets_shipactiv
            INTO TABLE int_shipactiv
              FOR ALL ENTRIES IN int_sin
                    WHERE petsdocnumber = int_sin-shipdocnum.
    *Modify the activity code, version, actual date and last changed date.
        SORT int_shipactiv BY petsdocnumber version DESCENDING.
        CLEAR wf_tabix.
        LOOP AT int_shipactiv.
          wf_tabix = sy-tabix.
          AT NEW petsdocnumber.
            READ TABLE int_shipactiv INDEX wf_tabix.
            int_shipactiv-activity = '030'.
            int_shipactiv-version = int_shipactiv-version + 1.
            int_shipactiv-actdate = sy-datum.
            int_shipactiv-lastchangedby = sy-uname.
            int_shipactiv-lastchangedt = sy-datum.
    *Modify the data base table
            MODIFY zmpets_shipactiv FROM int_shipactiv.
          ENDAT.
          CLEAR int_shipactiv.
          AT LAST.
    *Message is 'Data Processed Successfully.'.
            MESSAGE s203(zm050).
          ENDAT.
        ENDLOOP.
    *-send mail to the vendor and employee that the shipment is cleared for
        LOOP AT int_crb_mail WHERE sel = 'X'.
          PERFORM f_send_mail.
        ENDLOOP.
        REFRESH int_crb_mail.
       CALL SELECTION-SCREEN 1000.
      ELSE.
    *Message is 'No Data Selected for Processing.'.
        MESSAGE s200(zm050).
      ENDIF.
    ENDFORM.                    " f_modify_activity
    *&      Form  f_clear_fields
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear_fields .
      CLEAR int_crb.
      CLEAR int_crb_ver.
      CLEAR int_sin.
      REFRESH int_crb.
      REFRESH int_crb_ver.
      REFRESH int_sin.
      CLEAR int_shipactiv.
      REFRESH int_shipactiv.
      CLEAR wf_flag.
      CLEAR wf_tabix.
    ENDFORM.                    " f_clear_fields
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data .
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          MOVE-CORRESPONDING int_crb_ver TO int_crb.
          APPEND int_crb.
          CLEAR int_crb.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ELSE.
        CLEAR wf_tabix.
        LOOP AT int_crb.
          wf_tabix = sy-tabix.
          REFRESH lt_celltab.
          ls_celltab-fieldname = 'SEL'.
          IF int_crb-activity = '030'.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
    *status becomes green. ie processed
            int_crb-icon = '@08@'. "Green
          ELSE.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
    *status set to red. ie not yet processed
            int_crb-icon = '@0A@'. "Red
          ENDIF.
          INSERT ls_celltab INTO TABLE lt_celltab.
          INSERT LINES OF lt_celltab INTO TABLE int_crb-celltab.
          MODIFY int_crb INDEX wf_tabix.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " f_filter_data
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data_pending.
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    *then filter it with out the activities '30' and having the lastest
    *version. then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          IF int_crb_ver-activity NE '030'.
            MOVE-CORRESPONDING int_crb_ver TO int_crb.
            APPEND int_crb.
            CLEAR int_crb.
          ENDIF.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ENDIF.
    ENDFORM.                    " f_filter_data_pending
    *&      Form  EXCLUDE_TB_FUNCTIONS
          text
         <--P_LT_EXCLUDE  text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  f_send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM f_send_mail .
    *store the vendor name, vendor email id , employee name and employee
    *email id in the internal table int_crb
    Creation of the document to be sent
      CLEAR doc_chng.
      REFRESH objpack.
      REFRESH objhead.
      REFRESH  reclist.
      REFRESH objtxt.
    File Name
      doc_chng-obj_name = 'SHIPMENT'.
    Mail Subject
      CONCATENATE 'Shipment Document No.' int_crb_mail-shipdocnum
      'Cleared.'
      INTO doc_chng-obj_descr SEPARATED BY ' '.
    Mail Contents
      objtxt-line = 'Hi,'.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CONCATENATE 'Shipment Document Number ' int_crb_mail-shipdocnum
    ' cleared for move.' INTO objtxt-line SEPARATED BY ' '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CLEAR  objtxt.
      objtxt-line = 'Regards '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      objtxt-line = 'SAP '.
      APPEND objtxt.
      CLEAR  objtxt.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
    objtxt ).
    Creation of the entry for the compressed document
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num = 0.
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'RAW'.
      APPEND objpack.
    Completing the recipient list
    target recipent
      CLEAR reclist.
      reclist-receiver = int_crb_mail-empperid. "employee email ID
      "wf_empperid.
      reclist-express  = 'X'.
      reclist-rec_type = 'U'.
      APPEND reclist.
    copy recipents
    CLEAR reclist.
    reclist-receiver = 'anversha.shahul@'."int_crb_mail-smtp_addr
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    reclist-copy     = 'X'.
    APPEND reclist.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
        TABLES
          packing_list               = objpack
          object_header              = objhead
       contents_bin               = objbin
          contents_txt               = objtxt
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      COMMIT WORK.
      SUBMIT rsconn01
                    WITH mode = 'INT'
                    WITH output = ' '
                      AND RETURN.
    ENDFORM.                    " f_send_mail
    rgds
    anver
    pls mark hlpful answers

  • How to access hidden fields in a table

    hi
          what is the use of hidden fields in a table, ie. some fields doesn't visible in the field list of a table.  but the fileds will be visible if u display its contents.
        for example in table t518A the text field is not visible in the field list.  But it will be visible if display its contents.  can any one of u please help me out how to access those fields. 
    regards
    sri

    Hi Srivallika,
    The table T518A has a text table called T518B. You can have a look at this table by:-
    1. GOTO SE11 and display table T518A.
    2. GOTO menu GOTO -> TEXT table. It gives the text table for the given table. Here its is T518B.
    A Text table is table with same key fields as the main table with another extra Language key TYPE SPRAS. This table is related to the main table. Hence to access the extra text fields, you can use the TEXT table :).
    Thanks and regards,
    Ravi.
    NOTE: Points keep me alive on SDN .

  • How to access a field of a structure with a field symbol?

    Dear all,
    Currently I'm trying to access the fields of a structure (called "ls_tbl") dynamicly. The code looks as follows (of course the field symbols are defined correctly ;-):
        ASSIGN lv_f1 TO <lv_f1>.
        ASSIGN lv_f2 TO <lv_f2>.
        lv_pp = ls_tbl-(<lv_f1>).
        lv_pt = ls_tbl-(<lv_f2>).
    Unfortunatly I get the following error message:
    <<The data object "LS_TBL" does not have a component called "".>>          
    I really do not understand why ABAP is trying to interpret the field symbol name as a string. Does anybody have a clue how to access the field of ls_tbl with the help of a field symbol?
    Many thanks!!!

    Hi ,
    Please check the below sample code .
    data : begin of st_table,
                myfiledname type c value '1',
                myfiledname1 type c value '2',
           end of st_table .
    data : lv_filedname(11) type c value 'MYFILEDNAME'
    filed-symbols : <fs> type any,
                    <fs_table> type any.
    assign st_table to <fs_table>.
    Assign lv_filedname to <fs> .
    assign component <fs> of structure <fs_table> to lv_pp.
    Regards,
    Ratheesh BS

  • How ti disable screen fields in Module pool

    hi
    How to change screen fields to DISPLAY MODE aftr clicking on a particular pushbutton in Module pool  prg .
    regards
    chetan
    Edited by: chetan teli on Jul 29, 2008 1:04 PM

    hiiii
    use following code for disabling field
    IF p_rad2 IS INITIAL .
        LOOP AT SCREEN.
          IF screen-name CS 'p_docno'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN.
      ELSE.
        LOOP AT SCREEN .
          IF screen-name CS 'p_docno'.
            screen-active = 1.
            screen-input = 1.
            MODIFY SCREEN.
          ENDIF.                           " IF screen-name CS 'p_docno'.
        ENDLOOP.                           " LOOP AT SCREEN .
      ENDIF.                               " IF p_rad2 IS INITIAL .
    regards
    twinkal

  • How to populate dropdown without triggering PAI event ?

    Hi,
    I have a screen with two fields- One input field and one drop down list field which has to be populated based on the value given in the first field. 
    How can I populate the drop down list dynamically based on first input field without pressing enter ( i.e with out triggering PAI event ) .  I tried using DYNP_VALUES_READ in value request event.
    Please give me your suggestions .

    Hhhhmm, I thought initially it should work, but I must admit I couldn't get it to work with a listbox. I just tried a simple report with selection screen, see below. Just enter something for the first parameter and then choose the value help for the second field. You will see that it will pick up the value from the first field, if we don't use a listbox.
    Once you comment in the coding the LISTBOX and replace it with the normal field, you can see that the value help works as one would hope. It seems that the problem is that the values for the dropdown list get populated too early (i.e. start-up of the report). I don't have the time at the moment to check this out further, but I'm assuming others must have tried this before. Any comments?
    REPORT zvaluehelp.
    PARAMETERS:
      p_statva TYPE stacust-statva,
      p_status TYPE stacust-status AS LISTBOX VISIBLE LENGTH 3. " Doesn't work
    *  p_status TYPE char1. " Value-help works for this
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_status.
      PERFORM value_help.
    FORM value_help.
      DATA:
        dynpread TYPE dynpread,
        dynpread_tab TYPE STANDARD TABLE OF dynpread,
        stacust TYPE stacust,
        stacust_tab TYPE STANDARD TABLE OF stacust.
      dynpread-fieldname = 'P_STATVA'.
      APPEND dynpread TO dynpread_tab.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname                   = sy-repid
          dynumb                   = sy-dynnr
          perform_conversion_exits = 'X'
        TABLES
          dynpfields               = dynpread_tab
        EXCEPTIONS
          OTHERS                   = 1.
      CHECK sy-subrc = 0.
      READ TABLE dynpread_tab INTO dynpread INDEX 1.
      CHECK dynpread-fieldvalue IS NOT INITIAL.
      SELECT * FROM stacust INTO TABLE stacust_tab
               WHERE statva = dynpread-fieldvalue.
      CHECK sy-subrc = 0.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          ddic_structure = 'STACUST'
          retfield       = 'STATUS'
          dynpprog       = sy-repid
          dynpnr         = sy-dynnr
          dynprofield    = 'P_STATUS'
          value_org      = 'S'
        TABLES
          value_tab      = stacust_tab
        EXCEPTIONS
          OTHERS         = 0.
    ENDFORM.
    The coding above was just intended as a quick test - so I know it's not proper (i.e. check of return codes, etc.).
    Cheers, harald

  • How do I the Force F8 / PAI event to execute

    Hi,
    I have a screen that I enter a criteria on; next it brings up another screen with a table grid.  I select from the list the items that I am interested in then I hit the F8 key (execute) to bring up the selected data on another screen.
    If the table grid only has one record, I want to selected the one record and hit the F8 key via code instead of having the user have to do it.  I think I have figured out how to get the one item selected via code (at least while I am in debug mode) but I do not know how to have the F8 executed via code so that the PAI event will trigger allowing all the rest of the necessary code to execute.
    I appreciate your help.
    Tom

    Hi All,
    Below is the final code that I used to occomplish my task.  I want to thank everyone of you for your help.  All of you triggered thought in this solution.  I had to use a memory parm id to help prevent a looping effect that I was getting when I went back to the transaction.  In addition, I reset the parm id to spaces in the 'BACK' button part of code so that I can get into the IF statement.
    MODULE check_for_single_row OUTPUT.
      CONCATENATE 'SingleRowFlag' sy-uname sy-modno INTO g_parm_single_row_flag.
      GET PARAMETER ID g_parm_single_row_flag FIELD g_single_row_flag.
      IF sy-subrc <> 0.
        MESSAGE 'Parameter not found' TYPE 'I'.
      ENDIF.
      IF g_single_row_flag = '1'.
        EXIT.
      ENDIF.
      IF g_zrt_cnt = 1.
        temp_zrt = wa_zrt.
        temp_zrt-chkbx = 'X'.
        MODIFY i_zrt
          FROM temp_zrt
          INDEX 1
          TRANSPORTING chkbx.
        SET PARAMETER ID g_parm_Single_Row_Flag FIELD '1'.
        PERFORM zcart_transaction_art.
      ENDIF.
    ENDMODULE.                 " check_for_single_row  OUTPUT
    P.S.
    I could not get this code to work but it helped get to what I have above.
    Thanks again.
    Tom
    READ TABLE i_zrt INDEX 1.
    i_zrt-chkbx = 'X'.
    MODIFY i_zrt INDEX 1 TRANSPORTING chkbx.

  • How to access a field of an data source w/o binding a form field to it

    Hi
      This is a query regarding ADOBE print form.
      How to access a record field (of an data source.... typical multi row records) where the record is bound to a subform.
    Data is something like
    (I have used abap parlance for understanding)
    data : begin of data_tab occurs 0,
      field1 type .....,
    field2 type .....,
    fieldm type .....,
    fieldn type .....,
    end of data_tab.
    Subform is bound to
    $.DATA_TAB.DATA[*]
    How to access field1, field2,...... etc without creating subform fields and binding them to field1, field2, .... fieldn.
    I know normal approach is to define subform fields and then bind it to $.field1, $.field2 etc
    In the calculate event of a field bound to $.fieldm I have tried the following expressions to get the value of column fieldn of the same record but none of them worked.... Note that if I bind the field using $.fieldn data is displayed properly in the print form.
    $record.data_tab.fieldn.value
    $record.data_tab.data[*].fieldn.value
    $record.data_tab.data.fieldn.value
    $record.data_tab.fieldn.value
    Otherwise I would have to define hidden fields just to use these column values in the event script even though these value are not to be displayed in the ADOBE print form.
    Regards
    Abapper

    I can't remember the exact sentence, but do a little search, as that is a common question in this forum....
    How about:
    $record.data_tab.data[1].fieldn.value
    $record.data_tab.data[2].fieldn.value
    $record.data_tab.data[2].fieldn.value
    $record.data_tab.data[N].fieldn.value
    Cheers.

  • Hiding screen fields at an event

    hi,
    assume that i am having 3 fields in a screen.
    after antering the values on the first field and if i place the cursor on the second or third fields then these  fields (second and third ) should be disabled.
    can anyone help me out in this. For me it works only by pressing the enter key. I want that to work if the cursor has been placed on other fields.is there any event available for that.
    or pls tell me how to do this.
    regards,
    Phyrose.

    Hi,
    check the below.
    *& Report ZHAR_DYN_SELSCR.
    *& This program demonstrates how easy it is to set selection screen
    *& element properties dynamically
    *& The program uses 3 radio buttons to set the display and input
    *& properties of selection screen fields dynamically
    *& URL: http://allaboutsap.blogspot.com
    REPORT ZHAR_DYN_SELSCR.
    DATABASE TABLES
    tables : mara.
    SELECTION SCREEN
    selection-screen begin of block b1 with frame.
    *--- Radio buttons to set properties
    PARAMETERS:
    rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,
    rad2 RADIOBUTTON GROUP rad,
    rad3 RADIOBUTTON GROUP rad.
    *--- Selection Screen fields
    SELECT-OPTIONS:
    s_matnr FOR mara-matnr MODIF ID MI1,
    s_mtart FOR mara-mtart MODIF ID MI1,
    s_mbrsh FOR mara-mbrsh MODIF ID MI2,
    s_matkl FOR mara-matkl MODIF ID MI2.
    selection-screen end of block b1.
    AT SELECTION SCREEN
    at selection-screen output.
    loop at screen.
    *--- If Radio Button 1 is checked
    IF rad1 = 'X'.
    IF screen-group1 = 'MI2'.
    *--- Fields with MODIF ID MI2 disappear from the screen
    screen-input = 0.
    screen-invisible = 1.
    ENDIF.
    *--- If Radio Button 2 is checked
    ELSEIF rad2 = 'X'.
    IF screen-group1 = 'MI1'.
    *--- Fields with MODIF ID MI1 are input-disabled
    screen-input = 0.
    ENDIF.
    *--- If Radio Button 3 is checked
    ELSEIF rad3 = 'X'.
    IF screen-group1 = 'MI1' or screen-group1 = 'MI2'.
    *--- All fields will appear input-enabled
    screen-input = 1.
    ENDIF.
    ENDIF.
    *--- MODIFY SCREEN mandatory addition to apply changes to the screen
    Modify screen.
    endloop.
    Reward if helpful.
    Regards,
    Harini.S

  • How to make screen field enable when table control gives an error

    Hi,
        I had a scneario like when table control data wrong then one parameter of the screen should be enabled for the input, i knew that screen-name will not work since it will have always table control fields only when table control gives an error.
    How to make the other parameter enable when table control throws an error.
    Regards,
    Jaya

    Hi Gobi,
         Thanks for your response, but issue is - how to make other screen fields enable when there was an error in the table control data.
    For table control - lets say we will use the code as i mentioned above.i am sure that we cant write the code for field enable in between loop & endloop.
    as you said if we right outside the loop-endloop, the module wont be triggered when table control throws an error, because that statement was not there in the loop-endloop.
    please let me know if you need any more information on the issue. I hope there is alternative for this in SAP.
    Thanks
    Jaya

  • How to change screen field value.

    Hi Experts,
             I like to change the screen field MSAUS(check box) of program SAPLIQS0 in one of the exit.But if I use
    (SAPLIQS0)VIQMEL-MSAUS = 'X'. its showing compile error.Please tell me how can i change this field in this exit.
    Regards,
    Ajish.

    try something like this:
    create field symbol
      FIELD-SYMBOLS: <fs>.
    Assign value of variable from calling prog to field symbol
      ASSIGN ('(SAPLIQS0)VIQMEL-MSAUS' ) TO <fs>.
    <fs> = 'X'.
    Regards,
    ravi

  • How to access dynamic fields in a field symbol

    hi
    how do i access the dynamic fields created in side a field-symbol....
    wht i mean is i have a table, whose workarea i assign to field symbol. but this table is runtime, altough i have debugged and found the values in this table, I want to accees the field symbol in a generic way.
    say the table has 3 fields now fld1 fld2 and fld3 so i want to access the field symbol <fs> as <fs>-(name) where name can be anything fld1 or fld2 whichever i assign....
    thanks. Let me know if you have any further questions.

    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to a field symbol before you can address it in a program.
    Field symbols are similar to de-referenced pointers in the C programming language (that is, pointers to which the content operator * is applied). In ABAP, data references represent a real equivalent to pointers in the sense of variables that contain a memory address and can be used without the contents operator.
    All operations programmed with field symbols are applied to the field assigned to it. A MOVE statement between two field symbols, for example, assigns the contents of the field assigned to another source field symbol to the field assigned to the target field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before the MOVEstatement.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks during the field assignment whether the assigned field matches the type of field symbol.
    Field symbols provide greater flexibility when you address data objects:
    ·        You can assign one field symbol to another, which allows you to address subfields.
    ·        Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    ·        You can also force a field symbol to take different technical properties than those of the field assigned to it (casting).
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. The MOVE statement (with your own auxiliary variables, if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    To declare a field symbol, use the statement
    FIELD-SYMBOLS  .
    For field symbols, the angle brackets are part of the syntax. They identify field symbols in the program code.
    If you do not specify any additions, the field symbol.
    in a static ASSIGN and:
    ASSIGN (dobj) TO  from the second loop pass onwards.

  • [PAI] Refresh a screen field within PAI

    Hi,
    During the PAI process, I would like to refresh the content of a screen field (so that it is calculated automatically from the value of another field).
    Indeed, the user would greatly benefit from this field condidering the checks performed during the PAI.
    I tried the FM 'DYNP_VALUES_UPDATE' but without success...
    Has someone another idea ?
    Thanks in advance.
    Best regards,
    Guillaume

    Hi,
    Thanks for your insights !
    I have 2 fields on the screen : <b>my_source_field</b> and <b>my_pourcent</b>.
    Here is the code :
    PROCESS AFTER INPUT.
      MODULE exit AT EXIT-COMMAND.
      CHAIN.
        FIELD my_source_field MODULE calculate_%.
      ENDCHAIN.
      CHAIN.
        ... lot of checks here, where the user requires the value of a % mininum
      ENDCHAIN.
    and in the calculate_% subroutine :
      IF my_source_field <> 0.
        CLEAR my_pourcent.
        my_pourcent = ( k_%_mini * 100 ) / my_source_field.
    *   Updating screen immediately
        CLEAR   : wt_update.
        REFRESH : wt_update.
        wt_update-fieldname    = 'MY_SOURCE_FIELD'.
        wt_update-fieldvalue   = my_source_field.
        APPEND wt_update.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname                     = sy-cprog
            dynumb                     = sy-dynnr
          tables
            dynpfields                 = wt_update
          EXCEPTIONS
            INVALID_ABAPWORKAREA       = 1
            INVALID_DYNPROFIELD        = 2
            INVALID_DYNPRONAME         = 3
            INVALID_DYNPRONUMMER       = 4
            INVALID_REQUEST            = 5
            NO_FIELDDESCRIPTION        = 6
            UNDEFIND_ERROR             = 7
            OTHERS                     = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    Any idea ?
    Best regards,
    Guillaume
    Message was edited by: Guillaume Garcia

  • How to update screen fields dynamically

    Hi,
    Can any one help me in updating screen field dynamically using so_expr, so_where,so_flds

    Hi,
      Use this type of logic. Though this code is for selection-screen, but you can use this type of logic for screens by using screen table and implement this logic in PAI.
    REPORT z_sdn.
    PARAMETERS:
      p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
      p_char RADIOBUTTON GROUP rad1.
    PARAMETERS:
      p_num1 TYPE i MODIF ID num,
      p_num2 TYPE i MODIF ID num,
      p_char1 TYPE c MODIF ID chr,
      p_char2 TYPE c MODIF ID chr.
    AT SELECTION-SCREEN OUTPUT.
      IF p_num EQ 'X'.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'CHR'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'NUM'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Regards
    Abhijeet

Maybe you are looking for