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: 

When I enter some value in TBM Generator, everything is disabled.

Former Member
0 Kudos

Hello,

Very Good Afternoon!

I had created a Table Maintenance generator for a Z-table with a field : MANDT and PSTYV.

When I enter an invalid entry it is throwing an error message perfectly. But, when I try to remove that entry from the table it is not letting me to do that. All the functions are getting disabled.

This is the logic that I had written in the validation:

MODULE ZORD_ITM_VALIDATE INPUT.

DATA : L_PSTYV TYPE PSTYV,

L_MSG TYPE STRING.

IF ZORD_TYPE-PSTYV IS INITIAL.

CLEAR L_MSG.

MESSAGE 'Enter item category Type' TYPE 'E'.

ELSEIF NOT ZORD_TYPE-PSTYV IS initial.

SELECT SINGLE PSTYV FROM VBAP INTO L_PSTYV

WHERE PSTYV = ZORD_TYPE-PSTYV.

IF SY-SUBRC <> 0.

CLEAR L_MSG.

CONCATENATE 'Item category' ZORD_TYPE-PSTYV 'does not exist in VBAP(Check entry)' INTO L_MSG

SEPARATED BY SPACE.

MESSAGE L_MSG type 'E'.

ENDIF.

ENDIF.

These are the modules generated :

PROCESS BEFORE OUTPUT.

MODULE LISTE_INITIALISIEREN.

LOOP AT EXTRACT WITH CONTROL

TCTRL_ZORD_TYPE CURSOR NEXTLINE.

MODULE LISTE_SHOW_LISTE.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.

MODULE LISTE_BEFORE_LOOP.

LOOP AT EXTRACT.

MODULE LISTE_INIT_WORKAREA.

CHAIN.

FIELD ZORD_TYPE-PSTYV .

MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.

ENDCHAIN.

FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.

CHAIN.

FIELD ZORD_TYPE-PSTYV .

****Added By developer.

MODULE ZORD_ITM_VALIDATE. ->"I had written my code in this module.

****

MODULE LISTE_UPDATE_LISTE.

ENDCHAIN.

ENDLOOP.

MODULE LISTE_AFTER_LOOP.

********************

Any suggestions would be appreciated............

Regards

Kittu

1 ACCEPTED SOLUTION

prasanth_kasturi
Active Contributor
0 Kudos

hi ,

Check whether your module is between CHAIN ..... ENDCHAIN.

If not present write the module where you have the logic between chain and endchain

in the below manner

CHAIN.

FIELD ZORD_TYPE-PSTYV MODULE ZORD_ITM_VALIDATE.

ENDCHAIN.

regards

prasanth

3 REPLIES 3

prasanth_kasturi
Active Contributor
0 Kudos

hi ,

Check whether your module is between CHAIN ..... ENDCHAIN.

If not present write the module where you have the logic between chain and endchain

in the below manner

CHAIN.

FIELD ZORD_TYPE-PSTYV MODULE ZORD_ITM_VALIDATE.

ENDCHAIN.

regards

prasanth

Former Member
0 Kudos

Hi Kittu,

View maintenance has its own logic of performing validations, and accordingly changing the display of the screens (freezing/pop-up/warnings, etc). These are based on the Checks/Foreign Keys defined in the DDIC itself.

If apart from this you wish to do any additional validation, you can very well do that. But please refrain from using a message type 'E' within your code. By using that, you will be freezing the control of the View Maintenance program and the screen will freeze.

Instead, please use a Message type as 'W'. This will help you in identifying the error, but still maintain the screen as changeable, so that user can modify entered value.

Cheers

Rekha

Former Member
0 Kudos

Hello Prasanth and Kasturi,

Thank you for your response!

The answer that you have provided was helpful.

Points are rewarded!

Regards,

Kittu