Module Pool - Error Message

hi all,
plz help:
requirement:
thr r 2 screen fields CODE(Input Enable) and DESC(Output Only).
when user enters CODE corresponding DESC will come automatically but if no value is entered in CODE, DESC will also be blank with an error msg below: 'Enter Code'.
i have PAI Module like this:
FIELD code MODULE validate_code.
Module Validate_code.
  if CODE is initial.
      clear DESC.
      Message e000(zz) with 'Enter Code'.
  else.
      select DESC for CODE entered.
  endif.
endmodule.
for this code, though DESC becomes initial when CODE is deleted from screen but in the screen it is still showing the previous DESC value. i need to this older value of DESC.
ME21N->Org.Data TAB
Enter Pur.Org. and press ENTER Once and then delete the same and press ENTER again.
I need this functionality.
Plz Help.
Edited by: AVIJIT SIKDAR on Jun 4, 2008 2:59 PM

Nothing else.
By putting an FuncCode on the field, when the user changes it, the process will immediately go to the PAI routine, process the code
you have there, and then process the PBO routine to redisplay.
If your code recognizes an error, the error will be displayed and the user will need to correct the issue before proceeding.

Similar Messages

  • Module Pool - Error message on a Modal Dialog screen with input

    Hello All,
    I have a modal dialog screen which is called on F4 help of a input field. This dialog screen has radio buttons on it to select. On selection, we check if the user is authorized to that option. If not, raise and error message with command MESSAGE msgid.....
    When the error message pops-up and when clicked ok on it, the radio buttons on the modal dialog screen gets disabled. I want to have the modal dialog box to be able to accept the new radio button as input.
    Can anyone please suggest.
    Thanks,
    Smita

    Put all of your Radio buttons in the CHAIN ... ENDCHAIN with one module.
    CHAIN.
        FIELD rb1.
        FIELD rb2.
        FIELD rb3.
        MODULE check_chain ON CHAIN-REQUEST.   "<< implement logic in check_Chain
      ENDCHAIN.
    If you want, you can even disable the options before displaying the screen. Do all necessary checks in the PBO and based on that disable the options.
    Regards,
    Naimesh Patel

  • Module Pool Error handling

    Hi friends,
    This issue regarding Module Pool Error Handling
    How to handle the multiple error on the same screen ,
    For example in the below code you could see "Carrid is Invalid"  when carrid is entred wrongly
    "in the same way i also need " Connid is invalid" When the customer entres the wrong Connid
    *Select single * from sflight into e_sflight*
    where carrid = e_sflight-carrid AND
    connid = e_sflight-connid AND
    fldate = e_sflight-fldate.
    IF NOT sy-subrc IS INITIAL.
    MESSAGE ID 'ZADT' TYPE 'E'
    NUMBER '002' WITH 'Carrid is invalid'.
    Kindly let me know your feedback\
    Thank you
    Sandy

    Hi Sandy,
    in PAI. " Also try to close your Questions as currently 8 out of 8 are unresolved
    Chain. " For More info take F1 help on this Key word
    field : carrid, connid. " These are the Screen Field names
    module validate on chain-request.
    endchain.
    in Program.
    module validate.
    select single carrid into carrid
         from scarr
          where carrid = carrid.
    if sy-subrc = 0.
    select single connid into connid
              from sflight
              where connid = connid,
    if sy-subrc NE 0.
    message 'Enter Valid Connid' type 'E'.
    endif.
    else.
    message 'Enter Valid Carrid' type 'E'.
    endif.
    endmodule.
    Cheerz
    Ram
    Edited by: Ramchander Krishnamraju on Apr 12, 2010 11:48 AM

  • Select-option in Module Pool-Error-Include block not specified .........

    Hi,
    I am trying to define a select-option at Module Pool level.
    In the program
    SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
    SELECT-OPTIONS: V_BWTAR FOR MSEG-BWTAR.
    SELECTION-SCREEN END OF SCREEN 1010.
    In the Screen flow logic it is as follows
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0600.
    CALL SUBSCREEN sub_1010 INCLUDING sy-repid '1010'.
    PROCESS AFTER INPUT.
    CALL SUBSCREEN sub_1010.
    MODULE USER_COMMAND_0600.
    At SE51 it is showing an error
    "Include block not specified,not defined or spelt incorrectly.".
    Please let me know how to correct this.
    Thanks,
    K.Kiran.

    HI Emre
    I am having the same issue.  there is not possible to create a subscreen by se51 since I already define the subscreen by selection-screen begin of screen *** as subscreen.
    regards TP

  • Module pool. error while navigating between tabs in tabstrip

    Hi all,
    in the module pool program, when i navigate from one tab to another it is giving me an error saying "Illegal value when compressing the screen". what might be the reason?
    Thanks

    Hi,
    Check out the dimensions of the subscreen. May be its bigger than your subscreen area.
    Regards,
    Naga Sai Swapna

  • Module pool error

    Dear All,
    This is continuation of my last doubt.. this is my SAVE code:
    WHEN 'OK'.
          CLEAR ok_code.
          DATA : p_prime(8),
                 p_bend(8) ,
                 p_repair(8) ,
                 p_rejected(8).
          DATA:yield2(10).
          DATA:yield3(10).
          IF itab1-idnrk1 CS 'SHRB0'.
            DATA :slit2 TYPE zslit-slit1.
            DATA :menge2 TYPE zslit-***_coil1.
            LOOP AT itab1.
              IF itab1-lot IS NOT INITIAL.
                ON CHANGE OF itab1-slit1.
                  itab1-slit6 = v_slit1 - itab1-slit1.
                  itab1-menge1 = itab1-menge2 * itab1-slit1.
                  itab1-menge3 = itab1-menge2 * itab1-slit6.
                  CONCATENATE itab1-charg1 itab1-slit1 INTO itab1-charg2.
                  MODIFY  itab1 TRANSPORTING menge1 slit1 slit6  menge3 charg2.
                ENDON.
              ENDIF.
            ENDLOOP.
            DELETE ADJACENT DUPLICATES FROM itab1 COMPARING ALL FIELDS.
            BREAK-POINT.
            DATA : BEGIN OF tot OCCURS 0,
                   sum LIKE zslit-***_coil1,
                   END OF tot.
            DATA : count1 TYPE zppmill-sno.
            tot-sum = 0.
            LOOP AT itab1.
              IF itab1-idnrk = itab1-idnrk1.
                tot-sum = tot-sum + itab1-menge1.
                AT LAST.
                  APPEND tot.
                ENDAT.
              ENDIF.
            ENDLOOP.
            IF tot[] IS NOT INITIAL.
              LOOP AT itab1.
                IF itab1-idnrk1 NE ' '.
                  IF itab1-idnrk = itab1-idnrk1.
                    itab1-edcut = ( tot-sum * '0.39' ) / 100 .
                    itab1-edbaw = ( tot-sum * '1.4' ) / 100.
                    itab1-inchip = ( tot-sum * '0.05' ) / 100.
                    MODIFY itab1 TRANSPORTING edcut edbaw inchip .
                  ENDIF.
                ENDIF.
              ENDLOOP.
            ENDIF.
            BREAK-POINT.
            CLEAR count1.
            SELECT MAX( sno ) FROM zppmill INTO count1.
            LOOP AT itab1.
              IF itab1-idnrk1 NE ' '.
                IF itab1-idnrk = itab1-idnrk1.
                  count1 = count1 + 1.
                  zppmill-sno = count1.
                  zppmill-matnr = p_matnr.
                  zppmill-aufnr = p_aufnr.
                  zppmill-werks = p_werks.
                  zppmill-verwe = crhd-arbpl.
                  zppmill-thick = mark_thick.
                  zppmill-length = pipe.
                  zppmill-bsum = bsum_c4.
                  zppmill-con_qty = yield.
                  zppmill-prime = p_prime.
                  zppmill-bend = p_bend.
                  zppmill-repair = p_repair.
                  zppmill-reject = p_rejected.
                  zppmill-prd_qty = yield3.
                  zppmill-crd_user = itab1-ernam.
                  zppmill-crd_dt = itab1-ersda.
                  zppmill-kaptprog = p_shift.
                  zppmill-desc_mil = batch_txt.
                  zppmill-opnam = itab1-opnam.
                  zppmill-edbaw = itab1-edbaw.
                  zppmill-edcut = itab1-edcut.
                  zppmill-flag1 = 'X'.
                  zppmill-flag2 = 'X'.
                  IF sy-subrc = 0.
                    INSERT zppmill.
                    COMMIT WORK.
                  ENDIF.
            ENDIF.
            ENDIF.
                  CLEAR : zppmill.
            ENDLOOP.
            CLEAR count1.
            SELECT MAX( sno ) FROM zppmilldet INTO count1.
            LOOP AT ITAB1.
            IF itab1-idnrk1 NE ' '.
            IF itab1-idnrk = itab1-idnrk1.
            ZPPMILLDET-SNO = COUNT1.
            ZPPMILLDET-MATNR = p_matnr.
            ZPPMILLDET-CHARG = ITAB1-CHARG1.
            ZPPMILLDET-NSLIT = ITAB1-SLIT1.
            ZPPMILLDET-CLABS = ITAB1-MENGE1.
            ZPPMILLDET-CRD_DT = itab1-ersda.
            ZPPMILLDET-KAPTPROG = P_SHIFT.
            IF SY-SUBRC = 0.
            INSERT ZPPMILLDET.
            COMMIT WORK.
            ENDIF.
            ENDIF.
            ENDIF.
            CLEAR : ZPPMILLDET.
            ENDLOOP.
            CLEAR count1.
            SELECT MAX( sno ) FROM zppalldet INTO count1.
            LOOP AT ITAB1.
            IF itab1-idnrk1 NE ' '.
            IF itab1-idnrk = itab1-idnrk1.
            ZPPALLDET-SNO = COUNT1.
            ZPPALLDET-MATNR = p_matnr.
            ZPPALLDET-SDATE = SY-DATUM.
            ZPPALLDET-KAPTPROG = P_SHIFT.
            ZPPALLDET-CHARG = ITAB1-CHARG1.
            ZPPALLDET-LOTNO = ITAB1-LOT.
            ZPPALLDET-NPIPE = NOFP.
            ZPPALLDET-FLAG1 = 'X'.
            ZPPALLDET-FLAG2 = 'X'.
            IF SY-SUBRC = 0.
            INSERT ZPPALLDET.
            COMMIT WORK.
            ENDIF.
            ENDIF.
            ENDIF.
            CLEAR : ZPPALLDET.
            ENDLOOP.
    Edited by: rsandhosh on Feb 9, 2011 7:55 AM
    Moderator message: please do not open multiple threads for the same or similar issue.
    Moderator message: please use more descriptive subject lines for your posts.
    Edited by: Thomas Zloch on Feb 9, 2011 12:42 PM

    hi..
    can u tell me exactly where is the button placed?? i mean is it on the application toolbar or where???
    plus make sure that CON (func code) is assigned to the button (in screen layout)..
    give me a little bit more details abt ur problem??
    also as far as LOOP AT SCREEN goes... u can do that inside the code of a PBO module (First PBO preferred 4 ur case).. also the contents of the screen table is the same as what u see in the ELEMENT LIST tab while u r defining the screen (in SE51).
    regards,
    sagar
    Message was edited by:
            Sagar Mehta

  • Function module for error message with language param

    any Function Module that has language param in it?
    thanks,

    Dear Rayann,
    Use FM FORMAT_MESSAGE.
    Thanks & Regards,
    Nagaraj Kalbavi

  • How to bold/color text message in Module pool Programming ?

    Hi All ,
    I need to bold /color a message in module pool . this message will come when certain conditions satisfied , currently this text message is displaying through variable . I Refereed program DD_STYLE_TABLE , but still not getting desired output . .Is there any other way to achieve the same ?
    Could you please help me ?
    Thanks in advance !!!!
    Regards ,
    Mayank K

    Hi Mayank,
    You can give a try this.
    Within the screen you are calling give keyword
    Leave to list processing
    and then you can give whatever colors which are there in SAP
    For making the text bold you can set Format intensified on or off depending on your requirement.
    For more details you can refer to programs
    program1 : demo_leave_to_list_processing
    program2: demo_call_screen_from_list
    Regards,
    Sandeep Katoch

  • Getting error message Thru BAPI: BAPI_INCOMINGINVOICE_CREATE

    Hi All,
    Could anyone please investigate into this error and give me the possible answer.
    We're using ECC 6.0
    Getting error while doing Invoice Posting thru BAPI/Function Module: BAPI_INCOMINGINVOICE_CREATE
    Error Messages
    1. M8 376: Enter goods receipt data only when working with GR-based IV
    2. M8 375: Fill in mandatory field REF_DOC, REF_DOC_YEAR, REF_DOC_IT (table parameter ITEMDATA, row 000001)
    These above 1 & 2 been rectified by putting the GR/GI Slip No. of GR
    But still the 3rd error is facing it now
    3. M8 429: Enter a reference to a valid goods receipt (line 000001)
    FYI
    My PO: 4500017248 is having a Status/Control of GR, IR, GR-Based IV
    PO 1 Line- Qty: 10, Net Order Price: 10
    GR: 5000012041 for 1 Line- Qty: 10, Net Order Price: 10, Total: 100
    Regards
    Dinakar
    Edited by: Dinakar Nallavelli on Jan 19, 2009 1:17 PM
    Edited by: Dinakar Nallavelli on Jan 19, 2009 1:23 PM
    Self solved this issue by putting the REF_DOC as GR related- MIGO Doc number and the Year of the document and the line item in it
    No Reply required further for this issue
    Edited by: Dinakar Nallavelli on Jan 19, 2009 2:27 PM

    How did you resolve it?

  • How to set error message inside the loop...module pool

    Dear all,
         Am creating Table Control without wizard. In that i am looping the values, that is, Once if i entered 5 digit values means, 12345-08... the values should be stored in z-table like this 12345,12346,12347,12348 . That is 5-8 it as to update in z table. for this i createdloop at itab and inside that i written a code to count the value and all. and also its clearly updating the value in ztable too. now i want to know, if once again i entered the same value means, like 12345-08.. it as to show error messge.I dont know how to set the condition with error message inside the single loop .... Its all comes under module pool program.
    Thanks,
    Santhosh.R

    If i understood your doubt, here goes the answer.
    LOOP AT itab INTO wa_itab.  " This is your loop
      l_tabix = sy-tabix. "l_tabix receives the line of the loop
      READ TABLE itab WITH KEY itab = wa_itab.  "itab is the same tab of your loop
      IF sy-subrc EQ 0 AND l_tabix NE sy-tabix.    "Here the sy tabix have the value of the read table.
    *     Here you do your error treatment.
      ENDIF.
    ENDLOOP.
    Explanation: When you are looping your internal table, you use a READ TABLE to see the already recorded registers. If the read table finds one register (sy-subrc EQ 0) and the this register is not the one of the current line (l_tabix NE sy-tabix). It means you have a duplicated register.
    Maybe there is someway easier to do this, but this is what i thought now.
    I hope this was your doubt hehe.
    Thales Schmidt

  • Error message in Module Pool program

    Hi folks,
               I have developed a module pool program for a custom screen. while entering data on the screen,
    it throws a error message for a wrong data entry.But, even after cliking enter, the error message coming repeatedly and the screen is disabled.I havent inculded the screen fields in between CHAIN-ENDCHAIN.Is this the reason for the bug. If so, i have approximately 50 fields on my screen.Should i keep all those fields in between CHAIN-ENDCHAIN. Pls suggest me...
                  Thanks in advance,
                  Shyam.

    Hi Shyam,
    Please find the LInk below
    Hope this is help full
    [Error Message|Re: chain endchain]
    Thanks
    kalyan

  • Edit screen after error message in module pool

    Hello Experts,
    In our scenario ,we have some checks over inputs given in a table control of module pool screen.Requirement is that after error message we need to display that record of table control in editable mode.
    Thanks.

    Thanks for the reply...The issue was resolved by dispaying information message and using EXIT to stop program flow.

  • Handling Error message in Module Pool screen

    Hi Folks,
    I have developed a ALV report for table maintenace and I am calling the Dialog screen (small one) and Create and update the records of the Ztable through that screen.
    Presently I am handling the error message in the main ALV screen .
    My requirement is that I have to handle those error messages in small module screen.
    How to do the same ?
    Thanks.
    Hemum.

    crate message se91.
    insert failure
    if sy-subrc  <>0.
    message e001 with 'all readt exist'.
    endif.

  • ERROR MESSAGES IN MODULE POOL

    hi experts,
    i ve a query.
    say i am getting an error messages in modulepool, u all knw that if an eeror  occurd flow halt in that particular screen
    nw hw can i get exit from transaction without using, chain-endchain, at exit command, leave prog etc
    plz help, thnx in advance

    hi,
    if you are writing message statement with  type 'E' the write the message statement with  type 'S' display like 'E'. this will display the status messgae as error message and the flow will continue........
    "  for ex.
    " if you write....
    MESSAGE 'ERROR MESSAGE' TYPE 'E'.
    " THEN CHANGE IT TO.....
    MESSAGE 'ERROR MESSAGE' TYPE 'S' DISPLAY LIKE  'E'.
    Regards,
    Siddarth

  • Getting error while calling a subscreen in  module pool program

    HI  ALL,
                         ACTUALLY I'M GETTING A SYNTAX ERROR WHILE I'M CALLING A SUBSCREEN
                       IN A MODULE POOL PROGRAM IN PAI MODULE
                       THE ERROR IS AS FOLLOW
                           "." or "ID ... FIELD ..." expected after "SUBSCREEN"
                        CAN ANYBODY PLS HELP ME.
    REGARDS
    ANDREWS

    HI MAX ,
                      THE CODE IS AS FOLLOWS:
    *& Report  ZTABSTRIP_PS
    REPORT  ZTABSTRIP_PS.
    type-pools : vrm.
    DATA:number1 type I,
         number2 type I,
         result  type I,
         ok_code like SY-UCOMM,
         employee1 type c,
         ABAP(19)    type c,
         SALES(19)  type c,
         HR(19)      type c,
         MM(19)     type  c,
    employee type c.
        emp type c.
    CONTROLS  tabstrip TYPE TABSTRIP.
    CALL SCREEN 100.
    call screen 110.
    call screen 130.
    call screen 120.
    call screen  140.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
      SET TITLEBAR 'TITLE'.
      CASE OK_CODE.
        WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program.
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
       WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
      when 'TAB1'.
    tabstrip-activetab = 'TAB1'.
       when 'TAB2'.
    tabstrip-activetab = 'TAB2'.
    result = number1 + number2.
       when 'TAB3'.
      tabstrip-activetab = 'TAB3'.
    SET TITLEBAR 'TITLE1'.
      when 'TAB4'.
        tabstrip-activetab = 'TAB4'.
       if employee = 'NEERAJ'.
         ABAP = 'NEERAJ'.
       elseif employee = 'UMESH'.
         SALES = 'UMESH'.
       ELSEIF employee = 'RAM'.
         HR = 'RAM'.
       elseif employee = 'ANIL'.
         MM = 'ANIL'.
         endif.
       employee = employee.
    WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    ENDCASE.
       WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program .
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0110  OUTPUT
          text
    **MODULE STATUS_0110 OUTPUT.
    SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    **case ok_code.
    **WHEN 'back' or 'exit' or 'delete'.
        leave PROGRAM.
        WHEN 'save'.
          MESSAGE 'please choose a valid function ' TYPE 'W'.
    ENDCASE.
    **ENDMODULE.                 " STATUS_0110  OUTPUT
    *&      Module  USER_COMMAND_0110  INPUT
          text
    MODULE USER_COMMAND_0110 INPUT.
      number1 = number1.
      number2 = number2.
    CLEAR NUMBER1.
    CLEAR NUMBER2.
    REFRESH NUMBER1.
    REFRESH NUMBER2.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    *&      Module  STATUS_0130  OUTPUT
          text
    MODULE STATUS_0130 OUTPUT.
    SET PF-STATUS 'STATUS2'.
    SET TITLEBAR 'xxx'.
    RESULT = number1 + number2.
    *CLEAR RESULT.
    REFRESH RESULT.
    ENDMODULE.                 " STATUS_0130  OUTPUT
    *&      Module  STATUS_0120  OUTPUT
          text
    MODULE STATUS_0120 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    DATA:  l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'ANIL'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '2'.
      l_value-text = 'RAM'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '3'.
      l_value-text = 'NEERAJ'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '4'.
      l_value-text = 'UMESH'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
    l_name =  'employee'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID                    =  l_name
          VALUES                =  li_list
       EXCEPTIONS
         ID_ILLEGAL_NAME       = 1
         OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR li_list.
    ENDMODULE.                 " STATUS_0120  OUTPUT
    *&      Module  USER_COMMAND_0120  INPUT
          text
    MODULE USER_COMMAND_0120 INPUT.
    INCLUDING sy-repid '140'.
    employee1 = employee.
    IF employee1 CS 'NEERAJ'.
      call SUBSCREEN    sub4  .
      ABAP = 'NEERAJ'.
      CLEAR ABAP.
    ELSEIF employee1 CS 'UMESH'.
       call SUBSCREEN  sub4  .
        SALES = 'UMESH'.
        CLEAR SALES.
    elseif employee1 CS 'RAM'.
      call SUBSCREEN sub4 .
       HR = 'RAM'.
       CLEAR  HR.
    ELSEIF employee1 CS 'ANIL'.
       call SUBSCREEN sub4 .
       MM = 'ANIL'.
       CLEAR MM.
       endif.
    ENDMODULE.                 " USER_COMMAND_0120  INPUT
    *&      Module  STATUS_0140  OUTPUT
          text
    MODULE STATUS_0140 OUTPUT.
    *CASE OK_CODE.
       WHEN employee1  'NEERAJ'.
         screen-active = 1.
         ABAP = 'NEERAJ'.
       WHEN employee1 = 'UMESH'.
         screen-active = 1.
         SALES = 'UMESH'.
       WHEN employee1 = 'RAM'.
         screen-active = 1.
         HR = 'RAM'.
       WHEN employee1 = 'ANIL'.
         screen-active = 1.
         MM = 'ANIL'.
         endif.
    *ENDCASE.
    ENDMODULE.                 " STATUS_0140  OUTPUT

Maybe you are looking for