Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Module Pool - Error Message

Former Member
0 Kudos

hi all,

i have a module pool program where in pai after checking one field if it is blank i am throwing an error message so that the field will be in editable mode.

but the problem is that i want to remove the description also for that field when the field is blank and message is shown.

plz help.

Rgds,

Avijit

20 REPLIES 20

former_member223537
Active Contributor
0 Kudos

Clear V_MATNR.

Message 'Incorrect value' type 'E'.

abdulazeez12
Active Contributor
0 Kudos

Hi

Clear the field value before displaying the error message.

Thanks

Shakir

Former Member
0 Kudos

Hi,

clear screenfield name.

example

if < condition >

Clear VBAP-vbeln " screenname-fieldname.

Message Message' type 'E'.

endif.

regards,

muralidhar.

0 Kudos

hi all,

i cleared that screen-field before E message but the screen is still showing that value as mesage E is fired before PBO.

plz suggest wht to do.

rgds,

Avijit

0 Kudos

hi all,

there are 2 screen fields - one is for code which is in editable mode and the other is for description of this code which is in display mode. when user enters code corresponding description is displayed. the problem is if after entering once user deletes the code program shows error message that the field should not be blank. but at this time i also need to clear the description field as now there is no code.

for better understanding plz check with tcode ME21N where after entering pur.org. corresponding description is shown but then if u remove the value description is also removed and error msg is coming.

i tried to debug this tcode but fails.

plz help.

rgds,

Avijit

0 Kudos

Hi Avijit,

Can u show me the code?..Show the code for Modules called in sequence PAI and the validation module where u are throwing an error message.

One more way to clear the description when the code value is changed or cleared. is like this.

Process After Input.

FIELD code1 MODULE val_code on-request.

Module val_code input.

if code1 is initial.

clear code_desc.

else.

select desc from table1 into code_desc

where code = code1.

Endif.

ENDMODULE.

NOTE:Dont call the FIELD statement for Description field next to code field. like this...

Process After Input.

FIELD code1 MODULE val_code on-request.

FIELD code_desc.

if you put field statement for the code_desc next to code1 just like above in BOLD,then the value which you cleared in Module val_code input will be overwritten by the screen value for code_desc field.

Regards,

Vigneswaran S

0 Kudos

hi all,

thnks 4 ur suggestions. but till now i am unable 2 get d desired result.

i am giving d code part below:

2 screen fields CODE and DESC

CODE input field

DESC output only

PAI

FIELD CODE MODULE VALID_CODE.

MODULE VALID_CODE.

IF CODE IS INITIAL.

CLEAR DESC.

ERROR MESSAGE.

ELSE.

SHOW DESC FOR CODE ENTERED.

ENDMODULE.

Effect on screen:

initially if user presses ENTER message is showing. if valid code is entered desc is showing. now if user removes code and presses enter error message is showing but desc is not blank. i want desc should also be blank at this time.

this is d same functionality as in tcode ME21N purchase org. field.

plz advice wht 2 do.

rgds,

Avijit

0 Kudos

hi all,

any idea about dis problem.

rgds,

Avijit

0 Kudos

hi all,

any ideas. still facing d problem.

rgds,

Avijit

0 Kudos

Hi Avjit,

Sorry.I saw your reply very late..Here you go...

You have to use to put a module within a CHAIN ENDCHAIN .

Process After Input.

CHAIN.

FIELD code_desc .

FIELD code1 MODULE val_code on-request.

ENDCHAIN.

Note:the code_desc should be above the code1 field as mentioned in the above statement.

Regards,

Vigneswaran S

Edited by: Vigneswaran S on Jun 4, 2008 8:36 PM

0 Kudos

hi vignes,

thnks 4 ur reply. but i think u r not getting my problem.

i dont want d DESC field in editable mode when CODE field is blank.

my requirement is if CODE is not blank then after pressing ENTER, DESC will come automatically. but if CODE is blank and user presses ENTER then DESC will be blank and ERROR message will come below and CODE will be in editable mode.

plz help.

rgds,

Avijit

0 Kudos

Hi Avjit,

I have included CODE_DESC in FIELD statement of CHAIN ENDCHAIN block.But that does not mean that CODE_DESC field should be an Editable field in the Screen.

I think you didnt test the code which i put in my previous post.The same code is working well (meaning that if code field is initial and pressing 'ENTER" the error message is coming with code_desc field vaule gets cleared and code_desc always be an display only ) for me eventhough the Code_desc field is either Display only or Editable field.

Do Test with the code which i sent in previous post and let me know if it not works....

Thanks,

Vigneswaran S

0 Kudos

hi vignes,

thnks 4 ur valuable help. want 2 b in touch later also. give me ur mail id.

P.S. assigning u points also.

rgds,

Avijit

Edited by: AVIJIT SIKDAR on Jun 6, 2008 7:35 AM

0 Kudos

vignesh.dynpro@gmailcom

0 Kudos

hi vignesh,

how to achieve d same functionality when d first field is of a table control and d next field is not belongs to table control.

that means depending upon value in d field of table control d other field should b changed w/o firing PBO.

plz help.

rgds,

Avijit

0 Kudos

Hey Avjit,

Answer me to the following question.

How do you know which line(row) of the table control field to be considered for making the Non-Table control field either editable or non-editable.I can enter value for a table control field in any line ....

Regards,

Vigneswaran S

0 Kudos

hi vignesh,

table control has one field VALUE in editable mode.

below there is TOTAL in display mode. TOTAL will show sum of VALUEs entered in table control.

when user deletes any row's VALUE and presses enter system will show ERROR msg and TOTAL will be updated accordingly. (TOTAL = TOTAL - this row's previous VALUE).

plz help.

rgds,

Avijit

0 Kudos

Hi,

I am sorry to say that up to me it is not possible to do that. Instead ,I can suggest one alternative solution that If the user can change the amount value in any one of the row of the table control and still you want to re-calculate the total based on the new values,if it is a case,then why are you populating the Error message to the user.Instead you can populate one warning message and let the user to carry forward the action (means PBO can be triggered after warning message and your total will automatically recalculated).

Regards,

Vigneswaran S

Former Member
0 Kudos

hi,

try this.

PAI.

chain.

fields : code.

module validate_code.

endchain.

module validate_code.

if code is initial.

message 'shud not be blank' type 'E'.

clear : description.

else.

""""your code""""

endif.

regards

Sandeep REddy

Former Member
0 Kudos

requirement is changed