Application Development and Automation 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: 
Read only

Module Pool Issue

Former Member
0 Likes
907

Hi Experts,

I have one query regarding module pool. In screen I have one field named as Vendor Number. I want whenever user enter's the number, it will be validated.

If entry is not found then error message should display in status bar & cursor should be stopped in that field also.

In PAI, I wrote validation logic, but neither my respective message is getting displayed as well as the field becomes disabled. So, always again I need to enter the tcode & start the processing from scratch.

Can anybody suggest me how to resolve this?

Regards,

Neha

10 REPLIES 10
Read only

Former Member
0 Likes
879

Try this

CHAIN.
   FIELD 'field name (Vendor)'.
   MODULE 'module for Error Logic ' ON CHAIN-REQUEST.
 ENDCHAIN.

Read only

Former Member
0 Likes
879

Hi ,

Please do your validation in CHAIN and ENDCHAIN command .

You can throw error message is validation fails.

Press F1 on these to know more.

Hope this helps you.

Read only

Former Member
0 Likes
879

hi,

1) To make the validated field active for editing use the field statement in your PAI.

2) To make the cursor stay on that field use set cursor statement in your PAI.

3) To make the message appear in the status bar us ethe FM GUI_PROGRESS_INDICATOR.

hope it helps.

regards,

sakshi

Read only

sridhar_meesala
Active Contributor
0 Likes
879

Hi,

Try this. In the main screen.

PROCESS BEFORE OUTPUT.
 MODULE STATUS_1000.

PROCESS AFTER INPUT.

CHAIN.
 FIELD vendor_number MODULE check-vendor_no.
ENDCHAIN.

Now create an include F01. In that write the code.

MODULE check-vendor_no INPUT.

  SELECT SINGLE <vendornumber>
    FROM dbtable
    INTO lv_vendorno  " take a local variable to store vendor number
    WHERE <vendornumber> = <vendor number given on the screen by user>.

  IF sy-subrc NE 0.
   MESSAGE 'Vendor number does not exist' TYPE 'E'.
  ENDIF.

ENDMODULE.                 " check-vendor_no INPUT

Hope this solves your problem.

Thanks,

Sri.

Read only

0 Likes
879

Hi Sri,

Thanks for your valuable reply. But still my desired message is not getting displayed.

I wrote the below code in PAI.

CHAIN.

FIELD LFA1-LIFNR MODULE VALIDATE_VENDOR.

ENDCHAIN.

Module VALIDATE_VENDOR.

SELECT SINGLE LIFNR FROM LFA1 INTO GV_LIFNR WHERE LIFNR = LFA1-LIFNR.

IF SY-SURBC <> 0.

MESSAGE TEXT-001 TYPE 'E'.

ENDIF.

ENDMODULE.

Can anybody suggest?

Read only

0 Likes
879

Hi,

Write the CHAIN...ENDCHAIN part in the main screen flow logic.

Thanks,

Sri.

Read only

0 Likes
879

Hi Neha,

In screen painter you can write in PAI as:

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

loop at itab.

chain.

field lfa1-LIFNR.

MODULE TCTRL_0100_MODIFY on chain-request.

endchain.

endloop.

MODULE READ_DATA INPUT.

When you writing the logic in your abap editor you can mention it as:

MODULE READ_DATA INPUT.

SINGLE LIFNR FROM LFA1 INTO GV_LIFNR WHERE LIFNR = LFA1-LIFNR.

IF SY-SUBRC NE 0.

MESSAGE ID '00' TYPE 'S' NUMBER '058' DISPLAY LIKE 'E'

WITH lfa1-lifnr.

EXIT.

ENDIF.

let me know if this works.

Regrds,

Nikhil.

Read only

0 Likes
879

HI NEHA,

If you want to validate that Vendor not found then error should raise.

Add on chain-request after your MODULE Command .

Help this will solve your prob.

Edited by: NISHIT JOSHI on Mar 5, 2010 11:30 AM

Edited by: NISHIT JOSHI on Mar 5, 2010 11:31 AM

Read only

0 Likes
879

Please use this code in the validate_vendor module

MODULE validate_vendor INPUT.

DATA : gv_lifnr TYPE lifnr.

SELECT SINGLE lifnr FROM lfa1 INTO gv_lifnr WHERE lifnr = lfa1-lifnr.

IF sy-subrc NE 0.

MESSAGE text-001 TYPE 'E'.

ENDIF.

ENDMODULE. " VALIDATE_VENDOR INPUT

Thanks

Chinni

Edited by: Tirumula Rao Chinni on Mar 5, 2010 11:34 AM

Read only

Former Member
0 Likes
879

in PAI

CHAIN.

FIELD vendor MODULE validate_vendor. " the vendor screen field name

ENDCHAIN.

create a module validate_vendor and write vaidation code

Thanks

Chinni