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
Similar Messages
-
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?
ThanksHi,
Check out the dimensions of the subscreen. May be its bigger than your subscreen area.
Regards,
Naga Sai Swapna -
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,
SmitaPut 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 -
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 PMNothing 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. -
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 PMhi..
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 -
How to write module pool program
hai,
what is the module -pool program ?
what are the procedures to write the module-pool program.
plz give the simple program for module-pool programs?
regards
surenderHi
This component though is not attached to the screen painter, plays important role in transaction. Normally, for reports, on line executable programs are written but for transaction, Module Pool Programs are written. The module pool program contains only modules to handle various events associated with screen and data declaration statements.
System divides the module pool program into several include program. These are global field, PBO modules, and PAI modules. It is entirely users decision whether to use these modules or write directly into main program.
Creation of Module Pool Program
You can create module pool program either through
Object browser
System automatically creates the module pool program and for these program which are created through object browser, system creates the include modules.
Or
ABAP/4 editor
It is similar to normal program creation. Type of program should be given M and is not created by system.
Communication between Dynpro and Module Program
For each screen, the system executes the flow logic, which contains corresponding events. The control is passed to Module Pool Program. Module Pool Program handles the code for these events and again passes back control to the flow logic and finally to screen. Unlike on line program, in this case, the control remains with flow logic. The switching of control between flow logic and module pool program and back is common process when user executes transaction.
Creation of a Complete Transaction
Steps involved to create a complete transaction
Create module pool program.
From screen painter create screens.
Write flow logic for each screen.
Write code for all the events in module pool program.
Check for any error in screen and flow logic.
Generate each and every component of screen i.e. flow logic and screen.
Single screen can be tested using Screen Painter.
Create transaction code through object browser.
Generate the transaction code.
User can execute the transaction by entering the transaction code in the command field.
Handling Function Code
The function code or OKCODE is the last field of Field list. Function code can be handled as follows:
During the Designing of the screen, a function code is assigned to pushbutton.
In field list, developer needs to specify OKCODE as last field.
In module program it is a global field and can be evaluated in the PAI event.
A function code is treated in the same way, regardless it comes from pushbutton, menu item or any other GUI element.
When the user clicks on the Display button, you want to display details of sflight, with corresponding carrid and connid (which is entered by the user).
Module pool program to handle this particular screen is as follows:
Program YVTEST7.
TABLES: SFLIGHT.
DATA: OKCODE (4).
MODULE INPUT1 INPUT,
CASE OKCODE.
WHEN DISP.
SELECT * FROM SFLIGHT
WHERE CARRID = SFLIGHT CARRID AND
CONNID = SFLIGHT CONNID.
ENDSELECT.
LEAVE TO SCREEN 200.
WHEN EXIT. LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. INPUT1 INPUT
MODULE USER_COMMAND_0200 INPUT.
CASE OKCODE.
WHEN BACK. LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE. USER_COMMAND_0200 INPUT
When the user clicks on display, control is transferred to screen no. 200 on which you display sflight details & on the same screen, when user clicks on BACK button, he comes back to main screen.
Flow logic for screen 100 is as follows:
PROCESS AFTER INPUT.
MODULE INPUT.
Flow logic for screen 200
PROCESS AFTER INPUT.
USER_COMMAND_0200.
MODULES: Modules are handled in module pool program.
You need to write flow logic for screen 200 and design screen 200.
In case of transaction transfer of data from program to screen is automatic i.e. you need not transfer the data from program to screen explicitly. The fields, which you define in the screen receives the data from program and displays the same.
The Field Checks
As already mentioned Transaction is the only method, which SAP recommends to update the database tables. Data entered in the database table should be valid and correct. Data entered is validated at each and every point. ABAP/4 offers various methods to validate data and those are as follows:
Automatic field checks
Checks performed in the flow logic
Checks performed in the ABAP/4 module pool program
Automatic Field Checks
These checks are based on the field information stored in the dictionary. These checks are performed by the system automatically when the user enters the data for the screen field. System performs these checks before PAI event is triggered. Types of field checks performed by system are as follows:
Required input
While designing the screen, for particular screen field if you click the Req. Entry checkbox, the field becomes mandatory. When the transaction is executed if user leaves this particular field blank, the system displays error message. User cannot proceed until the user enters some data.
Proper Data Format
Each field has its own data format whether it is table field or screen field. Whenever data is entered, system checks for the proper format of the data. For example date. Each user has its own format for date, which is defined in the user master record. If the date defined in the user master record is in the format DD/MM/YYYY, if the user enters the date, say, in YY/DD/MM, the user displays the error message. System also checks for the value of month or days. For example if month entered is greater than twelve then the error message is displayed.
Valid Value for the Field
In data dictionary two tables are related by Primary key-Foreign key relationship. Whenever the user enters the data, the system checks for the check table values. Also in Domain, if you have fixed values, then the system checks for these values.
Automatic field checks are repeated each time the user enters the data.
About at Exit Command
Automatic field checks can be avoided by AT EXIT-COMMAND, which works exactly the same way as Cancel works on application tools bar. In the R/3 screen, if you want to quit the processing of that particular screen without entering the mandatory fields, user can click the Cancel button. Same functionality can be incorporated in the user-defined transaction by using AT EXIT-COMMAND. This module can be called before the system executes the automatic field checks and it goes without saying that before PAI event. Code for AT EXIT-COMMAND in flow logic and in module pool program can be written as follows:
In Flow Logic
Process After Input.
Module exit AT EXIT-COMMAND.
In module pool program.
Module exit.
Case okcode.
When Exit.
Leave to screen 0.
To achieve this kind of functionality a pushbutton or menu item should be assigned a function type E. It tells the system to process this particular module before carrying out any field checks.
Flow Logic Validations
Consider the case where you want user to enter only LH and SQ for sflight-carrid. In this case, you are restricting value of a screen field. This cannot be achieved by automatic field check. Hence there is a need of additional validation. It can be done in flow logic by using following statement:
Field -
Values
Syntax
PAI.
Field sflight-carrid values (LH).
For multiple values
PAI.
Field sflight-carrid values (LH SQ).
Field sflight-price values (between 1000 and 2000).
In this case when the user enters the value, PAI is triggered and field is checked for that particular value. If the value entered happens to be wrong, that field is enabled for user to enter. If you have multiple Field statements in your flow logic, it is sequential execution.
Consider the following case:
PAI.
Module assign.
Field sflight-carrid values (LH SQ).
In ABAP/4
Module assign.
Data: carrid1 like sflight-carrid.
Carrid1 = sflight-carrid.
Endmodule.
In this case, Sflight-carrid is used in the flow logic before the field statement. The system will give invalid value or some previous value as the field sflight-carrid is used in module before it is checked i.e., field statement is after the module in which sflight-carrid is being used. The field is not available to the system unless it executes the field statement. Field statement transfers the values to the program and is done only once. If you dont have Field statement in your flow logic, transfer of values takes place in PAI event.
Consider one more case where you have multiple field statement
PAI.
Field Sflight-carrid values (LH).
Field Sflight-connid values (0400 0500).
In this case if the user enters only carrid wrong, then this particular field is enabled and rest of the fields are disabled for user to input. Many times if the user enters wrong value for one field, then you might want to give option to user to enter all the fields, which is not possible by using Field statement only. This functionality can be achieved by CHAIN ENDCHAIN.
Syntax
Chain.
Field sflight-carrid value (LH).
Field sflight-connid values (between 200 and 500).
Endchain.
Field sflight-price values (100 1000).
In this case, if the user enters wrong value only for carrid, both the fields i.e. carrid and connid are enabled as they are grouped together in the Chain statement. The field price will be disabled for input. Usually, logically related fields are grouped together with Chain-Endchain statement.
Module Pool Program Validations
Checking fields ABAP/4 program includes
Field statement in flow logic.
Module statement in ABAP/4 module pool Program.
Syntax
PAI.
Field sflight-carrid module <name>.
This module can be handled in the main program i.e. module pool program.
In ABAP/4 program
Module Check.
Select single * from sflight where carrid = sflight-carrid.
If sy-subrc ne 0.
Message e001.
Endif.
In this case, field sflight-carrid is checked in the table for its existence.
Dynamically Calling the Screens
About Displaying Next Screen
Transaction is a sequence of screens, which are displayed one after the other. The next screen displayed depends upon the attributes of first screen. In attributes you need to give Next Screen number i.e. if next screen displayed should be 200 screen, then this number should be given in next Screen attributes. These are static attributes of the screen. By default, if nothing is specified in the program, the system branches out to the screen number, which is specified in the attribute screen.
In this case, if user selects MARA pushbutton, then fields from Mara table are displayed. When the user clicks on the MARD, then the fields from MARD table are displayed. Depending upon users selection, the screen is branched out and this has to be done during runtime. This functionality can be achieved by dynamically calling the screen in module pool program.
The screen can branch out to new screen depending upon user selection. Following command in module pool program can do this:
SET SCREEM
CALL SCREEN
LEAVE TO SCREEN <NUMBER>
All these commands override the specifications given in the attributes. This overriding is temporary. The values stored in the attribute are not changed.
Set Screen
Syntax
Set screen <number>.
In module pool program
Case okcode.
When DISP.
Set screen 200.
When LIST.
Set screen 300.
Endcase.
In this case, the entire processing of current screen takes place and then the system branches out to next screen. If you want to branch out to the next screen without processing the current screen, LEAVE SCREEN should be used along with the SET SCREEN.
For Example:
Case okcode..
When DISP.
Set screen 200.
Leave Screen.
When LIST.
Set screen 300.
Leave Screen.
Endcase.
When SET SCREEN is used, control cannot be transferred to the main screen or previous screen, unless you write code for the same.
Call Screen
Usually used for pop up screens. Many times, there is a need for user to enter additional information or secondary information on another screen or pop up screen. Once the user enters the data, he should be able to go back to main screen or to the screen where he started. This is not possible by using SET SCREEN. CALL SCREEN achieves this functionality.
Syntax
Call Screen 200.
Will simply call a screen number 200 from a main screen. Once the screen is displayed the user can enter all the data and return to the main screen by clicking BACK button.
To call screen as pop up screen the syntax is
Call screen starting at <col.no.> <line no>
Ending at <col no> <line no>.
In this case window will be popped as window and user can close it by using BACK button.
Leave to screen
To SET a new screen without processing current screen, you need to use the following two statements together:
SET SCREEN 200.
LEAVE SCREEN.
Or a Single statement
LEAVE TO SCREEN 200. -
Error handling in module pool program
hi,
in module pool program after enabling a field if the user enters an invalid value iam giving a error message.
message 'something' type 's' display like 'E'.
then again it should go to the previous screen where the user enters the value for that enabled filed.
can u guys share some ideas.Hi ,
if it is a ascreen field use the below syntax
Field <fieldname> module <module_validate>.
in the module validate write the validation and throw error message ,the screen will be in error position
if the field is in Table control
Loop at <table control>.
chain.
field <fieldnamemodule <module_validate>.
"in the module validate write the validation and throw error message ,the screen will be in error position
endchain.
Endloop.
Prabhudas -
Error while transporting modification in module pool of a specific infotype
HI experts,
While transporting some modifications that have be done on the PAI of a module pool of a specific infotype, we have an error with code return = 8, the error is --> Original object R3TRPROGMP900730 must not be changed!!!
Any suggestion .
Tanhks a lot .Hi ,
Nice to know that your problem is solved. If any of the replies were usefull please acknowledge their work.
And it would be great if you can just put in your remarks about the best solution you had in solving that problem.
It might be useful to other users when they encoutner such problem.
BR,
Vijay. -
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
ANDREWSHI 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 -
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.RIf 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 -
Runtime errors in module pool programming
HI all,
I have done a module pool program for invoice tracking level wise.
I am encountering a runtime error, LIST_TOO_MANY_LPROS, while execution ie., for two and more than two updations of the database.
The error analysis says that "At present, the maximum permitted number of nested screen levels is restricted to 50".
Short Text :- "No further list processing possible".
Can anyone please come out with a solution for this problem.
regards
samarendra.
Edited by: samarendra penugonda on Nov 5, 2008 5:03 AMHi
U should replace the comand CALL SCREEN with LEAVE TO SCREEN.
The command CALL SCREEN create an internal mode to link the calling screen to called screen automatically: in this way when it needs to back to calling screen it doesn't need to specify the screen number but only to use:
- LEAVE TO SCREEN 0.
or
- SET SCREEN 0. LEAVE SCREEN.
Now if you use LEAVE TO SCREEN, u need to indicate the screen when it needs to back to calling screen:
- Go from 100 to 200
LEAVE TO SCREEN 200. (Instead of CALL SCREEN 200)
- Back to 100.
LEAVE TO SCREEN 100. (Instead of LEAVE TO SCREEN 0)
Max -
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 -
Hi All,
I have created 1 module pool program with screen no. 0100. But the statement CALL SCREEN 0100 is not getting executing its showing error i.e ' statement cannot be accessable' even i have created and activated the sceen 0100.
Thanks...
kiranHi kiran,
Open you program in se38 menu bar -> GOTO -> ATTRIBUTES and check wheather it is executable program or module pool program.
if it is exeutable program then u can call the screen 0100 as ur intial screen. if not ur given type as module pool then u have to create a transaction in SE93 and give the screen name in that and prgoram name then it will display the screen which u hv created .
if you want to show the screen 0100 as ur initial sceen in module pool program without using transaction it is not possible so use either executable program and use the stament call screen 0100.
<b>reward if useful </b>
Regards,
sunil kairam. -
Getting Error when createing Table control in Module Pool.
Hi expert ,
i am creating a module pool program . i want to crate line item value for that i have created table control on screen 200 .
but when i am activation to that giving error below mention.
The field "ZFBDCHALLAN-EBELN" is not assigned to a loop. "LOOP ...ENDLOOP" must appear in "PBO" and "PAI".
thanks
chandraIts mandatory to have loop endloop in both events
PBO and PAI
loop your internal table similarly.
Please check it should be below format
PROCESS BEFORE OUTPUT.
* Set PF Status for screen 100.
MODULE status_0200.
* This module will initialize the field
MODULE init_0100.
LOOP AT t_custmat_asg INTO w_custmat_asg
WITH CONTROL tc_1
CURSOR tc_1-current_line.
* It will count the record in internal table
MODULE set_linecount.
* Screen Modifications
MODULE status_check.
ENDLOOP.
PROCESS AFTER INPUT.
* Module AT EXIT-COMMAND
MODULE exit_0200 AT EXIT-COMMAND.
LOOP AT t_custmat_asg .
CHAIN.
FIELD :
w_custmat_asg-check,
w_custmat_asg-kunnr,
w_custmat_asg-name1,
w_custmat_asg-asgtyp,
w_custmat_asg-productcls,
w_custmat_asg-sctegry,
w_custmat_asg-ctegry,
w_custmat_asg-parent,
w_custmat_asg-frmdate,
w_custmat_asg-todate,
w_custmat_asg-frecster,
w_custmat_asg-salesrep,
w_custmat_asg-flag,
w_custmat_asg-username,
w_custmat_asg-udate.
* Validation For Forecaster.
MODULE validate_forecaster.
* Validation For Salesrep.
MODULE valiate_salesrep.
* Validation for Customer
module validate_customer.
* Validate null value
module validate_null_vals.
* Validation For Data Changed On The Screen
MODULE data_changed_0200 ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
Regards
Satish Boguda
Maybe you are looking for
-
How do i get back tabs after f/f is closed by a crash?
After each of the last few F/F updates and after a few Windows updates, my open session was reset. When I look for system restore I cannot find the b****y thing. And this really p****s me off!! Since F/F has recently been "improved" (like hell it has
-
Hey guys, i have been assigned the task of moving our weblogic 10 (rhel AS 3) administration server from one location to another, and changing its ip address. i have replicated our environment into a virtual environment and tried changing the ip addr
-
Exporting photographs from iPhoto 6 without thumbnails
I have a Blaupunkt Lucca Navigator which can read secure digital cards with tiff or jpeg photographs. If you export photographs from iphoto 6 to a secure digital card you export each photo twice: one normal photo readable by the Lucca navigator and a
-
Issue on Solution Manager installation
Hi Guys, I'm installing a Solution Manager 7.0 SR3 and unfortunately i encounter troubles, i'm on the step "Create SAPJSF" and the error message appear: "FCO-00011 The step createJSF with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind
-
Hi, I would like to remove the pop-up message "Continue from where you stopped last time?"; however, even though I uncheck Self-Paced Learning, it still pops up. I am using Captivate 7.0 I am NOT publishing to a LMS I have unchecked the Self-Paced L